I'm trying to troubleshoot a circuit I just built. I am using a precision voltage regulator to supply 2.5V as an external reference. I find that without connecting the regulator to the AREF pin, I get 2.5V out of the regulator. When I connect the regulator output to the AREF pin only, the voltage on the AREF pin is 4.2V instead of 2.5V. With nothing connected to the AREF pin (just my shield installed on the Arduino Uno), I read 5V. When I disconnect my shield from the Arduino board, I read 0V on the AREF pin. I don't understand that. I guarantee there is no connection to the AREF pin when my shield is installed, so I have no idea where that 5V on the AREF pin is coming from. My code does include analogReference(EXTERNAL) in the setup, but it's the same results if I take the statement out entirely. I've switched ATMega chips as well with no different results.
You don't understand how important it is to give full information.
What is your shield?
Why do you think it has no connection with the Aref when it changes it?
What software are you running?
Grumpy_Mike:
You don't understand how important it is to give full information.
Sorry, I was trying to be succinct!
What is your shield?
It's a custom made shield that does three things- measures battery voltage and current and uses a IR sensor to measure flow of water. Completely my design.
Why do you think it has no connection with the Aref when it changes it?
My shield connects to the Arduino board with stand-offs. I removed the wire I had installed connecting to the AREF pin. IS there any other way of affecting the voltage on that pin if nothing is connected to it?
What software are you running?
Sorry, don't understand - do you mean the Arduino Environment 1.05-r2?
Thanks for your time.
Doug
edit: Additionally, there is no connection electrically from the AREF pin to the 5V supply (ie, infinite resistance between the AREF pin and a 5V pin on the shield.
Sorry. It looks like I had an errant analogReference(DEFAULT) in my code after the analogReference(EXTERNAL). Luckily, it looks like I didn't burn up my chip when I later in my code did an analogRead. I still don't understand why it read differently with and without the shield.
I'll verify all this and open the post up again if it still is acting up.
The analogReference setting isn't actually used until analogRead() is called,
so at start up the AREF may be unset, but the first call to analogRead will
set it up.
You measure the AREF with shield and your sketch running, you see 5V,
You remove power and shield, power up again, the lack of shield might
cause a different execution path that never calls analogRead() ???
Just one scenario, but all is guess-work without info on the shield and the
whole sketch.