Pir sensor motion to arduino clock - led matrix 8x32


I'm a newbie with arduino, I've made a clock using arduino nano, led matrix, ds3231 and added pir motion sensor.

But, for now the clock (with text) freezes and awakes when I wave my hand infront of pir motion sensor. I want the clock to go 'off' not showing anything before someone walks by.

Is that possible some how? I want this because I want this clock to run on batteries.

Is that possible some how?

Yes. When you detect a PIR input you make a note of the time using the millis() function. Then at the start of the loop function you check that the current time minus the time the PIR was detected exceeds your total display time and if it does then turn off your matrix.


Thanks for answering Grumpy_Mike :) I'm not that good with writing code and so on, but I will take a look att this in the weekend.