Im trying to use this PIR sensor to detect people, but i cant seem to be able to interface it. Heres the Datasheet. pewa.panasonic.com/pcsd/product/ … at/amn.pdf
I know that it is digital so thats 5v high[detect] 0 low[nothing].
Thankyou very much for your help.
The data sheet does not really specify the pulse duration of a detection event, and the application circuit for the digital output has an amplifier that would tend stretch a short pulse out (as well as the obvious debounce function.) That said I would have to ask how are you trying to detect the pulse?
IF you are tying the digital output to a port pin of a microcontroller and relying on polling to see the event you will have difficulty with that if it is a very short pulse. Some microcontrollers have setup and hold times related to their clock frequency for detecting level transistions on their pins, which would likely scrren a short pulse out entirely (by design). A better option may be to use an interrupt input that is edge driven, add a latch which can catch the negative edge and be polled/reset by the micro, or add some circuitry like they did in their application circuit so that when a pulse is received it quickly discharges a cap through the transistor and then (relatively) slowly charges back up through a resistor. You may want some sort of schmitt-trigger input on the R-C output so you get a nice digital pulse rather than an somewhat sharp negative edge and lazy slow positive edge that may give a microcontroller port pin odgeta.
yes, that should work well . that does seem to be the problem, the pulses are to short. what was missleading though is that it said it was interfaceable Directly with a microcontroler, so i assumde that useing a simple commad such as setting the sensors pin to and input and reading if it was high or low would work. I will build the circutiry as you suggested.
p.s is this the correct notation for inputs?
PIR var IN5 'this at top (setting p5 as input
IF PIR=1 then
'statements. while this work for this if it goes high?
Thank you very much for the reply.
I am using a PIR sensor that seems to work the same way.
The sensor comes with 3 pins GND, 5V and a digital output. So you should just be able to read the io pin value and it should give you 1 for about half a second if there is a heat source.
I am using BasicAtom pro and Pin 0 of the Atom Pro 28
value var byte
value = IN0 ; read value on i/o pin 0
Also you may need a warming up period before the sensor gives you reliable output.