Hi, I am very new to arduino and I am not sure what to use for my Kitchen LED Strip.
Basically I am using a PIR movement sensor to detect if anyone is in the kitchen, and if movement is detected I switch the relay to HIGH state which turns on the LED Strip. But I want it to turn on only in the evening when it's getting dark, so my question is what is the best way to achieve that?
I was thinking about using a photo-resistor but if I have other light source in the kitchen my LED's wont turn on. My 2nd idea was to use a RTC DS3231 to specify the times at which PIR should sense movement for example from 7pm to 4am.
What you guys think which one is better / more feasible for this kind of project?
One more think, if I want the LED strip to stay on for 5 minutes before enabling PIR sensor do I have to use RTC for that or can I just make a 5 min delay using the delay function?
I'd guess that you should measure the light reflected from one or more specific areas of the room, not light sources shining directly on the LDR.
Avoid delay(), the internal clock and millis() are sufficient to time certain periods. A RTC may be required when you want to do something at a very specific time (alarm clock...). An outdoor light sensor will provide more information about ambient light conditions (clouds, fog...) than the precise time-of-day.
If you have a photoresistor and you know the LED strip is off, then reading the photresistor should determine what the ambient light level is. Just establish whether there is adequate light before turning on the LED strip. Once it's on, set your program to ignore the photoresistor: unless someone enters the kitchen when it's dark, and stays there a long time (until it's light), you are ok. Even then, the photoresistor, might give you enough resolution to notice that the LED strip is on, but there is also lots of extra light, so you recognize that daylight has come.