Go Down

Topic: Changing Aref and NOT effecting all AnalogPins - is it possible? (Read 320 times) previous topic - next topic

jabami

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

Jack Christensen

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 .
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

jabami

THX for the fast reply.

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

Greetings,
Jan

dc42

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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

jabami

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.

Go Up