I have a problem monitoring the battery for my Arduino project. I had it working with a voltage divider, but now I am using a different battery source.
This is my setup:
LithPoly battery at 3.7V that goes to a motor shield and a step up to 8v for a camera and the Arduino it self. I figured since the battery is 3.7 i don't need the voltage divider and could read the voltage to one of the analog inputs. But since I have the step-up I get 8v reading. I think its because the ground of the Arduino is different from the direct to battery. So is 8v really going to the input pin (which is bad)? How do I read the battery level which is a different voltage than the Arduino's power source? Do I still need the voltage divider?
Some details about your step-up circuitry might help. To measure with the Arduino A2D, you will need a common ground. If your DC-DC converter provides total isolation, it may be feasible to simply tie the Arduino ground to the BAT-.
I am not at home to make a schematic but here is a rough layout.
Battery -> Motor Shield
-> Step - up -> Arduino and Camera
Does that help?
[Edit]
How could 8v come from the battery + when it can only supply 3.7+. It seems like a false reading? Also with nothing connected to the analog input i still get 2v+ reading? How is that possible? I am using analog pin 0 and reading that and outputting as a dec.
That LM2587 circuit may have a common ground already. Try measuring the resistance between IN- and OUT-. Also, when operating, measure the voltage between IN- and OUT-. If they are already common, you're in business.
If they are not common, then it would not be safe to directly connect the input ground to the output ground without first getting a better idea what the circuit actually is.
So you are saying if they are common and I connect the + of the battery to Arduino and adjust for the incorrect voltage reading? or using the - for reading voltage?
If not then what options do I have? Built a battery monitor circuit?
If there is no continuity and a voltage difference exists, then the two grounds are not tied together in the circuit. Since the voltage difference is low, it seems possible that the inputs and outputs are completely isolated.
With that small voltage difference between the IN- and OUT-, it would be quite safe to connect the two together with a resistor in the 300 ohm range. Then you should be able to get a reasonable reading from the BAT+ to the Arduino A2D input.
If you look at the reference circuits for the LM258 in its datasheet http://www.national.com/ds/LM/LM2587.pdf
I would have assumed that this board would be a boost converter like in Fig 41, but if the grounds aren't tied together, it's tough to say.
Can you have a close look at the coil on that toroid. How many wires come out and connect to the circuit board? Just two, or more?
If there's only two, then it has to be a simple boost converter circuit and the grounds are almost certainly tied together.
Where we're going with all this, is that your Arduino A2D can directly measure the 3.6V voltage on the main battery. The reasons you would not get a clear and accurate reading immediately is most likely because there is not a common ground reference between the battery input and the Arduino ground.
Figuring out how to get that common reference with a mystery circuit in between is what makes things interesting.
Based on your earlier measurements, I'd estimate that you are safe to go direct from BAT+ to the Arduino A2D input, and from BAT-, through a 300 ohm resistor, to Arduino ground.
The meter works well. It works if I touch probes together, beeps. I get O.L when I test the ground across it, same if I reverse it. Its a 24 range multi-meter from radio shack a few years ago with pc interface. I don't sell it anymore.
So far that seems the case. But I noticed on the auction that is says LM2587 and one spot it says LM2597. I will email them, is probably a typo.
I really hope they have the schematic.
The chip has a heat sink on the top and the backside of the PCB. I was tempted to take off the bottom one so it would lay flat, but doesn't matter for reading the chip.
I just remembered I have closeup pictures and there is 2 connections to the inductor.
I will get the pictures posted, need to copy them over to my webserver.