Hey, real EE types out there, is there any reason I can’t monitor 12V battery voltage using a simple voltage divider into an A/D input of a microcontroller that’s powered by a voltage regulator on that same battery?
This seems straightforward, but I ask because there seem to be a lot of fancy circuits and devices out there for monitoring supply voltage. It seems to me they all revolve around monitoring the device’s own VCC and where to get a reliable AREF when you don’t trust your own supply.
In the case of monitoring a battery voltage that will always be much higher than the dropout of the voltage regulator powering the microcontroller which generates its own AREF, I can’t think of any reason to get fancier than this.
I would Just Do It but I don’t have a good test setup for this and I’m getting ready to commit it to a board layout.

Note: I’m not a Real EE™ so these might not even be real issues.
It’ll probably work ‘good enough’. The only thing that I’d worry about with that is is the mico’s input impedance and I suppose the (admittedly low) power lost in the divider. Just take the input impedance into account and I don’t see any real problems with it.
If you really wanted to you could hookup an opamp with a negative gain, but that’ll probably waste more power anyway.
You can, but you have to remember that the voltage the battery puts out will vary with how much current is being drawn. At 10mA you might read 5V, at 20mA, 4.8V, and at 30mA 4.2V (these values are mostly made up). The point is, to get a realistic impression of how much charge there is left in a battery, you also need to have some idea of how much current is coming out of the battery at the same time you are measuring the voltage.
More importantly, a drained battery under no load will put out a voltage very similar to a fully charged battery under no load. In other words, you don’t know a battery is drained or not until you try and use it.
If you are using a micro-controller, you can either measure the average current draw at certain points in your program, or have a “battery test routine” that will draw a fairly constant current and then you can measure the voltage during that time. After that, find an approximate battery drain curve and bingo, you have an estimate of how much charge you have left in your battery.
Google for data on a battery discharge curve similar to one you are using.
Vanquish, all good points; thanks for identifying that my question was too general!
This is a 7.2Ah sealed lead-acid battery feeding a microcontroller-and-LED circuit drawing about 20mA most of the time and about 400mA (I don’t remember the exact amount) once in a while.
My goal is to shut the sculpture down into an ultra-low-power mode when the battery is too discharged to be useful anyway, so we stop having to take it out of the gallery for a day to charge it when the gallery staff forget to charge it overnight and leave it on for several days straight anyway.
“Hey, why’s that red light flashing and it’s not doing the usual things?”
“I dunno, did you forget to charge it again?”
I can make a point to sample when it’s quiesced. Since the current draw then is a