Hey!
I'm trying to light a room when motion is detected. I've puchased some relay's and a motion sensor to accomplish this. Each relay (2) will light 4 lights. When motion is detected, both relays are switched on (meaning 8 lights will be lit). 30 seconds after the last motion was detected, one relay will be swicthed off (remaining only 4 lights on). Another 30 seconds later (and still no motion detected) will turn off the second relay and put the arduino to sleep.
For testing I removed the relays and replaced them with LED's. The motion sensor is connected to ground, 5v and signal is attached to port 2 (interrupt 0).
When I move having the project started, everything is fine. After sitting still for 1 minute I see the LED's switch off and see the 'log' message "Power down" meaning the arduino is going to sleep.
Moving in front of the motion sensor however after the arduino has gone to sleep doesn't wake up the arduino.
Anyone??
Maybe the motion sensor is powered down when the Arduino goes to sleep, the motion sensor is powered through the board.
MotionSensorLight.ino (1.8 KB)