When using pin 3 and 5 as inputs, I get only 3.3v and I'm not able to use them as inputs. I use the same code and circuit on all the GPIO pins the circuit worked on every single pin except on this 2 can someone explain why?
1 Answer
What are you trying to connect to it?
They DO work as inputs e.g. if you connect a switch to GND.
These pins have 1.8k pullup to +3.3V, so high impedance circuits will have no affect.
-
I'm trying to connect a micro switch using the 5V of the gpio and 1 of the gpio pins on the raspberry. If i use any other pins on the board it works, but when i use the pin 3 or 5 it always shows a high value. I get the problem that you said but what is the best solution for that (I'm kinda noob) Commented Nov 26, 2014 at 7:39
-
3DO NOT connect 5V to a gpio. They are 3V3 safe only. You will damage the gpio/Pi. There are NO 5V gpios. There are some pins on the expansion header connected to the 5V rail. They are NOT gpios.– joanCommented Nov 26, 2014 at 8:58
-
As @joan states DO NOT connect to +5V. If you have the Pi may be damaged. Seeing as the pins are already connected by +3.3V connecting it to a voltage source is obviously not going to change its state. You can connect a switch to GND. Commented Nov 26, 2014 at 9:31
-
So, if i understood one of the problems is realted with the fact of possible damage on the board. But the other one is that those specific pins have an high impedance so they should be used with GND instead of looking for the 3.3V ? Commented Nov 26, 2014 at 10:16
-
1These pins have a resistor to 3.3V, so that with nothing connected the pins read high. You wire a switch to ground. When the switch closed, the pin reads low. When it is open, the pin reads high. This is a very common way for a simple sensor (like a switch, or anything with an open collector or open drain output) to drive a GPIO pin, as it drives the pin to a known level even if the switch is broken or disconnected. All of the GPIO pins on the Pi are designed to be operated by 3.3V logic. Driving them with voltages above 3.3V can damage the chip.– RBerteigCommented Nov 26, 2014 at 23:37
lsmod
?