

The 2 Channel 5V Relay Module ESP32, manufactured by Espressif, is a versatile electronic component designed for controlling high-power devices such as lights, fans, and appliances. It integrates seamlessly with the ESP32 microcontroller, enabling wireless control via Wi-Fi or Bluetooth. This module is ideal for home automation, IoT projects, and industrial control systems.
Common applications include:








The following are the key technical details of the 2 Channel 5V Relay Module ESP32:
The module has two main interfaces: the input control pins and the relay output terminals.
| Pin Name | Description |
|---|---|
| VCC | Connect to 5V power supply |
| GND | Ground connection |
| IN1 | Control signal for Relay 1 (active low) |
| IN2 | Control signal for Relay 2 (active low) |
| Terminal | Description |
|---|---|
| COM | Common terminal for the relay |
| 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 relay module using an ESP32:
// 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); // Active low, so HIGH turns it off
digitalWrite(RELAY2_PIN, HIGH); // Active low, so HIGH turns it off
}
void loop() {
// Turn on Relay 1
Serial.println("Turning on Relay 1...");
digitalWrite(RELAY1_PIN, LOW); // Active low, so LOW turns it on
delay(2000); // Wait for 2 seconds
// Turn off Relay 1 and turn on Relay 2
Serial.println("Turning off Relay 1 and turning on Relay 2...");
digitalWrite(RELAY1_PIN, HIGH); // Turn off Relay 1
digitalWrite(RELAY2_PIN, LOW); // Turn on Relay 2
delay(2000); // Wait for 2 seconds
// Turn off both relays
Serial.println("Turning off both relays...");
digitalWrite(RELAY1_PIN, HIGH);
digitalWrite(RELAY2_PIN, HIGH);
delay(2000); // Wait for 2 seconds
}
Relays not switching:
Relay clicks but no output:
ESP32 resets when relay is activated:
Q: Can I use this module with a 12V power supply?
A: No, this module is designed to operate at 5V DC. Using a higher voltage may damage the module.
Q: Is it safe to control AC appliances with this module?
A: Yes, but ensure proper insulation and follow safety guidelines when working with high voltages.
Q: Can I control the relays via Wi-Fi or Bluetooth?
A: Yes, the ESP32 can be programmed to receive commands over Wi-Fi or Bluetooth and control the relays accordingly.
Q: What is the maximum switching frequency of the relays?
A: Mechanical relays are not designed for high-frequency switching. For most applications, a switching frequency of 1Hz or lower is recommended.
By following this documentation, you can effectively integrate and use the 2 Channel 5V Relay Module ESP32 in your projects.