Hi everyone.
I'm using this method https://jeelabs.org/2013/05/17/zero-powe-battery-measurement/ to make esp32 measure it's own battery voltage. It measures fine but there is a small problem. I put the esp32 in hibernation mode with disabled IO periphery according to this https://lastminuteengineers.com/esp32-sleep-modes-power-consumption/#esp32-hibernation-mode. In this mode the GPIOs go to undefined state and have about 1.9 V (because of IO diod protections) to ground and this drains the battery as there is voltage between ADC and ground. It seems I need two transistors in order to isolate the ADC port from both "+" and "-". So is there a way to attach two transistors to a single GPIO or may be use second GPIO ?
Here is what I do:
1. I uploaded a program that does some stuff and also measures the voltage
2. Once the program ends it puts esp32 in hibernation which disables everything except the low power RTC.
3. I noticed that this workflow drains the battery much faster then without resistors.
4. While in sleep I measured the voltage between ADC pin and ground and found 1.9 V. This drains the battery through the second resistor from the voltage divider as the first one is isolated by the FET.
5. My conclusion is that it is the ADC pin that causes the leak. Another option is that the actual ADC procedure to be very consuming but I doubt.
Any ideas ?
I'm using this method https://jeelabs.org/2013/05/17/zero-powe-battery-measurement/ to make esp32 measure it's own battery voltage. It measures fine but there is a small problem. I put the esp32 in hibernation mode with disabled IO periphery according to this https://lastminuteengineers.com/esp32-sleep-modes-power-consumption/#esp32-hibernation-mode. In this mode the GPIOs go to undefined state and have about 1.9 V (because of IO diod protections) to ground and this drains the battery as there is voltage between ADC and ground. It seems I need two transistors in order to isolate the ADC port from both "+" and "-". So is there a way to attach two transistors to a single GPIO or may be use second GPIO ?
Here is what I do:
1. I uploaded a program that does some stuff and also measures the voltage
2. Once the program ends it puts esp32 in hibernation which disables everything except the low power RTC.
3. I noticed that this workflow drains the battery much faster then without resistors.
4. While in sleep I measured the voltage between ADC pin and ground and found 1.9 V. This drains the battery through the second resistor from the voltage divider as the first one is isolated by the FET.
5. My conclusion is that it is the ADC pin that causes the leak. Another option is that the actual ADC procedure to be very consuming but I doubt.
Any ideas ?