Waking arduino from a deep sleep with motion sensor

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)

What kind of lights are you switching with the relays?

  attachInterrupt(0, pin2Interrupt, HIGH);

You need to pay attention to the kinds of events that can wake a sleeping Arduino. HIGH is not one of them.

Turned out that moving the interrupt to pin 3 and changed code to attachInterrupt(1, pin2Interrupt, HIGH); everything suddenly works flawlessly...

I have tested this with several UNO boards and several NANO boards, all the same symptoms...
So the problem is solved for now, however still wondering why interrupt 0 (digital pin 2) doesn't work as expected...