Shop OBEX P1 Docs P2 Docs Learn Events
Monitor battery resource — Parallax Forums

Monitor battery resource

RsadeikaRsadeika Posts: 3,837
edited 2008-05-30 02:41 in Propeller 1
For my robot project I would like to have the propeller monitor the battery levels; my battery is going to be a 6V 11AH, which when fully charged is about 6.95V. Probably when the battery gets down to 5V I will initiate a program for the robot to start looking for a charger.

Can this be done with the prop? If it can, what kind of circuitry would I need? I guess what I am looking for is the first step with this.


Thanks

Ray

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-29 16:29
    Download the application note on the use of the counters (AN001) from the Propeller Downloads page. It discusses the use of the cog counters for various things including analog to digital conversion. The ZIP file includes sample code and a circuit diagram.
  • RsadeikaRsadeika Posts: 3,837
    edited 2008-05-29 18:04
    Thanks Mike, there is also some coverage in the PE-Kit-Counters-Lab-v0.81.PDF. As I glanced over the document I noticed that figure 11 and figure 14 describing the IR demodulator pin hook ups might be wrong. Looking at the front of the demodulator, I think it is supposed to be, from the right -·pwr, gnd, and output. I could be reading the diagram wrong, but not sure.

    In this same document, there is a D/A conversion example, and some coverage. Would be nice if it would have covered A/D conversion, with an example of monitoring the nine volt battery that powers the PE kit. After looking at the write up, would A/D conversion be just the opposite of D/A. Since the prop pins are 3.3V sensitive, I guess I would have to figure out the sequence of resistors to lower the voltage. No guessing is allowed here, 6V would probably fry a pin on the prop.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-29 18:29
    Do read the comments in the ADC object included in the AN001 archive and look at the circuit. The ADC circuit uses a 150K resistor for a full range of roughly 3.3V. For a higher full range voltage, you'd use a higher value resistor. The 150K resistor and the 100K feedback resistor make a kind of voltage divider for the I/O pin switching threshold. I'd get a 500K 10-turn trim pot, put a 10K resistor in series with it and use that instead of the 150K resistor. The 10K resistor would protect the Prop pin from any test voltages. Then I'd try measuring a fully charged battery and adjust the trim pot until I get a full scale reading, then measure the trim pot value and use a fixed resistor value that's the same or slightly higher.
  • SeariderSearider Posts: 290
    edited 2008-05-30 02:41
    Another option is to use a dedicated Battery Fuel Gauge. Texas Instruments has a wide variety. Then use the Prop to comunicate to it. Usually an I2C or 1-wire interface.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Searider
Sign In or Register to comment.