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
    Commented May 16, 2013 at 21:39
  • 2
    congratulations, you've just invented Radio =)
    – lenik
    Commented May 17, 2013 at 2:31

2 Answers 2


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
    Commented May 17, 2013 at 7:23

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 and acknowledge you have read our privacy policy.

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