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 !
GPIO max input/output current
-
- Posts: 9749
- Joined: Thu Nov 26, 2015 4:08 am
Re: GPIO max input/output current
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
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 againESP_Sprite wrote: ↑Thu Jun 17, 2021 2:05 amYou 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
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
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
-
- Posts: 9749
- Joined: Thu Nov 26, 2015 4:08 am
Re: GPIO max input/output current
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