Use analogReference(EXTERNAL) to switch my ADC measurements to a 3.3 reference voltage and then use analogReference(DEFAULT) to switch the reference voltage back to 5 volts.
Problem:
The analogReference() (analogReference() - Arduino Reference) documentation states that if I attach a supply voltage to AREF then I cannot use the DEFAULT voltage unless I put a 5k ohm resistor between the supply and AREF.
If I put a 5k ohm resistor between my 3.3 volt supply and AREF I will be using a reference voltage of 2.85 volts. I want to use a reference voltage of 3.3 volts.
I understand the voltage divider calculations, but I don't understand enough of the rest of the circuit issues involved here.
Proposal:
Put a 48.5k ohm resistor between the 5 volt supply and AREF creating a reference voltage of 3.3 volts.
Is the 5k ohm resistor mentioned in the analogReference() documentation a specific value, or a minimum resistence?
Would I still be able to switch between the default 5 volt reference and my external 3.3 volt reference?
(I understand they don't make a 48.5k ohm resistor and I will need to use a 47k and 1.5k resistor in series)
(I understand that after switching from 3.3 to 5 volt that the first few measurements will not be accurate, I would prefer not to discuss that in this thread)
I think 5K was picked to limit the current but still provide enough of the original voltage.
Using the 16.5K configuration, you should be able to switch between them (provided your 5V reference is good.)
As for the inaccuracies, just make sure you take one sample after switching then delay, or throw away 5-10 samples in a row. (The switch doesn't occur until the next analogRead() and then it doesn't settle for a few microseconds.)
When you select EXTERNAL the AREF pin is connected directly to the internal reference, if you have a hard voltage on AREF then select INTERNAL you have a blue smoke situation.
I'm pretty sure the point of the resistor they mention is just to keep the smoke in, nothing to do with voltage dividers.
With the resistor in place EXTERNAL should work as long as the current drawn by AREF is not enough to cause much voltage drop over the resistor (as you would assume but you could measure it) and INTERNAL would not be affected at all.
Note that I haven't tried this, just my take on what I know from reading the data sheets.