raspberry pin --> auto triggering

Ok. I spend few hours thinking that there must be something wrong with code or HW but the real problem is quite weird.

I have rsp model 2B adn few programs running on the device. Just one program is using pin 36 as listener for button press.

Now the funny part :-) If the pin has nothing on it, totally nothing, i get correct values. In other words, program is waiting for button press.

If i connect ONE wire ( cca 10 cm wire ) to that pin, WITHOUT to connect the other part of the wire to GND, i get impulse like if the button was pressed ??

If i leave this wire connected and restart the whole rsp i get the same situation, auto triggering. Wtf ?.

I disconnect the wire, everything works OK. Is it possible that there is some static picked up by this wire and if so, how to solve this ?

GM

Reply to
gm
Loading thread data ...

Resistor to ground or local power (might be able to achieve this by suitable programming)

Reply to
Frank Miles

I added pull up setup with two resistors ( 10 / 1 K ) and it solved the problem. Btw. setting pullup in sw didnt work.

Thank you for your answer anyway ! Regards.

Reply to
gm

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.