4

I've installed the GPIO python library to read/write to GPIO pins. To get the state of the pins I'm using "gpio readall" which displays a table with all the pins from the RPI and I can see which pin is HIGH and which one is LOW.

The problem i'm facing is that if I connect a ribbon cable to RPI (the other end of the cable is not connected) and run the "gpio readall" command multiple times one after another I see different values for the pins... the values are randomly changing... but if I remove the ribbon cable and run the same command multiple times I get all the time the same result...

I'm expecting to see the same values with or without the ribbon cable connected...

Do you have any idea why is that ?

  • What connected to the other side? What are you measuring? Id there is nothing connected the cable it self pick up on electro magnetic differences and as suggested is "floating" – Piotr Kula May 16 '13 at 21:39
  • 2
    congratulations, you've just invented Radio =) – lenik May 17 '13 at 2:31
7

Pins cannot be left floating, the value will be indeterminate without at least SOME external hardware (pull--up or -down resistors, etc.). The ribbon cable may act as an antenna and pick up additional noise that may otherwise not be present, giving more variation.

  • This. If there's nothing on the far end of the ribbon cable, you can't make assumptions about what the GPIOs will read from it. – Ian Howson May 17 '13 at 7:23
1

It is actually possible to set up the RasPi input ports with/without pull up/pull down resistors. check the GPIO register descriptions available on the net.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.