NOTE: If you don’t know about RFID system (TAG, Module/ Reader) or working mechanism, you can go through the links before reading this article about Interfacing RFID with Arduino.
RFID tags have similar applications to barcodes in that (barcodes) data from a tag are captured by a device that stores the data in a database. RFID, though, has more than a few advantages over barcode asset tracking software.
Most importantly data of the RFID tag can be read outside the LOS (line-of-sight), whereas Bar-codes stickers must be made straight against an optical scanner to decode/read.
EM18 RFID PINS CONFIGURATION
EM-18 is a nine pin device. Among nine pins, 2 pins are not connected, so we basically have to consider seven terminals.
Pin Number | Description |
VCC | Connect to the positive of power source. |
GND | Connected to the ground. |
BUZZ | Connect to BUZZER if used |
NC | No Connection |
NC | No Connection |
SEL | SEL=1 then o/p =RS232
SEL=0 then o/p=WEIGAND |
TX | DATA send through TX using RS232 communication |
DATA1 | WEIGAND interface DATA HIGH pin |
DATA0 | WEIGAND interface DATA LOW pin |
CIRCUIT DIAGRAM INTERFACING RFID READER WITH ARDUINO
RFID ARDUINO CODE
PROGRAM: READ RFID TAG ID AND PRINT IT ON SERIAL MONITOR
String id; void setup() { Serial.begin(9600); } void loop() { if (Serial.available() > 0) { id = Serial.readString(); Serial.println(id); delay(1000); } }
This is the same code we used for Bluetooth devices but here we will receive 12 character string of RFID tag information.
Serial.readString() will give us serial data present and it is stored in “String id”. Then print it on Serial Monitor and note it somewhere for later use.
READ NEXT
ELECTRONIC APPLIANCE CONTROL BY RFID CARD