Back to Basics: Data conversion details
Bit counts matter when converting analog data to digital.
An analog-to-digital converter is an electronic or device that changes a continuous quantity into a digital number proportional to the magnitude of the input. When evaluating the specifications of analog-to-digital converters, it’s useful to understand the basics of bit rates and frequency as they relate to data acquisition.
For bit rate, imagine measuring the diameter of a coin with a ruler. You put the ruler on the coin and notice that it’s slightly more than 11/16 in. The actual is somewhere between 11/16 and 3/4 in. You can eyeball the measurement and interpolate in your own mind—but machines aren’t as good at that as you are. Getting a machine to make that measurement requires converting analog input to digital input.
Since digital data deals with high and low (on or off, 1 or 0, etc.), you have to break the reading into discrete segments. For a machine, an analog measurement might be given as a voltage, such as 0 to 10 V. To digitize the measurement, you can use a comparator that turns from off to on when the voltage reaches 5 V. Using that, you have just created a one-bit A-to-D converter. Applying this to the ruler used in the example above, you can say anything below 1/2 in. is less than 5 V, and anything over 1/2 in. is greater than 5 V.
Unfortunately, this isn’t very precise. But if you’re clever, you realize that if you add a second comparator, you can effectively double the number of marks on the ruler. You now have a two-bit device which gives you marks at quarters. Adding another comparator makes a three-bit device and gives you eighths. Every time you add another bit, you get twice as many divisions, so a ruler that has sixteenths is equivalent to a four-bit device.
The specifications for an A-to-D converter will say that it’s an 8-bit or 12-bit device. By extending the math, you find that a 12-bit converter gives you 4,096 units; that means, whatever range of measurement you’re dealing with is divided into 4,096 individual units. In the ruler example, each inch would be divided into 0.00024414 in. increments. The same math applies regardless of what you’re measuring: pressure, temperature, size, flow, level, weight, etc. The total range span will be divided the same. So, for a given range, 12-bit conversion (with 4,096 units) allows you to be more precise than eight-bit conversion, which provides only 256 units.
Ultimately, if you’re trying to determine what bit count you need for a specific application, you have to ask how precise the measurement has to be. If high precision over a wide range is necessary, say for robotics or a coordinate measuring machine, 12-bit may not cut it. On the other hand, if you’re trying to measure pressure between 0 and 100 psi, and ±5 psi is close enough, even eight-bit resolution is overkill.
If bit rate is the vertical or y-axis on a graph, frequency is the horizontal or x-axis. Bit rate says how many divisions you have, and frequency says how often you make a mark. Say you need to draw a series of parallel lines 1/8 in. Apart. . If you have a ruler and a pencil with a sharp point, that’s no problem. But if all you have is a chisel point marker that makes a thick line 1/4-in. wide, you will have a hard time. Your drawing instrument has to be finer than the distance between the lines.
It’s the same when converting analog data to digital. Just as you must have a sufficient bit rate to duplicate subtleties in the analog waveform, your frequency also has to be up to the task. Digital frequency should be at least double the highest analog frequency that you have to convert.
Do the math
- To digitize a measurement, you can use a comparator that turns from off to on at a certain increment.
- If you add a second comparator, you effectively double the number of marks. This is a two-bit device.
- Every time you add another comparator, you get twice as many divisions, so, a 12-bit converter gives you 4,096 units of measurement accuracy.
This “Back to Basics” is based on an “Ask Control Engineering” blog post by Peter Welander, Control Engineering; edited by Renee R. Bassett, a technical writer for Control Engineering. Reach her at email@example.com.
Tutorials Channel at www.controleng.com/tutorials.
Ask Control Engineering blog at www.controleng.com/blogs.
Analog Devices, manufacturer of ICs for analog and digital signal processing applications, also offers online tutorials. www.analog.com/training