Operation Manual

Human-computer interfacing
126
Notes:
This gives us 4 (2
2
) combinations that we can use. The first “2” is the number of
states in a digital channel – on and off. The second “2” is the number of digital
channels we are using.
An analogue signal is one that can have a range of values, whereas a digital signal
only has two. One way to think about digital versus analogue is comparing a flight
of stairs with a ramp. When climbing the stairs you can be quite certain that you
are on the seventh step, for example. You have no option to stand halfway between
the sixth and seventh stair. This is much like a digital signal. In contrast, when
climbing the ramp, you can reach any height above the ground, but with less
certainty about what that height actually is. This is similar to an analogue signal.
Just remember that a digital signal comes in steps (possibly very small steps, but
still steps), while an analogue signal is smooth, allowing any value, but harder to
gauge precisely.
A computer can only understand data in a digital form, so all analogue inputs have
to be converted into a digital format before they can be used by the computer.
Likewise, analogue outputs have to be created by converting the digital values
coming out from a computer. On the Raspberry Pi, this conversion has to be done
using external electronics.
Digital-to-analogue converters (DACs) and analogue-to-digital converters (ADCs)
are widely used in the electronics that connect to computers. The more digital bits
that the converter handles, the more resolution (more accurate) the conversion
will be. For example, if a temperature sensor produces a linear analogue signal
in the range 0 °C to 100 °C and you wanted to be able to measure to at least
the nearest degree on your computer, you would need at least seven digital bits
(2
7
= 128).
Analogue-to-digital
converters (ADCs) and
digital-to-analogue
converters (DACs) are a key
part in most computer
input/output systems.