GPIO max input/output current

Wicked
Posts: 10
Joined: Sat Jun 05, 2021 4:20 pm

GPIO max input/output current

Postby Wicked » Wed Jun 16, 2021 8:28 am

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 !

ESP_Sprite
Posts: 9749
Joined: Thu Nov 26, 2015 4:08 am

Re: GPIO max input/output current

Postby ESP_Sprite » 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.)

Wicked
Posts: 10
Joined: Sat Jun 05, 2021 4:20 pm

Re: GPIO max input/output current

Postby Wicked » Thu Jun 17, 2021 6:27 am

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

vanBassum
Posts: 68
Joined: Sun Jan 17, 2021 11:59 am

Re: GPIO max input/output current

Postby vanBassum » Wed Jun 23, 2021 6:34 am

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

ESP_Sprite
Posts: 9749
Joined: Thu Nov 26, 2015 4:08 am

Re: GPIO max input/output current

Postby ESP_Sprite » Thu Jun 24, 2021 1:17 am

This is true, especially since the relay is an inductive load, it may initially pull a lot more than 40mA. Better use a transistor.

Who is online

Users browsing this forum: No registered users and 109 guests