I am attempting to build a Pandora Box. The basic idea of this project is that I am able to use the raspberry pi as a pandora radio device. Inputs are taken in from the user via Normally Open push buttons hooked into the RPi's GPIOs. In this step, we construct a simple circuit for the push button. It seems to be the case that all GPIOs work except SDA and SCL. I have been using a combination of my multimeter and WiringPi to test, and it seems that both these GPIOs hover at 3.3v, even when set to input.

gpio -g mode 2 in
gpio -g mode 3 in

These 2 inputs work as expected when in output mode:

gpio -g mode 2 out
gpio -g write 2 0
gpio -g write 2 1

I suspect that it has something to do with these same inputs being used for I2C by default, but I can't confirm. Has anyone else had this issue? What more can I do to investigate the problem? I am running the latest raspian wheezy

  • Unfortunately I ran in to the same problem. I have no idea why. I tried to make them outputs and drive them low they stay at 3.3V. Tried to make them inputs and connected them to ground - still they read "1". I have no idea what is going on with GPIO0 and GPIO1. All other GPIO pins behave as expected. I thought I have burned them before I saw your post.
    – user6911
    Apr 12, 2013 at 23:36
  • @rumen Good to hear other people are having the same issues. Krzysztof Adamski's answer below seems to explain the phenomenon.
    – Jeff
    Apr 15, 2013 at 15:50

1 Answer 1


SDA and SCL pins have external 1k8 pull-up resistors connected. This is indeed because they are intended for I²C usage (which requires them). Unfortunately, since they are external, they can't be disabled in software.

Having pull-up resistors means that default state of the pin in HIGH, unless they are pulled to ground. And this is exactly the problem you described.

This may be seen as a disadvantage but for buttons, this can be actually useful. This means that you don't have to use any additional pull-up/pull-down resistors with those pins (but you will have to use inverse logic - 1 when button is not pushed and 0 whet it is).

  • That make's sense. I figured after some time that it was an issue with the build in pull up/down resistors, but my knowledge in EE prevented me from 'fixing' it. I ended up mapping my buttons to different ports. Thanks for the explanation.
    – Jeff
    Apr 15, 2013 at 15:52
  • @Jeff: Just not that they are not build in the sense of SoC. SoC has building pull-up resistors on all GPIO pins too but they can be disabled pragmatically and they are weaker (10kOhm). But they are build-in in a sense of whole RaspberryPi, of course. Apr 15, 2013 at 16:15

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.