as I want to set up my Arduino Mega as a Measuring Node that measures DC over shunts with a max range of 300 mV I wanted to increase my accuracy by feeding a voltage of 300mV + a little bit more (just to be save) to the AREF pin.
Also I want to measure other sensors, why it's also needed to change from EXTERNAL back to DEFAULT. I read and understood the explanation of the analogReference function. So I'm aware that I need to feed the reference voltage through a 5k resistor (actually I took a 5.1k, but I think it should do the job aswell), if I want to jump between EXTERNAL and DEFAULT. Also I'm aware that this will change the actual fed value on the AREFpin, because the 5k resistor and the internal resistor will work as a voltage devider. I calculated my circuit under that circumstances.
Still I'm concerned of damaging my Arduino. Has ever someone made experiences with jumping between the references.
"[...]Note that the lowest reference voltage you can have is 1.1V. There are two forms of AREF – internal and external, so let’s check them out. [...] This sets the reference voltage to whatever you have connected to the AREF pin – which of course will have a voltage between 1.1V and the board’s operation voltage.[...]"
For what I undestand ( I'm not a native speaker an no electronics pro), it claims that voltages lower than 1.1 won't work, but the analogReference explanation points everything between 0-5V is fine.
It would be nice to now what voltage actually is fed to the Aref pin, of course I can calculate it, but just to be sure I'd like to now to make my measuring as good as possible. I already found and read this forum entry, which seems to deal with this question but also points that its only possible to tell if it is between 1.1 and 5V. That actually leads me back to my first question...
I hope my explanations are understandable and enough.
Vref below 1V is not guaranteed to give you the cited ADC performance in the datasheet - it may
work poorly, or reasonably - they can't guarantee it will be useful.
AREF needs to be a stiff voltage source, so you will have to switch it between different voltage rails
for best performance, not rely on a pull-up resistor. The 0.1uF decoupling cap on the pin may really
help here - I haven't tried this.
Just select analogReference (EXTERNAL) and physically switch the pin, then you cannot damage
anything. INTERNAL internally shorts the AREF pin to Vcc via a transistor which is not able to
handle large currents, note.
Try a ~300k resistor between the 3.3volt pin and the Aref pin, and switching to external.
That will drop Aref to 32/(32+300)*3.3 = 0.318V
Not sure how the A/D converter will perform at these low levels.
Maybe best to boost your shunt voltage with an opamp, drop (divider) to 1.1volt, and use 1.1volt Aref in the code.
Don't know what you're trying to measure, but this might be easier.
Leo..
Yeah you pointed out what my intentional problem was: It's just not sure how the ADC will perform at these low levels. But as far as I need to be really sure, I just cant use this method.
As you just recommended I dug myself into OPamps...luckily I can use a really easy one, that I actually really understand, yeaaah!!
But I think to avoid the jumping between the references, I will boost it to 5 Volts.
If you supply the opamp from 5volt, you will need a rail to rail output opamp for (almost) 5volt output swing.
And the shunt voltages have to be within the common mode range of the opamp.
The resulting A/D value also depends on Aref. Don't expect stable current measurements with default (5volt) Aref.
Tell us what you want to measure. There might be other ways.
Leo..