Introduction: EM-18 RFID Reader Module Interfaced With Arduino Uno

This module directly connects to any microcontroller UART or through an RS-232 converter to PC.It gives UART/Wiegand26 output. This RFID Reader Module works with any 125 KHz RFID tags

Specifications :

  1. 5VDC through USB (External 5V supply will boost range of the module)
  2. Current: <50mA
  3. Operating Frequency: 125Khz
  4. Read Distance: 10cm
  5. Size of RFID reader module: 32mm(length) * 32mm(width) * 8mm(height)

Pin Configuration of EM-18 Reader Module is shown in the figure:.

Step 1: COMPONENTS

  1. ARDUINO UNO - Buy
  2. EM 18 RFID READER MODULE - Buy
  3. RFID TAGS - Buy

Step 2: Connections : EM-18 With Arduino UNO

Connections of EM 18 Reader Module with Arduino UNO are shown in the figure. You can also use Arduino NANO instead of UNO. As we know EM-18 gives two methods to get output (RS-232 and Weigand). So wisely choose a SELECT pin. A high Select pin will enable RS 232 output and Low SELECT pin will enable Weigand output. In this instructable, I have used a HIGH Select pin. This will enable RS 232 output. I have connected TX RS 232 pin to RX pin of ARDUINO UNO.

Step 3: CODE

Programming Arduino UNO for reading serial RFID Tag Keys is very easy.Basic idea is to initialize the Serial port at some baud rate. I have initialized it at a baud rate of 9600 bits/sec. i.e Transfer of 9600 bits in a sec. Now RFID key is 12 bytes. So, initialize a vector (array) of length 12 and data type to be char.[char size is 1 byte.]

char input[12];
int count = 0;

// SETUP FUNCTION

void setup()

{

Serial.begin(9600); // START SERIAL AT BAUD RATE OF 9600 BITS/SEC

}

Now in Loop function, Read these 12 bytes if the Serial data is available.

I have used Serial.available() function to check whether Serial Data is available at the port or not. Now Print this Key on Serial Monitor. [ Do not print any text or extra data on Serial Monitor except RFID Key because I will tell you how to make a Windows Based Application for same.]

void loop()
{

if(Serial.available()) // CHECK FOR AVAILABILITY OF SERIAL DATA

{ count = 0; // Reset the counter to zero

while(Serial.available() && count < 12) {

input[count] = Serial.read(); // Read 1 Byte of data and store it in the input[] variable

count++; // increment counter delay(5); }

// PRINTING RFID TAG

for(int i=0;i<12;i++)

Serial.print(input[i]);

Serial.println();

}

}

The full code is attached below in this instructable. You can download from there.

Step 4: Arduino (.INO) Files

I have developed a Window Application using Python Qt for this project. You can download the source code of the application from my Github Repository. Preview of the Application is provided by some screenshots attached here.

GITHUB REPOSITORY LINK: RFID SECURE APPLICATION