SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By whysitsmoking
#169846
I am considering building a battery monitor. I found the Multimeter kit on the web site (since discontinued), and thought this might be a good starting point as it provides some basic information (sorry, I'm a newby to this, so I'm needing all the help I can get, and will be using the SIK as my development platform).

Initially, what I would like to do is to be able to monitor the batteries in my travel trailer (12V deep-cycle lead/acid and or LGM type batteries - currently 1 but soon to be 2) so that I can have a decent idea of power consumption, etc. As such I would like to initially be able to monitor voltage and amperage.

My first step is voltage. In the above mentioned Multimeter kit, the voltage measurement falls within the spec's. With the battery voltage, I'm measuring voltage somewhere between 0 V DC (although hopefully the battery never ever gets that low) and less than 15 V DC. The kit uses a "simple" voltage divider (and thanks to the SIK and Sparkfun tutorials) I understand that part. What I'm wondering about at this point is if the circuit could handle the battery, and the current that it is capable of delivering. I really don't want to see smoke or charred parts! So, if I hook this up to my battery, what kind of current would it draw? What will determine the current draw?

Further steps will include:
- Current sensing (I believe that the current sensing circuit outlined in the above kit will be totally inadequate, based mostly on the kit specs and my limited understanding). The DC system in the trailer is currently fused for 50A, and I would be sensing on the fuse-protected side of the circuit.
- Data storage (for later analysis)
- RF transmission to remote monitor (inside the trailer) for status checking and warnings.
- Possible battery switchover (ie: when battery 1 becomes depleted, switch over to battery 2) and charging (charge the battery that's not in use).

Thank you in advance for all help received.
By trueRF
#169855
Any micro-controller with a A/D should be capable of sensing the voltage on the batteries. As well as current, I'll get to that later. All you have to do is set up the voltage divider correctly. Then program that ratio into the micro-controller to read and output the correct value. Voltage sensing circuits should consume very little power at all. Once you come up with the correct ratio add 5 zeroes to both numbers and you have the resistor values for your voltage divider.

There are several types of current sensing circuits. Some don't even need to be directly connected to the current circuit and are very safe. The most basic kind of current sensing is to detect the very small voltage drop over a very small high power resistor (typically .01 ohms or smaller) in the path of current flow. The greater the current flow the greater the voltage across the resistor. The other way to measure current is to measure the magnetic field created by the flow of current, this is how clamp meters work. This is a much safer method of measuring current because you don't have to put something between the source (the battery) and the sink (the electrical equipment in your trailer).

Good luck
By Harvey51
#171502
I would like to build a battery monitor, too! Motorhome. I want to measure voltage and current, calculate the power in or out and integrate it over time to display the state of charge. I bought a device to do that on ebay but the darn thing only does discharge - is not aware of charging! I know some electronics (started with tubes!) - no problem using a shunt to get a voltage appropriate for monitoring. I am an experienced Delphi (Pascal) programmer. Unfortunately I have not worked with microcontrollers beyond a brief effort a couple of years ago where I got one to flash some LEDs. I am hoping you can give me a leg up and get me going and I will actually make something interesting since I want this monitor pretty bad.
By jremington
#171519
Once you come up with the correct ratio add 5 zeroes to both numbers and you have the resistor values for your voltage divider.
That is an odd bit of advice, but not correct. The actual voltage divider ratio is (bottom resistor)/(top+bottom resistor). If you want, for example, a 5:1 voltage divider, choosing 500000 and 100000 ohm resistors gives a 6:1 ratio. http://hyperphysics.phy-astr.gsu.edu/hb ... oldiv.html
By Valen
#171555
Harvey51 wrote:I would like to build a battery monitor, too! Motorhome. I want to measure voltage and current, calculate the power in or out and integrate it over time to display the state of charge. I bought a device to do that on ebay but the darn thing only does discharge - is not aware of charging! I know some electronics (started with tubes!) - no problem using a shunt to get a voltage appropriate for monitoring. I am an experienced Delphi (Pascal) programmer. Unfortunately I have not worked with microcontrollers beyond a brief effort a couple of years ago where I got one to flash some LEDs. I am hoping you can give me a leg up and get me going and I will actually make something interesting since I want this monitor pretty bad.
It is better if you start your own thread for asking for help getting this device to work. This thread is already a couple of months old. Anyway, with having different equipment the discussion might get confusing.
I bought a device to do that on ebay
It would help a bit if you lifted the mystery a bit on what this thing might be. My magic ball is not acquainted with the world of current sensing.
Image
By trueRF
#171576
jremington wrote:
Once you come up with the correct ratio add 5 zeroes to both numbers and you have the resistor values for your voltage divider.
That is an odd bit of advice, but not correct. The actual voltage divider ratio is (bottom resistor)/(top+bottom resistor). If you want, for example, a 5:1 voltage divider, choosing 500000 and 100000 ohm resistors gives a 6:1 ratio. http://hyperphysics.phy-astr.gsu.edu/hb ... oldiv.html
DOH! You are absolutely right!In my attempt to make it as simple as possible, I made it wrong. Thanks for the peer review.
By Harvey51
#171604
Valen wrote:
Harvey51 wrote:I bought a device to do that on ebay but the darn thing only does discharge - is not aware of charging!
It would help a bit if you lifted the mystery a bit on what this thing might be. My magic ball is not acquainted with the world of current sensing.
Image
This is the battery monitor I bought for $36. It monitors output only.
http://www.ebay.com/itm/300696028021?_t ... EBIDX%3AIT

This one says it does input and output for $25.
http://www.ebay.com/itm/DC-120V-10A-Vol ... 1142316463

After some thought, it seems to me integrating power over time to get energy is a poor approach because so much of the energy is lost to heat in charging. For starters, it takes over 14 Volts to charge the battery but it outputs at 12.x. I now think it would be better to integrate current over time to get the charge in the battery. I am interested in the % of full charge - and a good warning when it gets down to the dreaded 50% where damage to deep cycle batteries begins.
User avatar
By Ross Robotics
#171605
This is the battery monitor I bought for $36. It monitors output only.
http://www.ebay.com/itm/300696028021?_t ... EBIDX%3AIT

This one says it does input and output for $25.
http://www.ebay.com/itm/DC-120V-10A-Vol ... 1142316463

After some thought, it seems to me integrating power over time to get energy is a poor approach because so much of the energy is lost to heat in charging. For starters, it takes over 14 Volts to charge the battery but it outputs at 12.x. I now think it would be better to integrate current over time to get the charge in the battery. I am interested in the % of full charge - and a good warning when it gets down to the dreaded 50% where damage to deep cycle batteries begins.
It is better if you start your own thread for asking for help getting this device to work. This thread is already a couple of months old. Anyway, with having different equipment the discussion might get confusing.