I need to monitor the battery levels of 4 "AA" batteries individually, once per second. I would think the easiest method would be to send one end of the batteries to ground, and then the other ends to four of the analog inputs. However, I am concerned about this method imparting its own drain on the batteries (regardless of how minimal). Would this actually be the case?
If so, is there a method to monitor these batteries where the Arduino would NOT impart a drain?? I have been considering other methods as well, such as the possible use of optocouplers, etc., though I am just now sure how these methods of affect the levels of the batteries being monitored.
If anyone has any creative (or simplistic) techniques, I would appreciate any input or guidance.
THANKS!
However, I am concerned about this method imparting its own drain on the batteries (regardless of how minimal). Would this actually be the case?
Yes it would be the case. Note that if the 4 batteries are in series you are going to go over the 5V limit on the analogue input pins. You will then have to use a potential divider which will cause more drain.
is there a method to monitor these batteries where the Arduino would NOT impart a drain?
No. If you want to monitor the voltage you have to connect it to something. That something will have an impedance and so you will always get a drain.
The ADC input resistance is typically 100M?. While technically it is true that this will impart some drain, at 1.5V, it would be 15nA, which for most practical purposes can probably be considered to be effectively zero. I wouldn't be surprised if it's less than the cell's internal self-discharge rate. You will have to decide whether that is minimal enough for your purposes. There are few absolutes in the real world.
Op-amps also have high input impedance. You could add a tap between cells and use the gain of the op-amp to adjust the voltage to a range suitable for the Arduino inputs. Measure each point and subtract the voltage at the previous point to get cell voltage. The first op-amp could be *3 to get about a 4.5v maximum. The second would be *1.5, The third a voltage follower, and the 4th a /1.5 to keep from going over the 5v limit. Of course all the various gains would be un-done in software.
Good idea, John. I've used inexpensive JFET op amps that have typical input impedance of 1012?. That would get the current drain down into pico-amp territory.
The downside of using op-amps here is that you need supplies for them. The OP might clarify what is the supply for the Arduino. Assuming it has a 5V supply independent from the battery pack, that would do the job with a couple of rail-to-rail amps.
Personally, I think a high impedance voltage divider would do the job. Choose parts for a 50 microamp current and it should be fine.
Yes all this is indeed true but the OP asked for:-
is there a method to monitor these batteries where the Arduino would NOT impart a drain?
Which we all know is impossible, because you can't make ANY measurement of any system without having an effect on the system, it's one of the fundamental tenets of science.
However reading it more closely he wanted:-
the battery levels of 4 "AA" batteries individually, once per second. I would think the easiest method would be to send one end of the batteries to ground, and then the other ends to four of the analog inputs.
So this would suggest to me four totally separate batteries. If they were in series and you did this then at least three of them would have a dead short across them and that would drain things rather a lot. However, separate batteries would obviate the need for any potential divider.
First of all, thank you to everyone who contributed their input to this question! I was under the assumption that ANY monitoring method would impart some form of draw by virtue of the physical monitoring requirements of the system (indeed, EVERYTHING has some kind of draw), and that was confirmed.
My issue was whether or not the draw would be substantial, and Jack you have proven that the draw would be ultra-minimal - well within my desired limits. I want to be able to identify as close to the natural decay of the battery as possible without the system decaying it far more rapidly. This confirms that the analog input monitoring method would be suitable.
And Grumpy Mike, you are correct in that my original post implied INDIVIDUAL monitoring of each battery.... not all four batteries connected together. Yes, connected together this would exceed the 5V limit of the Arduino. I am interested in monitoring each battery INDIVIDUALLY.
I will wire it up and give it a shot. Thank you all for the invaluable information!
Very cool, Jack!
I see the similarities, except that mine will measure a battery at rest instead of under load.
If I may ask an additional question, what is the best code for measuring a voltage directly from the input pin which is LESS than 5V. I see a lot of examples to convert things down to 5V using voltage dividers and then to spread the values across the1024 scale....
For example, instead of using the full 5 volts, since I am only measuring a 1.5 volt battery, could I use the code:
Well the problem with any battery is the uncertain voltage. It could be a 1.5v AA battery, or 1.7v, or even 1.4v. I need some way of being able to monitor it, given 1.5v as the average voltage of a AA battery. Any suggestions as to how to handle this?? I know this "printVoltage = (value * 5.0)/1024.0;" would not be an appropriate method.
To get the most accurate reading from the arduino supply it with a reference voltage just less than the maximum voltage you are expecting. You can get voltage reference chips that supply a stable voltage.
In which case you have:-
"printVoltage = (value * Vref)/1024.0;"
Where Vref is your reference voltage.
Note if the input voltage is greater than the reference voltage but less than 5V then there is no harm, you just get the maximum reading.
Technically it's possible to measure voltages whilst placing no burden on the voltage source.
Many years ago we used to use a device called a Cambridge Potentiometer for the measurement and generation of low voltage/high impedance sources. The method was to balance the measured voltage against a known standard such that zero current was consumed by/from either circuit ( the measured variable and the measuring device). The reference voltage was generated by a "standard cell" whose chemistry produced a known potential (1.018636 volts at zero current and standard temperature).
However with the progression of technology (demand for auto-measuring devices) we may have lost the ability to use a truly zero load measurement - but I'm sure someone will put me right.
Yes I have used standard cells to calibrate digital volt meters.
While this technique has no current draw when the two voltages are matched finding that match point involves current flow so it still represents a load.
ddeprospero:
If I may ask an additional question, what is the best code for measuring a voltage directly from the input pin which is LESS than 5V. I see a lot of examples to convert things down to 5V using voltage dividers and then to spread the values across the1024 scale....
I'd echo what Mike said,
To get the most accurate reading from the arduino supply it with a reference voltage just less than the maximum voltage you are expecting. You can get voltage reference chips that supply a stable voltage
Zener diodes are another possibility for a voltage reference. I think they can be had in the 2-3V range. Or use the 3.3V Arduino supply as a reference.
You know, as I'm reading what everyone is writing, I find myself getting a bit confused. Not that I don't understand what you are all saying, but because it is not clicking with regard to what I think I'm trying to do. Grumpy Mike, I think it was your post about reference voltages that made me realize I think I may be asking the wrong question, or rather interpreting my own piece of code wrong.
I was under the ASSUMPTION that within the code snippet:
printVoltage = (value * 1.5)/1024.0;
that the 1.5 is the voltage value that I am intending to compare my input against. In other words, I was under the impression that the 1.5 sets the scale which is then divided into 1024 individual parts. I don't know if I am saying that correctly.
Given the assumption that I have a 1.5v AA battery, I want to break 1.5v into the 1024 scale (0=0v, 1023=1.5v). I know by default the Arduino references the inputs against 5v unless you tell it otherwise. I guess the way I am looking at it is that the readings of the battery levels would be much more precise if I were able to spread 1024 among 1.5v rather than 1024 among the default 5v. I was under the impression that the modification of this scale was a software consideration rather than a physical/electronics consideration. I remember a while back I saw some small sketch that switched the 5v scale (0=0v, 1023=5v) down into a 2v (0-0v, 1023=2v) scale (for some specialized power supply or something), and it was accomplished within the coding of the skech.
Am I making more sense now, or are we still talking about the same thing and I'm just not comprehending it for some reason. I know this isn't anything THAT complex.
ddeprospero:
...I was under the impression that the modification of this scale was a software consideration rather than a physical/electronics consideration...
Like other things in the world of microcontrollers, it's both. Mike posted earlier, but be sure to read the doc for the analogReference() function. Note there are various options for configuring the reference voltage that the ADC compares against. There are a couple options where the reference voltage is supplied internally as part of the hardware, or if none of those are suitable, an external reference voltage can be used. So analogReference() actually configures the MCU hardware to operate differently, depending on which option is chosen.
I usually think hardware first: In this case, set up the ADC to use an appropriate reference voltage for the task at hand. Note that this may involve custom wiring/hardware if an external reference is used (e.g. Mike's comment about voltage reference chips ... there are chips whose sole purpose in life is to provide a reference voltage. An admittedly dull existence :P)
Once the hardware design is known, then obviously the software has to scale the results appropriately, which is what is going on in those lines of code you posted earlier.
Aaaahhh.... I gotcha, Jack. That is why I was confused. I was not aware that I needed to compare against some actual referece voltage.... I thought it was just a value that you set in the code that did the work and set the scale.
Mike, thank you for your input and resources regarding the chips and the function... now it all makes much more sense.
Yes Jack, it is rather simple once you understand how it all works - it was just more in depth than what I had expected. I didn't realize that I would need to supply a stable reference voltage of the same voltage that I wanted to meter against. Now I have to do some digging I guess. The problem with AA batteries (or, any battery I guess), is that they are not a consistent voltage - one brand may be 1.8v, one may be 1.3v, etc. I think the most common accepted value is 1.5, so I think 1.5 should be my starting point.
As I begin my search, any other pearls of wisdom would be greatly appreciated! Lol.
I didn't realize that I would need to supply a stable reference voltage of the same voltage that I wanted to meter against. Now I have to do some digging I guess.
I think you are making it more stringent then is necessary. A new external reference voltage only has to have two properties. First it has to be as stable and nosie free as possible, as any variation in the reference voltage will cause a variation in the value obtained by the analogRead of the input pin being measured. Second the reference voltage must be equal or HIGHER then the maximum voltage applied to the analog input pin. The fact the the reference might be higher then the analog input pin only means you will not attain the maximum possible resolution steps (1023 counts) but rather some fraction of that value. If it was me I would just wire a jumper from the arduino 3.3vdc pin to the Aref pin (as already suggested below from another poster) and then work out the software scaling needed to calculate the values in your code using the map function.
I guess really to come up with the 'best' approach you should better define what your measurement requirements are. The chemistry type of the AA battery you want to measure would better put a value on the possible range of battery voltage you will see. A alkaline battery will usually never be above around 1.6. Then you should tell us how small a measurement resolution (step size) you need to be able to read, is it .1 volt or 1 microvolt, or some value between those two values? Once that is defined then one can even see if the arduino A/D converter can even meet your requirements. Often some applications require a better A/D converter that has more then the 10 bit resolution of the arduino, and there are such external devices avalible that can wire to a arduino.
So basically analog measurements can be simple or complex depending on the range and accuracy requirements required or desired. Accuracy is not a simple subject as it is very dependent on many internal and external variables that may or may not be important to a given application.
Lastly I will leave you with this. Many will tell you that reading battery terminal voltage, without it being under a certain load, will not give you an accurate indication of the true state of the battery. Batteries tend to have a 'bounce back' factor when it's external load is removed. Most battery voltage measurements are done to get some kind of indirect indication of how much capacity remains in the battery. So maybe if you could more specifically state what you are trying to determine with your measurements?