My simple IOT setup to control room light using esp8266.
- A relay bridging the power to room light controlled from esp8266's GPIO
- Uses Micropython Framework
- ESP 8266 LoLin Module
- Single Channel Relay 220V - 5V control
- 5V Power Supply (I used a mobile charger brick)
TODO: Circuit Schematics
- Install Micropython, follow this documentation here
- Upload this code using the WebREPL, documentation
Write the WiFi credentials in config.py
# contents of config.py
wifi_cred = ("SSID", "PASSWD")
Find the IP address of the esp8266 connected to WiFi either from the router page or nmap
. Then, go that ip address from browser on your phone or pc.
You can cURL
follow urls to toggle the light
# to turn on the lights
curl http://<ip addr>/turnon
# to turn off the lights
curl http://<ip addr>/turnoff
- Complete Implementation of NTP for toggle lights by the time of the Day