USA
Asked — Edited
Resolved Resolved by JustinRatliff!

Pir Script

I'm trying to read the status of a PIR detector using:

getDigital(D0)

but it is always showing the the port is high, whether something is in front of it or not. Do I first have to designate that the port is in input port, and if so, how do I do this? If that is not the issue, any suggestions?

Thanks for anyone willing to assist.

R1D1


ARC Pro

Upgrade to ARC Pro

With ARC Pro, your robot is not just a machine; it's your creative partner in the journey of technological exploration.

United Kingdom
#9  

Have you tried adjusting any settings on the PIR itself? Most (not all) sensors have some kind of adjustment that can be done by turning a knob or using a screwdriver (potentiometer).

User-inserted image

#10  

Do you have a link for "TotalRobots", I could not find them from a google search.

Not all PIR have the adjustment potentiometers like SteveG pictured. The kind he pictured is probably the standard type now, but there are older ones still being sold that don't have the pots and in documentation suggest having a pull up or pull down resister. I'd really like to see the exact PIR you purchased @R1D1. If you can't find a site link to the product can you post a pic of your PIR if SteveG's advice does not work?

@RichardR, I'm surprised the Parallax PIR's run on 3.3 volts. That's handy to know! :)

#11  

@R1D1 Try it on an analog port (since it is an old PIR version).... see if the voltage changes with motion.... Also I was referring to the ezb's signal pin being only 3.3v... that may have something to do with why it won't work ....

@JustinRatliff

User-inserted image

#12  

@RichardR, that makes sense, you have the revB that works in the lower voltage range.

#13  

Here is a picture of the sensor. There is no place to make any adjustments. I was however able to dig up some old notes that came with it saying that if it always indicates that the sensor is activated, then to connect a 10k resistor between the signal wire and ground. So now I've got to see if I've got one laying around, as Radio Shack is no longer!

User-inserted image

#15  

Unfortunately, too much secular work right now. I will try to wire up the resistor this weekend and post as to whether or not this was successful.

Thanks for all of the input so far.

#16  

@R1D1, if you can't find a 10K resister let me know and I'll mail you a few for free. My email address is in my profile.