ADC Analog-to-digital converters B YASWANTH What is ADC? An analog-to-digital converter (also known as an ADC or an A/D converter) is an electronic circuit that measures a real-world signal (such as temperature, pressure, acceleration, and speed) and converts it to a digital representation of the signal. How does an ADC work? In the real world, analog signals are signals that have a continuous sequence with continuous values. Digital signals are represented by a sequence of discrete values where the signal is broken down into sequences that depend on the time series or sampling rate. Below figure shows a great example of what analog and digital signals look like. Figure : A continuous signal (analog) turning into a digital signal. ADCs follow a sequence when converting analog signals to digital. They first sample the signal, then quantify it to determine the resolution of the signal, and finally set binary values and send it to the system to read the digital signal. Two important aspects of the ADC are its sampling rate and resolution. What is the ADC sampling rate/frequency? The ADC’s sampling rate, also known as sampling frequency, can be tied to the ADC’s speed. The sampling rate is measured by using “samples per second”, where the units are in SPS or S/s. This simply means how many samples or data points it takes within a second. The more samples the ADC takes, the higher frequencies it can handle. One important equation on the sample rate is: fs = 1/T Where, fs = Sample Rate/Frequency T = Period of the sample or the time it takes before sampling again Example In above Figure, let’s assume fs is 20 S/s (or 20 Hz), while T is 50 ms. The sample rate is very slow, but the signal still came out similar to the original analog signal. This is because the frequency of the original signal is a slow 1 Hz, meaning the frequency rate was still good enough to reconstruct a similar signal. What happens when the sampling rate is considerably slower? If the sampling rate is slow and the frequency of the signal is high, the ADC will not be able to reconstruct the original analog signal which will cause the system to read incorrect data. It is important to know the sampling rate of the ADC because you will need to know if it will cause aliasing. Aliasing means that when a digital image/signal is reconstructed, it differs greatly from the original image/signal caused from sampling. A example is shown in below figure. Figure : An example of how aliasing happens. In this example, you can see where the sampling occurs in the analog input signal. The output of the digital signal is not at all close to the original signal as the sampling rate is not high enough to keep up with the analog signal. This causes aliasing and now the digital system will be missing the full picture of the analog signal. One rule of thumb when figuring out if aliasing will happen is using Nyquist Theorem. According to the theorem, the sampling rate/frequency needs to be at least twice as much as the highest frequency in the signal to recreate the original analog signal. The following equation is used to find the Nyquist frequency: fNyquist = 2fMax Where, fNyquist = Nyquist frequency fMax = The max frequency that appears in the signal there are cases where outside noise can introduce unexpected high frequency into the analog signal, which can disrupt the signal because the sample rate couldn’t handle the added noise frequency. It is always a good idea to add an anti-aliasing filter (low pass filter) before the ADC and sampling begins, as it can prevent unexpected high frequencies to make it to the system. How is resolution of ADC determined? The resolution of the ADC can be determined by its bit length. Below figure shows about resolution, Here you can see that the 1-bit only has two “levels”. As you increase the bit length, the levels increase making the signal more closely represent the original analog signal. Figure : Example on how resolution affects the digital signal. The resolution depends on both the bit length and the reference voltage. These equations help you figure out the total resolution of the signal that you are trying to input in voltage terms: Sample ADC Resolution Formula: Step Size = VRef/N Where, Step Size = The resolution of each level in terms of voltage VRef = The voltage reference (range of voltages) N = Total level size of ADC To find N size, use this equation: N = 2n Where, n = Bit Size Figure shows common bit length and their number of levels. It also shows what the step size would be for a 5V reference. You can see how accurate it gets as the bit length increases. Figure :Bit Length and their number of levels and step size for a 5V reference range.