My project is a reflection, of the current COVID-19 pandemic, we are going through currently. Using ancient keys to unlock your assets, would now be considered unsafe and boring. Currently, right now, authorities are promoting anything regarding contactless operations to reduce the risk of contracting the virus. This made me question both important aspects of living in a COVID world where economic and health are brought to the question.
Using this idea, I have made an RFID device which provides information to its serial monitor (the computer essentially). Only a limited number of cards can unlock the system, in doing so, the Arduino detects the unique identification number(UID) of the RFID card. On the serial monitor, it would advise the user, on the UID number and then describe the situation with it either providing authorisation or denying access. All of this is done under the capacity of the Arduino which can handle this processing in a limited amount of time.
In background information, I am a grade 9 student at a leading high school in Sydney Australia where we are required to make a project where year 7 students would view my submission and try to replicate it underneath the tag of 'codequest' which is made for our school. In a broader sense, it was important that I do not aim for high-level creation, as it would not approve my point of making sure that my project is under the capability of a year 7 student.
Important Note
- Make sure you purchase an MFRC522 RFID reader, I can assure you that the project would be a fail for you.
- You would need to pre-install and RFID Example called MFRC522, more information would be pasted down below.
- Even though I have mentioned it in the HARDWARE section, you would obviously need an RFID card otherwise you wouldn't have anything to scan with!
Library download.
This is the most important step of the whole project, without this, the code won't work and the circuit won't work meaning like I have said before your project would fail.
This library is available using this link where it has ZIP files in which extraction is necessary: https://github.com/miguelbalboa/rfid
After extracting the file, you would put in an already Arduino folder, this means that the library is now in your downloaded Arduino app.
When accessing this project you would need to make sure you confirm that its there via checking it through going to file ⇉ Examples ⇉ Custom Libraries. Make sure you click on these options to insert it to the Arduino.
SETTING UP THE CIRCUIT
There is a clear diagram already shown on my instructions later but however to clear any doubts I have provided a simple table in accordance with the pin wiring, necessary to operate the RFID reader.
Here are a few images of myself constructing the code;
UPLOADING THE LIBRARY TO THE ARDUINO
As shown before, the Examples category, after clicking on MFRC522 which is part of the custom libraries, you would select 'DumpInfo.' This term refers to how there's an abundant amount of information being processed. This is required for the RFID where the reader has to make prolific judgements.
After selecting DumpInfo, you would need to go to Serial Monitor (Ctrl+Shift+M) where it will request you to scan your RFID card.
After scanning, the serial monitor will advise the user on the Card UID, this can be seen in the image below.
Remember to notate this card UID, this will be used in the code later on.
Now you will upload the code being set. Remember to change the UID number where it says to, I will comment that on the software section. If you do not change, you will always be shown access denied.
After pasting in the code, it is essential that you open the serial monitor and then after scanning your correct card and in your incorrect card you will information like the image down below.
This pseudocode is here to help you understand, the code in a language where you will not have any doubts with the definitions if some terms int he Arduino code I have provided int the software section.
Include Serial Peripheral Interface to sketch
Include external example, in this case the RFID Reader example
Give a constant value to the serial input pin
To make sure that the RFID resets after being used
To make the MFRC522 an instance
“While true”
Set the speed of communication between Arduino and serial monitor at 9600 bits per second.
Initiate the (BUS)
Initate MFRC522
Print “Approximate your card to the reader…”);
Print new line
Loop
If new card is present, turn on for limited time
Identify Card Serial
Print “UID tag :”)
Response required
Print (“Message : “)
If the UID is the specific UID number
Print “Authorised Access”)
With delay for 3 seconds
otherwise
Print “Access denied”
Then delay for 3 seconds
FLOWCHARTRFID is a colossal topic to expand where anyhting can be done with various ideas and passions. Here are some ideas which you could explore
- LED's which are there to show the user if access has been authorised or not. Preferably green and red are universal colours to use.
- Using an ultrasonic sensor, it is possible to make an action based on the authorisation
Comments