

The ESP32 Relay X2 is a dual-channel relay module designed to interface seamlessly with the ESP32 microcontroller. It allows users to control high-voltage devices such as lights, fans, or appliances using low-voltage digital signals. Each relay channel can be independently controlled, making it ideal for home automation, IoT projects, and industrial control systems.








The following table outlines the key technical details of the ESP32 Relay X2 module:
| Parameter | Specification |
|---|---|
| Operating Voltage | 5V DC |
| Control Signal Voltage | 3.3V (compatible with ESP32 logic levels) |
| Relay Channels | 2 |
| Maximum Load Voltage | 250V AC / 30V DC |
| Maximum Load Current | 10A per channel |
| Trigger Type | Active Low |
| Dimensions | 50mm x 40mm x 20mm |
The ESP32 Relay X2 module has the following pinout:
| Pin Name | Description |
|---|---|
| VCC | 5V power supply input for the relay module |
| GND | Ground connection |
| IN1 | Control signal for Relay 1 (Active Low) |
| IN2 | Control signal for Relay 2 (Active Low) |
Each relay channel has three output terminals:
| Terminal | Description |
|---|---|
| COM | Common terminal |
| NO | Normally Open terminal (connected to COM when active) |
| NC | Normally Closed terminal (connected to COM when idle) |
Below is an example Arduino sketch to control the ESP32 Relay X2 module:
// Define GPIO pins for the relay control signals
#define RELAY1_PIN 26 // GPIO pin connected to IN1
#define RELAY2_PIN 27 // GPIO pin connected to IN2
void setup() {
// Initialize serial communication for debugging
Serial.begin(115200);
// Set relay pins as outputs
pinMode(RELAY1_PIN, OUTPUT);
pinMode(RELAY2_PIN, OUTPUT);
// Ensure relays are off at startup
digitalWrite(RELAY1_PIN, HIGH); // Relay is active low
digitalWrite(RELAY2_PIN, HIGH); // Relay is active low
}
void loop() {
// Turn on Relay 1
Serial.println("Turning on Relay 1");
digitalWrite(RELAY1_PIN, LOW); // Activate relay
delay(2000); // Wait for 2 seconds
// Turn off Relay 1
Serial.println("Turning off Relay 1");
digitalWrite(RELAY1_PIN, HIGH); // Deactivate relay
delay(2000); // Wait for 2 seconds
// Turn on Relay 2
Serial.println("Turning on Relay 2");
digitalWrite(RELAY2_PIN, LOW); // Activate relay
delay(2000); // Wait for 2 seconds
// Turn off Relay 2
Serial.println("Turning off Relay 2");
digitalWrite(RELAY2_PIN, HIGH); // Deactivate relay
delay(2000); // Wait for 2 seconds
}
Relays Not Activating:
ESP32 GPIO Pins Not Working:
Load Not Switching:
Relay Module Overheating:
Q1: Can I use the ESP32 Relay X2 with a 3.3V power supply?
A1: No, the module requires a 5V power supply for proper operation. However, the control signals are compatible with the ESP32's 3.3V logic levels.
Q2: Is the relay module opto-isolated?
A2: No, the ESP32 Relay X2 does not include opto-isolation. For additional safety, consider using an opto-isolated relay module.
Q3: Can I control both relays simultaneously?
A3: Yes, you can control both relays independently or simultaneously by sending appropriate signals to the IN1 and IN2 pins.
Q4: What happens if I send a HIGH signal to the IN1 or IN2 pins?
A4: The corresponding relay will deactivate, and the load connected to the NO terminal will turn off.