lighty
Member level 3
I need a general idea on a way to measure (or at least detect) reverse polarity signals by PIC ADC.
I'm designing a pulse charger for lead-acid batteries. Voltage ratings of batteries is from 6 - 48V. MCU is measuring potential over the charging cap in order to determine voltage to be dumped into the battery. A simple voltage divider does the trick and there is no problem there (although with such extended potential range resolution is lost, especially on 10-bit ADC).
However, MCU also needs to take into account the voltage of the battery and MCU is measuring battery voltage through differential OPAMP (there is also inherent loss of resolution by fixed sets of voltage dividers but that's also not a problem).
Now, what bothers me is how to detect if battery polarity is reversed ie how to detect if battery is connected in reverse. Analogue part of the circuit is not a problem and with dual power supply the output of differential OPAMP will correspond to the reversed polarity. However, MCU ADC can't handle that and also input will probably get damaged if differential OPAMP output is lower than Vss by more than 0.3 V.
Let's say, for the sake of the argument, that I want to measure inverted voltage. I could of course invert signal by adding additional OPAMP but it has to be done automatically by MCU or by some analogue design (which is of course advisable).
Even just a detection of reverse polarity would be a good solution in order to prevent MCU to start charging process. However, the reverse polarity detector must be done in a way that would be able to indicate to MCU that polarity is reversed without damaging ADC input.
I considered using a single power supply to feed the differential OPAMP which would prevent its output from going negative. However INA117 is AFAIK not capable of going rail to rail and that could present a problem, especially with such a wide voltage range to be measured. Even if it's possible to get INA117 to go rail to rail with acceptable error in lower range I still have the challenge of designing a reverse polarity detector that would signal to MCU that battery is connected in reverse.
The schematic is just a general idea to convey the concept of what I'm thinking and I'm open for suggestions.
Any ideas are appreciated.
BTW - I hope I'm posting this to correct section of the forum.
I'm designing a pulse charger for lead-acid batteries. Voltage ratings of batteries is from 6 - 48V. MCU is measuring potential over the charging cap in order to determine voltage to be dumped into the battery. A simple voltage divider does the trick and there is no problem there (although with such extended potential range resolution is lost, especially on 10-bit ADC).
However, MCU also needs to take into account the voltage of the battery and MCU is measuring battery voltage through differential OPAMP (there is also inherent loss of resolution by fixed sets of voltage dividers but that's also not a problem).
Now, what bothers me is how to detect if battery polarity is reversed ie how to detect if battery is connected in reverse. Analogue part of the circuit is not a problem and with dual power supply the output of differential OPAMP will correspond to the reversed polarity. However, MCU ADC can't handle that and also input will probably get damaged if differential OPAMP output is lower than Vss by more than 0.3 V.
Let's say, for the sake of the argument, that I want to measure inverted voltage. I could of course invert signal by adding additional OPAMP but it has to be done automatically by MCU or by some analogue design (which is of course advisable).
Even just a detection of reverse polarity would be a good solution in order to prevent MCU to start charging process. However, the reverse polarity detector must be done in a way that would be able to indicate to MCU that polarity is reversed without damaging ADC input.
I considered using a single power supply to feed the differential OPAMP which would prevent its output from going negative. However INA117 is AFAIK not capable of going rail to rail and that could present a problem, especially with such a wide voltage range to be measured. Even if it's possible to get INA117 to go rail to rail with acceptable error in lower range I still have the challenge of designing a reverse polarity detector that would signal to MCU that battery is connected in reverse.
The schematic is just a general idea to convey the concept of what I'm thinking and I'm open for suggestions.
Any ideas are appreciated.
BTW - I hope I'm posting this to correct section of the forum.