Pin X1 sees pulse when X2 goes high

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
michaelaye
Posts: 4
Joined: Fri Aug 14, 2015 11:15 pm

Pin X1 sees pulse when X2 goes high

Post by michaelaye » Wed Aug 26, 2015 6:50 am

I am connecting a PIR to the Pyboard and, as a beginner, made the rookie mistake of having a rectangular 2 row header in the corner of the X1 sensor and connecting the PIR simply to the pin that was closest to me which then of course was not X1 but X2.
So there I was trying to get things working while looking at values measured by pin X1. Thing is, I always got a pulse on X1 when the PIR triggered, it only did not stay high when the PIR was supposed to do that. Took me a while until I *DOH*-ed and addressed X2 and everything worked as expected. But now I'm worried that something else is fishy with me being able to see anything on X1 despite having it not connected to anything?
Has anybody else seen something like this?

Michael

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Pin X1 sees pulse when X2 goes high

Post by pythoncoder » Wed Aug 26, 2015 7:14 am

CMOS inputs are very high impedance and can pick up signals from adjacent pins by capacitive coupling. This explains why it didn't stay high: stray resistance gradually discharged the pin. To prove the point you could configure pin X1 with a pulldown i.e. with pull=pyb.Pin.PULL_DOWN and it should read zero. But I wouldn't worry: it's entirely to be expected.
Peter Hinch
Index to my micropython libraries.

Post Reply