I have a raspberry pi receiving inputs with a 300k resistance connected between the voltage input (12V) and the gpio. When my python code is not running the voltage at the gpio is 1.7v, but when I run my code the voltage goes up to 5.4v. I tried to add another 300k resistor to see if I could lower the voltage at the gpio, but the voltage just dropped down to 5.2v. The pi still runs perfectly when receiving this amount of voltage. I want to understand why the circuit is behaving this way. I also tried using a 900k resistance before the gpio input and the voltage is still 5.1-5.2v at the gpio.

  • the observed behaviour is most likely the result of your code – jsotola Sep 6 '18 at 21:10
  • You'll probably need to post code and maybe a photo of the wiring to get help on this. – Brick Sep 7 '18 at 0:47
  • Most likely because you instructed your code to change pin resistance. – Dmitry Grigoryev Sep 11 '18 at 7:21

Adding a resistor in series will not drop the voltage. It will simply reduce the current.

Fortunately you seem to have limited the current to a level which the Pi's GPIO protection circuitry can handle. However you are risking destroying the Pi when you connect any voltage more than 3V3 to a GPIO.

One way to produce a safe voltage for the Pi GPIO is to use a resistor divider circuit.

|improve this answer|||||

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