NLD's ESP8266-Powered Smart Mains Plugs Offer Wide-Ranging Functionality, Integrated Current Sensing

Low-cost smart plugs with high security, NLD's design repurposes housings from significantly less capable remote-controlled hardware.

Gareth Halfacree
5 years ago β€’ Home Automation

Instructables user NLD has published a guide for constructing remotely-controlled Wi-Fi mains plugs using the low-cost Wemos D1 Mini ESP8266 development board β€” though admits that "if you have just started with electronics you should only build low voltage circuits, this build is only for experienced engineers β€” build it for your own risk."

"In case of my old setup there was a Raspberry Pi -> Arduino -> 433MHz transmitter controlling ALL the wireless plugs," NLD explains. "It also introduced a single point of failure. What if the Pi or Arduino (not likely) crashes, then all the home control is down. This new design is completely decentralized (no blockchains yet :P), the only point of centralisation is the wireless access point and if you worry about that you can just easily link multiple APs in a WDS net and the plugs will connect automatically to whichever is on and reachable. The Wi-Fi connection is extremely quick, the device connects and reachable in 1-2 seconds after powering on."

The heart of NLD's smartplug design is the Wemos D1 Mini development board, powered by the Espressif ESP8266 microcontroller. There's a 5V isolated power supply, a relay shield, and an Allegro ACS712 Hall-effect current sensor, all of which is fitted into housings from HomeEasy 874 and 878 433MHz remote-controllable plugs.

"3D printing cannot compete with hard melted plastic and although this plug is still kinda expensive at the time of writing ($15) you might be able to pickup a bunch second hand/for parts on smaller auction sites for a low price," NLD explains. "The HomeEasy series of wireless plugs and dimmers have similar form factors as well so the board can be easily modified to fit into another models case. The board ended up to be longer than what could be fitted into the plugs original case so I have created a 3D printed extension box to complete the case."

Compared to the native functionality offered by the HomeEasy hardware, NLD's variant is a considerable upgrade: it offers state detection, the ability to know whether a device is switched on or off; is able to keep the current state of the device over multiple restarts and power losses; offers current metering; and includes a programmable timer β€” and, NLD jokes, "if you are still not satisfied with the functionality of the new plug a smaller Multi User Dungeon can be still implemented over TELNET."

The full build guide is available on NLD's project page. As an added bonus, NLD has provided details of an Arduino-based variant which may be applicable for someone "who can accept a trade off of basic security and attack vectors over an ESP32/ESP8266 secure 802.11 WPA2 plug solution."

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles