Answered: Voltage to AD conversion

Can somebody explain me how voltage gets converted to a analog value? The closest answer I could find on the forums is that there is a ‘10 bit converter’ but no clue how it works.
I’m also trying to find out how to get an angle out of potentiometer value. Is there at least a graphic for rotation/voltage?
Finally any GOOD beginers book to robotics/electronics that you can recomend?
Thank you.

**Voltage does not get converted to an analog value. The analog voltage/value is converted to a digital value. For the VEX System, the analog voltage must between 0 and 5V or damage can result. The analog voltage is sent to the Microprocessor via an Analog Input. The Microprocessor then samples this input and converts the input to a digital value using its Analog to Digital Converter. Since the Microprocessor has 10-bit resolution, this means that the input signal can be encode into one of 1024 different levels, since 210 = 1024.

To get an angle out of a potentiometer: The potentiometer will give a varying or analog voltage out as the shaft of the potentiometer is rotated or as the resistance of the pot changes. You can then monitor the varying voltage of the potentiometer with the Microprocessor by writing code to get digital values using the A/D converter. These digital values represent a position of the potentiometer and thus a position of the potentiometer shaft which now can be interpreted as an angle.

For more information on the PIC18F8520 processor and A/D converter, get the data sheet from the** website. You can also refer to the ifi_utilities.c file from the Vex Starter Code and user_routines_sensor_test.c file from the Vex Sensor Test, both found on the Support page.