The ESP32 Relay Board 8ch is an 8-channel relay module designed to work seamlessly with the ESP32 microcontroller. This board allows users to control multiple high-voltage devices such as lights, fans, and other appliances, making it an ideal choice for home automation, industrial control systems, and IoT projects. Each relay on the board can be independently controlled, enabling flexible and efficient device management.
The following table outlines the key technical details of the ESP32 Relay Board 8ch:
Parameter | Specification |
---|---|
Operating Voltage | 5V (Relay Power) / 3.3V (ESP32 Control Logic) |
Relay Channels | 8 |
Relay Type | SPDT (Single Pole Double Throw) |
Maximum Load Voltage | 250V AC / 30V DC |
Maximum Load Current | 10A |
Control Signal Logic | Active LOW |
Communication | GPIO pins of ESP32 |
Dimensions | ~140mm x 50mm x 20mm |
Isolation | Optocoupler-based isolation for each relay channel |
The ESP32 Relay Board 8ch has the following pin configuration:
Pin Name | Description |
---|---|
IN1 | Control signal for Relay 1 (Active LOW) |
IN2 | Control signal for Relay 2 (Active LOW) |
IN3 | Control signal for Relay 3 (Active LOW) |
IN4 | Control signal for Relay 4 (Active LOW) |
IN5 | Control signal for Relay 5 (Active LOW) |
IN6 | Control signal for Relay 6 (Active LOW) |
IN7 | Control signal for Relay 7 (Active LOW) |
IN8 | Control signal for Relay 8 (Active LOW) |
Pin Name | Description |
---|---|
VCC | 5V Power Supply for the relay module |
GND | Ground connection |
Each relay has three output terminals:
Terminal | Description |
---|---|
NO | Normally Open contact |
NC | Normally Closed contact |
COM | Common contact |
Below is an example code snippet to control the ESP32 Relay Board 8ch using an ESP32 microcontroller:
// Define GPIO pins for the relay inputs
#define RELAY1 25 // GPIO pin connected to IN1
#define RELAY2 26 // GPIO pin connected to IN2
#define RELAY3 27 // GPIO pin connected to IN3
#define RELAY4 14 // GPIO pin connected to IN4
#define RELAY5 12 // GPIO pin connected to IN5
#define RELAY6 13 // GPIO pin connected to IN6
#define RELAY7 32 // GPIO pin connected to IN7
#define RELAY8 33 // GPIO pin connected to IN8
void setup() {
// Initialize relay pins as outputs
pinMode(RELAY1, OUTPUT);
pinMode(RELAY2, OUTPUT);
pinMode(RELAY3, OUTPUT);
pinMode(RELAY4, OUTPUT);
pinMode(RELAY5, OUTPUT);
pinMode(RELAY6, OUTPUT);
pinMode(RELAY7, OUTPUT);
pinMode(RELAY8, OUTPUT);
// Set all relays to OFF (HIGH state)
digitalWrite(RELAY1, HIGH);
digitalWrite(RELAY2, HIGH);
digitalWrite(RELAY3, HIGH);
digitalWrite(RELAY4, HIGH);
digitalWrite(RELAY5, HIGH);
digitalWrite(RELAY6, HIGH);
digitalWrite(RELAY7, HIGH);
digitalWrite(RELAY8, HIGH);
}
void loop() {
// Example: Turn on Relay 1 for 2 seconds, then turn it off
digitalWrite(RELAY1, LOW); // Activate Relay 1
delay(2000); // Wait for 2 seconds
digitalWrite(RELAY1, HIGH); // Deactivate Relay 1
delay(2000); // Wait for 2 seconds
}
Relays Not Activating:
ESP32 Resets When Relays Switch:
Relays Stuck in ON/OFF State:
High Voltage Load Not Switching:
Can I use a 3.3V power supply for the relay board?
No, the relay board requires a 5V power supply for proper operation.
How many relays can I control simultaneously?
You can control all 8 relays simultaneously, provided your power supply can handle the current draw.
Is the relay board compatible with other microcontrollers?
Yes, the relay board can be used with other microcontrollers like Arduino, Raspberry Pi, etc., as long as the control logic matches.
What precautions should I take when switching high-voltage loads?
Ensure proper insulation, use appropriate wiring, and avoid exceeding the relay's voltage and current ratings.