Help with PIR

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
mkingdom
Posts: 9
Joined: Sun Apr 30, 2017 2:25 pm

Help with PIR

Post by mkingdom » Sat Feb 24, 2018 12:47 pm

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?

cefn
Posts: 230
Joined: Tue Aug 09, 2016 10:58 am

Re: Help with PIR

Post by cefn » Sat Feb 24, 2018 4:02 pm

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.

mkingdom
Posts: 9
Joined: Sun Apr 30, 2017 2:25 pm

Re: Help with PIR

Post by mkingdom » Sun Feb 25, 2018 9:21 am

Thanks. All fixed with:

pin0.set_pull(pin0.NO_PULL)

:D

Post Reply