In this tutorial, I am going to show you how to use the RFID Reader ID-20LA with CT-UNO (or any Arduino Uno equivalent). Before going through this tutorial, please have a look on the getting started with Compact RFID Reader, ID-20LA.
Below are the parts required to build the RFID prototyping shield:
- RFID Reader ID-20LA (125kHz)
- RFID Reader ID-20LA Breakout Board
- 125kHz Passive RFID Card
- 125kHz Passive RFID Key Chain
- CT UNO
- Cytron Prototyping Shield
- Piezo Transducer
- 5mm Red LED
- Resistor 0.25W 100 ohm
- Resistor 0.25W 4.7k ohm
- Resistor 0.25W 2.2k ohm
1. RFID Reader ID-20LA – An RFID reader from ID-Innovations which can be used to detect 125kHz RFID tags. ID-20LA requires minimum amount of circuit connection and be easily used with Arduino or any microcontroller. The data can be obtained through serial communication, with the settings of 9600 Baud, No Parity and 1 stop bit.
2. 125kHz Passive RFID Card/Key Chain – There are various of RFID cards available at different frequencies. To use it with ID-20LA reader, you need to use cards/key chains with 125kHz.
Before using the RFID reader, I am going to show you how you can make a RFID prototyping shield. This shield will provide the necessary connection to interface with CT-UNO. Besides providing the communication with Arduino, the shield also have a LED and buzzer as an indicator for card/key chain read.
While constructing the RFID prototyping shield, I will be referring to the circuit diagram as stated in ID-20LA datasheet. The pin numbering that I used is same as in datasheet.
1. First, let’s start of with the prototyping shield. Here, I will be using Cytron Prototyping Shield.
2. Solder the RFID Reader breakout board. If you not sure on how to make this breakout board, have a look at Compact RFID Reader, ID-20LA.
3. Now solder pin 1 to the shield’s ground pin. Besides that, solder pin 2 (Reset) and pin 11 (V supply) to 5V of the prototyping shield.
4. Solder one end of 2.2k ohm resistor to the pin 10 of RFID reader.
5. Now solder the other end of 2.2k ohm resistor to the base of BC547 transistor. If you are not sure about BC547 pinout, kindly refer to the datasheet. Next, solder the emitter of BC547 to GND.
6. Solder a 100 ohm resistor to the collector of BC547 transistor.
7. Solder the cathode of LED to the other end of 100 ohm resistor. Then, the anode of LED has to be connected to 5V.
8. Solder a 4.7k ohm resistor to the collector of BC547.
9. Solder the piezo transducer to the 4.7k ohm resistor with the other end of piezo transducer to 5V supply.
10. Now that the shield is almost done, plug in the ID-20LA RFID Reader onto the breakout board. Finally the RFID prototyping shield is done.
11. Finally, stack the shield on top of CT UNO and plug in the USB cable to your computer. If nothing goes wrong, when you place the RFID card or key chain on top of the reader, the LED would blink once and the piezo tranducer will ‘beeps’.
Here I have an example sketch to run the ID-20LA with Arduino. What the sketch does is read the data transmitted from the reader and decodes it into the data and checksum section. Therefore, you can use this code to identify the ID of the card/key chain that you have. You can download the example sketch, rfid_data.
Note: If you have the shield attached on the CT-UNO, you need to remove the reader temporary while the code is uploading. If not, you will receive an avrdude error from the compiler.
Image below shows what you should see on your Arduino serial monitor when a RFID card/key chain is sensed and read.
The sketch basically reads for 13 bytes of serial data from the RFID reader. Whenever 13 bytes of data is received, it will check on the start byte which is 0x02, then the data is valid. Otherwise, the data will simply be discarded. What we are interested is the twelve bytes after the start byte (0x02) which consists of the tagID and also the checksum. An ASCII to HEX number conversion is made before the data is saved into the tagID array.
Demo application of ID-20LA:
In this demo, I will be using three RFID cards/key chains to change the colour of a common anode RGB LED. The demo sketch is available here.
Additional parts required for this demo:
Fritzing breadboard setup:
Connect 5V to the common anode of RGB LED. Then, connect a 330 ohm resistor to each colour (Red, Green, Blue) pins and to CT-UNO pin (8, 9 and 10).
When RFID card is placed near the ID-20LA reader (From top), the tag’s ID is read and compared with the registered RFID tag in Arduino sketch. Each registered ID will toggle the LED colour on and off. Unregistered card won’t have any effect on the RGB LED. Therefore, you need to change the registered card ID before running the sketch.
Finally a demo of using the RFID ID-20LA reader with RFID card/key chain to mix the colour of RGB LED.
If you have any inquiry, feel free to discuss at our technical forum.
In this github file there are two folder which are:
- rfid_data – Sketch to decode the tagID and checksum.
- color_mixing_rfid – Sketch to mix RGB LED colour using RFID.