The project became necessary to me once I came back home late, leaving my dog (God bless her heart) alone for a long time. It was all dark and I felt bad. So, it is mainly for her: when she's not sleeping, the PIR picks up her movement and if it's dark, it will light up.
The main idea is not to simply implement an LDR to turn the LED bulbs on and off accordingly with brightness in the room; neither to attach a PIR sensor to turn it off and on depending on someone's presence in the room. It would simply be annoying, and pretty useless. And again, annoying… On, off, on, off, on, on, off… over and over.
However, by combining both sensors and properly using the millis function, this automation becomes fluid and useful.
I also added a physical switch to be able to disable the automation without turning the arduino off, for when you don't want the lights turning on automatically. Just switch it and reset the arduino.
I'm still working on an irrigation system, I'll update the project once it's complete, the soil humidity sensor didn't arrive yet.
Feel free to comment or to ask anything.
(If you know how to make the code more elegant, feel free to tell me in the comments, I am not much of a programmer.)
Cheers!
Comments