Shop OBEX P1 Docs P2 Docs Learn Events
Using a LTC1298 to measure a 12 Volt Battery — Parallax Forums

Using a LTC1298 to measure a 12 Volt Battery

SailerManSailerMan Posts: 337
edited 2007-11-29 21:59 in General Discussion
What is the most effective way to measure the voltage of 12 Volt battery using the LCT1298 ADC that is designed for 5 Volts.

I was thinking of just a basic voltage divider using a 8.2V Zener and a small sense resistor like 220ohms to measure across.

I also don't want to measure all the time maybe once every every minute which case the zener and the resistor would basically be just wasted battery juice... Hmmm. Maybe there is a way that this measurement circuit would be out of the circuit until it's time for the measurement. I'm just thinking here and looking for any guru insight.

Thoughts?

Thanks,
Eric

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-07 16:50
    An ADC like the LTC1298 is a high impedance device and doesn't draw much current from the source being measured. You could use a high resistance voltage divider with a very low constant current. For example, you could use 200K / 100K resistors in series with the ADC across the 100K resistor for a maximum of 4V representing 12V. The current through the resistors would be about 40ua.
  • Steve JoblinSteve Joblin Posts: 784
    edited 2007-11-07 17:02
    SailerMan - I still have not yet purchased any components for my 12v battery monitor... are you thinking this is the best way to go? Do they make ADC's for 12 volts?
  • SailerManSailerMan Posts: 337
    edited 2007-11-07 18:16
    Mike,

    Thanks...I did forget to mention that this 12 volt source (Battery) will be measured in circuit to be used as a Gas Gauge. Will the Voltage Divider still be my best alternative. This battery is going to be feeding a 5v / 3.3 volt buck switching regulator for all of my logic and the 12 volts will also feed directly to motor. I'm looking to have just one 12V source to power my Robot and I want it to know if it's getting hungry.

    Speaking of the motors. What is a good was to prevent the motors from causing noise.



    Steve,

    I wouldn't say this is the best way to go, I just have these parts laying around. I played with the OP-Amp aproach, but that only gives me a High / Low indication.. I was looking for something a little more analog.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-07 18:27
    1) The voltage divider will give you a true indication of the battery voltage under load.

    2) Filter / filter / filter. Use 0.1uF bypass capacitors near the motor and near the regulators running off the 12V. Use large filter capacitors at the input to the regulators (1000uF for sure). You could also use a small inductor in series with the 12V to the regulators (see the schematic for the Propeller Protoboard for an example in the servo motor power feed).

    3) Make sure you don't have ground loops. Connect the motor ground and the logic / regulator ground to the battery at one point only using separate wires.
  • SailerManSailerMan Posts: 337
    edited 2007-11-07 19:33
    The link for the protoboard example is broke... I'll check that out later.

    Ground loop? Are you refering to a loop circling the board, like an antenna of sorts.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-07 19:54
    Do a web search on "wiki ground loop" and you'll find a better explanation than I can give off the top of my head.
  • Steve JoblinSteve Joblin Posts: 784
    edited 2007-11-09 01:05
    I just did a search at Digikey for the LTC1298... it is like $10 !!!!! the cost of a LM3914, plus a 10K Pot, some resistors, a capacitor, and a diode is about $3.50

    I think I am going to try http://www.uoguelph.ca/~antoon/circ/batmon12.htm as my approach... I'll let you know how it goes.
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-11-09 01:10
    Here's one for you - don't just use an inductor in your filter; use a power resistor! Your digital logic likely draws very little power. By using a power resistor as a filter, with a capacitor on either side, you won't be wasting very much power, but you will slow down the rise/fall times on the filter capacitors considerably. The idea is that a fast spike might be too quick for the regulator to adapt to, but with a resistor the regulator will have enough time to adjust and adapt to the change in voltage so that the spike doesn't get through.
  • RDL2004RDL2004 Posts: 2,554
    edited 2007-11-09 12:06
    I agree the LTC1298 is maybe overkill for this application but if you already have one on hand it's okay. The LM3914 circuit will be a fine visual indicator, but only 10 step resolution and you still don't have the data in a form a microcontroller can use. I would probably use something like the ADC0831 - cheap and you can get down to 10 millivolt resolution over the range of interest.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Rick
  • Steve JoblinSteve Joblin Posts: 784
    edited 2007-11-09 12:37
    $1.79 for an ADC0831 is more my speed... How would I use it in a circuit? I'm a newbie, so if you could show it as a schematic, that would be great! I assume I can figure out the code by looking for examples in "Basic Analog and Digital" and "Process Control" manuals?
  • SailerManSailerMan Posts: 337
    edited 2007-11-09 14:58
    I agree the LTC1298 Is over kill... I've been looking at cheap ADC's in the 8 Bit range.

    Steve, The "Basic Analog and Digital" is a good place to start.

    http://www.phanderson.com/stamp/tutorial_9.html

    Do a google search.. This part has been around a while.
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-11-09 16:14
    The ADC0832 has the same pinout and is a lot less expensive.
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2007-11-09 16:57
    The RCtime approach often works fine for monitoring a 12v battery that has a ground in common with the Stamp. See www.emesystems.com/BS2rct.htm#B_voltage for details.
              681 kohm        470 ohm 
        Vx ----/\/\/\---o-----/\/\/\----P0 to stamp
        unknown         |
        voltage       ===== 0.01 uF film
                            |
                           Vss
    
    
    


    The components for the RCtime circuit should be mounted close to the Stamp. It is not the highest precision circuit (about 8 bits), and it does require an initial calibration step, but you can't beat it for cheap.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • SailerManSailerMan Posts: 337
    edited 2007-11-09 18:11
    How simple that is... I will play with that tonight. Thanks!! [noparse]:)[/noparse]

    I'm assuming that I can have 8 of these things running at the same time and that this setup will also work with the SX Chips... I don't have any Stamps. [noparse]:)[/noparse]

    Eric
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2007-11-10 05:51
    It should work fine on the SX, but it will take asm to catch the end point of the intervals if they are all in fact running simultaneously. On the SX, you also have the option of setting the schmitt trigger or CMOS inputs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-10 06:32
    By using the cog counters to time the RC decay, you could do two simultaneous measurements per cog still using Spin.
  • SailerManSailerMan Posts: 337
    edited 2007-11-27 19:36
    Mike Green said...

    Filter / filter / filter. Use 0.1uF bypass capacitors near the motor and near the regulators running off the 12V. Use large filter capacitors at the input to the regulators (1000uF for sure). You could also use a small inductor in series with the 12V to the regulators (see the schematic for the Propeller Protoboard for an example in the servo motor power feed).

    Make sure you don't have ground loops. Connect the motor ground and the logic / regulator ground to the battery at one point only using separate wires.

    Mike good advise, but I am a little unsure how to make sure I'm designing a circuit right the first time without too much trial and error...

    Picture my home made PCB it has two dual H-Bridge motor control IC's and an SX48 to create the PWM ,do comms with the host MCU, and control a few indicator LED's. All of this is on one circuit board. This seem to work ok, but I want to bullet proof this board.

    The board has 12V Battery in 5 Volt In A serial port and two motor hook ups.

    The capacitor and inductors you mention above.. What types of things should I be looking at while selecting my Items.

    Would you be willing to look
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-27 20:12
    Regarding capacitors and inductors ... When picking a capacitor, make sure the voltage rating of the capacitor is greater than the highest voltage you expect across the capacitor. When picking inductors, make sure their current rating is greater than the amount of current you expect to draw through it. That's it. It's pretty obvious. Similarly, with resistors, make sure their power rating is higher than the amount of power they will have to dissipate.
  • pwillardpwillard Posts: 321
    edited 2007-11-29 21:59
    Note: SAMPLE code for the TLC549
    'PIN 9 = DATA
    'PIN 8 = CLOCK
    'PIN 10 = Chip Select
     
    DataIN var byte 'incoming data
     
    Loop: 
          Low 10 'CS is low active
          SHIFTIN 9,8, msbpre, [noparse][[/noparse]dataIN] 'Get Data from A/D
          Debug? dataIN 'Print result
          pause 200
          goto loop
     
    

    Akin to the ADC0832 is the 8-bit (versus 12 bit LTC1298) ·TLC549 (Which I personally like) at $2.38 from Mouser.·


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

    There's nothing like a new idea and a warm soldering iron.

    Post Edited (pwillard) : 11/29/2007 11:27:35 PM GMT
    714 x 372 - 5K
Sign In or Register to comment.