Pages menu

Wednesday, August 19, 2020

Ordinary to smart lamp

The project

Using cheap components, you can make your home devices smart. My lamp which used 220 volt ac bulb  which is not common and may not be available on normal neighborhood DIY stores got busted. So instead of finding a bulb replacement, I decided to make use of cheaply available components and make it a smart lamp.

Components


 

1. 5V power supply (old charger)

2. ESP8266 module

3. 5V to 3.3V dc-dc to power up ESP

4. RGB led strip based on WS2812

5. Arduino Uno (only for flashing ESP8266)

Lamp Connections 

Below is the connection for the modules on the final setup when the ESP is already been flashed with the firmware. 

Programming connections

Before making the connections above, I flashed the EPS8266 module in arduino environment. I made use of the arduino uno to flash with the below connections
Arduino Uno    ESP8266
TX                    RX
RX                    TX
3.3V                  3V3, EN
GND                 GND, IO0

Steps

1. Download the Adafruit libraries. Update necessary library using Arduino's library management instead of manually copying manually.

2. Make the setup as described in programming connections

3. Flash the ESP8266 with "Torogi Smart Lamp" sketch in https://github.com/Lakay-Codes/Torogi-Smart-Lamp. (modify the wifi names/passworsds/mqtt broker address)

4. Create the lamp connections as described above.

5. Assemble the lamp.

6. Install the Mosquitto MQTT broker on synology (can be also in any PC or raspberry pi 4)

7. Download a free MQTT client app (IOT On/Off) and test.


Testing the lamp

YouTube video of testing the lamp


Conclusion

I love the outcome. Been using it for a few days and looks great. A cloud MQTT broker may be a good upgrade if things get more serious. With that, it can be controlled outside the home.