Component guide · Intermediate · 4 min read
ESP8266 Wi-Fi Relay Boards (ESP-01S and ESP-12F)

Flashing, Pins and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
These boards combine an ESP8266 (ESP-01S or ESP-12F) with one to four relays and a power supply, making a cheap programmable Wi-Fi switch. The ESP-01S relay uses GPIO 0 for its relay and runs from 5 V; the ESP-12F boards take 5 V, 7 to 28 V, 5 to 80 V or mains input and expose GPIO and programming pins. Flash them with Arduino, ESPHome or Tasmota for Home Assistant.
Key specs at a glance
- ESP-01S relay
- 1 relay on GPIO 0, 5 V input, ESP-01S plugs in
- ESP-12F 1-channel
- Relay on GPIO 16 or 5 (by board), DC 5 to 80 V or AC input
- ESP-12F 4-channel
- Relays on GPIO 16, 14, 12, 13 (typical), DC 7 to 28 V or 5 V
- Relays
- 10 A (30 A on some 4-channel boards) at 250 V AC / 30 V DC
- Programming
- UART pins (TX, RX, GND, IO0) with a 3.3 V USB to TTL adapter
- RF version
- GB-IOWC-1522 adds 433 MHz remote control
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1ESP8266 ESP-01S WiFi Relay Module w/ 10A Relay₹89
Option 25V Relay Module for ESP-01 / ESP-01S (ESP Not Included)₹98
Option 3LC-Relay-ESP12-1R-MV ESP8266 1-Channel Wi-Fi Relay Module₹779
Option 4ESP8266 ESP-12F Wireless Wi-Fi Relay Module 1-Channel DC5-80V₹529
Option 58-80V Wi-Fi Single-Channel Relay Module₹569
Option 6ESP8266 ESP-12F 4-Channel Relay Module DC7-28V/5V 30A₹1,099
What the ESP8266 Wi-Fi relay board is
These suit DIY projects: a pump controller, gate opener, garage door, or a lab supply switch, with your own firmware. Relay GPIO assignments vary between sellers, so check the board silkscreen or test each GPIO.
The ESP-01S relay is the smallest; the 4-channel ESP-12F board has free GPIO for sensors.
ESP8266 Wi-Fi relay board pinout
The pins on the ESP8266 Wi-Fi relay board and what each one does.
| Pin | Function |
|---|---|
| VCC / DC+ | Supply (5 V, 7 to 28 V or 5 to 80 V by board) |
| GND | Ground |
| TX / RX / GND | Programming UART (3.3 V) |
| IO0 | Tie to GND while powering on to flash |
| Relay COM / NO / NC | Load contacts |
| Spare GPIO | Sensors and buttons (ESP-12F boards) |
- VCC / DC+
- Supply (5 V, 7 to 28 V or 5 to 80 V by board)
- GND
- Ground
- TX / RX / GND
- Programming UART (3.3 V)
- IO0
- Tie to GND while powering on to flash
- Relay COM / NO / NC
- Load contacts
- Spare GPIO
- Sensors and buttons (ESP-12F boards)
Wiring the ESP8266 Wi-Fi relay board
Use a 3.3 V USB to TTL adapter for flashing and disconnect mains while the adapter is attached. Some cheap ESP-01 relay boards need the newer ESP-01S (with pull-ups) to work.
| ESP8266 Wi-Fi relay board pin | ESP-01S relay | ESP-12F 4-channel |
|---|---|---|
| Supply | 5 V 1 A | 7 to 28 V DC |
| Relay control | GPIO 0 (fixed) | GPIO 16, 14, 12, 13 (check board) |
| Flashing | Remove ESP-01S and use the programmer | TX, RX, GND + IO0 to GND |
| Load | COM and NO | COM and NO per channel |
- Supply
- ESP-01S relay:
- 5 V 1 A
- ESP-12F 4-channel:
- 7 to 28 V DC
- Relay control
- ESP-01S relay:
- GPIO 0 (fixed)
- ESP-12F 4-channel:
- GPIO 16, 14, 12, 13 (check board)
- Flashing
- ESP-01S relay:
- Remove ESP-01S and use the programmer
- ESP-12F 4-channel:
- TX, RX, GND + IO0 to GND
- Load
- ESP-01S relay:
- COM and NO
- ESP-12F 4-channel:
- COM and NO per channel
Example code
Choose "Generic ESP8266 Module". For an ESP-12F board, change RELAY to the board's relay GPIO. Tasmota has ready templates for many of these boards.
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
const int RELAY = 0; // ESP-01S relay board
ESP8266WebServer server(80);
void page() { server.send(200, "text/html", "<a href='/on'>ON</a> | <a href='/off'>OFF</a>"); }
void setup() {
pinMode(RELAY, OUTPUT); digitalWrite(RELAY, HIGH); // most are active-low
WiFi.begin("your-wifi", "your-password");
while (WiFi.status() != WL_CONNECTED) delay(300);
server.on("/", page);
server.on("/on", [] { digitalWrite(RELAY, LOW); page(); });
server.on("/off", [] { digitalWrite(RELAY, HIGH); page(); });
server.begin();
}
void loop() { server.handleClient(); }Setup and tuning
toggle each GPIO in a test sketch and listen for the click.
GPIO 0, 2 and 15 affect boot; a relay on GPIO 0 may click at power-up.
DC5-80V boards suit 12 V, 24 V and 48 V systems directly.
mount in a plastic box with cable glands for mains loads.
What you need
Shop this list12 of 13 found in our store · ₹5,906
ESP8266 ESP-01S WiFi Relay Module w/ 10A Relay: the part this guide coversESP8266 ESP-01S WiFi Relay Module w/ 10A Relay₹89
5V Relay Module for ESP-01 / ESP-01S (ESP Not Included): another version this guide covers5V Relay Module for ESP-01 / ESP-01S (ESP Not Included)₹98
Generic LC-Relay-ESP12-1R-MV ESP8266 1-Channel Wi-Fi Relay Module: another version this guide coversLC-Relay-ESP12-1R-MV ESP8266 1-Channel Wi-Fi Relay Module₹779
ESP8266 ESP-12F Wireless Wi-Fi Relay Module 1-Channel DC5-80V: another version this guide coversESP8266 ESP-12F Wireless Wi-Fi Relay Module 1-Channel DC5-80V₹529
Generic 8-80V Wi-Fi Single-Channel Relay Module: another version this guide covers8-80V Wi-Fi Single-Channel Relay Module₹569
ESP8266 ESP-12F 4-Channel Relay Module DC7-28V/5V 30A: another version this guide coversESP8266 ESP-12F 4-Channel Relay Module DC7-28V/5V 30A₹1,099
ESP8266 ESP-12F Wi-Fi Relay Module w/ AC-DC Power Supply: another version this guide coversESP8266 ESP-12F Wi-Fi Relay Module w/ AC-DC Power Supply₹709
4-Channel WiFi RF Relay Switch Module DC5-32V w/ 433MHz Remote: another version this guide covers4-Channel WiFi RF Relay Switch Module DC5-32V w/ 433MHz Remote₹1,489
USB to ESP-01 programmer adapter: to flash ESP-01S relay boardsUSB to ESP-01 Programmer Adapter (CH340)₹72Closest match, check the specs
USB to TTL serial converter: to talk to the module from a PCUSB to TTL Serial Converter (CH340G / CP2102 / FT232RL / PL2303)₹85Closest match, check the specs
Hi-Link AC-DC power module: to power a DIY relay board from mainsHi-Link AC-DC Power Module, More Models₹211Closest match, check the specs- Fuse holder: to fuse the switched circuitFind this part
Digital multimeter: to check supply and signal voltagesDigital Multimeter₹177
Alternatives and when to choose them
- ESP-01 ESP8266: the module on the small relay board.
- ESP-12F module: the module on the larger boards.
- 5V relay module: relays for any microcontroller.
Common mistakes to avoid
- Flashing with mains connected.
- Using an old ESP-01 instead of ESP-01S.
- Assuming relay GPIOs from another seller's board.
- 5 V logic on the programming pins.
Frequently asked questions
Which GPIO controls the relay?
GPIO 0 on ESP-01S boards; it varies on ESP-12F boards, often 16, 14, 12 and 13.
Can it run Tasmota?
Yes, with a template for the relay pins.
Can it switch 230 V?
Yes, through the relay contacts, with proper enclosure and fusing.
Why does my ESP-01 not start on the board?
It needs an ESP-01S with built-in pull-ups.
Can I add sensors?
Yes on ESP-12F boards with spare GPIO.
Parts for this guide
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.


