ESP32 RDM6300 RFID Reader Module
The RDM6300 is a simple and reliable 125kHz RFID reader module suitable for a wide range of identification and access control applications. Its straightforward UART interface ensures easy integration into any project requiring RFID capabilities.
Jump to Code Examples
Quick Links
RDM6300 Price
About RDM6300 RFID Reader Module
The RDM6300 is a compact RFID reader module designed for 125kHz RFID tags. It uses a UART interface for communication, making it easy to integrate with microcontrollers. The module reads the unique identification (UID) of RFID tags and transmits it in a simple serial format. Its low power consumption and compact design make it an excellent choice for projects such as access control, inventory management, and identification systems.RDM6300 Sensor Technical Specifications
Below you can see the RDM6300 RFID Reader Module Technical Specifications. The sensor is compatible with the ESP32, operating within a voltage range suitable for microcontrollers. For precise details about its features, specifications, and usage, refer to the sensor’s datasheet.
- Protocol: UART
- Communication Protocol: UART
- Operating Voltage: 3.3V to 5V
- Frequency: 125kHz
- Read Range: 5-10cm
- Operating Temperature: -10°C to +70°C
- Dimensions: 38mm x 22mm x 8mm
RDM6300 Sensor Pinout
Below you can see the pinout for the RDM6300 RFID Reader Module. The VCC
pin is used to supply power to the sensor, and it typically requires 3.3V or 5V (refer to the datasheet for specific voltage requirements). The GND
pin is the ground connection and must be connected to the ground of your ESP32!
The RDM6300 pinout includes:
- VCC: Power supply input (3.3V to 5V).
- GND: Ground connection.
- TX: UART transmit data (connects to microcontroller RX).
- RX: UART receive data (not commonly used).
RDM6300 Wiring with ESP32
Below you can see the wiring for the RDM6300 RFID Reader Module with the ESP32. Connect the VCC pin of the sensor to the 3.3V pin on the ESP32 or external power supply for power and the GND pin of the sensor to the GND pin of the ESP32. Depending on the communication protocol of the sensor (e.g., I2C, SPI, UART, or analog), connect the appropriate data and clock or signal pins to compatible GPIO pins on the ESP32, as shown below in the wiring diagram.
- Connect
VCC
to a stable 3.3V or 5V power supply. - Connect
GND
to the system ground. - Connect
TX
to the microcontroller's RX pin to receive UID data. - Optionally, connect
RX
for bidirectional communication (rarely required).
Code Examples
Below you can find code examples of RDM6300 RFID Reader Module with ESP32 in several frameworks:
If you encounter issues while using the RDM6300 RFID Reader Module, check the Common Issues Troubleshooting Guide.
ESP32 RDM6300 Arduino IDE Code Example
Fill in your main
Arduino IDE sketch file with the following code to use the RDM6300 RFID Reader Module:
#include <SoftwareSerial.h>
#define RX_PIN 10
#define TX_PIN 11
SoftwareSerial rfid(RX_PIN, TX_PIN);
void setup() {
Serial.begin(115200);
rfid.begin(9600);
Serial.println("RDM6300 initialized. Waiting for RFID tags...");
}
void loop() {
if (rfid.available() > 0) {
String tag = "";
while (rfid.available() > 0) {
char c = rfid.read();
tag += c;
}
Serial.print("Tag detected: ");
Serial.println(tag);
}
delay(500);
}
This Arduino sketch interfaces with the RDM6300 module over UART using SoftwareSerial. The `setup` function initializes the UART communication, and the `loop` reads incoming tag data and prints it to the Serial Monitor. The code captures the entire tag UID transmitted by the module and displays it for further use.
Connect your ESP32 to your computer via a USB cable, Ensure the correct Board and Port are selected under Tools, Click the "Upload" button in the Arduino IDE to compile and upload the code to your ESP32.
ESP32 RDM6300 ESP-IDF Code ExampleExample in Espressif IoT Framework (ESP-IDF)
If you're using ESP-IDF to work with the RDM6300 RFID Reader Module, here's how you can set it up and read data from the sensor. Fill in this code in the main
ESP-IDF file:
#include <stdio.h>
#include "driver/uart.h"
#include "freertos/task.h"
#define RX_PIN 16
#define TX_PIN 17
#define UART_PORT UART_NUM_1
void init_uart() {
uart_config_t uart_config = {
.baud_rate = 9600,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE
};
uart_param_config(UART_PORT, &uart_config);
uart_set_pin(UART_PORT, TX_PIN, RX_PIN, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
uart_driver_install(UART_PORT, 1024, 0, 0, NULL, 0);
}
void app_main() {
init_uart();
printf("RDM6300 initialized. Waiting for tags...\n");
while (true) {
char data[128];
int len = uart_read_bytes(UART_PORT, data, sizeof(data) - 1, 100 / portTICK_PERIOD_MS);
if (len > 0) {
data[len] = '\0';
printf("Tag detected: %s\n", data);
}
vTaskDelay(pdMS_TO_TICKS(500));
}
}
This ESP-IDF code configures a UART interface to communicate with the RDM6300 module. The `init_uart` function initializes the UART peripheral, and the `app_main` function continuously reads incoming tag data. The tag UID is logged to the console, making it suitable for integration into access control or identification systems.
Update the I2C pins (I2C_MASTER_SDA_IO
and I2C_MASTER_SCL_IO
) to match your ESP32 hardware setup, Use idf.py build to compile the project, Use idf.py flash to upload the code to your ESP32.
ESP32 RDM6300 ESPHome Code Example
Fill in this configuration in your ESPHome YAML configuration file (example.yml
) to integrate the RDM6300 RFID Reader Module
uart:
tx_pin: GPIO17
rx_pin: GPIO16
baud_rate: 9600
sensor:
- platform: custom
lambda: |-
return {nullptr};
sensors:
- name: "RFID Tag UID"
binary_sensor:
- platform: template
name: "Tag Detected"
This ESPHome configuration sets up UART communication with the RDM6300 using GPIO17 (TX) and GPIO16 (RX). A custom sensor is defined for capturing tag UID data, and a binary sensor indicates when a tag is detected. This setup can be extended to trigger automations based on the detected tag.
Upload this code to your ESP32 using the ESPHome dashboard or the esphome run
command.
ESP32 RDM6300 PlatformIO Code Example
For PlatformIO, make sure to configure the platformio.ini
file with the appropriate environment and libraries, and then proceed with the code.
Configure platformio.ini
First, your platformio.ini
should look like below. You might need to include some libraries as shown. Make sure to change the board to your ESP32:
[env:rdm6300]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
ESP32 RDM6300 PlatformIO Example Code
Write this code in your PlatformIO project under the src/main.cpp
file to use the RDM6300 RFID Reader Module:
#include <HardwareSerial.h>
HardwareSerial rfid(1);
void setup() {
Serial.begin(115200);
rfid.begin(9600, SERIAL_8N1, 16, 17); // RX, TX
Serial.println("RDM6300 initialized. Waiting for tags...");
}
void loop() {
if (rfid.available() > 0) {
String tag = "";
while (rfid.available() > 0) {
char c = rfid.read();
tag += c;
}
Serial.print("Tag detected: ");
Serial.println(tag);
}
delay(500);
}
This PlatformIO code initializes a UART interface to communicate with the RDM6300 module. Incoming RFID tag data is read and displayed on the Serial Monitor. The `loop` function continuously checks for tag data and handles its output, making it suitable for quick prototyping or integration into other systems.
Upload the code to your ESP32 using the PlatformIO "Upload" button in your IDE or the pio run --target upload
command.
ESP32 RDM6300 MicroPython Code Example
Fill in this script in your MicroPython main.py file (main.py
) to integrate the RDM6300 RFID Reader Module with your ESP32.
from machine import UART, Pin
import time
# Initialize UART
uart = UART(2, baudrate=9600, tx=17, rx=16)
print("RDM6300 initialized. Waiting for tags...")
while True:
if uart.any():
tag = uart.read().decode('utf-8')
print("Tag detected:", tag)
time.sleep(0.5)
This MicroPython code sets up UART communication with the RDM6300 RFID module. The script continuously listens for incoming RFID tag data and prints the UID to the console. The simplicity of the code makes it ideal for quick prototyping or integration into identification projects.
Upload this code to your ESP32 using a MicroPython-compatible IDE, such as Thonny, uPyCraft, or tools like ampy
.
RDM6300 RFID Reader Module Troubleshooting
This guide outlines a systematic approach to troubleshoot and resolve common problems with the . Start by confirming that the hardware connections are correct, as wiring mistakes are the most frequent cause of issues. If you are sure the connections are correct, follow the below steps to debug common issues.
Module Fails to Power On
Issue: The RDM6300 module does not power up or respond to commands.
Possible causes include insufficient power supply, incorrect wiring, or faulty hardware.
Solution: Ensure the module is connected to a stable power source within the recommended voltage range of 5V. Verify that all connections are secure and correctly configured. If the problem persists, consider testing the module with a different power source or replacing it.
Communication Interface Not Working
Issue: The module fails to communicate with the microcontroller over the chosen interface (typically UART).
Possible causes include incorrect wiring, improper interface selection, or incompatible voltage levels.
Solution: Double-check the wiring to ensure correct connections for UART communication. For UART, verify the TX and RX lines are properly connected. Ensure that the microcontroller's UART interface is enabled and configured correctly.
Unable to Read Tags
Issue: The module initializes correctly but fails to read RFID tags.
Possible causes include incorrect antenna orientation, insufficient power supply, or interference from nearby electronic devices.
Solution: Ensure the module's antenna is properly oriented and positioned near the tags. Verify that the power supply provides adequate current for the module's operation. Keep the module away from sources of electromagnetic interference.
Inconsistent Tag Detection
Issue: The module detects tags intermittently or with delays.
Possible causes include low-quality tags, environmental interference, or firmware issues.
Solution: Test with different tags to rule out tag quality issues. Ensure the operating environment is free from strong electromagnetic interference. Update the module's firmware to the latest version to benefit from bug fixes and improvements.
Library or Software Issues
Issue: The module operates erratically or produces errors during operation.
Possible causes include outdated or incompatible libraries, incorrect initialization, or software bugs.
Solution: Ensure that the latest version of the RDM6300 library is installed and compatible with your development environment. Review the initialization code to confirm that the module is set up correctly. Consult the module's documentation and community forums for guidance on proper usage.
Conclusion
We went through technical specifications of RDM6300 RFID Reader Module, its pinout, connection with ESP32 and RDM6300 RFID Reader Module code examples with Arduino IDE, ESP-IDF, ESPHome and PlatformIO.