Asked — Edited
Resolved by JustinRatliff!
I'm trying to read the status of a PIR detector using:
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.
Upgrade to ARC Pro
Unleash your creativity with the power of easy robot programming using Synthiam ARC Pro
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
And here's a quick example I used to test my PIR sensor a while ago...
Hope that helps.
My EZB runs off a 6 volt nimh, and I have an inline 5 volt voltage regulator between the sensor and the EZB.
I used code just like the first example above, except my output was for speech, instead of print, sleep 10 seconds and check the status of the pin again, but I can point it at the wall and it just keeps indicating the pin is high every time.
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!
Thanks for all of the input so far.