Pages: [1]   Go Down
Author Topic: Changing Aref and NOT effecting all AnalogPins - is it possible?  (Read 299 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 1
Posts: 61
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4086
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 .
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Offline Offline
Jr. Member
**
Karma: 1
Posts: 61
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

THX for the fast reply.

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

Greetings,
Jan
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6619
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Offline Offline
Jr. Member
**
Karma: 1
Posts: 61
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-confuse ).
I now allready redesigned my circuit to use a 1,2V reference LDO.
Logged

Pages: [1]   Go Up
Jump to: