Learn how to interface the EM-18 RFID reader module with an Arduino board and read data from RFID cards or tags. Follow our step-by-step guide to wiring, coding, and testing the system. Add contactless identification to your projects with the EM-18 module and Arduino.

Disclaimer:

Advertisements

About EM-18:

The EM18 RFID reader is a widely used module in access control systems and other applications where contactless identification is required. The EM18 module communicates with the Arduino microcontroller board via serial communication, which makes it easy to integrate into any project.

Pin configuration of EM-18:

How to interface the EM-18 RFID reader module with an Arduino
Pinout of EM-18 RFID module

How to interface EM-18 RFID with an Arduino:

Now, to interface EM-18, you need to follow the following steps.

Step 1: Required Components:

Before we begin, we need to gather the necessary components for this project:

Step 2: Wiring:

The wiring diagram for interfacing EM18 with Arduino is straightforward. First, connect the GND pin of the EM18 module to the GND pin of the Arduino board. Then, connect the VCC pin of the EM18 module to the 5V pin of the Arduino board.

How to interface the EM-18 RFID reader module with an Arduino

Next, connect the TX pin of the EM18 module to the RX pin of the Arduino board, and the RX pin of the EM18 module to the TX pin of the Arduino board. Finally, connect the LED and Buzzer pins of the EM18 module to any digital pins of the Arduino board.

Step 3: Code:

Now that we have connected the EM18 module to the Arduino board, it’s time to write the code. First, we need to include the SoftwareSerial library to communicate with the EM18 module. Then, we create a new instance of the SoftwareSerial class, which we will use to read the data from the EM18 module.

Next, we initialize the LED and Buzzer pins as output pins. Finally, we enter the main loop of the code, where we read the data from the EM18 module using the SoftwareSerial object. When a card or tag is detected, the LED and Buzzer pins are turned on to indicate that a card or tag has been read.

Here’s the code:

#include <SoftwareSerial.h>

SoftwareSerial RFID(2, 3); // RX and TX pins

int ledPin = 13;
int buzzerPin = 12;

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  Serial.begin(9600);
  RFID.begin(9600);
}

void loop() {
  if (RFID.available() > 0) {
    String data = "";
    while (RFID.available() > 0) {
      data += char(RFID.read());
      delay(10);
    }
    if (data.length() > 0) {
      digitalWrite(ledPin, HIGH);
      digitalWrite(buzzerPin, HIGH);
      Serial.println(data);
      delay(500);
      digitalWrite(ledPin, LOW);
      digitalWrite(buzzerPin, LOW);
    }
  }
}

Result:

Now that we have connected the EM18 module to the Arduino board and uploaded the code, we can test the system by placing an RFID card or tag near the EM18 module. When a card or tag is detected, the LED and Buzzer pins will turn on, indicating that the card or tag has been read.

Conclusion:

Interfacing the EM18 RFID reader with Arduino is a simple and easy process. By following the steps outlined in this article, you can quickly integrate the EM18 module into your projects and read data from RFID cards or tags. With a little creativity, you can use the EM18 module to add contactless identification to your projects and create innovative new applications.

Read more on:

For Professional Designs or Help:

Loading

MKDas

Mithun K. Das; B. Sc. in EEE from KUET; Head of R&D @ M's Lab Engineering Solution. "This is my personal blog. I post articles on different subjects related to electronics in the easiest way so that everything becomes easy for all, especially for beginners. If you have any questions, feel free to ask through the contact us page." Thanks.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *