Author Topic: Battery tester negative voltage protection  (Read 585 times)

0 Members and 1 Guest are viewing this topic.

Offline stepanoplustilTopic starter

  • Newbie
  • Posts: 1
  • Country: cz
Battery tester negative voltage protection
« on: January 14, 2021, 02:25:44 pm »
Hello,

I'm doing AA battery tester project to school. It is based on STM8S MCU. My task is to prevent people from placing the battery in opposite direction. Mechanically it's impossible. So I have to prevent voltage from getting to MCU pin. Thats the easy thing (using schottky diode and resistor). But I also have to show on display that the battery is being placed in wrong direction.  So my thought is to tell to another MCU pin this information (analoge or digital - I have enough pins left). I'm looking for some simple circuit which gives 0V when the battery is in right direction and voltage >0V when it's placed wrong. I've tried many circuits (in simulator) and nothing works.

One of the thought was to use op-amp as an inverting amp. with asymmetrical power supply (same as for the MCU) so it will do what I need. The problem was propably that the opamp and rest of my circuit shared ground. I don't know exactly why but it just didn't work. The next problem is that I'm using pretty small MCU that doesn't have separated ground for power and ADC converter. Otherwise the op-amp theory was able to been used (I think).

I'm attaching my scheme here. AIN is the analoge reading pin on MCU, GPIO is used for turning on the N-MOSFET (loading the battery is also my task). The R3 10k is pull-down resistor when no battery is connected. Battery holder will be soldered directly to J2 BAT pins.

Do you have any ideas how to solve this problem? Anything helps. Thanks a lot!
 

Offline fordem

  • Regular Contributor
  • *
  • Posts: 234
  • Country: gy
Re: Battery tester negative voltage protection
« Reply #1 on: January 14, 2021, 03:09:52 pm »
Curiosity question - how will the tester get power to operate the display when the battery is in backwards?
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3079
  • Country: us
Re: Battery tester negative voltage protection
« Reply #2 on: January 14, 2021, 03:32:24 pm »
How about checking if the BUT (battery under test) is capable of driving a transistor? If the base is reversed biased wrt the emitter the transistor will be off. You can detect whether the transistor is on with another GPIO.  Using a BJT it wouldn't be able to distinguish between a really flat (< 0.6V) battery and a reversed biased one. Maybe you could do something with a P-channel MOSFET.
 

Offline eliocor

  • Supporter
  • ****
  • Posts: 521
  • Country: it
    • rhodiatoce
Re: Battery tester negative voltage protection
« Reply #3 on: January 14, 2021, 04:24:05 pm »
1151258-0
Just an idea (only if you have to test ONE AA battery):
R1/R2 make a voltage divider: 1/2 of Vcc
RL is the battery load (about 1mA)

When no battery is connected A/D reads 1/2Vcc
When battery is connected A/D reads 1/2Vcc+1.5V or 1/2Vcc-1.5V
Voltage range of the A/D converter is in range (if Vcc is from 3.3V to 5V) and you can determine if battery is in correct or wrong position.
As a bonus your battery is checked with a load (1mA)


 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf