I use the ESP32 ADC to measure the battery voltage. The board has a battery boost ic which takes the voltage of the two AAs to 3.3V for ESP32.
The issue is that if the batteries are inserted backwards, the VCC will not be connected, but the ADC input pin which is connected to the battery terminal will see -3V against GND.
How does one protected ADC pin without affecting the measurements?
how do you protect the ADC pin from battery reverse polarity?
Re: how do you protect the ADC pin from battery reverse polarity?
Use a diode and in your code adjust for the drop of the diode which I believe is constant over varying voltages.
Pretty easy.
Or, use a diode bridge and get correct polarity voltage regardless of connection.
Tom
Pretty easy.
Or, use a diode bridge and get correct polarity voltage regardless of connection.
Tom
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
Who is online
Users browsing this forum: No registered users and 39 guests