Shop OBEX P1 Docs P2 Docs Learn Events
Battery Tester w/ BS2 — Parallax Forums

Battery Tester w/ BS2

BorisBoris Posts: 81
edited 2004-12-29 11:49 in BASIC Stamp
I have a device based on BS2 (BS2, buttons, LCD). The device is powered by 2 x 9v batteries in parallel (so batteries dont need to be replaced as often). My goal is to add a function for the user to check battery status. I understand BS2sx does not have an a/d converter, so i'll have to add one. Do you see any possible problems with BS testing voltage on a battery, while its being powered from the same battery?

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2004-12-03 21:27
    You need a voltage reference -- but you can get that from the linear regulator in the BS2.

    You need to power the AtoD converter (ADC8032?) -- but I believe you can power that from the BS2 Vdd line.

    You need to produce some 0 to 5-volt signal for the ADC from the 0 to 9 volt battery voltage. Typically you would do this with a voltage divider -- but that will require some additional current from the battery.

    Question: Can you have one of the BS2 pins supply the ground, so the resistor divider is 'normally' disconnected?

    I'm sure you can use some transistor/mosfet/Darlington to provide a 'ground' for a resistor divider periodically, then read the voltage from the divider, then turn off the transistor -- no?
  • BorisBoris Posts: 81
    edited 2004-12-03 21:32
    "Question: Can you have one of the BS2 pins supply the ground, so the resistor divider is 'normally' disconnected? " Do you mean one of the I/O pins, then yes i can. I am currently only using 1st 6 I/O pins. And i forgot to mention, but it should not make much difference, i am not using the 5v regulator on the board, i have a separate one (just as a precaution).
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2004-12-04 18:14
    Hi Boris,

    You won't necessarily need to add an ADC chip to your BS2sx in order to monitor the battery voltage. The RCtime command can be used for that purpose, with a resistor and a capacitor.
    
           681 kohm       470 ohm   
    Vx ----/\/\/\---o-----/\/\/\----P0 to stamp
    unknown         |
    voltage       ===== 0.01 uF film
                          |
                        Vss
    
    



    There is a diagram and BS2 code at this link:

    owlogic.com/BS2rct.htm#B_voltage

    The current that flows from the battery into the resistor is less than 6 microamps, and that current is not lost, as it contributes to the Vdd supply.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • BorisBoris Posts: 81
    edited 2004-12-06 12:36
    Thank you.
    I definately like this idea Simple, yet efficient.
  • vir-technologiesvir-technologies Posts: 4
    edited 2004-12-08 16:05
    Boris,

    I suggest you use capacitor discharge/RC time command approach outlined by Tracy, it is quite efficient. If you want more accuracy on the ability of the battery to deliver its charge, I suggest working with and ADC such as the LTC1298 or ADC0831, both of which are detailed in Parallax application notes.

    For the ADC version, it would enable you to charge and monitor batteries. A 8-12 bit ADC will work fine, and code is fairly simple. Below is a link to battery management source code I have designed and used over the past several years, and the core functions have been used in NASA since the early 1990's. It can easily be modified for SLA, multiple Li or Ni packs.

    Please review the kit listed here, vir-inc.com/software.html, for circuits and source code which can be downloaded with the IPMCharge code - PBASIC SDK.

    This type of simple circuit could just snap on to the BSII Carrier Board, and you have a complete solution for rechargeable batteries.

    I caution you to not look at battery voltage alone to determine low or high battery levels, as this does not provide any data on the efficiency of the cells to power the system. This applies to wireless phones, RC vehicles or SLA batteries.

    Regards,

    Steve Halla
  • BorisBoris Posts: 81
    edited 2004-12-08 16:55
    Thank you for the info vir-technologies, the goal is to measure voltage on a non-rechargable 9v batter that is powering the basic stamp and the LCD (2x16) display. So there isn't really much current draw on the battery and i just need something simple to indicate if the battery is about to die, so the user does not flip out when the unit stops working. Tracy Allen's solution will accomplish that I believe.
  • m_fabio2m_fabio2 Posts: 49
    edited 2004-12-29 11:49
    A common mistake for measuring the life of a battery is to measure the voltage of the battery. The true test of a battery is the amount of current it can supply. I adivise using the capcitor setup. The would be a more accurate test, than to just measure the voltage of the battery.


    On a side note, one cool thing I saw was a instuctor at college hook a "D" battery up to a analog meter and draw 6 Amps.
Sign In or Register to comment.