Now Reading
How To Build Your Own Homemade RFID Card With Arduino

How To Build Your Own Homemade RFID Card With Arduino

Dr. Raul V. Rodriguez

Radio Frequency Identification (RFID) technology is a system capable of identifying objects through a unique identifier (UID).

The RFID system consists of two main components: an RFID tag and an RFID reader.
The RFID tag has different formats. It can be a sticker like the one placed on supermarket products to prevent theft, on a plastic card, on a keychain, and it can even go under the skin like in animals.

There are read-only RFID tags. These labels are engraved with the identifier in the manufacturing process. Once a read-only RFID tag is generated, the UID can no longer be modified.



However, there are other types of RFID tags that are read and written. Such a tag can change your information thanks to RFID readers such as RC522 that allow you to read and write RFID tags of this type. In reality this component not only reads information, it is also capable of emitting a radio frequency signal.

How RFID Works

RFID, Integrated Technologies, Solutions
Source: Replica Sistemi

The power of the RFID reader and RFID tag is different. A module like RC522 must be connected to the electrical network to function. But what about RFID tags? How do you feed these types of cards?



The typical RFID stickers that go on many products do not have any batteries or power supplies. Neither do RFID-based access control cards.

The basic operating principle on which they are based is induction. These types of RFID tags are known as passive.

To read the information encoded on a passive RFID tag you need to withdraw the electromagnetic field that causes the electrons to move through the tag’s antenna and then power the chip.

When this happens, the powered chip is able to send the information stored in the RFID tag through the radio frequency. This is called backscattering.

The backscatter is detected and interpreted by the RFID reader, which then sends the data to a computer or a microcontroller such as the one with Arduino.

RFID types

Just as a radio must be tuned to different frequencies to listen to different channels, RFID tags and readers must be tuned to the same frequency in order to communicate.

An RFID system can use multiple frequencies within the radio frequency spectrum. The radio frequency spectrum is between the Extremely Low Frequency (ELF) band and the infrared.

Comparing different types of RFID tags | Resource Label Group
Source: Resource Label Group

There are three types of system depending on the frequency they use.

  • Low frequency or LF (125-134 KHz)
  • High frequency or HF (13.56 MHz)
  • Ultra-high frequency or UHF (433, 860 and 960 MHz)

Radio waves do not behave the same at all frequencies in the radio spectrum. This forces us to choose a frequency depending on the application we want to build.

Low frequency RFID or LF systems

RFID applications that use low frequency or LF have a long wavelength and can better penetrate thin and metallic objects. Furthermore, RFID systems using LF are ideal for reading objects with high water content such as fruits and drinks.

However, the range of the low frequency range is limited to a few centimeters. Memory on RFID tags is very limited due to the low data transmission rate and high production cost.

Typical RFID applications using low frequency include access control and tagging of animals. 

High frequency RFID or HF systems

These use high frequency work very well on metal objects and products with a medium and high-water rate.

Generally, these RFID systems operate in a range of centimeters although the maximum reading is around the meter.

They use global standards and protocols such as NFC with larger memory options, although the reading range is still short and the data transmission rate is low.

Ultra-high frequency RFID or UHF systems

RFID systems based on ultra-high frequency generally offer a greater range than LF and HF types. We speak from a few centimeters to more than 20 meters. Another difference is that they can read data faster –several labels per second.

This technology is used to monitor warehouse items, to count people, to control races when runners cross the finish line, and for tolls and for access control to parking lots.

RFID reader with Arduino RC522

The RFID reader module RC522 is based on the MFRC522 integrated circuit. 

See Also

It is usually accompanied by an RFID tag in a credit card format and an RFID tag in a keychain format.

The cards can have 1K or 4K memory divided into sectors and blocks. The RFID reader module RC522 is also used to write RFID tags.

RC522 RFID Card Reader Module - RoboHaat
Source: Shutterstock

The RFID reader RC522 uses the high frequency HF creating an electromagnetic field of 13.56 MHz. In theory it has a maximum range of 35 centimeters.

Something very interesting is that this module comes with a very useful interrupt pin. It is used so that instead of asking the RFID reader RC522 over and over again if there is an RFID tag nearby, the module will warn us through the pin when an RFID tag approaches and thus be able to activate the microcontroller. 

The operating voltage is 2.5V to 3.3V. This implies that it is compatible with most microcontrollers on the market such as those used by Arduino.

The good news is that despite being powered by 3.3V, the logic levels are compatible with 5V making it compatible with any Arduino or microcontroller that works at 5V.

These would be the complete specifications taken from the technical data sheet:

Frequency range13,56 MHz
InterfaceSPI/I2C/UART
Supply Voltage2,5V to 3,3V
Max. current13-26 mA
Min. current10 uA
Logic levels5V y 3V3
Reach5 cm

Components of the RFID RC522

  1. VCC: RFID reader power pin RC522. It supports a supply voltage between 2.5V and 3.3V.
  2. RST: it is a pin to turn the module on and off. As long as the pin is in the LOW state it will stay off with little consumption. When the state changes to HIGH the RC522 restarts.
  3. IRQ: interrupt pin that alerts the microcontroller when an RFID tag approaches the RFID reader RC522.
  4. MISO / SCL / TX: This pin has three functions. When the SPI interface is enabled, it functions as slave output and master input. 
  5. MOSI: entry in the SPI interface.
  6. SCK: clock signal of the SPI interface.
  7. SS / SDA / RX: The pin acts as a signal input when the SPI interface is enabled.

RFID reader connection RC522 with Arduino UNO

The communication between Arduino and the RFID reader RC522 is quite complex at the programming level. Fortunately, we have ready-to-use Arduino tools such as the Grove Beginner Kit for Arduino, an All-in-one Arduino compatible board with 10 sensors and 12 projects that will surely help us saving valuable time.

A circuit board

Description automatically generated

First, we will run DumpInfo. This program does not write any data to the RFID tag. Just read the RFID tag if you can and display the information on the serial monitor.

A screenshot of a social media post

Description automatically generated

Let’s have a look at the code. This will vary depending on the purpose for the RFID

:

A screenshot of a social media post

Description automatically generated
A screenshot of a cell phone

Description automatically generated
A screenshot of a social media post

Description automatically generated
A screenshot of a social media post

Description automatically generated
A screenshot of a cell phone

Description automatically generated

Provide your comments below

comments


If you loved this story, do join our Telegram Community.


Also, you can write for us and be one of the 500+ experts who have contributed stories at AIM. Share your nominations here.

Copyright Analytics India Magazine Pvt Ltd

Scroll To Top