Current Sensor

Discussion in 'The Projects Forum' started by Brownout, Aug 14, 2013.

  1. Brownout

    Thread Starter Well-Known Member

    Jan 10, 2012
    2,375
    998
    Last edited: Aug 14, 2013
  2. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,910
    2,173
  3. Brownout

    Thread Starter Well-Known Member

    Jan 10, 2012
    2,375
    998
    Thanks. Can you tell me more about your battery monitor?
     
  4. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,910
    2,173
    The battery monitor is part of a larger solar energy project I started a few years ago. The BMS also saves very detailed data to a SD card for later downloading and off-line analysis.
    http://forum.allaboutcircuits.com/showpost.php?p=508979&postcount=44

    The software and hardware is not really structured or optimized for speed as well as it should be as I've been testing several ideas about tracking battery SoC dynamically and have tended to just pile on test code without cleaning things up first.

    The latest testing version is here: https://github.com/nsaspook/mbmc/tree/master/swm8722

    The energy collected runs a outdoor patio media room, a CCTV camera system and outdoor lights normally but has several times provided emergency power for the house during extended outages.
     
  5. Brownout

    Thread Starter Well-Known Member

    Jan 10, 2012
    2,375
    998
    ^- Mad scientist alert! My project has more humble goals. I just want to monitor my battery and prevent it from getting damaged from discharging too much. Like you, I set the A-H for 1/2 the battery rating.
     
  6. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,910
    2,173
    I really had no idea how complex batteries were until I started this project. To just track current in/out was a fairly simple task but keeping track of the true State of Charge so I would see how much energy to allocate for runtime, cycle time and battery life requires a much more detail state of information about what's happening inside the battery because they don't actually store charge like a electronic device. The damn things are almost like a living creature responding to food and work.

    For basic amp counting I use a sliding value of charge efficiency for adjusting input amps based on what stage the charger is (Bulk ~95% , Absorption from ~95% to ~50% as the current tapers off), during discharge the Peukert factor function of the battery monitor adjusts the actual Ah rate to a true discharge rate based on battery chemistry corrections. If the battery is at a constant temperature year-round a sensor (I use a thermistor on ADC channel) might not be needed to correct for that but it's a good idea to adjust the battery Ah capacity if it's much lower or higher than 25c if you push the limits on daily usage.
     
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    I recently caught an article on the TI BQ2040, which looks like a very interesting device for monitoring a battery.

    Basically all the "smarts" of the charge/discharge algorithm get built into the thing, your micro just has to monitor it.
     
  8. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,910
    2,173
    What fun is that? :)

    I just read the Lead Acid gauge part app note: BQ34Z110
    http://www.ti.com/lit/ds/slusb55a/slusb55a.pdf
    Their basic "Fuel Gauging" method is a lot like mine but it's missing a few factors like Peukert for lead chemistry batteries discharge rate adjustments.
    http://www.ti.com/lit/an/slua450/slua450.pdf
     
  9. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    A cheap and easy way to do the monitor job.

    You can using the resistor (0.1Ω or 0.01Ω) to in series into the circuit where you like to monitor, and using Ohm's law V=I*R to get the voltage, you can also using the LM393 to setting the ref voltage and comparation and get the output result, or using LED to be the indicator.
     
  10. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,910
    2,173
    Sure you could use a proper shunt that's not affected by self-heating but an advantage of using a external Hall type sensor is total isolation from a potentially noisy power circuit and the ability to use high/low side current monitoring easily without extra parts when using a uC to read the results and perform actions based on those inputs. My BMS manages a 450Ah battery bank that can easily produce 200A currents in 4/0 cables to the 2kW inverter for extended times. A 300A sensor reads current on the ground connection from the battery with no splices or extra connections making the sensor choice cheaper when all the parts needed for a inline shunt are included.
    http://flic.kr/p/9vt4zf
     
  11. Brownout

    Thread Starter Well-Known Member

    Jan 10, 2012
    2,375
    998
    My first though was to use a small value resistor. I want to measure 1 - 30 amps without dropping too much of the supply voltage. At 30 Amps, a .1 ohm resistor would drop 3V and .01 ohm would drop .3V. Both of these are unacceptable. I would need a precision .001 ohm resistor or shunt. The cost for the shunt is comparable to the hall sensor, and so I'm looking at giving the hall sensor a try.

    I had a curcuit designed to amplify the small shunt voltage. The sensor comes integrated and needs no external circuitry. I might experiment with both solutions. The project has a practical objective, but that doens't mean I can't experiment and learn along the way.
     
  12. Brownout

    Thread Starter Well-Known Member

    Jan 10, 2012
    2,375
    998
    Thanks, that is very interesting. But it's for smaller capacity batteries than I'm using. I went ahead and ordered a couple of these: http://www.digikey.com/product-sear...ang=en&site=us&keywords=620-1353-ND&x=21&y=14

    They work in 3.3 or 5V and will connect directly to the A/D converter on the PIC.
     
  13. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,910
    2,173
    What PIC are you using? A device with a 12bit ADC would nice to get the best resolution in current from the 050U chip at 40mV/A sensitivity.
     
  14. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
  15. Brownout

    Thread Starter Well-Known Member

    Jan 10, 2012
    2,375
    998
    I'm prototyping with the 18f45k20. It features a 12-bit A/C converter. The deployed unit might use a different PIC, but I'll keep the 12-bit format.

    My prototype setup has character displays, temperature sensors, PC interfaces and other things that the final unit won't have.
     
  16. Brownout

    Thread Starter Well-Known Member

    Jan 10, 2012
    2,375
    998
    I'll look into that if I build a higher amp controller. Thanks.
     
  17. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,910
    2,173
    The 18f45k20 has an 10bit ADC, something like the 18f45k80 (with CAN) will give you 12bits channels.
     
  18. Brownout

    Thread Starter Well-Known Member

    Jan 10, 2012
    2,375
    998
    Right, 10-bit. But that gives 50mA resolution. Since I'm only trying to determine amp-hours used on a 110 A-H battery over a 50 amp range, that sould be better than good enough.
     
  19. Metalmann

    Active Member

    Dec 8, 2012
    700
    223
  20. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    Last edited: Aug 25, 2013
    Metalmann likes this.
Loading...