ARef

Is it possible to have a “Window” of voltage values for the ADC inputs on the UNO? Do I have to know that the low voltage is 0V or that the high voltage is 5V? What I’m really asking is can I somehow set my readings to 2V as the low and 4V as the high?

Thanks!

Tom

tomroth:
Is it possible to have a "Window" of voltage values for the ADC inputs on the UNO? Do I have to know that the low voltage is 0V or that the high voltage is 5V? What I'm really asking is can I somehow set my readings to 2V as the low and 4V as the high?

Thanks!

Tom

No, the mega328 uses ground as it's 0 count value and whatever the reference voltage used to be the 100% (1023 count) value. To have a full 0-1023 counts equal to +2 to +4 would require external circuitry using a op-amp circuit to scale and offset the voltage for the A/D circuit.

Lefty

map can be useful to you perhaps? http://www.arduino.cc/en/Reference/Map