Introduction: Yet Another Instructable on Using the DIYMall RFID-RC522 and Nokia LCD5110 With an Arduino
Why did I feel the need to create another Instructable for the DIYMall RFID-RC522 and the Nokia LCD5110? Well, to tell you the truth I was working on a Proof of Concept sometime last year using both of these devices and somehow "misplaced" the code. Since the DIYMall RFID-RC522 doesn't have the pins labeled the same as some of the other RFID-RC522 board do, it was difficult to determine which pin was which. Besides, if I ever forget what I did in the POC I can now find it out on the web.
Step 1: Disclaimer
Just a quick disclaimer to state that we take NO responsibility for anything that happens as a result of following this instructable. It's always best to follow the manufacturers instructions and safety sheets when building anything so please consult those documents for any of the parts and tools you use to build your own. We are simply just providing information on the steps we used to create ours. We are not professionals. As a matter of fact, 2 out of 3 of the individuals who participated in this build are children.
Step 2: Gather the Needed Components.
1) An Arduino Uno board.
2) A DIYMall RFID-RC522 board.
3) Nokia LCD5110 board
5) An RFID tag (key chain).
6) Optional UNO Proto Shield or just a typical bread board.
Step 3: Connect the RFID-RC522 to the Uno
To make things easy on myself I used a Proto Shield to make all of my connections. You can optionally use a breadboard or just wire things up directly. The advantage to the Proto Shield or a breadboard is the pins of the RFID-RC522 can connect directly into the Proto Shield or the breadboard thus providing a "stand" to hold the RFID-RC522.
I used the Proto Shield because I just happened to have one hanging around. In any case connect the RFID-RC522 as follows:
SDA / NSS to Pin 10 on the Uno
SCK to Pin 13 on the Uno
MOSI to Pin 11 on the Uno
MISO to Pin 12 on the Uno
GND to GND on the Uno
RST to Pin 9 on the Uno
VCC to 3.3 on the Uno
Step 4: Connect the Nokia LCD5110 to the Uno
Now it is time to connect the Nokia LCD5110 to the Uno. This time I elected to just use the jumper cables to connect directly to the Uno for the main pins and used the breadboard on the Proto Shield for the voltage connections. The main reason for this choice was I wanted the Nokia LCD5110 to stand up. If I would have connected it directly to the breadboard on the Proto Shield the screen would have been lying down instead.
- VCC to 3.3 on the Uno
- GND to GND on the Uno
- CS/SCE to Pin 3 on the Uno
- RST to Pin 4 on the Uno
- DC / D/C to Pin 5 on the Uno
- MOSI / DN(MOSI) to Pin 6 on the Uno
- SCK / SCLK to Pin 7 on the Uno
- LED to GND on the Uno
Step 5: Write the Code
I combined example code from The Engineering Projects site for the The Engineering Projects DIYMall RFID-RC522 as well as Rinky Dink Electronics for the Nokia LCD5110 with some minor changes to entertain myself.
This example simulates the use of RFID tags to lock and unlock some secured entry point. Once the proper RFID tag is detected the system unlocks.
When the program is first initialized it displays the Arduino logo (stored in a seperate graphics file) on the LCD5110 screen so the user knows it is working. After 3 seconds it then displays the "RFID Locked" message indicating that the entry point is locked. The program then loops every second checking for an RFID tag. If an RFID tag is detected the program checks the RFID tag's unique number and determines if it should unlock the entry point. If the proper unique number is detected the system will display the unique number on the LCD5110 and place the system in unlocked status for 2 seconds. If the proper unique number is not detected the system will display the unique number on the LCD5110 and keep the system in locked status.
One could easily add a servo or relay into this example code to perform some measure of work when the proper unique number is detected.
Step 6: Source Code and Arduino Logo Graphics
Step 7: The System in Action
I hope someone, besides myself, finds this Instructable helpful.