Internal Analog Reference - 1.1v & 5v in the same program

Morning,

I've got a program that is using the internal 1.1v reference to increase the read resolution of an LM35 temperature sensor output using analogReference(INTERNAL);

However, is there a way for me to set analogReference to 1.1v on specific analog pins, and 5v on other pins?

No. It's one or the other.

You can, of course, switch between them at will though. Add a slight delay to allow the references to settle between each change.

I feared that would be the problem.... the dreaded delay.

Cheers anyhow!

The other option is to use an external ADC. Then you can have 2 voltage references - the one for the internal ADC, and a different one for the external ADC.

I am working on an ADC shield at the moment: http://hacking.majenko.co.uk/node/58 and in my testing of it I use the internal ADC of the Arduino to monitor the Vref of the external ADC.

I feared that would be the problem.... the dreaded delay.

It is not necessary to delay(). Simply discard the first reading after switching reference voltages.

It is not necessary to delay(). Simply discard the first reading after switching reference voltages.

Which basically creates a delay :wink:

Which basically creates a delay

Yes, but it is a delayMicroseconds (110) (approx), which is only a tenth of a "delay(anything)" :wink:

PaulS:

I feared that would be the problem.... the dreaded delay.

It is not necessary to delay(). Simply discard the first reading after switching reference voltages.

Simply discard the reading? Sorry?

What I meant, was to be able to simultaneously read the input from an LM35, whilst reading other 0 - 5v sensors - in addition to running numerous other I/Os. A delay of any sort is a delay is it not?

Simply discard the reading? Sorry?

(void) analogRead (myPin);
myReading = analogRead (myPin);

jtw11:
What I meant, was to be able to simultaneously read the input from an LM35, whilst reading other 0 - 5v sensors - in addition to running numerous other I/Os. A delay of any sort is a delay is it not?

You can't simultaneously read more than one analog input anyway. There is only one ADC. The pins go into a MUX, which sits in front of the lone ADC.