2

Hopefully this question isn't too silly on my part... but I am very new to this - so I am very likely missing something obvious :)

So, the background... I have relays which I want to control them with switch inputs... I am able to control the relays... no problem... I am able to pick up most of the switch inputs - but not all...

For some reason GPIO2 (pin3) and GPIO3 (pin5) always show high...

I do have pull-down resistors installed on my breadboard... and if I move my testing switches to any of the other pins - I can see switch state on / off.

With GPIO2 and GPIO3, the switch always shows high - even when the switch is open...

Is there anything else I can check / set / look out for?

2 Answers 2

5

GPIO 2 and 3 are special in that they have hard wired 1k8 pull-up resistors to 3V3 fitted on board. That's to allow their use as I2C bus 1 (I2C requires pull-ups for SDA/SCL for proper bus operation).

Use any other GPIO.

2

For some reason GPIO2 (pin3) and GPIO3 (pin5) always show high...

Those pins have pull-ups built into the PCB. you must use pull-down resistors less than about 1k6 in order to overcome these. Two options:

1) Don't use them. You have about 30 others to chose from.

2) Configure your circuit for inverted logic such that the closed switch grounds the input (logic 0 = closed logic 1 = open).

I've skipped the obvious questions like: Have you actually specifically configured them as inputs?

Incidentally, it can be useful to know what language you're using. Then i could give examples.

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.