I saw this information in the arduino webpage at the description of the arduino duemillanove board.
The Duemilanove has 6 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function.
So, if i am right, it could be possible to increase the higher value (actually, 1024) to other (for example, 2048). In that case, we could have more steps when measuring from analog pins, for example accelerometers, temperature sensors, pings,.. or whatever depending of the value readed at analoge pins. In that case, it could increase the resolution of the result.
i show in this forum different topics related to the resolution of sensors than clearly depends on the 1024 values.
Am i right? Is it really usefull or it just only could increse the noise of the signal?
if it is really usefull, how knows how to use the analogReference() function?
So, if i am right, it could be possible to increase the higher value (actually, 1024) to other (for example, 2048)
Sorry, wrong. This means you can change the range, i.e. you can measure from 0 to 2.048V instead of 0 to 5V. You still only have 10 bits of resolution.
If you need more resolution you'll have to use an external ADC.
Oh, may be i understand bad, but right now, if i have a value of 1024 it means that i read 5V, as well as a read of 512 means 2.5V.
But if i change the analoge value to 2048... i understand that i can read 5V when i have a 2048 value, and 2.5V when i have a reply of 1024, and so on.
am i wrong?
UPDATE: I am confuse. I readed the analogReference() function.
What seems to be in agreement with you kg4wsv, but what i understand for the first explanation (in the quote in the first post), in what i say above here....
But if i change the analoge value to 2048... i understand that i can read 5V when i have a 2048 value
You could that by multiplying your analogue readings by two, but then, you'd be missing all the odd numbers, so you'd still only have 1024 distinct values.
The on-board A/D has a maximum resolution of 10 bits.
The fact that the analog inputs are 10 bit means that you will always have 1024 distinct values (2**10th = 1024). The voltage on the ARef pin determines how big each step is, not how many steps there are. The output of an analogRead() will always be an integer from 0 to 1023 regardless of the value on ARef.
If you could put 1024 volts on that pin (you can't, of course...), you'd have 1024 1V steps. If you could put 512 volts on it (again, don't even think it...), you'd have 1024 1/2V steps.
More realistically, if you put (say) 1.024 volts on that pin, each step would represent an increase of .001 volts (or 1 mV). A 4.096 volt ARef would give steps representing increases of .004 volts (4 mV).
Increasing ARef does not give you more steps, it increases the size of each step (in essence decreasing your resolution).
If you want more resolution, you need to divide those 1024 steps across a lower range of voltages. If you knew your input was always going to be less than 1 volt, for example, using a reference of 1.024 volts would give you that resolution of 1 mV, more than 4 times better resolution than you'd get using a 5V ARef value (5V/1024 = 4.88 mV). But of course if you use an ARef of 1.024 V and the analog input you're trying to read exceeds that value, you get no resolution at all. It'll constantly max out at a reading of 1023.
You can use a voltage divider circuit to bring an analog input voltage down to a usable level, but it seems to me that you'd be introducing a new source of error and so you wouldn't be able to get much if any improvement in resolution by doing so. Adding an external ADC with more than 10 bits would work, as long as you had a good reference voltage for it.
To satisfy my curiosity, precisely how low can the analog reference voltage be set and still derive meaningful data? Secondly, what would occur if the sampled voltage exceeded the reduced reference voltage?
You can go lower than the internal 1.1V by supplying an external voltage. But there is no point because of the internal noise on the comparator input would just give you more noise bits instead of more detailed measurement.