I’m starting my first project, a battery discharge tester, and have a question about using the external aref pin for a precision voltage.
My objective is to get a precise(ish) reading from an analog pin (mega256 is my test controller) to measure the loaded voltage of a battery. After reading many posts, blog articles, and general topics, I think I have an understanding of how the aref pin works. So far my observations are:
- Internal/Default - uses VCC as the basis for the 10-bit ADC – can vary based upon what the actual voltage is
- 1.1 or 2.56V - reference voltages that can be used – unsure if these are relative on VCC or actually close values
- External - voltage provided that can be used as reference V for measurements - fraught with danger is not properly addressed on the inout circuit and sketch
I have an LM4040-4.1 that I’d like to use as the reference V. Overall though, I’d like to ensure that the circuit I design to provide the AREF voltage protects the Arduino from potential damage (e.g., in the event I upload the wrong sketch).
My understanding is that when the DEFAULT setting is used an analogRead() is issued, AREF it’s tied to the AVCC and there is no resistance is tied to GND. But when EXTERNAL is used, there is a 32K resistor. In reading, there is mention that if using an external V, a 5K resistor should be used to protect the AREF pin and allow for switching between INTERNAL and EXTERNAL voltages.
Not having a EE background, how does having a resistor between the external reference V and the AREF pin protect the circuit when reference is changed from external to internal? Is it because the resistor on the provided external source provides the reduction of current so it doesn’t blue smoke the pin?
Before I actually hook up the circuit, I’d like to understand the why of protecting the AREF pin.
And for an actual 4.096V reference, would the following be something that is suitable:
5V → 1K R → +LM4040- → GND
- on the LM4040 tied to the AREF, which in turn is tied to 10K to GND and also parallel to the AREF 32K resistor if external, or 0R if changed to internal. The LM4040 appears to have a total draw of < 1mA, inclusive of the 128uA AREF draw.
Appreciate any guidance of clarification on how multiple voltage sources are dealt with…