Analog Digital Converters (ADCs)
ADCs are devices that convert analog signals such as voltage, current, sounds, and light into a digital value that is proportional to the input. Our car uses ADCs to read steering data, pedal position and cell voltages!
Resolution
Resolution refers to the smallest change in voltage an ADC can detect. It is usually expressed in bits (ie: 16-bit ADCs). An ADC with n bits of resolution can represent 2n discrete levels of the input signal.
Example: A 12-bit ADC can represent 212 = 4096 different voltage levels. Take an example input range of 0V-5V. This means the 12-bit ADC can detect a change of 5V / 4096 = 1.22 mV.
Sampling
Sampling refers to converting a continuous analog signal into a discrete digital signal by taking measurements at regular intervals. The rate at which samples are taken is the sampling rate, usually measured in samples per second (Hz).
According to the Nyquist theorem, the sampling rate must be at least twice the highest frequency present in the signal to reconstruct the original signal without aliasing/distortion.
ADC Gain and Offset
Gain is the amplification factor applied to the input signal when the ADC converts it to a digital value. The ideal gain is 1 (the ADC's digital output is directly proportional to the input voltage), but imperfections can cause it to deviate from this.
Offset is the deviation of the ADC output from zero when the input is zero. An ideal ADC has an output of zero when the input is zero, but in reality, there might be a small non-zero output even with zero input.
Some ADCs rely heavily on the Voltage reference it is supplied. In all of our boards, we use a ferrite bead to ensure a clean and stable voltage bus, ensuring high-accuracy measurements.
Calibration
Calibration adjusts the ADC’s gain and offsets to correct errors and ensure accurate readings of the input signal.
Procedure: It typically involves applying known input signals to the ADC, measuring the output, and then adjusting the ADC’s parameters to minimize the difference between the measured and expected outputs. If an ADC shows a non-zero output for a zero input, the offset can be adjusted to bring the output to zero. Similarly, if the ADC output is not scaling linearly with the input, the gain can be adjusted
Types of ADCs
Flash ADC: Also known as a parallel ADC. It compares the input voltage to a set of reference voltages, the output is a binary code. They are called flash ADCs because they convert instantly. Below is an example of a 2-bit flash ADC.
Successive Approximation ADC (STM32 usually uses this): Binary search algorithm to approximate the input voltage. It starts with the MSB defined by the resolution and compares the analog input and the maximum value (through a DAC).
For example, a 3-bit SAR sampling 4.5V will approximate the binary output ‘100’. This is 4V, so the comparator shows that the input > approximate, so the MSB must be 1. It then moves on to the next digit and approximates ‘110’, which is 6V. Since input < approximate, the bit remains 0. You notice that the final output will be 4V. A SAR is significantly limited by its resolution.Sigma-Delta ADC: Uses oversampling and noise-shaping techniques for high accuracy and resolution. Samples at a very high frequency, and then filter out the noise. It then quantizes the samples and outputs a value. These are typically slower than the above ADCs but offer very high precision. Sigma-Delta ADCs are incredibly complex, if you’re interested in learning more take a look at this resource: Sigma-Delta ADCs Tutorial | Analog Devices
Dual Slope ADC: Integrating ADC that measures input voltage by comparing it to a reference voltage during fixed time intervals. Input voltage is integrated over another distinct time interval.
Integration Phase: The input voltage (V_in) is integrated over a fixed period (T_int), which results in a voltage ramp. The slope of the ramp is proportional to the input voltage.
De-integration Phase: After the integration period, a reference voltage (V_ref, usually of opposite polarity) is applied. The time it takes for the ramp to return to zero is measured (T_deint).
Measurement: The time measured during the de-integration phase is proportional to the input voltage by a factor of V_ref / T_int.
This ADC is effective since noise is processed out by integration. You can see this in the below visualization:
https://www.asdlib.org/onlineArticles/elabware/Scheeline_ADC/ADC_ADC_Dual_Slope.html
Pipeline ADC: High-speed and high-resolution ADC that consists of multiple sub-ADCs. Each sub-ADC samples a portion of the input signal, and the output of each stage is passed on to the next.
https://en.wikipedia.org/wiki/Analog-to-digital_converter
The Ultimate ADC Guide: Everything You Need to Know
Delta-Sigma ADC | Digital-Analog Conversion | Electronics Textbook
https://www.arrow.com/en/research-and-events/articles/engineering-resource-basics-of-analog-to-digital-converters