|WiFi control of Porch :Light|
Following related posts on ESP-01S, the ESP-12E Arduino sketch, this post shows the final assembly of the light panel and the 5V power supply.
The light panel is a generic "Surface LED Down Light Panel Lamp" from cpeelectrical which I bought for RM43, mainly because there is room inside the enclosure to mount the ESP-1S and relay PCB.
|Top: ESP-01S with relay module. Middle: 230Vac to 5Vdc power supply. Bottom: 18W LED Driver|
For the ESP-01S power supply I used an old smartphone charger. It was marked as 'output 5.7V 800mA' but when used I measured 5.05V which is just as well as the ESP-01S only takes 5V. It is too large to be mounted inside the lamp, so I removed the PCB and mounted it without its enclosure.
|Old Android smartphone charger, disassembled. Note the lack of a controller IC|
|5V Charger tested on ESP-01S|
The ESP-01S drew 170mA during WiFi access, and 60mA more when operating the relay. In practice it drew somewhat more than 230mA on power up so that 800mA at 5V came in handy. For easy installation I had the relay come on on power up. This also acts as a manual override 'ON' from the light AC mains power switch.
The final part, the LED Driver came with the lamp. It took in 85-230Vac (any lower and it shuts down) and puts out a stonking 60Vdc at no load, but settled down to 50Vdc at 330mA when the lamp is turned on.
|LED driver 18W 230V|
Now the relay can be wired up to switch the DC or AC side of the LED driver. I opted to switch the AC side- hopefully it saves a little power as the primary side will not be always on.
|LED Driver. Note the IC controller on the primary side|
For enclosures for the ESP-01S and the mains 5V power, I used the casings from 20W LED drivers. The entire LED driver costs only RM6 each and I had a couple of faulty ones left over from other LED lamps. You must enclose them: all 3 boards have 230V mains voltages that must be insulated. Here in Malaysia insects get into electrical fittings, especially light fittings including bulbs.
There you have it: an IoT lamp, switched from your smartphone or desktop browser. Happy Trails.