This WiFi relay based on AI-Thinker ESP-01/ 01S WiFi module, we use the GPIO0 of ESP-01/ 01S to control the relay by low level. It’s easy to DIY your smart switch to any device by your phone anywhere with this smart relay.
- Working voltage: DC 5V-12V
- Working current: ≥250mA
- Communication: ESP01 or ESP 01S
- WiFi module Transmission distance: the maximum transmission distance is 400m (open environment, mobile phone equipped with WiFi module)
- Load: 10A/ 250VAC, 10A/ 30VDC, 10A/ 30VDC, 10A/ 28VDC
- Size: 37 x 25mm
Step 1: Material Preparation
In this tutorial, we only used the following materials:
- USB to UART FTDI Converter
- ESP8266 WiFi Serial Transceiver Module
and last but not least, ESP01/01S Relay Module.
We connect ESP8266 WiFi Serial Transceiver Module to ESP01/01S Relay Module so that we can control the relay via WiFi. To program ESP8266, FTDI Converter is required to be connected with ESP8266.
Step 2: Hardware Installation
As for the connection between ESP8266 and FTDI Converter, it is shown as diagram above or listed as below:
- RX -> TX
- TX -> RX
- VCC -> VCC
- CH_EN -> VCC
- GPIO-0 -> GND
- GND -> GND
The pins for ESP8266 is also labeled as diagram 2.
After done uploading the code to ESP8266, simply connect it to ESP01/01S Relay Module.
Step 3: Uploading the Code
For coding part, change the SSID and PASSWORD to your WiFi SSID and Password respectively. In the code, it is mentioned that serial begin is 115200, so make sure that the serial monitor is 115200 otherwise it will not display anything. We set the URL to https://192.168.0.178/ and it will be used later on.
Step 4: Results
When we access the URL, it will show as diagram 1 above. Make sure that you have been activated the ESP8266 along with ESP01/01S Relay Module with a range of 5V to 12V so that you can access the URL. The results for the module is shown as diagram 2 which LED lighted up indicated that the relay is ON.
Once we pressed the OFF in URL, the relay will be turned OFF simultaneously and vice versa for ON option.
nagkiller made it!