Page 1 of 1

Pin X1 sees pulse when X2 goes high

Posted: Wed Aug 26, 2015 6:50 am
by michaelaye
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

Re: Pin X1 sees pulse when X2 goes high

Posted: Wed Aug 26, 2015 7:14 am
by pythoncoder
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.