A smart light scheduling system that allows users to set ON/OFF times via a web UI.
The schedule is sent over WebSocket β MQTT β Arduino, controlling an LED accordingly.
- Frontend: HTML, CSS, JavaScript (WebSocket client)
- Backend: Python (WebSocket server, MQTT publisher)
- IoT: Arduino (LED control), MQTT (Mosquitto broker)
- Protocol: WebSocket, MQTT, Serial
-
Start MQTT Broker
Run Mosquitto onlocalhost:1883. -
Connect Arduino
Upload the Arduino sketch and ensure it's on the correct serial port (e.g.,COM3). -
Run Subscriber
python subscriber.py(receives MQTT messages, sends commands to Arduino) -
Run WebSocket Server
python backend.py(listens onws://localhost:8765) -
Open
client.html
In a browser to set the light ON/OFF schedule.
python install -r requirements.txtπ LED will toggle based on the scheduled times!