Page 1 of 1

Help with PIR

Posted: Sat Feb 24, 2018 12:47 pm
by mkingdom
Using a Keyestudio PIR designed to operate at 3.3v http://wiki.keyestudio.com/index.php/Ks ... ion_Sensor

When triggered the signal goes high and is outputting 2.9v. I'm using pin0.read.digital and I'm not getting an on reading when it goes to 2.9v. Is this normal?

Re: Help with PIR

Posted: Sat Feb 24, 2018 4:02 pm
by cefn
Possibly normal, due to a mistaken default (in my view), see https://github.com/bbcmicrobit/micropython/issues/288

On microbit you may need to explicitly disable the Pull-Down resistor which is automatically configured for you by the fact you called digital_read(), depending on the nature of the output, and whether the pull-down will dominate your circuit logic.

Re: Help with PIR

Posted: Sun Feb 25, 2018 9:21 am
by mkingdom
Thanks. All fixed with:

pin0.set_pull(pin0.NO_PULL)

:D