Shop OBEX P1 Docs P2 Docs Learn Events
Battery charger - Please help — Parallax Forums

Battery charger - Please help

Dr.NoDr.No Posts: 60
edited 2008-07-19 17:32 in BASIC Stamp
Hello everyone.

I'm building a battery (attempting) charger with BS2.
How can I read volts using the stamp?

The idea is to turn on a relay (charge) switch if the volts fall
below x volts snd turn off if above y volts.

The battery is 6 - 12volt motorbike battery.

Any ideas?

Thanks

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-14 02:49
    There's a discussion on reading voltages using the RCTIME statement here: www.emesystems.com.
    Select the link "app-notes" near the bottom. On the linked page, look under the RCTIME command section.

    Other options include using an analog to digital converter like the ADC0831. There are lots of articles and sample
    code for this in the Nuts and Volts Columns and in the "Basic Analog and Digital" tutorial. Both are accessible from
    the main Parallax webpage. Click on the Resources tab. The tutorials are under "Downloads", then "Stamps in Class
    Downloads".

    Post Edited (Mike Green) : 7/14/2008 2:54:31 AM GMT
  • Dr.NoDr.No Posts: 60
    edited 2008-07-14 03:09
    Thank you very much.
  • ercoerco Posts: 20,256
    edited 2008-07-14 09:29
    A noble effort, but dedicated chargers can be bought for less than the price of a BS2 that will do a much better job:

    ·$21·· http://cgi.ebay.com/12-Volt-SLA-Battery-Charger-1000mA-Maintainer-Condition_W0QQitemZ220184015103QQihZ012QQcategoryZ36323QQrdZ1QQssPageNameZWD1VQQcmdZViewItemQQ_trksidZp1638Q2em118Q2el1247

    http://www.batterymart.com/p-battery-tender-jr-12v-0_75a-battery-charger.html

    http://www.batterymart.com/p-cliplight-6-12v-1_5a-battery-charger.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."

    Post Edited (erco) : 7/14/2008 10:14:39 AM GMT
  • Dr.NoDr.No Posts: 60
    edited 2008-07-14 20:37
    Actually, the BS will be doing a lot more than that.
    But your post has given me the idea to use the BS to read
    the charger's results.

    Thanks
  • ercoerco Posts: 20,256
    edited 2008-07-14 21:22
    The LM339 quad comparator is one of my favorite analog chips, I use it as a poor man's A/D converter. Easy to use to establish a voltage threshhold and get a digital higher/lower signal that can be input directly into the BS2 for monitoring. Great for voltage threshold switching in battery chargers.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • GusieGusie Posts: 2
    edited 2008-07-14 21:28
    Hi

    Built·this today. It measures the voltage. Look half way down the page.. Works great. There is a calibration procedure there aswell.

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

    Gus

    ·
  • Dr.NoDr.No Posts: 60
    edited 2008-07-15 14:04
    I'd be very interested in this... do you have any pics?

    I was very concerned with the variable results that is dependent upon battery types.
  • Dr.NoDr.No Posts: 60
    edited 2008-07-16 12:34
    Erco,

    Do you have a diagram layout of the LM339 and all the components?
    As you can figure out, I'm NEW to all this so a step by step breakdown would be greatly appreciated.
    I found a website but it lists variants such as the LM339N, which one did you use? Any links?

    I'd preffer that the BS do as little work as possible because of it's low power limit but I do need it
    to be able to read voltage. Currently, it is powering two 5V reed relays - so I rather not use it
    to power a circuit.

    Thanks for your help.

    I like the BS but it's terrible when it comes to power compared to other chips. It's been around
    long enough for them to juice it up by now - but they haven't.

    Post Edited (Dr.No) : 7/16/2008 10:56:59 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-16 13:21
    The suffix generally designates the package type, temperature range, etc. The LM339N is the DIP package. Here's one link from a quick websearch: www.national.com/mpf/LM/LM339.html.

    The Stamp is not very different from other microprocessor and logic chips in terms of power. The BS2 is based on a PIC processor from Microchip while the other Stamps are based on the SX processor. I/O pins can handle about 25mA individually while groups of 8 pins are limited to 50mA total and there's a limit for the entire chip. The SX has a higher total chip limit, but the other values are similar.

    Post Edited (Mike Green) : 7/16/2008 1:30:06 PM GMT
  • Dr.NoDr.No Posts: 60
    edited 2008-07-19 01:36
    Thanks Mike!
  • Dr.NoDr.No Posts: 60
    edited 2008-07-19 13:49
    Hi Mike!

    Is there such a thing as an off the shelf switching controller? What I wanted to do
    was when the primary battery runs low, automatically switch to the backup battery.

    This is what I think I need now.

    Thanks again.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-19 14:04
    The simplest way to do this is just to use a Schottky diode in series in one lead from each battery. When the primary battery voltage drops below the backup battery's voltage, the backup battery will automatically supply the load. You could use a conventional power diode for this, but a Schottky diode has a lower voltage drop, so wastes less current.
  • Dr.NoDr.No Posts: 60
    edited 2008-07-19 17:32
    Thanks Mike.
    I solved the problem finally.
Sign In or Register to comment.