# Protecting a battery charger from reverse polarity

I am building a battery charger for AGM (lead-acid) batteries that will output max. 5 amps to charge the battery, through a pair of clips. This makes it a possibility that the battery could accidentally be connected backwards.

My main concern is internal voltages being pulled "below ground" (negative) if the charger ground is already referenced to ground and a battery is connected, as this would damage my microcontroller (RP2040)'s ADC. Currently the battery ground connection is directly connected to internal power/signal ground.

A regular diode (or even one with low forward voltage) in series with the battery output would dissipate significant power in the volt drop, which is suboptimal. I've researched some ideal diode ICs but it seems like the body diode of their external MOSFET would conduct in reverse polarity. I'm also not sure how an ideal diode IC would work if the "ground" was pulled lower than the "output" pin in a reversed polarity situation.

I have checked this related question, but the RP2040's datasheet lists (in Section 5.5.3, Table 625) the minimum ADC input voltage as 0 volts, so the diode clamping method is not good enough.

My questions:

1. Would an ideal diode IC protect the battery charger from a user accidentally connecting the battery in reverse (polarity)?
2. Is there a solution for measuring the battery voltage that mitigates this problem?
• Could you simply use a 5A 12V DPST relay with a diode in series with the coil? Commented Feb 1, 2023 at 4:44

Reverse polarity protection with a single p-FET? Yep, here: What does this simple circuit do?

Protecting the ADC input? Add a series resistor then a Schottky diode (e.g., BAT54) to ground at the ADC pin. This will limit the input to -0.3V, which won't damage the IC. (See Absolute Maximum Ratings for I/O voltage, which shows -0.5V max.)

You could avoid the issue altogether: add a full-wave rectifier bridge between the charger input clips and the board. This would ensure correct polarity regardless of the input connection.

This maybe the simplest solution.

• the input resistance of RP2040's ADC would be much greater than R.
• the ADC input probably won't damage at negative -0.7V input, which is the forward voltage of D.

## Edit

I just realized that you mentioned about the same solution. In my opition, it would be fine. As most CMOS circuits has maximum absolute ratings of -0.7 ~ +VCC+0.7V.

If you are really afraid of ADC input damage by -0.7V, you can add Op amp repeater, as Op amp output will not go below 0V, while it is okay with -0.7V input.