We will learn how to make 8 channel 5VDC relay module controlled over WiFi with the SONOFF Tasmota firmware on the ESP8266 ESP-12E module.
ESP8266 ESP-12E module with SONOFF Tasmota firmware can be integrated with various IoT platforms. It’s also possible to access the Tasmotized ESP8266 ESP-12E module via its embedded WEB server (either as AP or with DHCP or static IP address) using a Web Browser.
To access the Tasmotized ESP-12E module from the Internet you need to port forward your router to redirect to the Tasmotized ESP-12E module Web Server.
Tag: Project 109e ESP8266 ESP-12E module with Tasmota firmware and 8 channel relay module. Acoptex.lt
Project resources
- Sketch: None;
- Libraries: None;
- Other attachments: None.
Parts required
In this project, you needed these parts (Dear visitors. You can support our project buy clicking on the links of parts and buying them or donate us to keep this website alive. Thank you):
1. Micro USB cable 1 pc

2. ESP8266 ESP-12E module 1pc

3. 8 channel 5VDC relay module 1 pc

4.Jumper cables F-F,F-M

5.Breadboard 1 pc (optional)

Understanding the Tasmota
Tasmota is an alternative firmware for ESP8266 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Written for Arduino IDE and PlatformIO.
It was initially written for Sonoff devices, but it supports devices from many other brands like Electrodragon, MagicHome, AriLux, Blitzwolf, and Allterco. You can also install it on development boards like the Wemos D1 mini and the ESP8266 NodeMCU.
Understanding the 8 channel 5VDC relay module
You can read more about it here.
Understanding the ESP8266 ESP-12E WI FI module (LoLin NODEMCU V3)
You can read more about it here.
Signals and connections of the 8 channel 5VDC relay module
You can read more about it here.
Signals and connections of the ESP8266 ESP-12E WI FI module (LoLin NODEMCU V3)

- TX – transmit pin. GPIO pin
- RX – receive pin. GPIO pin
- 3V3 (or 3V or 3.3V)- power supply pin (3-3.6V).
- GND ( or G) – ground pin.
- RST – reset pin. Keep it on high (3.3V) for normal operation. Put it on 0V to reset the chip.
- EN – Chip enable. Keep it on high (3.3V) for normal operation.
- Vin – External power supply 5VDC.
- D0-D8 – GPIO (General Purpose Input Output) pins
- D5-D8 – SPI interface
- D1-D2– I²C/TWI Interface
- SC (or CMD) – (Chip Select) – the pin that the master can use to enable and disable specific devices. GPIO pin
- SO (or SDO) – Master In Slave Out (MISO) – SPI communication. The Slave line for sending data to the master. GPIO pin
- SK (or CLK) – SCK (Serial Clock) – SPI communication.The clock pulses which synchronize data transmission generated by the master. GPIO pin
- S1 (or SD1) – Master Out/Slave In (MOSI). SPI communication. The Master line for sending data to the peripherals. GPIO pin
- S2 (or SD2) – GPIO pin
- S3 (or SD3) – GPIO pin
- VU (or VUSB) – external power 5VDC.
- A0 – ADC output.
- RSV – reserved
Wiring

Nodemcu 1.0 module | 8 channel 5VDC relay module | Tasmota firmware |
GIO0 (D3) | IN8 | Relay 8 (28) |
GPIO2 (D4) | IN7 | Relay 7 (27) |
GPIO4 (D2) | IN6 | Relay 6 (26) |
GPIO5 (D1) | IN5 | Relay 5 (25) |
GPIO13 (D7) | IN4 | Relay 4 (24) |
GPIO14 (D5) | IN3 | Relay 3 (23) |
GPIO15 (D8) | IN2 | Relay 2 (22) |
GPIO16 (D0) | IN1 | Relay 1 (21) |
G | GND | External power supply |
VIN | VCC | External power supply |
Step by Step instruction
1.Preparing, flashing and testing SONOFF Tasmota Firmware.
There are several methods to do it:
ESP8266 ESP-12E module – How to flash the SONOFF Tasmota firmware with Tasmotizer
ESP8266 ESP-12E module – Another way to flash with SONOFF Tasmota firmware
ESP8266 ESP-12E module – Flashing Tasmota Firmware with Arduino IDE
2.Configuring SONOFF Tasmota firmware an doing wiring
1.To find ESP8266 ESP-12E module IP address, download, install and open Advanced IP scanner software. Open any web browser and type http://yourIPaddress (in our case http://192.168.1.168)

By default, Tasmota Firmware fashed device will be in Sonoff Basic. You need to change it to ‘Generic’ in the Configuration menu. Click on Configuration and choose Configure Module.


2.Select the board as Generic and click on Save. The device will restart.
3. If you click on Configuration Module again, you will see more GPIO options.You can select the GPIO Functions now. Depending on the GPIO setting the option will appear on the homepage like Relay, Button, Switch,DHT and so on.

4.Do wiring and configuration.


5. Congrats!! You have done it. You can control your relays by pressing the blue buttons – 1,2,3,4,5,6,7,8.

Wrapping up
We have learnt how to make 8 channel 5VDC relay module controlled over WiFi with the SONOFF Tasmota firmware on the ESP8266 ESP-12E module.
Check for more DIY projects here.
Thank you for reading and supporting us.
Check for more DIY projects on Acoptex.lt and Acoptex.com!
If you are looking for high quality PCBs PCBWay is the best choice:

RELATED POSTS
Installing the ESP8266 NodeMCU Board in Arduino IDE 2.0 (Windows, Mac OS X, Linux)
How to flash NodeMCU ESP8266 firmware
How to control servo with joystick PS2 using NRF24L01 2.4GHZ RF transceiver module