Shop OBEX P1 Docs P2 Docs Learn Events
Measuing battery voltage — Parallax Forums

Measuing battery voltage

icepuckicepuck Posts: 466
edited 2011-03-17 09:28 in General Discussion
I have two 12v(parallel) deep cycle batteries I'm trying to figure out how to read voltage with a bs2.
The battery voltage can be as high as 15volts when the charge controller goes into equalize mode.
OCV from the solar panels is about 22v in full sun.
Battery voltage is first thing I'd like get working. Then maybe the solar panels.
Is there an ADC that can handle that high of voltage?
-dan

Comments

  • LeonLeon Posts: 7,620
    edited 2011-03-15 16:08
    Scale it with a suitable voltage divider (two resistors), and use a 5V ADC, or use the RC measurement technique.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-15 16:19
    A voltage divider will reduce this sort of voltage range to 0-5V or less. See Wikipedia on "voltage divider" for details.

    There's some discussion on using the BS2's RCTIME statement for measuring battery voltage here. Use the "app-notes" link at the bottom of the page.
  • tonyp12tonyp12 Posts: 1,951
    edited 2011-03-15 16:49
             681 kohm           470 ohm 
    Vx -------/\/\/\------o------/\/\/\--------P0 to stamp
    unknown               |
    voltage             ===== 0.01 uF film 
                          |               
                          Vss
    
    http://www.emesystems.com/BS2rct.htm#B_voltage
  • icepuckicepuck Posts: 466
    edited 2011-03-16 07:30
    I found an interesting 555 use while searching for voltage dividers.
    http://www.circuit-projects.com/converter/555-timer-as-an-analog-to-digital-converter.html
  • ercoerco Posts: 20,260
    edited 2011-03-16 10:29
    Sweet app, icepuck! Another WIN for the everlovin' 555...

    I'll have to try that out. Sounds like the right voltage range for your project. Have you tried it yet?
  • icepuckicepuck Posts: 466
    edited 2011-03-16 16:44
    erco wrote: »
    Sweet app, icepuck! Another WIN for the everlovin' 555...

    I'll have to try that out. Sounds like the right voltage range for your project. Have you tried it yet?

    No, I havn't. but the more I read up on all this the more I'm thinking of having something between the stamp and my batteries. I'd rather smoke a 555 than a stamp if something goes wrong.
    I have enough spare parts I think can build one, maybe just for the learning experiance.
    If it doesn't work I can always try a real ADC.
    -dan
  • Ray0665Ray0665 Posts: 231
    edited 2011-03-17 07:59
    My H/W skills are quite limited so I just have to ask.
    Where's the reference in the voltage measuring schemes discussed here.
    Would not the voltage across the smaller resister change with the supply in a voltage divider and I thought and a-d converter was referenced to VDD so would not its reading be off? How do this work?
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2011-03-17 09:28
    I had a similar issue trying to monitor a battery and ended up using a Zener diode to drop most of the voltage. In my case I had 24V battery power. In reality you'll probably never need to measure the full range from fully charged to 0V since the battery will be dead (or at least useless) well before it gets anywhere near zero. So, I was interested in a 5V range near top where the active range of the battery was. You can do the same for 12V by changing the value of the Zener diode used. I'm sure the circuit could be cleaned up but you may find the following thread useful:

    http://forums.parallax.com/showthread.php?102636-Any-examples-on-using-the-built-in-ADC-to-monitor-a-24V-SLA-battery

    If anyone has suggestions for improvements please let me know.

    Robert
Sign In or Register to comment.