Understanding bits and resolution is key to working with analog converters. The resolution of an analog converter helps us to make meaningful interpretations of a sensed signals. It seems that the resolution just gives us a conversion ratio so that the true value of the signal can be expounded, but there is more to it, than what meets the eye.
What are bits in Analog converters?
Bits in ADC are actually the number of bits the output data from the ADC will have. A 8, 12, 16 or 24 bit ADC will convert the analog signal into a discrete time-based data which will have 8, 12, 16 or 24 bits respectively. As shown in the image below according to the ADC bits, the output data is determined. For 8 and 16 bit, the output data size is 1 and 2 bytes respectively. But for 12 bit, we generally have 2 bytes of output data, which is left or right aligned (details of which can be found in the manufacturers datasheet) with 4 bit as ‘don’t care’.
Thus we can deduce that the bits represent the sensitivity with which the ADC senses the signal. More the bits an ADC has, finer the change it can perceive (improved resolution). The higher the resolution, more precise the measurement.
Step Size(Voltage step) : Δ = Vref / 2n
Vref = Reference voltage, it is the range across which the voltage measurement is to be made. Vref= Vrefmax – Vrefmin.
n = ADC resolution in bits.
To better understand step size, let’s assume the example where we have a 8 bit ADC. with Vref = 5V.
Therefore, Δ = 5V/256 = 0.0195V or 19.5mV = LSB
The voltage step size is also the LSB (Least Significant Bit) of the data obtained. i.e the minimum value of the output date i.e. 1 corresponds to the voltage step size. The MSB (Most Significant Bit) of this word indicates whether the input voltage is greater than half the reference (2.5V, with a 5V reference). Each succeeding bit represents half the range of the previous bit.
The table above illustrates this point. Adding the voltages corresponding to each set bit in 0110 1100, we get:
1.25 + .625 + .156 + .078 = 2.109 Volts
For the example we’ve been using , the voltage resolution is 19.5mV. This means that any input voltage below 19.5mV will result in an output of 0. Input voltages between 19.5mV and 39mV will result in an output of 1. Between 39mV and 58.6mV, the output will be 2.
Voltage resolution can be improved by reducing the reference input. Changing that from 5V to 2.5V gives a resolution of 2.5/256 or 9.7mV. However, the maximum voltage that can be measured is now 2.5V instead of 5V.
The only way to increase resolution without reducing the range is to use an ADC with more bits. A 10-bit ADC has 210, or 1024 possible output codes. So the resolution is 5V/1024, or 4.88mV; a 12-bit ADC has a 1.22mV resolution for this same reference.
Step size formula
When I initially started working with ADCs, I went through a lot of documents and found something confusing. Certain documents mentioned the formula as Vref / 2n while, others mentioned Vref / (2n – 1). So which one is true?
Well, both the formulas are true as it all comes down to the definition of Vref.
While using the formula Vref / 2n, Vref = Reference voltage
While using the formula Vref / (2n – 1), Vref = Full-scale voltage reading (EFSR or FS)
so the correct way of putting this together would be:
Voltage Step Size : Δ = Vref / 2n = EFSR / (2n – 1)
Full-scale voltage determines the maximum voltage the ADC can measure. For our example of an 8 bit ADC with Vref=5V, if we have a close look at the step size, the digital output is actually restricted to 255 which is equivalent to 4.98V. Here 4.98V is our Full-scale. Though our reference voltage is 5V (Vref), we can only measure up to 4.98V (EFSR or FS).
EFSR = Vref – LSB
Another confusion is the formula and the example stated on Wikipedia regarding analog to digital converters (as on 27th July 2016).
The data stated on Wikipedia is a little confusing and may seem to contradict the facts stated earlier in this post. But if you take a closer look at the definition, they are one and the same.
Δ = Vref / 2n = EFSR / (2n – 1)
The formula for voltage step size seems to be the same as we deduced, but the definition of EFSR seems to match the formula for Vref. This completely contradicts the idea of EFSR =Vref – LSB. But as I said earlier, everything lies in the definition of the terms and symbols used. The same notations used by different documents may have a different definition and meaning.
As stated, VRefHi and VRefLow are the upper and lower extremes, respectively, of the voltages that can “be coded.”
- The term “be coded” is really important. This means the VRefHi value is associated with the upper boundary voltage that can be quantized and encoded. i.e 255 for an 8-bit converter. Whereas our Vref definition takes into account Vrefmax as the upper extreme value which in fact cannot be coded. i.e. Vrefmax corresponds to 256 which is a value above 8 bits. So the actual value which can be coded is Vrefmax – LSB which corresponds to 255. Resulting in the conclusion of VRefHi = Vrefmax – LSB, thus proving the equality of both the definitions.
Some pratical advice
- In most of the ADCs I have worked with like ST, Freescale, TI, Microchip the manufacturer’s datasheet sticks to the formula of Δ = Vref / 2n where Vref= Vrefmax – Vrefmin. And Vrefmax (Vref+ ) and Vrefmin (Vref- ) are provided as Input pins on the microcontroller or ADC chip. And in most applications, Vref+ is to be externally connected to Vdd (supply for the IC) or any voltage below Vdd through a small inductor and Vref- is externally connected to the ground. If Vref- pin is not provided, it is assumed to be internally connected to the analog ground (Vssa).