how do you protect the ADC pin from battery reverse polarity?

RMandR
Posts: 75
Joined: Mon Oct 29, 2018 3:13 pm

how do you protect the ADC pin from battery reverse polarity?

Postby RMandR » Mon Sep 14, 2020 4:15 pm

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?

tommeyers
Posts: 184
Joined: Tue Apr 17, 2018 1:51 pm
Location: Santiago, Dominican Republic

Re: how do you protect the ADC pin from battery reverse polarity?

Postby tommeyers » Mon Sep 14, 2020 9:38 pm

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
IT Professional, Maker
Santiago, Dominican Republic

Who is online

Users browsing this forum: No registered users and 37 guests