The Relay ESP01S is a compact and versatile relay module designed to work seamlessly with the ESP-01S Wi-Fi module. Manufactured by ESP, this component allows users to control high-voltage devices remotely via Wi-Fi. It is widely used in IoT applications, home automation systems, and smart appliances due to its ease of integration and reliable performance.
The Relay ESP01S module has two main interfaces: the relay terminal block and the ESP-01S header pins.
Pin Name | Description |
---|---|
VCC | 5V power input for the relay module |
GND | Ground connection |
TX | Transmit pin of the ESP-01S module |
RX | Receive pin of the ESP-01S module |
GPIO0 | Control pin for the relay (active LOW) |
GPIO2 | General-purpose I/O pin (optional use) |
Terminal | Description |
---|---|
COM | Common terminal for the relay |
NO | Normally Open terminal (default open) |
NC | Normally Closed terminal (default closed) |
The following code demonstrates how to control the Relay ESP01S using an ESP-01S module connected to an Arduino UNO.
#include <SoftwareSerial.h>
// Define RX and TX pins for ESP-01S communication
SoftwareSerial espSerial(2, 3); // RX = Pin 2, TX = Pin 3
// Define GPIO0 pin for relay control
const int relayPin = 4;
void setup() {
// Initialize serial communication with ESP-01S
espSerial.begin(9600);
// Initialize relay control pin
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, HIGH); // Ensure relay is off initially
// Debugging via Serial Monitor
Serial.begin(9600);
Serial.println("Relay ESP01S Control Initialized");
}
void loop() {
// Example: Turn relay ON for 5 seconds, then OFF for 5 seconds
Serial.println("Turning relay ON");
digitalWrite(relayPin, LOW); // Activate relay (active LOW)
delay(5000); // Wait for 5 seconds
Serial.println("Turning relay OFF");
digitalWrite(relayPin, HIGH); // Deactivate relay
delay(5000); // Wait for 5 seconds
}
Relay Not Activating:
ESP-01S Not Responding:
High-Voltage Device Not Working:
Can I use a 3.3V power supply for the relay module? No, the relay module requires a 5V power supply to operate correctly.
Is the Relay ESP01S compatible with other ESP modules? The module is specifically designed for the ESP-01S. Other ESP modules may not fit the header pins.
How do I reset the ESP-01S module? Pull the RESET pin of the ESP-01S module LOW momentarily to reset it.
By following this documentation, you can effectively integrate the Relay ESP01S into your projects and troubleshoot common issues.