An oscilloscope, or o-scope, is the best friend of an electronics enthusiast, be they professional or hobbyist. While a digital multimeter can help you measure steady state and RMS (Root-Mean-Square) voltages, theoscilloscope can not only measure peak-to-peak voltages, but more importantly provide timing information on your signal.

For instance, have you ever been working with an Arduino controlling a servo motor that has to have just the right pulse width modulation in order to spin clockwise instead of counter-clockwise? During your programming, you may have wondered just how close the pulse width was to what was needed. With an oscilloscope you can measure these pulses. When dealing with analog signals, you can use an oscilloscope to see how close you are to the frequency you need or measure what frequency you need to filter. With so many digital electronic projects, timing between signals is extremely important. Therefore, having an oscilloscope is essential.

However, price can be an obstacle. Entry-level scopes can start off at a few hundred dollars. From there, higher-end scopes can end up into the tens of thousands. However, did you know that you probably have all you need to make your own oscilloscope? In fact, you are probably reading this on a device that has the essential parts needed. All other parts are probably in your parts bin.

herocrop

In essence, an oscilloscope is a data acquisition box that records the voltage from your circuit. Another device on your computer already does this: the sound card. The main differences are the level of voltage each can handle, and how fast they sample the voltage (more on that later). Since the sound card on your computer can only handle a small amount of voltage (around +/- .6V to .8V) you need to scale it down. Building your own scope probes accomplishes: allowing input of higher voltages and scaling the voltage down so the sound card can handle it.

The steps below outline how to build such a probe. The probe being built here is used with the line input of a sound card. Line inputs typically accept stereo inputs, therefore this probe will have two channels. If you’re thinking of using the mic input on your system, you will want to build just one channel as mic inputs typically are mono. After the build, I’ll show you some comparisons of this oscilloscope to a lab-grade model and discuss some limitations.

herocrop_screen

Much of this project is adapted from http://homediyelectronics.com/projects/howtomakeafreesoundcardpcoscilloscope, and the software can be found http://www.zeitnitz.de/Christian/scope_en.

What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.

Project Steps

Schematic Overview

The o-scope schematic is really simple. The 4.7k ohm resistor (R1) connects directly to the probe and therefore the point you are measuring on your circuit.

From there the signal goes through a 1M ohm potentiometer (R2), which allows you to adjust how much voltage is getting to your sound card.

NOTE: The resistor and potentiometer values were selected to target measurements ±10V. In fact, with these values you can probably go as high as 30V without worrying about too much current.

The two diodes (D1 & D2) are placed back-to-back to help protect the line input of the sound card by clipping the incoming signal if it gets over about .7V. The 4.7k ohm resistor (R1) also helps to limit the current the diodes see, thus protecting them too.

Note: If you need to look at higher voltages, I would recommend a secondary divider to feed into this circuit. Along with these components, you will need a stereo audio cable, clip leads, and a perfboard to mount everything on.

IMPORTANT: This project is designed for a double-sided perfboard (that is a perfboard with copper pads on both sides). If you don’t have one, don’t worry. Check out the next step for a TIP on how to make your own!

TIP: Make a Double-Sided Perfboard

If you don’t have a perfboard with copper pads on both sides, you can easily make one. Take any two identical perfboards and put them back-to-back, so that the copper pads are on the outside.

You could glue the perfboards together (I recommend a spray glue if you go this route) or, alternatively, you could use the properties of the perfboard to hold it together. That is, you could solder them together!

Use solid-core 22AWG wire cut to length to create a “frame” around the perimeter of the perfboard’s columns and rows (see image 2). Run the wires on one side and solder them on the backside to create a solid, immovable double-sided perfboard with copper pads on both sides.

All of the perfboard holes will lineup nicely now (image 3). Even with the frame, with this size perfboard there are 644 holes available.

Layout Components

Start by placing the largest components, the potentiometers, on the board to determine the overall size needed. Then cut the board to size and arrange the rest of the major components to see a rough layout.

Here you see that both potentiometers and the 4.7k ohm resistors are placed. Then look for the best area to put the diodes. Mark where the leads of the potentiometers are on the board so they can be referenced later.

Connect the Audio Cable

Cut the audio cable to the length you need for your desktop or laptop setup. Next strip out the three different wires from the cable itself. One will be a stranded wire set without any insulation, this is the ground connection. The other two, both insulated, will be channel 1 and channel 2 of the input. Stripping the insulation from the channel carrying wires can be tricky as they are incredibly small.

Note: A handy trick is to take your soldering iron and burn off the insulation to the length you need and tin the leads at the same time. Don’t forget to wipe off the tip of your iron afterward.

Next mount the wires to your board using the potentiometer reference points as guides. The connection of the channels will be to the center lead of the potentiometers. The ground can be taken off to the side and secured in multiple places as you will have multiple connections going to ground.

Mount Components to Board

Connect the black wire, ground, to the far left (from the top perspective) lead on the potentiometer and the 4.7k ohm resistor to the far right lead. To do this, push scrap leads up from the bottom of the board through the holes nearest the reference points marked earlier.

Each potentiometer has the three connections. In the photos, from left to right, are ground — to sound card — from 4.7k ohm resistor. To mount the potentiometers to the board, use drops of hot glue.

Lastly, connect the two diodes per channel between the ground and sound card connections. Remember, one diode goes anode to ground, the other goes cathode to ground.

Complete the Clips

Solder 18 gauge wire to the clip leads. For a two-channel o-scope setup make a total of three wire and clip combinations: two for the signal lines using red wire and one for ground line using black wire.

After connecting the clip leads, connect the other end of the wire to the appropriate place on the perfboard. The ends of the red wires are signal wires and they attach to the 4.7k ohm resistor (opposite the potentiometer connection). The black wire attaches to the ground rail on the perfboard.

The perfboard and wire solder joint needs some sort of strain relief so you don’t pull the wires out accidentally. A well-placed drop of hot glue on each of the three wire-to-board junctions does the trick. Hot glue is such great stuff!

At this point, the electronics and hardware portion of the project is complete. However, you might want to add an enclosure and some nobs to the potentiometer.

Install Software

Download and install the software from http://www.zeitnitz.de/Christian/scope_en. To install, simply double-click on the .exe file and follow the dialog box prompts.

Note: Sadly, the Sound Card O-Scope software is only available for Windows machines; in all my searches I was unable to find a Mac version. (Perhaps I should write one for my Mac and send it out!)

Software Use — 60Hz Comparison

The features in the software are surprisingly robust. Not only does it provide support for two-channel (if available from your hardware) input, but also FFT measurement, cursors, X-Y plots, and a signal generator!

Note: Image one shows the output of a non-DIY bench o-scope, whereas image two and three show the output of the Sound Card O-Scope.

Both the bench o-scope and the Sound Card O-Scope can easily handle a 60Hz sine wave. Cursors are available for both time and voltage measurements. However, since voltage is not calibrated to your resistor divider, it will not be an indication to how much voltage is actually on your circuit. The software does provide a calibration point for this if you want to input it.

Look closely at the third image and you will see that the sine wave peaks are flattening out a bit. This occurs when you turn the potentiometer up too much and the diodes start conducting. It’s typically called waveform clipping. If you notice waveform clipping, simply dial back the potentiometer until the waveform is corrected i.e. peaks of the sine wave are not flattening out.

Software Use — 1kHz Comparison

At 1kHz the Sound Card O-Scope still works well.

Note: The Sound Card O-Scope even displays what frequency it measures, which is handy for verification.

Software Use — 10kHz Comparison

However, at 10kHz, the Sound Card O-Scope approaches its limits. Notice how the signal is jagged with angular sloping — it’s a good sign of a sampling issue.

O-scopes are limited by two main specifications:



Bandwidth, or how wide a frequency range they can measure effectively. The lab-grade scope in this case has a 200MHz bandwidth, meaning it can measure from 0 to 200MHz very well. The bandwidth of the sound card is much lower: about 20 – 15kHz. Anywhere out of this range and measurements get sloppy.



Sample Rate The lab model here has a sample rate of 2GS/s! The sound card in your computer is only around 44kS/s. So, you see why faster waveforms may not be captured as well. In essence, the sample rate is how often the system measures the voltage. So, a lab model can measure up to 2 billion times per second while the sound card model does it 44 thousand times.

You may think this really negates the use of this DIY tool. Not so! In many hobbyist circuits 14kS/s is more than fast enough to measure your pulse widths and frequencies. As your circuits get faster and faster, you can worry about buying a lab model.

Software — Square Wave and FFT

For a lot of hobbyist projects, like the servo motor mentioned already, you are going to be measuring square waves. Not to worry, this software does very well at that with minimal degradation of signal at lower (<10kHz) speeds.

In addition, the software has other features that are really helpful — some I already mentioned. A particular favorite of mine is the FFT function, because that's something I use often.

Overall this project will give you a great tool for use in your electronics work. As a beginning o-scope it has some great features and can help your work out immensely! All with a price that won't kill your tool budget for months to come.