Description
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.
Specifications
In this tutorial, we only used the following materials:
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.
As for the connection between ESP8266 and FTDI Converter, it is shown as diagram above or listed as below:
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.
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.
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.