Analog to Digital

An Analog to Digital converter, or ADC, is a way of transforming an analog signal, or voltage, into a digital number. This is useful for sensors such as sonars and IR rangefinders, which use an analog voltage as the output signal.

=Operation= ADC's operate by comparing your input voltage to a reference voltage. The reference voltage (Vref) is usually supplied by the user if the ADC is on a dedicated chip like the ADC0838. Microcontrollers with built in ADC's like the Arduino use the 5v chip supply voltage as the Vref. However, the Arduino does allow the user to override the default Vref through the Aref input pin. Each ADC has a certain resolution, as determined by its bit capacity. For example, an 8 bit converter can only return digital values between 0 and 255 (2^8 - 1), while a 10 bit converter can return values between 0 and 1024 (2^10 - 1). The more 'bits' your ADC has, the greater its resolution.

=Reading Voltages= When the voltage line being read is connected to the ADC's ground line, the ADC will return 0. When the voltage being read is the same as the ADC's Vref, the ADC will return its maximum value, based on how many bits of resolution it has. That is, 1023 for a 10 bit ADC, 255 for an 8 bit ADC, etc. To find a voltage between from the ADC reading, you can use the formula Voltage = (ADC Reading / Maximum Reading) * Vref