EM-18 RFID Reader Module Interfaced With Arduino Uno

5,090

1

11

Intro: 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

Share

    Recommendations

    • Audio Contest 2018

      Audio Contest 2018
    • Electronics Tips & Tricks Challenge

      Electronics Tips & Tricks Challenge
    • Plastics Contest

      Plastics Contest

    11 Discussions

    0
    None
    jacky.yap16

    4 months ago

    Is it possible to use this coding for Mifare RC522?

    0
    None
    TMM2018

    6 months ago

    Thank you for the answer LalitA9

    0
    None
    TMM2018

    Question 6 months ago

    Hello everyone, I am Matthew I am about to buy a RFID Reader EM-18 that I want to place inside a smart shopping trolley. I've made research on the read range of the EM 18 (which is about 10cm ) but I still wonder if products will be effectively and efficiently detected. Which RFID reader and RFID tags do you think is suitable for such a project ? Thank you

    1 more answer
    0
    None
    LalitA9FaheenM

    Answer 7 months ago

    You can loop for all cards and print them in new lines. or you can also store card's tags in Array and then print each of them in a new line.

    0
    None
    FaheenMFaheenM

    Answer 7 months ago

    Want to print each card number in the each line,it's urgent

    IMG_20180227_221654216.jpg
    0
    None
    AlekyaC

    11 months ago

    bro i need a small help bro... i have done the same windows form application using visual studio by using the platform of c#.... there is small error in it.... that is the card is reading by reader but its breaking in to pieces.... i.e, only with in a few second of reading the we need to press the read button else it is not detecting the correct uid... please help me with this bro.. thank you

    1 reply
    0
    None
    LalitA9AlekyaC

    Reply 9 months ago

    Apology for the delay! I did not get the error you just explained. write me in detail at electrotrickk@gmail.com

    0
    None

    Yes. Sure. Many new functionalities can also be added to this project to make it more interactive and powerful.