Nowadays everyone conversates about (IOT) internet of things because of the internet of things life makes more comfortable and reliable. today I tell you about how Arduino works with the internet of things, in this article, we will make RFID lock with Arduino.
How to make Arduino-based RFID lock
Basically, this project about how you make RFID lock and how to communicate RFID with Arduino Uno or any board. you can open a door just swiping RFID tag you can also make your personal locker RFID-based no one expects you open your locker but only RFID card holder can open in case if you granted access to a tag.
so there is some feature of RFID lock you can program a master card that acts like as a program you can add and remove a tag with master card.
Easy User Interface
you just need 1 tag to add or remove a user from database/memory you can add LEDs to use as output to inform user you also can use LCD module as output or both.
Stores Information on EEPROM
All information stored on EEPROM non-volatile memory to serve users tags and master card there is no limit to read card but EEPROM has 100,000 write limit.
Easy to Modify
The code is modifiable you can easily add servo o unlock your apartment door instead of relay if you need.
its bit secure because we use unique tag but hackers can play with it 😀
Things required for this project is
- Arduino board mega 2560 or nano v3.0 atmega328p
- RFID RC522
- RFID tags
- relay module 5v
- some jumper wires
- 9v battery
now we have to communicate RFID reader to Arduino I mention Arduino and RFID reader pin diagram below you have to connect this way.
For nano Arduinos
MOSI: Pin 11 / ICSP-4
MISO: Pin 12 / ICSP-1
SCK : Pin 13 / ISCP-3
SS : Pin 10 (Configurable)
RST : Pin 9 (Configurable)
For Arduino Mega:
MOSI: Pin 51 / ICSP-4
MISO: Pin 50 / ICSP-1
SCK : Pin 52 / ISCP-3
SS : Pin 53 (Configurable)
RST : Pin 5 (Configurable)
Connect LEDs and Relay (All Configurable)
Red: Pin 7
Green: Pin 6
Blue : Pin 5
Relay : Pin 4
Wipe Button : Pin 3
I recommend you to use a breadboard for this when you were done the tweak for your exact need.
when you powering RFID reader from Arduino only connect right pin otherwise your RFID burns I lost my one RFID by mistake so you should be careful 😀 only connect 3.3v pin to 3.3v not 5v pin.
How to add MasterCard? when you scan the first time any tag it will be stored as a MasterCard so keep in mind when you stored first tag it will your MasterCard.
Uploading source code/RFID RC522 Library
now upload the code and do experiment tweaks and build your final setup after uploading code when you run Arduino first-time blue led will flash and wait for the scan first tag as MasterCard that act like a programmer to add and remove user tags.
here the code linkDownload
If you newbie don’t know how to use Arduino IDE you have to read this Arduino complete IDE guide here everything describe clearly about IDE tool.
User also Read:
Note: in this project, i use 12v electric door lock using relay module, one thing more always use separate power supply for electric lock don’t use same for Arduino it may cause your board because 12 electric lock takes more (about 2-8A) compare to unlock its depend on your lock see instruction first that provided with 12v lock.
I made it!
You can attack a keypad for access code lock with RFID in my next project I will make RFID door lock with access code stay tuned 🙂
If you like my project don’t forget to appreciate below in comment for any problem or any updating comment below and share with others 🙂