Sinking Current of GPIO

MohdRais
Posts: 5
Joined: Thu Oct 10, 2024 7:09 am

Sinking Current of GPIO

Postby MohdRais » Fri Sep 05, 2025 8:09 am

I want to use a button switch with one switch terminal attached to the 3.3V power pin and the other switch terminal attached to a GPIO as an input pin, to monitor whether the switch is press or not. I was informed that the normal input (sinking) current should be 20mA. How to limit the input current? (If I am not mistaken, the current from the power pin can be as high as mA 400)

Sprite
Espressif staff
Espressif staff
Posts: 10612
Joined: Thu Nov 26, 2015 4:08 am

Re: Sinking Current of GPIO

Postby Sprite » Sat Sep 06, 2025 1:52 am

That current is only applicable if you set the pin to an output pin (which you shouldn't and don't do in this case). The pin is high-impedance when it's an input, so no need for current limiting. Make sure to have some sort of pulldown resistor, though, either in your circuit or enable the one built into the GPIO pad in software.

Who is online

Users browsing this forum: Amazon [Bot] and 0 guests