Hello,
I would like to know if I destroy an ESP 32 if I apply 3.3 volts to GPIO16 for example, BUT is no power on VIN or on 3.3volts pin.
My VIN power it is controlled by another ON/OFF circuit, but on GPIO16 I have permanent power.
Thank you.
Can i have power on GPIO - 3.3 volts, but no VIN or no power on 3.3 volts pin ?
-
- Posts: 7
- Joined: Fri Jan 17, 2020 3:53 pm
-
- Posts: 9770
- Joined: Thu Nov 26, 2015 4:08 am
Re: Can i have power on GPIO - 3.3 volts, but no VIN or no power on 3.3 volts pin ?
It's not a great idea in general, with any chip/microcontroller... there's ESD protections that shunt power on any pin that is above the power supply voltage, to the power supply rails. In your case, it means you'll be trying to power the chip *through* the GPIO.
What you can do is either turn the ESP off by grounding its EN pin (its power use is negligible when you do that), or if you really need to keep your current setup, connect a high-value resistor (say 33K or so) between the GPIO and whatever it's connected to in order to limit the current.
What you can do is either turn the ESP off by grounding its EN pin (its power use is negligible when you do that), or if you really need to keep your current setup, connect a high-value resistor (say 33K or so) between the GPIO and whatever it's connected to in order to limit the current.
-
- Posts: 7
- Joined: Fri Jan 17, 2020 3:53 pm
Re: Can i have power on GPIO - 3.3 volts, but no VIN or no power on 3.3 volts pin ?
My configuration and what i want to do.
My ESP, it is powered by a battery or an external 5 volts.
Both of them are connected to the VIN pin.
The mosfet T1 decide if the power to board is from Lipo or from outside source.
If no outside source, the power it is supplied by Lipo. If the board it is connected to an outside source, the power to the board will be from the outside source.
The software on the ESP, has a timer which will shut down the incoming power to the VIN if no action on the keypad for more than 40 seconds.
What I want is to keep the board running if it is an outside source.
I need to detect the power before the T1.
If it is outside power, no timer.
The board get power by pressing the start button, which make the IRF to conduct and send power to ESP.
By software, ESP keeps the CONTROL line HIGH and ESP has permanent power.
When 40 seconds timer is UP, the ESP put the CONTROL line LOW and power to ESP will Stop.
Now, in normal condition, power goes to Start/Stop circuit, and after I press the Button goes to ESP.
But by the time I press the start button, power is already to GPIO16 and ESP does not have yet any power on VIN pin.
This is my problem.
Will ESP destroyed.
Dtasheet said the max voltage on any one pin id VCC+0.3 volts, meaning 3.3+0.3 = 3.6
But in my case, with no power on VIN should be 0+0.3= 0.3 volts, and not 3.3 volts.
What to do?
My ESP, it is powered by a battery or an external 5 volts.
Both of them are connected to the VIN pin.
The mosfet T1 decide if the power to board is from Lipo or from outside source.
If no outside source, the power it is supplied by Lipo. If the board it is connected to an outside source, the power to the board will be from the outside source.
The software on the ESP, has a timer which will shut down the incoming power to the VIN if no action on the keypad for more than 40 seconds.
What I want is to keep the board running if it is an outside source.
I need to detect the power before the T1.
If it is outside power, no timer.
The board get power by pressing the start button, which make the IRF to conduct and send power to ESP.
By software, ESP keeps the CONTROL line HIGH and ESP has permanent power.
When 40 seconds timer is UP, the ESP put the CONTROL line LOW and power to ESP will Stop.
Now, in normal condition, power goes to Start/Stop circuit, and after I press the Button goes to ESP.
But by the time I press the start button, power is already to GPIO16 and ESP does not have yet any power on VIN pin.
This is my problem.
Will ESP destroyed.
Dtasheet said the max voltage on any one pin id VCC+0.3 volts, meaning 3.3+0.3 = 3.6
But in my case, with no power on VIN should be 0+0.3= 0.3 volts, and not 3.3 volts.
What to do?
- Attachments
-
- Power.png (55.52 KiB) Viewed 4166 times
-
- ON-OFF.png (48.58 KiB) Viewed 4166 times
-
- Posts: 9770
- Joined: Thu Nov 26, 2015 4:08 am
Re: Can i have power on GPIO - 3.3 volts, but no VIN or no power on 3.3 volts pin ?
There's multiple options.
The 'nice' option that keeps you within datasheet specs is to feed the external power signal into e.g. a N-channel mosfet gate, with the source to ground. The drain will then be pulled down to ground if you have voltage on the external input. Route that to GPIO16 and enable the internal pullup on that pin.
The 'lazy' solution is to put a 33K (or so; anything 10K-100K will likely work) resistor between the external power and GPIO16. The ESD protection in the ESP32 will make sure that the voltage never goes above the limit and the resistor makes sure you don't supply enough current to actually power the ESP32.
The 'nice' option that keeps you within datasheet specs is to feed the external power signal into e.g. a N-channel mosfet gate, with the source to ground. The drain will then be pulled down to ground if you have voltage on the external input. Route that to GPIO16 and enable the internal pullup on that pin.
The 'lazy' solution is to put a 33K (or so; anything 10K-100K will likely work) resistor between the external power and GPIO16. The ESD protection in the ESP32 will make sure that the voltage never goes above the limit and the resistor makes sure you don't supply enough current to actually power the ESP32.
-
- Posts: 7
- Joined: Fri Jan 17, 2020 3:53 pm
Re: Can i have power on GPIO - 3.3 volts, but no VIN or no power on 3.3 volts pin ?
Thank you for the suggestion.
Can you please make a hand drawing and post it.
What N mosfet you suggest.
What is the command to enable pull-up on GPIO16 ?
Please believe me, I am so new to that, and I need help.
Thank you very much.
Can you please make a hand drawing and post it.
What N mosfet you suggest.
What is the command to enable pull-up on GPIO16 ?
Please believe me, I am so new to that, and I need help.
Thank you very much.
- Attachments
-
- And gate.png (26.62 KiB) Viewed 4071 times
-
- Posts: 9770
- Joined: Thu Nov 26, 2015 4:08 am
Re: Can i have power on GPIO - 3.3 volts, but no VIN or no power on 3.3 volts pin ?
Random sketch: (Note I added an 1K resistor from the gate to ground to make sure the 5v0 is actually 0V when not plugged in. You may or may not need that in practice, but probably better to include it anyway.)
Pull-up enabling depends on what SDK you use, for ESP-IDF, you'd use e.g. this.
For the mosfet, you can use any random logic-level N-channel mosfet. I tend to grab the AO3400, but that's mostly because I have oodles of them around. In your case, you might get away replacing this new mosfet and your existing mosfet T1 with a second IRF7317; that'll save on the amount of different components you need to buy.Pull-up enabling depends on what SDK you use, for ESP-IDF, you'd use e.g. this.
-
- Posts: 7
- Joined: Fri Jan 17, 2020 3:53 pm
Re: Can i have power on GPIO - 3.3 volts, but no VIN or no power on 3.3 volts pin ?
Thank you for help.
I did try in my own to figure out and read about pull-up and I made a test on Proteus.
I found the hard way that I need a resistor on the gate, but it did work. See the pictures.
As mosfet I found BSS138, which on Proteus had a chip.
I will make the board and test it live.
Thanks again.
I did try in my own to figure out and read about pull-up and I made a test on Proteus.
I found the hard way that I need a resistor on the gate, but it did work. See the pictures.
As mosfet I found BSS138, which on Proteus had a chip.
I will make the board and test it live.
Thanks again.
- Attachments
-
- No_Ext_Power.png (35.73 KiB) Viewed 4003 times
-
- With_Ext_Power.png (33.5 KiB) Viewed 4003 times
-
- GPIO16.png (16.17 KiB) Viewed 4003 times
-
- Posts: 1
- Joined: Thu Mar 16, 2023 3:28 pm
Re: Can i have power on GPIO - 3.3 volts, but no VIN or no power on 3.3 volts pin ?
You have a model for simulating ESP 32 in Proteus. Please share this model to me. Thank you very much. You can send by e-mail: dv-59@yandex.ru or give a download link.
Who is online
Users browsing this forum: No registered users and 71 guests