Hardware Reference
In-Depth Information
ComparingAnalogandDigitalSignals
The graphs in Figure 3-1 show how analog and digital signals compare to each
other. On the left is a square wave that varies between only two values: 0 and
5 volts. Just like with the button that you used in the preceding chapter, this
signal is only a “logic high” or “logic low” value. On the right is part of a cosine
wave. Although its bounds are still 0 and 5 volts, the signal takes on an infinite
number of values between those two voltages.
Figure 3-1: Analog and digital signals
Analog signals are those that cannot be discretely classified; they vary within
a range, theoretically taking on an infinite number of possible values within
that range. Think about sunlight as an example of an analog input you may
want to measure. Naturally, there is a reasonable range over which you might
measure sunlight. Often measured in lux, or luminous lux per unit area, you
can reasonably expect to measure values between 0 lux (for pitch black) and
130,000 lux in direct sunlight. If your measuring device were infinitely accurate,
you could measure an infinite number of values between those two. An indoor
setting might be 400 lux. If it were slightly brighter, it could be 401 lux, then 401.1
lux, then 401.11 lux, and so on. A computer system could never feasibly measure
an infinite number of decimal places for an analog value because memory and
computer power must be finite values. If that's the case, how can you interface
your Arduino with the “real world?” The answer is analog-to-digital convert-
ers (ADC), which can convert analog values into digital representations with a
finite amount of precision and speed.
Search WWH ::




Custom Search