Shop OBEX P1 Docs P2 Docs Learn Events
Battery Status? — Parallax Forums

Battery Status?

computer guycomputer guy Posts: 1,113
edited 2010-05-22 23:42 in Propeller 1
Is there a cheap and easy way to get the propeller to determine the status of a 9V battery? i.e 0-100%, how much charge is remaining.

edit: Li-Ion 9V battery.


Thank you smile.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"powered by Propeller" domed stickers $1.50 - Find them here
Check out my Design and Technology project for my Higher School Certificate www.ecosureblog.net

The Sarah Myatt Fund - Help Sarah and Her Family Fight Quadriplegia HERE

Post Edited (computer guy) : 5/23/2010 1:34:31 AM GMT

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2010-05-22 10:54
    to analyse how much(electrical) charge is remaining you have to measure the current all the time and accumulate the current-measurings over time.

    So this requires a shunt-resistor which should have a low value dependning on the current 1 ohm down to 0,01 ohm.

    The value should be low like this to keep the wasted energy low that is dissipated in the resistor.
    You would measure the voltagedrop across the shunt-resistor. Which could be done by the ADC-circuit using a propeller-counter
    or with any kind of adc-chip.

    Another idea is: to watch the voltage-level of the accumulator accurately over time. I have no practical experience with that.
    It MIGHT be possible to conclude surely from the voltage-level to the remaining charge.

    If the current is always on the SAME level you could simply add a constant (representing the current) over time.
    If you have different states that are absolutely deterministic you could include this information to add several constant values depenending on the state of your program

    Before using this technique in situations where you have to rely on a proper function I would test it dozens of times with different accumulators etc.

    another idea:
    counting pulses from a voltage controlled oscillator (VCO)
    The voltagedrop across a shunt-resistor determines the frequency of a VCO and a propeller-counter counts and summarises the pulses.

    best regards

    Stefan


    If you regard all these things it might be the better solution to buy a ready to use mAh-meter (milliampere-HOUR-meter) from the shelf and add it to your application
  • RsadeikaRsadeika Posts: 3,837
    edited 2010-05-22 10:56
    What is "cheap and easy" for you? For me it's having some pins that can do AD. This topic has been discussed before, do a search, I know it was discussed within the past couple of weeks. Basically, you will have to do the circuit yourself, maybe easy for you, but not for me.

    Ray
  • RaymanRayman Posts: 14,887
    edited 2010-05-22 11:16
    you can do sigma-delta ADC with 2 resistors and 2 capacitors and get the voltage.· Hard to do on a breadboard, but you can do it on a protoboard.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • Zap-oZap-o Posts: 452
    edited 2010-05-22 13:02
    What about using diodes? They are switches that are turned on by a voltage. Depending on your precision needed between 0 - 100% you could use 0 to 10 diodes etc... Diodes are cheap.
  • RaymanRayman Posts: 14,887
    edited 2010-05-22 15:44
    or leds...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • StefanL38StefanL38 Posts: 2,292
    edited 2010-05-22 15:48
    with diodes you can only measure voltage but if I understand it right computerguy want's to measure milliampere hours.
    The resistor for measuring the current has to be a small value. The voltagedrop across this resistor could be amplified with a
    OP-Amp. Then the outputvoltage of the OpAmp could "drive" the diodes. To keep the current low you would have to use so many didodes that
    NEVER all diodes would switch through. This would mean a high current emptying the acumulator quickly

    best regards

    Stefan

    Post Edited (StefanL38) : 5/22/2010 4:39:50 PM GMT
  • Clock LoopClock Loop Posts: 2,069
    edited 2010-05-22 20:12
    Use voltage drop resistor + RCTIME. Use 2 pins to run two RCTIME's on both sides of the resistor, (with proper caps and resistors for rctime)
  • LarryGLarryG Posts: 50
    edited 2010-05-22 23:42
    OK, this probably does not fit into the category of "simple and easy" but...
    You can use a "gas gauge" chip. Grab a free sample here http://focus.ti.com/docs/prod/folders/print/bq27210.html#samples
Sign In or Register to comment.