1

I'm using RPi.GPIO in Python 3.

If I do

GPIO.setup(24, GPIO.OUT, pull_up_down=GPIO.PUD_DOWN)
GPIO.output(24, 1)

will then a current flow internally from the pin to ground even if it is not connected?

If I do

GPIO.setup(24, GPIO.OUT, pull_up_down=GPIO.PUD_UP)
GPIO.output(24, 0)

will then a current flow internally from 3.3 V to the pin even if it is not connected?

Would these currents be 0.066 mA? It could be 1.12 mA for 17 GPIOs and 1.72 mA for 26 GPIOs (assuming 50 kΩ internal pull-up resistor), but then the internal current could be even higher for GPIO2 and GPIO3 because the internal pull-up is lower there: 1.8 kΩ corresponding to 1.83 mA per GPIO, i.e. in total 4.66 mA in the last case for 17 GPIOs, and 5.25 mA for 26 GPIOs. Is this correct? If not, why not? It would be useful to know this in order to minimize power consumption.

1

I don't know if the internal pull-ups are connected when the gpio is set as an OUTPUT. I don't know how to find out.

For the sake of argument assume they are.

Each pull-up/down is of the order of 50k+. So at most 3300mV/50000R or 0.066mA will flow per gpio. For 24 gpios that gives a total of 1.584mA.

For the two I2C gpios with hard wired 1k8 resistor pull-ups to 3V3 each one will use 1.83mA, so 3.67mA for both.

See http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/raspberry-pi/gpio-pin-electrical-specifications

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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