Shop OBEX P1 Docs P2 Docs Learn Events
Voltage Meter — Parallax Forums

Voltage Meter

ArchiverArchiver Posts: 46,084
edited 2001-01-22 17:53 in General Discussion
I have a BS2e with SEE LCD screen. I am trying to figure out a way so I can
show how much of the battery is left on the screen, and then add a low
battery alarm. Thanks.

Jason Coutermarsh
jasoncout@b...

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-01-22 17:53
    >I have a BS2e with SEE LCD screen. I am trying to figure out a way so I can
    >show how much of the battery is left on the screen, and then add a low
    >battery alarm. Thanks.
    >
    >Jason Coutermarsh
    >jasoncout@b...

    Hi Jason,

    You can do this using the RCtime command.

    680k 1%
    ~9V battery --/\/\---o
    P0 on stamp
    |
    === 0.01uf mylar
    |
    Vss (common)

    bv var word
    loop:
    low 0
    RCtime 0,0,bv
    serout lcdpin,lcdbaud,[noparse][[/noparse]home,dec5 bv]
    goto loop

    will return bv~=1000 when the voltage drops too low to operate the
    stamp, and bv~=600 for a fresh battery.

    More information about it and how to calibrate bv to read in volts at:

    http://www.emesystems.com/BS2rct.htm

    -- Tracy Allen
    electronically monitored ecosystems
Sign In or Register to comment.