Changing Aref and NOT effecting all AnalogPins - is it possible?

Hi there,

for a project I need to change Aref on my Arduino Mega 2560 to the internal 1,1V reference source. However, Im using some of the AnalogPins with different hardware sensors. Now is there any possibility of changing the Aref and not effecting all the AnalogPins (A0 to A15). This said, is there any way to set different reference voltages for groups of AnalogPins? lets say A0-A7 using 1,1V and A8 to A15 using the usual 5V. Havent found any clou that this is doable at all without using an extra reference voltage IC. Any suggestions are highly appreciated.

Greetings,
Jan

There is only one ADC, and therefore only one reference voltage; which input pin is connected to the ADC is just selected with a multiplexer. Best bet might be to use the 1.1V reference, and resistive voltage dividers for the sensors with higher voltages .

THX for the fast reply.

Guess, it´s got to be some more parts for the project then.

Greetings,
Jan

It's easy to switch between +5V AREF and 1.1V AREF. All you need to do is to make the appropriate analogReference call before the analogRead call, depending on which pin you are about to read. Add a short delay between the analogReference call and the analogRead call, to allow the reference voltage to stabilise.

THX for the answer,

but in my case this is no option, as i need to read 2 analog pins shortly after one another and I guess the switching of Aref in between would mess up the measurements if I do not allow for an apropriate delay (which I cannot :~ ).
I now allready redesigned my circuit to use a 1,2V reference LDO.