Tuesday, December 24, 2024

RFID Based Smart Device For Storing Data

In order to not forget confidential details such as login IDs, passwords, bank account number etc. we often note them down on a document for future references. But it not safe to write these things down on paper as anyone can access it and use it for wrong purposes. To prevent this, I have made a RFID tag-based storage device where you can safely keep such information from anyone’s reach. And this RFID tag is so small that it can be kept anywhere, like in between a book, a bag or as a sticker. Isn’t it awesome?!! 

So, let’s begin with this amazing DIY project. 

- Advertisement -

First, collect the following components. 

- Advertisement -

 Bill Of Materials

Prerequisite

Before you begin to write the Arduino code, go to Tools –> Library Functions and install the following library functions (Refer Fig 1.)

  • Ug8 Oled library
  • Adafruit gfx
  • MFRC522 RFID
Fig 1. Installing Library Functions

Coding

Here, we will write two codes: One for storing your data into the RFID tag/card and other for reading that stored data and displaying it on the OLED display.

First, let’s begin with the RFID writing code for storing your data into the RFID tag/card. You can download the code from below or you find it in RFID library example folder. (Refer Fig 1.)

Fig 1. RFID writing code

Now, let’s go to the RFID reading code for obtaining the stored data. 

Here, we have initialized the following libraries in the code. (Refer Fig 2.)

  • SPI.h
  • MFRC522.h 
  • U8g2lib.h
Fig 2. Initializing the libraries

After that we create a Setup function where we setup the OLED, SPI (for RFID reader) and Serial communication (for debugging). (Refer Fig 3.)

Fig 3. Setup unction

Next, we create a loop function that repeatedly checks the presence of a RFID tag/card near the reader. Once detected, the RFID card is further checked for UUID (Universally Unique Identifier). Once the UUID is verified, the stored data then can be safely retrieved. (Refer Fig 4, 5.)

Fig 4. Loop function
Fig 5. Loop function (contd…)

Connection

After completing both the codes, let’s now connect the components as described below:

Arduino Pro Micro RS522 RFID
RST Reset
Pin 10 SDA
Pin 16 MOSI
Pin 14 MISO
Pin 15 SCK
VCC VCC
GND GND

 

Connection

Testing

In order to check that everything is working, upload the RFID writing code in the Arduino board and make sure that the right connections are made. Then open the serial monitor and write the message or password that you want to store. After that, upload the reading code in the Arduino board and place the same RFID tag/card near the RFID module. It should read and display the stored message or password.

Download Source Code

Ashwini Sinha
Ashwini Sinha
A tech journalist at EFY, with hands-on expertise in electronics DIY. He has an extraordinary passion for AI, IoT, and electronics. Holder of two design records and two times winner of US-China Makers Award.

1 COMMENT

SHARE YOUR THOUGHTS & COMMENTS

EFY Prime

Unique DIY Projects

Truly Innovative Electronics

Electronics News

Latest DIY Videos

Electronics Components

Electronics Jobs

Calculators For Electronics