Hardware Reference
In-Depth Information
Using an Oscilloscope
Most of what you'll be building in this topic involves
computer circuits that read a changing voltage over time.
Whether your microcontroller is reading a digital or analog
input, controlling the speed of a motor, or sending data to
a personal computer, it's either reading a voltage or gener-
ating a voltage that changes over time. The time intervals
it works in are much faster than yours. For example, the
serial communication you just saw involved an electrical
pulse changing at about 10,000 times per second. You
can't see anything that fast on a multimeter. This is when
an oscilloscope is useful.
An oscilloscope is a tool for viewing the changes in an
electrical signal over time. You can change the sensitivity
of its voltage reading (in volts per division of the screen)
and of the time interval (in seconds, milliseconds, or
microseconds per division) at which it reads. You can
also change how it displays the signal. You can show it in
real time, starting or stopping it as you need, or you can
capture it when a particular voltage threshold (called a
trigger ) is crossed.
Figure 1-19
DSO Nano oscilloscope reading a
serial data stream.
data. The vertical axis is the voltage measurement, and the
horizontal measurement is time. The Nano was sampling
at 200 microseconds per division in this image, and 1 volt
per division vertically. The 'scopes leads are attached to
the ground pin of the Arduino and to digital pin 1, which is
the serial transmit pin.
Oscilloscopes were once beyond the budget of most
hobbyists, but lately, a number of inexpensive ones have
come on the market. The DSO Nano from Seeed Studio,
shown in Figure 1-19, is a good example. At about $100,
it's a really good value if you're a dedicated electronic
hobbyist. It doesn't have all the features that a full profes-
sional 'scope has, but it does give you the ability to change
the volts per division and seconds per division, and to set
a voltage trigger for taking a snapshot. It can sample up
to 1 million times a second, which is more than enough to
measure most serial applications. The image you see in
Figure 1-19 shows the output of an Arduino sending the
message "Hello World!" Each block represents one bit of
Besides inexpensive hardware 'scopes, there are also
many software 'scopes available, both as freeware and
as paid software. These typically use the audio input
of your computer to sample the incoming voltage. The
danger, of course, is that if you send in too much voltage
you can damage your computer. For this reason, I prefer
a hardware 'scope. But if you're interested in software
'scopes, a web search on software oscilloscope and your
operating system will yield plenty of useful results.
X
 
Search WWH ::




Custom Search