DIY Wi-Fi controlled relay
April 11, 2018
on
on

The project offers 6 presets and 3 custom (user) programs for switching a 250 VAC, 10 A load through a relay with both normally-open (NO) and normally-closed (NC) contacts.
The Wi-Fi network connectivity permits control of the load through an interactive user interface on your smartphone, tablet or computer.
Highly Integrated Wi-Fi-Capable System-on-Chip ESP8266
At the heart of this Wi-Fi controlled temperature activated relay sits an ESP-12F module built on the famous ESP8266EX, flanked by a 4-MB serial flash memory.This ubiquitous ESP module takes care of practically everything:
- reading the four pushbuttons;
- controlling the three LED;
- communicating with the temperature sensor;
- switching the relay on and off.
The program for the interactive thermostat was written as an Arduino sketch with setup and loop functions. It is quite a large program due to the inclusion of a web server and a Wi-Fi access point. The thermostat functionality is implemented in the function loop and this is where you can add custom presets. All pretty straightforward indeed.
If you prefer to think of the integrated web server and WiFi functionality as more than "black boxes", this project is a great way to learn about the intricacies of the communication between the main program and the webpage that provides the user interface on the remote device.
Four programming & scripting languages

the phone, tablet or computer that displays the
webpage.
The image opposite shows a graphic representation of the mechanism. More detailed info can be found in the well documented and onthe related Elektor LABs web page.
Although it is presented here as a thermostat, nothing should keep you from making something enterily different of this Wi-Fi-controlled relay simply by creative substitution of the temperature sensor.
Read full article
Hide full article
Discussion (0 comments)