Arduino interfacing with EM-18 RFID reader

Arduino based RFID card reader using EM-18



1.Introduction 

About the project in brief

In this project, we'll be using em-18 as an RFID card reader to reveal the unique id of RFID tag cards that can be used for many purposes one of them are attendance making system used in many companies for their employees but in this article, we'll just explore how the card reads via the reader and see the generated output over the display.




Generally, the RFID card has a 12 digits unique id stored on it and can only be read via special readers so EM-18 is one of them. Many more types of readers are available, but EM-18 is a simplified version of complex readers as it works of UART communication at a baud rate of 9600 by default (Bits per second).

We'll be using Arduino to read those 14 digits unique code and display that over the Arduino serial monitor, so further that can be recorded for any specific purpose like marking attendance or catalogue management at a warehouse etc.

For this project, we need a few components listed below.

2. Components

Hardware:

  1. Arduino Uno x 1
  2. Male to Female jumper wire x 3
  3. Arduino  Cable x 1
  4. EM-18 Reader Module x1
  5. RFID Tag Cards x 1 (quantity varies as per requirement)



SOFTWARE:

  1. Arduino IDE 
  2. Arduino Drivers  i.e CH340 (If using Arduino nano)

Note: Github repository for code and circuit Click here

3. Wiring Circuit diagram


4. Code 

/* This program is written by: Prince Kumar, Team member innovationsfy

All Social handles i.e instagram/ Facebook/ github/ youtube/ twitter @innovationsfy
*/
#include <SoftwareSerial.h> // using Software serial for uart communication with em-18 module
SoftwareSerial mySerial(9, 10); // defining and naming the pins for software serial
char data; // container to store received data via rfid tag
void setup(){
Serial.begin(9600); // to display on arduino serial port setting baud rate
Serial.println("Tap the RFID card:"); //display over serial port for once in the begining
mySerial.begin(9600); // baud rate for softwareserial
}
void loop(){
if(mySerial.available()){ // checking the software serial for any data
data = mySerial.read(); //reading the softwareserial
Serial.print(data); //printing the raeded data via software serial on arduino serial port
} //ending the if statement
} //ending the main loog program


5. OUTPUT 




For any kind of doubt or query just comment down and we'll get back to you as soon as possible 
Till then stay creative and DIY

Regards
Team Innovationsfy
Instagram: @innovationsfy


Post a Comment

0 Comments