Raspberry Pi Pico ProjectsRaspberry Pi Projects

RFID Door Lock With Raspberry Pi Pico Using Micropython

RFID Door Lock Using Raspberry Pi Pico

In this project, we will be building an RFID door lock With Raspberry Pi Pico and micropython. We will be using an MFRC522 RFID controller board and an RFID tag. The MFRC522 is connected to the Pico via SPI and the RFID tag is read using the RC522 built-in RFID reader. The RFID tag will be used to unlock the door. The door will be locked using a solenoid valve.

The door lock will work by reading the special identifier of an RFID tag and comparing it to a list of authorized tags. If the tag is approved, the door will unlock. If the tag is not permitted, the door will stay locked.

Required Material

You will need a few things to get started:

  • Raspberry Pi Pico
  • RFID reader -RFID tags
  • Breadboard
  • Jumper wires
  • Relay Module
  • Solenoid valve

With these components, you can build a door lock that uses RFID tags to unlock.



What is Raspberry Pi Pico?

raspberry-pi-pico

Raspberry Pi Pico is a low-cost, high-performance microcontroller board with flexible digital interfaces. Its features include a powerful Arm Cortex-M0+ processor and support for Arduino and MicroPython programming.  It is designed for use in a wide range of applications, from simple electronic projects to complex IoT devices.

In point you are using a Raspberry Pi Pico for the first time, I would absolutely suggest you read my “Getting started tutorial on Raspberry Pi Pico”. In this article, I have explained and tried to clear light on basically everything in the article that a beginner must be trained with it.

RC522 RFID Module

A Brief Note on RC522 RFID Module

The RC522 RFID Module is a low-cost module that is used for short-range radio communication. The module can be used for any type of application, including security and identification. The module is compatible with a wide range of devices, including Arduino, Raspberry Pi Pico, and other microcontrollers. Check more detail MFRC522 RFID Module With Raspberry Pi Pico Using MicroPython

RC522 RFID Module Pinout

RFID Pinout



Raspberry pi pico Pinout

Raspberry Pi Pico is a new microcontroller from Raspberry Pi. It is a low-cost, high-performance microcontroller board with a flexible digital interface. The board is designed for use in a wide variety of applications, including IoT, robotics, and machine learning.raspberry_pi_Pico-pinout

Schematic Diagram –  RFID Door Lock With Raspberry Pi Pico

The SDA, SCK, MOSI, MISO, and RST pins of the MFRC522 RFID reader module are connected with the Raspberry Pi Pico GPIO pins 5, 6, 7, 4, and 3 respectively.

  • A one-channel relay module is controlled using the GP28 pin on the Raspberry Pi Pico.
  • The 5V buzzer is controlled using the GP27 pin on the Raspberry Pi Pico

RFID Door Lock With Raspberry Pi Pico

Fortunately, even though the RFID module is powered through 3.3V, the rest of the pins are 5V tolerant.



RC522 RFID Module Arduino UNO
VCC 3.3V
RST GP3
GND GND
IRQ —-
MISO GP4
MOSI GP7
SCK GP6
SS GP5

Programming & Libraries

The code requires MFRC522 Library.

Open your Thonny IDE and paste the following code into the editor window. Save this file to Raspberry Pi Pico with the name mfrc522.py

Mfrc522.py



main.py

Open another tab on Thonny IDE and paste the following code into the editor window. Save this file to Raspberry Pi Pico with the name main.py. Now, copy the code given below.



Conclusion

In ending, the RFID Door Lock with Raspberry Pi Pico Using Micropython is an excellent project for anyone who wants to use RFID technology in their own home. This project is easy to set up and use, and it provides a wonderful way to secure your home.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Ad
Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker