Shop OBEX P1 Docs P2 Docs Learn Events
Monitoring Battery Power Level — Parallax Forums

Monitoring Battery Power Level

joelmanjoelman Posts: 10
edited 2005-10-31 22:11 in BASIC Stamp
How would I monitor the power level of my 9V battery using the Basic Stamp? I basically want to keep track of how much more life is in my battery.

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-10-30 13:34
    joelman -

    Other than checking the voltage with a voltmeter before you use it, little else makes much practical sense, since 9 volt batteries have such poor power reserve. With larger or different batteries, and/or with rechargables, a battery monitoring system would be worth the investment in money and time.

    Just one opinion.

    Regards,

    Bruce Bates
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-10-30 17:25
    There's an app note on using RCTIME to monitor the Vin battery supply, at this URL
    emesys.com/BS2rct.htm#B_voltage
    Bruce, a 9 volt battery at 300 milliamp hour can last quite a long time in a project, especially if the Stamp can SLEEP, perchance dream.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 10/30/2005 7:11:30 PM GMT
  • joelmanjoelman Posts: 10
    edited 2005-10-30 18:08
    Sweet.

    Thanks,
    Joel
  • Tricky NekroTricky Nekro Posts: 218
    edited 2005-10-30 18:43
    The best way is by using a 555 timer...
    Here's schematic and program...

    attachment.php?attachmentid=39269


    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    ' First started by TronicGR, later modified by Provas.
    ' For
    www.Greekbotics.tk

    'Variables
    coefficient·· VAR·· Word···· 'AD555 math var
    adc555······· VAR·· Word···· 'AD555 input values
    result······· VAR·· Word···· 'AD555 calculated float-point output
    volts········ VAR·· Word···· 'AD555 true integer output
    LED·········· CON·· 1


    DO

    ·· PULSIN 2, 1, adc555········
    ' DEBUG DEC adc555, CR····

    coefficient = 27499······
    volts = coefficient / adc555
    result = volts *100······
    volts = adc555 * volts···
    coefficient = coefficient - volts * 10
    volts = coefficient / adc555
    result = volts * 10 + result
    volts = adc555 * volts
    coefficient = coefficient - volts * 10
    volts = coefficient / adc555
    result = volts + result
    result = result + 250

    ·····················
    ·· DEBUG CLS, DEC result," = volts * 100",CR
    ·· IF (result < 800) THEN blink_Led
    ·RETURN······································
    LOOP


    blink_Led:
    HIGH LED
    PAUSE 100
    LOW LED
    PAUSE 100
    RETURN


    Greece, Provas

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--


    Post Edited (Provas) : 10/30/2005 6:53:00 PM GMT
  • Tricky NekroTricky Nekro Posts: 218
    edited 2005-10-30 19:18
    My application is precise and used for seperate volt supply...devil.gif

    I didn't try yours, but it sould be as fine as mine...blush.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-30 19:20
    I think, "Best Way" is a relative/subjective term which may apply differently depending on the given circuit/power/layout considerations.· I guess what I am saying is that we cannot offer the "best" solution, only possible solutions and the user has to decide what works best for him/her.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-10-30 19:56
    I found that spacing in the ascii art at emesys.com/BS2rct.htm#B_voltage had been thrown off somehow, so I just went in and corrected and republished it. Agreed, "best" is a relative term. In some cases, a simple "low battery" threshold detector is all that is required. At the otherr extreme, it has to be accurate to microvolts and only a high resolution ADC will do the trick.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • steve_bsteve_b Posts: 1,563
    edited 2005-10-30 20:20
    There was an article (not on this pc) that described using a lamp (@rated voltage) and a CDS photocell with RCtime.
    The orginal use was in a solar panel system, so the user wanted to be sure to isolate the measuring device from the charging system....

    They enclosed the lamp and the photocell in a 'dark' box and used a lookup table I think to determine voltage levels.

    You could also use an A/D converter or if you just want to know when the voltage drops to a certain amount you could use a voltage divider that equates to a logic level....."many ways to skin a cat"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-10-30 21:54
    This subject came up recently in another thread....

    Here is a link to a thread that I posted quite some time ago on the L.O.S.A. (List Of Stamp Applications)

    http://forums.parallax.com/showthread.php?p=548418

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2005-10-31 02:04
    Hi Provas

    And every one else

    Please look at PM· Provas

    I have to ask you something

    Sam
  • Tricky NekroTricky Nekro Posts: 218
    edited 2005-10-31 22:11
    Sam

    I've received the pm...

    Please check yours, too...

    I'll upoad some files, hoping to help you as·much as I can...

    attachment.php?attachmentid=39288

    attachment.php?attachmentid=39287

    Friendly, Provas, Greece


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--


    Post Edited (Provas) : 10/31/2005 10:17:23 PM GMT
Sign In or Register to comment.