Asked
— Edited
Hey guys.
I need a little help with a small PIR sensor I picked up. Operating voltage is 4.5 v upwards so have it plugged in to D0 as analog won't be enough to power it (tried it on ADC0 but voltage meter shot up to 220). Could someone offer me a Short script example for me to work from to test if the sensor is working? I had a quick look on the forum but the very few entries I found were regarding ADC.
Many thanks.
Hey @Steve G
PIR sensors emit a high or low signal based on whether there is a change in passive IR in the area or not. They are a digital sensor so a simple script like "getDigital(D0)" will work to see if an event has occurred.
Wow. Simpler than I thought. Thanks Jeremie. I'll give it a try.
@Steve.... PIRs are digital.... If that is a cheap (no offense eBay Chinese one) it may not work very well... Don't forget to use a 5V regulator.... I buy Parallax PIRs... Although more expensive they work perfectly and have a wide voltage range...
We had this very discussion with MovieMaker this morning... LOLPIR detectors and IR detectors
Err, what did I do wrong?
Sorry Steve I forgot to mention you'll need to either assign it to a variable or place it in a condition
ex:
@RR I believe that unit has a 5V reg on it, I have one like it
Thanks @Jeremie...
@Steve... getDigital(D0) needs to be used like Jeremie said...or you can use a variable...
@Jeremie.
Thanks bud. All sorted now.
@Richard.
Yes mate, it was a "cheap as chips" one from China, but it actually works, now. Had to turn the sensitivity right down to min, otherwise it stays open. I figured as it was less than a pint of beer, it was worth a gamble. (5v reg was connected
)
Here's what I used...
Thanks again guys.