Breadboarding: Potentiometer (Voltage Divider) to ADC (Analog to Digital Conversion)
The center lead (Vout) of the potentiometer is connected to the ADC pin 0. The potentiometer's outer leads are connected to ground (GND) and 5V (VCC). These connections create the voltage divider. Optionally you can used resistors rather than wires for the two outer lead connections to minimize the possibility of a short where the resistance goes very low across the center lead to one of the outer leads.
The ADC needs to be powered. The ADC has its own power pins for AVCC and GND. the AVCC is connected directly to VCC (the 5V rail) and the GND is simply connected to GND on the - rail. Across these two power pins should reside a 100nf (nanofarad) or .1uf (microfarad) capacitor just like on the main power pins.
Another important pin for ADC is the voltage reference pin. This pin will receive the top voltage in our range of voltages we need to consider in the ADC input. Say, for instance, you don't want the 5v to be your voltage reference, because your device only has a range of 0v to 3.3v that will be delivered to the ADC. The top voltage in this range, 3.3v, should be connected to the ADC voltage reference Vref pin. If you had 5v connected to this Vref pin, but the device only gave you 0v to 3.3v, then your precision will be reduced.
The Vref pin can be set in programming, which is the case in this video clip.
Comments and Additional Information
Have some code to share? Or additional information? Respond here:
You need to be logged in to save a response on this page. The response must be constructive, helpful, supplimentary or to correct the existing video, code or narrative content.