Analog to Digital Converter HOWTO
The motivation behind using analog to digital converters is that many applications require converting between the two realms, especially when sensors are involved. This howto will describe some common kinds of ADCs and methods of communicating with them.
Using Analog to Digital Converters
Before using an ADC, it is important to realize how most of these devices operate. In general, ADCs operate by allowing the input signal to charge a capacitor and then read the voltage off of the capacitor. Problems will arise if the input signal varies too quickly or the convertion rate is too high to allow the voltage to charge the capacitor.
There are a number of details that should be considered when choosing an appropriate ADC: number of inputs, resolution, throughput, output format, and approximation technique. ADCs can typically handle up to 8 inputs, range between 8 and 16 bits of resolution, and range from 10 ksps (kilo samples per second) to 100 Msps. Output formats are widly varying and your choice will depend heavily on your application. For applications in this class you will likely not care about whether the device uses sample-and-hold or successive approximation or any other technique.
Typical ADCs provide their data serially, although some do offer parallel output along with other bizarre formats. Some ADCs provide an EOC (end of convertion) signal that indicates when the output data is ready, which can be used to interrupt a microcontroller, while others do not provide any such signal, which results in the need for polling the data. ADCs can also provide multiple output formats, giving the user the choice between binary or BCD (binary-coded decimal) for example.
For these reasons, asking for "any ol' ADC" is treated like asking for "any ol' capacitor". We're pretty sure it matters and we wonder why you don't think it does.
- See the PIC Programming HOWTO if you're using a PIC and need an ADC
- You can use an analog multiplexer to connect multiple sensors up to a single ADC (most of the multiple input ADCs do this internally)