Setting internal 1.1 reference to a single pin only

Hi all,

I'm currently working on a control system for a hot water solar panel and as part of the system I want to have the current solar irradiation displayed on an LCD.

I have a 2 wire calibrated solar cell (pyranometer) which gives a linear voltage output to a linear solar irradiation input, measured in W/m2. The voltage is very low, 0.158 V at 1000 W/m2 solar irradiation. So to get better resolution I use the internal 1.1 voltage reference.

But if I understand it correct, when I set the internal reference to 1.1 V, I do so for all pins. This is not so great, since I would like to use other temperature sensors and motor controls (pump) with the same board which require a different voltage reference.

Is it possible to set the 1.1V reference only to the pin which the pyranometer connects to and have 5V for the rest of the pins?

You have one ADC - the reference is for the ADC, not the pin, so is the same for all inputs, but you can change it on-the-fly (though read the restrictions carefully, and expect to waste at least 50% of your reads)

Hi AWOL,

Thanks for that. Does that go for all Arduinos? Also the DUE?

AWOL: You have one ADC - the reference is for the ADC, not the pin, so is the same for all inputs, but you can change it on-the-fly (though read the restrictions carefully, and expect to waste at least 50% of your reads)

In particular after changing the analog reference setting you must force an ADC conversion and ignore the result, only thereafter will it return meaningful readings.