Page 1 of 1

GPIO max input/output current

Posted: Wed Jun 16, 2021 8:28 am
by Wicked
Hi !

I have an ESP32 WROOM 32 and I'm a bit confused on what is the maximum current a GPIO can output or take in ?
I've read different articles that say either 12mA or 40mA . The datasheet doesnt help much either.

PS: I'm using a relay that needs 15 mA to activate so that's why im wondering. I also have an ultrasonic sensor that works at 5V and outputs a signal, but I made sure to use voltage divider to lower the voltage input on the pin

Thanks !

Re: GPIO max input/output current

Posted: Thu Jun 17, 2021 2:05 am
by ESP_Sprite
You can source 40mA from these pins at max, but you may need to tweak the drive pins to obtain this. (The 12mA number is for the 8266, but that was in the datasheet for the ESP32 for a while as well as it took us some time to obtain the final figures for this.)

Re: GPIO max input/output current

Posted: Thu Jun 17, 2021 6:27 am
by Wicked
ESP_Sprite wrote:
Thu Jun 17, 2021 2:05 am
You can source 40mA from these pins at max, but you may need to tweak the drive pins to obtain this. (The 12mA number is for the 8266, but that was in the datasheet for the ESP32 for a while as well as it took us some time to obtain the final figures for this.)
Thank you for the fast reply ! Im trying to write a small introduction for this board, like 2-3 pages , and all this information is really needed. Thanks again

Re: GPIO max input/output current

Posted: Wed Jun 23, 2021 6:34 am
by vanBassum
Don't forget to add a diode over the coil to catch the induced voltage when the relais is switched off!

BTW, I would always use something like a transistor in cases like this. The output meight be able to drive the coil, you don't really want to do this. Especially in a long term solution.

https://aws1.discourse-cdn.com/arduino/ ... d57eb.jpeg

Re: GPIO max input/output current

Posted: Thu Jun 24, 2021 1:17 am
by ESP_Sprite
This is true, especially since the relay is an inductive load, it may initially pull a lot more than 40mA. Better use a transistor.