|Right socket:: regular UK 230V power socket with builtin USB charger. Left socket: ESP-01S controllerd|
Warning- this project involves hazardous AC mains voltages. Do not attempt this if you are not a qualified electrician/engineer.
Luckily here in Malaysia we use the UK 230V standard. This means it is easy to buy AC wall socket parts.
|Two-gang UK Mains AC wall socket|
|AC mains wall socket with built-in USB charger. I paid RM25 for mine.|
It is not difficult to fit the ESP-01S Relay Module into the socket enclosure. By fitting it face-down over the opening in the middle, this makes sure the AC mains on the PCB cannot be accessed from outside the enclosure. It also makes the ESP-01S's blinkenlights visible and gives its antenna an unobstructed view of the WiFi modem router.
|Fitting in the ESP-01S Relay Module|
A cheap (RM2) phone charger cable from Alibaba is used to connect the Relay Module to the charger output.
There you have it: an IoT (ie remotely-switched) AC mains power socket. Happy Trails.