aabm01:
In the Analog pins in the Yun following the specifications we get:
0 V --> 0 bits
5 V --> 1023 bits
Yes, assuming that you are using Vcc as the reference voltage (the default) and that Vcc is actually 5V.
Your are telling that the 5V are not real, instead we are geting 4.5V. So the the relation changes like that:
0 V --> 0 bits
4.5 V --> 1023 bits
Mostly. The Yun has some polarity protection diodes in the power supply lines. So while 5V may be passed in on the USB line, or the VIN line, by the time the power passes through the diode and reaches the processor, the voltage is approximately 4.5 volts. So your numbers above are mostly right, but they might vary based on variations from board to board. 4.5V is not a regulated value, it's just the input voltage minus the diode voltage drop.
or we have to interpolate and the relations changes like that;
0 V --> 0 bits
4.5 V --> 921 bits
No. A 4.5V input to the ADC will only give you an output reading of 921 if the reference voltage is 5V. That's not the case on the Yun if you use the default configuration.
That's very important to determine the accuracy when reading from sensors.
If you need accuracy, you should be calibrating your conversion values to give yourself the right answer. Do not assume that you will get 4.88 mV/bit with a 5V reference (or 4.39 mV/bit with a 4.5 volt reference.) Those theoretical numbers will get you close, but there will always be variations from board to board that will cause a loss of accuracy. If Vcc is stable, you should be able to calibrate out the difference between 5V and 4.5 V, but remember that the maximum voltage that you can convert is still limited to the actual Vcc voltage used as the reference - any voltages higher than that will be clipped with a value of 1023.
Besides board to board component variations, remember that the Vcc voltage reference is not regulated - the Yun has no on-board 5V regulation: it either gets its power from the USB jack, or the VIN pin. In either case, the power passes through a protection diode (which causes a voltage drop) but is not otherwise regulated. Any variations on input voltage can cause variations in the ADC readings.
Using Vcc as your ADC reference voltage gives you an approximation, at best. For a lot of projects, that's good enough. But if you need better accuracy, or better stability, you need to use a better reference voltage. You can switch to an internal reference voltage, and that will give you an increase in accuracy, although it will reduce your measurable range of voltages - the upper limit that you can convert will be the same as the reference voltage. So if you select the internal 1.1 volt reference, you will get 1.074 mV/bit resolution, but the largest voltage you can convert is 1.1 volts.
The internal reference voltages are more accurate than using the Vcc as the reference. If you need more accuracy than that, you can use an external precision voltage regulator, and use that as your external reference. They make high precision reference voltage regulators for just this purpose.