Need HELP with PIR

hello everyone
I am doing a certain project using a PIR motion sensor and controlled with arduino UNO, the problem I'm facing is that the PIR sensor goes 'high' when motion is detected then goes 'low'. what I need in my project the when an object is detected with the PIR it stays 'high' as the object is in its range and goes back to 'low' when the object is away from its range and count the time that it stays high and display it.
I really need any help with this project as my deadline is soon.
Thanks in advanced

I may be wrong, but I think that's the nature of pir. If the movement sets off the sensor, but then the object stops moving, the heat pattern settles and the sensor thinks the new heat pattern is normal.

They don't detect the presence of anything, rather the movement, afaik.

You may need to consider a different type of sensor, such as ir (but not pir) or ultrasound.

You won't get better or more answers by posting the same question in two places.....

When the signal goes high take a snapshot of the current time (currentTime = millis()). When it goes low, get the elapsed time with elapsedTime = millis() - currentTime.

JimboJA is correct, PIR is a motion detector and works by detecting differential IR energy from a moving body. No movement, no differential signal... which is why things like a heating vent does not generally set off the alarm.

Devices that detect IR work differently:

The detector is easily interfaced with Arduino;

Ray

Topics merged.

DO NOT CROSS-POST.

groundfungus:
When the signal goes high take a snapshot of the current time (currentTime = millis()). When it goes low, get the elapsed time with elapsedTime = millis() - currentTime.

Won't that simply measure the time the pir took to settle?

I also though of measuring the time between highs, but that won't work either, since the second high will be any disturbance, not necessarily the object moving out of range; it could be the object moving again, but staying in range.

Note that special optics and the dual IR sensor make up the "PIR":
http://www.ladyada.net/learn/sensors/pir.html

To do what you want with the IR differential detector, you would need to mask-off 1/2 of the sensor and use an optical chopper, OpAmp and low-pass filter. Essentially, this removes one half of the pyroelectric material from the internal differential connection, allowing the other half to generate a small signal on IR absorption which can be amplified and filtered.

From history:

By 1880, Langley's bolometer was refined enough to detect thermal radiation from a cow a quarter of a mile away.

Source: Bolometer - Wikipedia