Hi,
I am attepting to monitor a battery as it discharges. The circuit is quite simple: the battery is drained
using a load and I measure the battery voltage, every 10 minutes, using A0. The battery is 4 NiCads ( in series ).
Now, the unloaded voltage is around 5.5V. The cells are 600mA/Hr and I've decided to discharge at C/10,
ie 60mA over 10 hours ( or whatever they can take ). This is convenient as I can do it over-night.
I found out the hard way not to take the A/D pins over 5V and, in fact, under load, the voltage starts at 4.5V
which is handy!
That's the good news. The bad news is that it doesnt work properly. The voltage is 4.%V, at least for the first hour.
I can see that using a meter. But the 328 'sees' a different voltage. And it isnt consistent; it fluctuates between
1V and 5V. I have tied Aref to 5V.
The only thing I can think of is noise, but maybe others have a better idea.
First, do not tie Aref to 5V, just use a 100nf cap to Gnd.
The software will command it to connect internally to 5V (actually the voltage on the AVcc pin I think) if that is needed.
Try making 2 readings in a row, and use the 2nd reading, see if that gives better results.
This gives the internal sample & hold circuit a chance to stabilize for the 2nd reading.
Try making 2 readings in a row, and use the 2nd reading, see if that gives better results.
This gives the internal sample & hold circuit a chance to stabilize for the 2nd reading.
should there be a delay between the two readings... if so what would the minimum delay be to allow stabalization?
Hi guys,
problem solved.
There is an old expression. It comes in many forms, but the one I favour is this: the system is fool-proof,
but, unfortunately, not idiot proof.
The reason the 328 was giving spurious results is that the battery was not, in reality, connected to the A/D pin.
The 'data-logger' is on one board, the battery on another, and the two are connected by 2 wires: one to GND,
the other to the A/D pin. However, the ground connector pin had a dodgy solder joint and was o/c.
Thanks for your help and at least I now know what to do with Aref.