I need to hook up a couple of pots to the ADC inputs of an AVR. Is there anything "wrong" with this design:
1. AREF = Vcc = +5V
2. pot ends are connected to Vcc and GND with wiper connected to an ADC input pin
The pots would be the normal kind like what is typically used in joysticks.
I'm interested in unexpected failure modes of the pot which could cause problems. Can pots short? Is there a problem if the wiper loses contact with the resistive material in the pot? Are there any problems with trying to use an AREF which is close to Vcc?
Also, I want to have a resolution of 256 steps when reading the pot. To compensate for the particular dynamic range of a pot, what about using the following calibration procedure:
When a certain button is pressed, the uC goes into calibration mode. In this mode the user moves the pot to its extremes. The uC will reads the pot using 10-bit ADC and record the extreme values in its EEPROM. In normal operation the uC reads the pot value using 10-bit ADC and determines an 8-bit value by interpolating the value read between the two extremes stored in the EEPROM.
I just want to make sure this is reliable in practice. Any comments?