Skip to content

simple arduino-driven scheduled light switch

License

Notifications You must be signed in to change notification settings

hoffmannmatheus/ardu-light-switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arduino Switch

I made this little project to automate switches in my house using Arduino ESP32's, so lights can turn on/off on a schedule while I'm away.

Overview

The arduino code will first acquire the current time (using NTP servers), then load the switch schedule from a file hosted in the internet. The schedule is polled every 10 minutes.

The main loop will try matching the current time against the schedule, accurate to the second (format HH-MM-SS). If it matches a switch time, the servo will actuate to either on or off.

There's many improvevements that could be made, but this worked perfecly for a few weeks out of the house.

Build

The build is very simple, using an Arduino ESP32 and 9g servo hot-glued to a little wooden base. I fed the servo through the VBUS pin from the Arduino. Here's what it looks like:

PXL_20231210_211808794

Quick demo

switch720p.mp4

Observability

There's minimal observability, which I can use to know if the switches are working. Its simply a Firebase real time database, which can be updated with Firebase API calls. It currently logs the times the switch started (e.g. maybe the power went out), and the last time the schedule was polled:

image

Links

Some links that were useful for this project:

About

simple arduino-driven scheduled light switch

Topics

Resources

License

Stars

Watchers

Forks

Languages