Pir sensor read for 10 minutes

I am building a system that automatically turns off the light. The goal is that if there isn't any movement after 10 minutes, that it turns off the light. I just don't know how to do this on the Arduino. How can the Arduino constantly read out the pir sensor for 10 minutes?

You simply read the Arduino pin to which the sensor is connected in the main loop().
You have to record the time in millis() when the last movement was detected to be able to turn the light off after a certain period.

Or you could just use a monostable 555 timer, no need for an Arduino.

Pieter

6v6gt:
You simply read the Arduino pin to which the sensor is connected in the main loop().
You have to record the time in millis() when the last movement was detected to be able to turn the light off after a certain period.

The state change detection example shows how to determine if the state of the sensor changed - from “I see motion” to “Nothing moving here” or from “All is quiet, all is calm” to “Hey, what the f**k was that?” (or something like that).

PieterP:
Or you could just use a monostable 555 timer, no need for an Arduino.

Pieter

I guess you could but I don't think we have the full story here where the exercise may specify an Arduino and anyway, for practical purposes, there has also to be an LDR or similar light sensitive device to ensure the light does not come on during daylight.
Not only that, if you need two or more PIR sensors to control a light or other load, some of the cheaper ones are prone to re-trigger each other through electrical noise caused when switching the load off. You then need programming logic to ignore the triggers which occur within X ms of the load switch. I know all this because I spent some considerable time stabilising an application which has 3 PIR sensors like this.

PieterP:
Or you could just use a monostable 555 timer, no need for an Arduino.

Or double the value of capacitor C6 on pin4 of the BISS0001 inside the PIR.
That will double the 'stay on' time of the PIR, controlled with the 'time' pot, for up to 14 minutes.
No need for any external chip then.

6v6gt:
...there has also to be an LDR or similar light sensitive device to ensure the light does not come on during daylight.

There are two pads/vias for an LDR under the dome of a common HC-SR501 PIR.
They connect to the enable pin9 of the BISS0001. With LDR, here is no PIR output when it's light.

The PIR output can directly drive the base of an NPN transistor (no base resistor), that can switch a relay.
Several PIR sensors could drive that transistor with a diode 'or'.

But where's the fun in not using an Arduino.
Leo..