Tutorial
raspberrypi.org/magpi July 2018 47
Voltage
Voltage A3
5V
Gnd
Time A2
Trigger A4
10K
10K 10K Time
Trigger
STEP-03
Wiring the pots
We then drilled three holes for the pots, and
added the small slots for the anti-rotation lugs.
Then we fitted the pots and wired them up using
the diagram above. This is the view from inside the
lid of the box; if you're worried about touching the
side of the box with your soldering iron, consider
soldering them before attaching to the box.
the information as to whether to use a trigger or not
on the next sample.
Finally, before each buffer full of data is gathered,
pin 13 on the board is lit, and turned off after. This is
so that we could time the process on a commercial
oscilloscope to find the sample rate – something you
will not have to do if you use the recommended AVR-
type Arduinos running at 16MHz.
Pi software
The software for the Raspberry Pi is written in
Python 3 and used the Pygame framework. It proved
to be a lot more tricky to write than we first imagined,
and is shown in the Scope.py listing. Python 3 uses
Unicode characters by default, and allowed us to
display the delta (Δ) and mu (μ) Greek characters for
the difference and the time. The code first sets up the
non-display part of the window, this is only drawn
once and then parts of it are updated when necessary.
Depending on what type of Arduino you have, it can
show up as a different USB port; we found that ours
>STEP-04
Finishing off
Add the resistors and capacitors to the
stripboard and wire up the BNC socket. Solder
this up before mounting, otherwise you will
melt the plastic. Remember to thread the
central wire through the ground washer,
crinkle washer, and nut before soldering
it. Add labels Trigger, Time, and Volts to
the knobs.
BUILD AN OSCILLOSCOPE