This website uses 'cookies' to give you the best, most relevant experience. Using this website means you're happy with this. read more Accept & Close
Start Games
Do It Yourself
DIY & Home Improvement

ESP8266 WIFI Remote Relay Switch

ESP8266 WIFI Remote Relay Switch
ESP8266 WIFI Remote Relay Switch
In this tutorial I will show you how to convert an old power strip into WIFI remote control. This will allow us to control electrical devices from the Internet via HTTP. For example we will be able to turn on and turn off a heater, fan or light over the internet. To build i will use a popular electronic circuit ESP8266 D1 mini. ESP8266 is a good platform for iot (the Internet of things).

Step 1: Components

Step 2: Preparing the power strip

At the beginning I removed the broken switch and everything cleaned.
The broken switch
The broken switch

Step 3: Measuring and cutting

I measured and cut the plexiglass board for electronic circuits.
For cutting I used Hot wire foam cutter from the previous project.
Follow this link to see how I built this tool.
Plexiglass cut with hot wire.
Plexiglass cut with hot wire.

Step 4: Drilling

I drilled mounting holes, for plexiglass board. Then I mounted the plexiglass board inside the power strip.
Drilling of mounting holes, for plexiglass board.
Drilling of mounting holes, for plexiglass board.

Step 5: Scheme

Schematic of the electronic circuit
Schematic of the electronic circuit

Step 6: Mounting the plexiglass board

The next step is assembling the plexiglass board and electronic circuits together.
In this project, I only use one relay to control power strip.
AC-DC step-down and relay module 250V 10A
AC-DC step-down and relay module 250V 10A

Step 7: Mounting ESP8266

Because my power strip is made of metal, I'm afraid there might be a problem with the WIFI connection.
That's why the ESP8266 is assembled inside a plastic case and screwed to the power strip.
ESP8266 D1 mini.
ESP8266 D1 mini.

Step 8: ESP8266 flashing firmware

I had a problem with flashing firmware. My version of the ESP8266 D1 mini has something wrong
with the RST pin, it does not work. That's why, I disconnect the USB cable from the computer
instead of using the RST button. In this article, step by step, I described the entire software flashing procedure.
SONOFF - ESP8266 update firmware with Arduino IDE

Download source code: ESP8266_on_off.ino
Before you upload the software to ESP8266 setup your WiFi connection.
#define WIFI_SSID "" #define WIFI_PASSWORD ""
Connect the USB cable to the ESP8266 D1 mini.
Connect the USB cable to the ESP8266 D1 mini.
Press and hold the button connected to pin D3.
Press and hold the button connected to pin D3.

Step 9: Testing HTTP server on ESP8266

Open serial monitor in Arduino IDE.
Open serial monitor in Arduino IDE.
Get your server IP from serial monitor.
Get your server IP from serial monitor.
Now open WWW page in your browser.
Now open WWW page in your browser.
Now we can control the power strip using the web browser, we can also use the button on the plastic box.