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 ⚠️

Working with electricity involves serious risk. Ensure you have the necessary skills and take proper safety precautions before attempting any electrical projects. Proceed at your own risk — the author assumes no responsibility for any damage, injury, or issues resulting from the use or misuse of the information provided.

Advertisements

All content on this website is original and protected by copyright. Please do not copy or reproduce content without permission. While most of the resources shared here are open-source and freely accessible for your learning and benefit, your respect for our intellectual effort is appreciated.

If you find our tutorials helpful, consider supporting us by purchasing related materials or sharing our work — it helps keep the content flowing.

Need help or have questions? Leave a comment below — the author is always happy to assist!

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:

Liked this article? Subscribe to our newsletter:

Loading

or,

Visit LabProjectsBD.com for more inspiring projects and tutorials.

Thank you!


MKDas

Mithun K. Das. B.Sc. in Electrical and Electronic Engineering (EEE) from KUET. Senior Embedded Systems Designer at a leading international company. Welcome to my personal blog! I share articles on various electronics topics, breaking them down into simple and easy-to-understand explanations, especially for beginners. My goal is to make learning electronics accessible and enjoyable for everyone. If you have any questions or need further assistance, feel free to reach out through the Contact Us page. Thank you for visiting, and happy learning!

0 Comments

Leave a Reply

Avatar placeholder

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