Circuit to choose/correct battery polarity

Thread Starter

CuatroMan

Joined Nov 25, 2018
13
Hi friends,

I'm hoping for a bit of help with a challenge I'm faced with solving.

I have a project that aims to "automatically" sort AA batteries by remaining voltage/capacity.
I believe I have a handle on the voltage sorting portion, yet the physical orientation of the batteries is tripping me up.

With a voltage reading of a positive number or negative number, I can determine if the battery is oriented incorrectly.
Yet, I'd like to find a circuit solution to possibly switch the negative and positive leads so the batteries polarity is correct and functions like a properly oriented battery.

I'm hoping this explanation makes sense -- I'm a lifelong newbie.

Thanks for any help!
 

AlbertHall

Joined Jun 4, 2014
12,346
You could connect the battery via a bridge rectifier so the polarity would always be correct but you will lose some of the voltage in the diode drops.

Alternatively, having detected the polarity, you could operate a DPDT relay to switch the battery terminals around. You will need some cunning with this method. When the relay switches and the polarity is correct the relay will switch back again! One way would be to put the polarity sensing before the relay contacts and the voltage using/measuring circuit after the relay.

Or measure the voltage with a microcontroller and use the abs() function.
 

Thread Starter

CuatroMan

Joined Nov 25, 2018
13
Alternatively, having detected the polarity, you could operate a DPDT relay to switch the battery terminals around. You will need some cunning with this method. When the relay switches and the polarity is correct the relay will switch back again! One way would be to put the polarity sensing before the relay contacts and the voltage using/measuring circuit after the relay.
Thank you AlbertHall! A relay seems like an elegant solution.
Am I on the right track with this schematic?


Or measure the voltage with a microcontroller and use the abs() function.
I'm not familiar with the "abs" function but looking into it now.

Thank you!
 

AlbertHall

Joined Jun 4, 2014
12,346
Thank you AlbertHall! A relay seems like an elegant solution.
Am I on the right track with this schematic?



I'm not familiar with the "abs" function but looking into it now.

Thank you!
Yes, that will do the job.

abs() is a function in 'C' on the Arduino. It returns the absolute magnitude of a value.
abs(2)=2
abs(-3)=3
and so on.
 

dl324

Joined Mar 30, 2015
16,921
Thank you DL324. Currently just using a gravity method (ramp) and an arduino to measure the individual voltages.
If the ADC range doesn't allow reading negative voltages, you could use an absolute value circuit. Or use some method to insure proper orientation.
 

AlbertHall

Joined Jun 4, 2014
12,346
If you connect the batteries to the Arduino with a circuit as below then you can directly read the cell voltage without worrying about the polarity.
The two resistors give a point at half the supply voltage and the cell voltage will add or subtract from that, giving you 1V or 4V. For accuracy the Arduino can also measure the mid point voltage then find the difference between the two voltages and use the abs(function to get the cell voltage regardless of orientation.

upload_2019-2-13_18-40-11.png
 

crutschow

Joined Mar 14, 2008
34,442
If you need to actually reverse the battery polarity for you testing, below is the LTspice simulation of a circuit using a relay, as Albert suggested.
It uses a comparator to switch a DPDT relay so that the output test voltage (yellow trace) always has the A voltage positive with respect to the B voltage, as the input test battery (Vtest) (blue trace) changes polarity.
The relay turns on (green trace) when the voltage is more positive that about 148mV.
With no input connected, the relay is off.

upload_2019-2-13_11-54-14.png
 

ian field

Joined Oct 27, 2012
6,536
You could connect the battery via a bridge rectifier so the polarity would always be correct but you will lose some of the voltage in the diode drops.

Alternatively, having detected the polarity, you could operate a DPDT relay to switch the battery terminals around. You will need some cunning with this method. When the relay switches and the polarity is correct the relay will switch back again! One way would be to put the polarity sensing before the relay contacts and the voltage using/measuring circuit after the relay.

Or measure the voltage with a microcontroller and use the abs() function.
If you can spare 1.4V out of 1.5...……………..
 

ian field

Joined Oct 27, 2012
6,536
Hi friends,

I'm hoping for a bit of help with a challenge I'm faced with solving.

I have a project that aims to "automatically" sort AA batteries by remaining voltage/capacity.
I believe I have a handle on the voltage sorting portion, yet the physical orientation of the batteries is tripping me up.

With a voltage reading of a positive number or negative number, I can determine if the battery is oriented incorrectly.
Yet, I'd like to find a circuit solution to possibly switch the negative and positive leads so the batteries polarity is correct and functions like a properly oriented battery.

I'm hoping this explanation makes sense -- I'm a lifelong newbie.

Thanks for any help!
There's a way to rig a MOSFET so the body diode would conduct if there was enough voltage, but it also enhances the channel so you pretty much get RDSon - but I doubt you have the voltage to do that.

Many "smart" chargers have a comparator to check the polarity of any battery applied. Its high impedance stuff that isn't damaged by reverse polarity, but a correct polarity of sufficient voltage flips the comparator - that activates a relay to complete the main current path.

The downside is, it requires a power source to work.
 

Thread Starter

CuatroMan

Joined Nov 25, 2018
13
If you need to actually reverse the battery polarity for you testing, below is the LTspice simulation of a circuit using a relay, as Albert suggested.
It uses a comparator to switch a DPDT relay so that the output test voltage (yellow trace) always has the A voltage positive with respect to the B voltage, as the input test battery (Vtest) (blue trace) changes polarity.
The relay turns on (green trace) when the voltage is more positive that about 148mV.
With no input connected, the relay is off.

View attachment 170117
Thank you for this! Very helpful!
 

Thread Starter

CuatroMan

Joined Nov 25, 2018
13
I'm so impressed and grateful for everyones quick responses and suggestions to help.
I truly appreciate everyone taking time out to help.

Off to the bench!
 

BobaMosfet

Joined Jul 1, 2009
2,113
If voltages are not large, I'd use transistors instead of relays. Faster, no spark issue (so safe anywhere), no snubber needed, and no time delays due to EM field charge/discharge time.
 

Thread Starter

CuatroMan

Joined Nov 25, 2018
13
If voltages are not large, I'd use transistors instead of relays. Faster, no spark issue (so safe anywhere), no snubber needed, and no time delays due to EM field charge/discharge time.
Thank you. I'm measuring individual AA batteries. Would the diode drop be an issue with transistor?
 

BobaMosfet

Joined Jul 1, 2009
2,113
Thank you. I'm measuring individual AA batteries. Would the diode drop be an issue with transistor?
Unlike a BJT, a MOSFet does not have a diode drop. Instead the Source->Drain voltage drops much less, as if a low-value resistor is between them. You can look at the datasheet to determine it's value (RDS(on)) and calculate the voltage value across it by the current going through it, and readd that to your end value.
 
Top