Changing the measuring range of the A/D converter

Hello,

I am successfully reading analog voltage 0-5V from analog sensors. However i would like to read a sensor voltage which outputs 0-1V. Is there any way to change the range so that 0-1V represents 0-1023 bits in order not to compromise resolution?

Thank you,

Christos

Is there any way to change the range so that 0-1V represents 0-1023 bits in order not to compromise resolution?

analogReference(INTERNAL);

https://www.arduino.cc/en/Reference/AnalogReference

INTERNAL selects the internal band gap reference, 1.1V +/- 0.1V per Table 29-20. ADC Characteristics in the '328P datasheet.

Hello,

So if i understand correctly the:analogReference(INTERNAL); will assign

the 0-1023 ADC range to 0-1.1V range. Correct?

I tried to locate the: Table 29-20. ADC Characteristics in the '328P datasheet

but i could not find it. Can you please add the link to the right datasheet?

Thank you,

Christos

In the latest datasheet from Oct 2014 it's here now

29.8 ADC Characteristics

Table 29-15. ADC Characteristics

Page 310 http://www.atmel.com/images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Complete.pdf VINT Internal Voltage Reference 1.0 1.1 1.2 V

It's page 317, Table 29-20

29.8 ADC Characteristics

Table 29-20. ADC Characteristics

in the Feb 2013 datasheet: 8271G–AVR–02/2013

https://www.arduino.cc/en/Reference/AnalogReference

Hello,

You are right. The table says that the VINT Internal Voltage Reference 1.0 1.1 1.2 V. But i still do not understand how to set it to 1.0V

If i add the line analogReference(INTERNAL); in my code i think that the range is set between 0-1.1V

I did not find any parameter to change the Internal Voltage Reference to 1.0V. I forgot to mention that the board i am using is an arduino uno.

Thank you,

Christos

So you think default reference is 5volt. It could vary between 4.75 and 5.25volt. And who knows what it is when you supply the board from USB. Sure, 1.1volt Aref is not exactly 1.1volt. But it's STABLE. The maths line in the code takes care of it not being exactly 1.1volt. e.g. voltage = analogRead(A0) * 1.0674 / 1023; Leo..

@ckeleshis Arduino UNO can provide only 5V and 1.1V reference. If you want exactly 1.0 V you must provide it on the AREF pin and you must set the analog reference to EXTERNAL before calling analogRead().

Why exactly 1volt Aref to measure 0-1volt. The A/D also does not produce 0-1000, so you always end up with a fraction. Leo..

I believe too that the 1.1V internal reference is adequate.

Or maybe just use the map function.

-Standby: Or maybe just use the map function.

If you lower Aref to just above the voltage you want to measure, you have more A/D values to work with. ~1000 values, or a ~10-bit resolution. Reading 1volt with default 5volt Aref results in using only 1/5 of the A/D range. ~200 values, or less than 8-bit resolution. AFAIK, the map function doesn't do fractions. Leo..