# Evaluating Oscilloscopes (Part 2)

This is Part 2 of my mini-series on selecting an oscilloscope. Rather than a completely thorough guide, it’s more a “collection of notes” based on my own research. But I hope you find it useful, and it might cover a few areas you hadn’t considered.

Last week I mentioned the differences between PC-based and stand-alone oscilloscopes and discussed the physical probe’s characteristics. This week I’ll be discussing the “core” specifications: analog bandwidth, sample rate, and analog-to-digital converter (ADC) resolution.

Topic 1: Analog Bandwidth
Many useful articles online discuss the analog oscilloscope bandwidth, so I won’t dedicate too much time to it. Briefly, the analog bandwidth is typically measured as the “half-power” or -3 dB point, as shown in Figure 1. Half the power means 1/√2 of the voltage. Assume you put a 10-MHz, 1-V sine wave into your 100-MHz bandwidth oscilloscope. You expect to see a 1-V sine wave on the oscilloscope. As you increase the frequency of the sine wave, you would instead expect to see around 0.707 V when you pass a 100-MHz sine wave. If you want to see this in action, watch my video in which I sweep the input frequency to an oscilloscope through the -3 dB point.

Figure 1: The bandwidth refers to the “half-power” or -3 dB point. If we drive a sine wave of constant amplitude and increasing frequency into the probe, the -3 dB point would be when the amplitude measured in the scope is 0.707 times the initial amplitude.

Unfortunately, you are likely to be measuring square waves (e.g., in digital systems) and not sine waves. Square waves contain high-frequency components well beyond the fundamental frequency of the wave. For this reason the “rule of thumb”  is to select an oscilloscope with five times the analog bandwidth of the highest–frequency digital signal you would be measuring. Thus, a 66-MHz clock would require a 330-MHz bandwidth oscilloscope.

If you are interested in more details about bandwidth selection, I encourage you to see one of the many excellent guides. Adafruit has a blog post “Why Oscilloscope Bandwidth Matters” that offers more information, along with links to guides from Agilent Technologies and Tektronix.

If you want to play around yourself, I’ve got a Python script that applies analog filtering to a square wave and plots the results, available here. Figure 2 shows an example of a 50-MHz square wave with 50-MHz, 100-MHz, 250-MHz, and 500-MHz analog bandwidth.

Figure 2: This shows sampling a 50-MHz square wave with 50, 100, 250, and 500 MHz of analog bandwidth.

Topic 2: Sample Rate
Beyond the analog bandwidth, oscilloscopes also prominently advertise the sample rate. Typically, this is in MS/s (megasamples per second) or GS/s (gigasamples per second). The advertised rate is nearly always the maximum if using a single channel. If you are using both channels on a two-channel oscilloscope that advertises 1 GS/s, typically the maximum rate is actually 500 MS/s for both channels.

So what rate do you need? If you are familiar with the Nyquist criterion, you might simply think you should have a sample rate two times the analog bandwidth. Unfortunately, we tend to work in the time domain (e.g., looking at the oscilloscope screen) and not the frequency domain. So you can’t simply apply that idea. Instead, it’s useful to have a considerably higher sample rate compared to analog bandwidth, say, a five times higher sample rate. To illustrate why, see Figure 3. It shows a 25.3-MHz square wave, which I’ve sampled with an oscilloscope with 50-MHz analog bandwidth. As you would expect, the signal rounds off considerably. However, if I only sample it at 100 MS/s, at first sight the signal is almost unrecognizable! Compare that with the 500 MS/s sample rate, which more clearly looks like a square wave (but rounded off due to analog bandwidth limitation).

Again, these figures both come from my Python script, so they are based purely on “theoretical” limits of sample rate. You can play around with sample rate and bandwidth to get an idea of how a signal might look.

Figure 3: This shows sampling a 25.3-MHz square wave at 100 MS/s results in a signal that looks considerably different than you might expect! Sampling at 500 MS/s results in a much more “proper” looking wave.

Topic 3: Equivalent Time Sampling
Certain oscilloscopes have an equivalent time sampling (ETS) mode, which advertises an insanely fast sample rate. For example, the PicoScope 6000 series, which has a 5 GS/s sample rate, can use ETS mode and achieve 200 GS/s on a single channel, or 50 GS/s on all channels.

The caveat is that this high sample rate is achieved by doing careful phase shifts of the A/D sampling clock to sample “in between” the regular intervals. This requires your input waveform be periodic and very stable, since the waveform will actually be “built up” over a longer time interval.

So what does this mean to you? Luckily, many actual waveforms are periodic, and you might find ETS mode very useful. For example, if you want to measure the phase shift in two clocks through a field-programmable gate array (FPGA), you can do this with ETS. At 50 GS/s, you would have 20 ps resolution on the measurement! In fact, that resolution is so high you could measure the phase difference due to a few centimeters difference in PCB trace.

To demonstrate this, I can show you a few videos. To start with, the simple video below shows moving the probes around while looking at the phase difference.

A more practical demonstration, available in the following video, measures the phase shift of two paths routed through an FPGA.

Finally, if you just want to see a sine wave using ETS you can check out the bandwdith demonstration  I referred to earlier in the this article. The video (see below) includes a portion using ETS mode.

A less prominently advertised feature of certain oscilloscopes is the ADC bit resolution in the front end. Briefly, the ADC resolution tells you how the analog waveform will get mapped to the digital domain. If you have an 8-bit ADC, this means you have 28 = 256 possible numbers the digital waveform can represent. Say you have a ±5 V range on the oscilloscope—a total span of 10 V. This means the ADC can resolve 10 V / 256 = 39.06 mV difference on the input voltage.

This should tell you one fact about digital oscilloscopes: You should always use the smallest possible range to get the finest granularity. That same 8-bit ADC on a ±1 V range would resolve 7.813 mV. However, what often happens is your signal contains multiple components—say, spiking to 7 V during a load switch, and then settling to 0.5 V. This precludes you from using the smaller range on the input, since you want to capture the amplitude of that 7-V spike.

If, however, you had a 12-bit ADC, that 10 V span (+5 V to -5 V) would be split into 212 = 4,096 numbers, meaning the resolution is now 2.551 mV.  If you had a 16-bit ADC, that 10-V range would give you 216 = 65,536 numbers, meaning you could resolve down to 0.1526 mV. Most of the time, you have to choose between a faster ADC with lower (typically 8-bit) resolution or a slower ADC with higher resolution. The only exception to this I’m aware of is the Pico Technology FlexRes 5000 series devices, which allow you to dynamically switch between 8/12/14/15/16 bits with varying changes to the number of channels and sample rate.

While the typical ADC resolution seems to be 8 bits for most scopes, there are higher-resolution models too. As mentioned, these devices are permanently in high-resolution mode, so you have to decide at purchasing time if you want a very high sample rate, or a very high resolution. For example, Cleverscope has always advertised higher resolutions, and their devices are available in 10, 12, or 14 bits. Cleverscope seems to sell the “digitizer” board separately, giving you some flexibility in upgrading to a higher-resolution ADC. TiePie engineering has devices available from 8–14 bits with various sample rate options. Besides the FlexRes device I mentioned, Pico Technology offers some fixed resolution devices in higher 14-bit resolution. Some of the larger manufacturers also have higher-resolution devices, for example Teledyne LeCroy has its High Resolution Oscilloscope (HRO), which is a fixed 12-bit device.

Note that many devices will advertise either an “effective” or “software enhanced” bit resolution higher than the actual ADC resolution. Be careful with this: software enhancement is done via filtering, and you need to be aware of the possible resulting changes to your measurement bandwidth. Two resources with more details on this mode include the ECN magazine article “How To Get More than 8 Bits from Your 8-bit Scope” and the Teledyne LeCroy application note “Enhanced Resolution.” Remember that a 12-bit, 100-MHz bandwidth oscilloscope is not the same as an 8-bit, 100-MHz bandwidth oscilloscope with resolution enhancement!

Using the oscilloscope’s fast Fourier transform (FFT) mode (normally advertised as the spectrum analyzer mode), we can see the difference a higher-resolution ADC makes. When looking at a waveform on the screen, you may think that you don’t care at all about 14-bit accuracy or something similar. However, if you plan to do measurements such as total harmonic distortion (THD), or otherwise need accurate information about frequency components, having high resolution may be extremely important to achieve a reasonable dynamic range.

As a theoretical example I’m using my script mentioned earlier, which will digitize a perfect sine wave and then display the frequency spectrum. The number of bits in the ADC (e.g., quantization) is adjustable, so the harmonic component is solely due to quantization error. This is shown in Figure 4. If you want to see a version of this using a real instrument, I conduct a similar demonstration in this video.

Certain applications may find the higher bit resolution a necessity. For example, if you are working in high-fidelity audio applications, you won’t be too worried about an extremely high sample rate, but you will need the high resolution.

Figure 4: In the frequency domain, the effect of limited quantization bits is much more apparent. Here a 10-MHz pure sine wave frequency spectrum is taken using a different number of bits during the quantization process. (CLICK TO ZOOM)

Coming Up
This week I’ve taken a look at some of the core specifications. I hope the questions to ask when purchasing an oscilloscope are becoming clearer! Next week, I’ll be looking at the software running the oscilloscope, and details such as remote control, FFT features, digital decoding, and buffer types. The fourth and final week will delve into a few remaining features such as external trigger and clock synchronization and will summarize all the material I’ve covered in this series.

Author’s note: Every reasonable effort has been made to ensure example specifications are accurate. There may, however, be errors or omissions in this article. Please confirm all referenced specifications with the device vendor.

# Configurable Regulator

The LTM4644 quad output step-down µModule (micromodule) regulator is configurable as a single (16-A), dual (12-A, 4-A, or 8-A, 8-A), triple (8-A, 4-A, 4-A), or quad (4-A each) output regulator. This flexibility enables system designers to rely on one simple and compact µModule regulator for the various voltage and load current requirements of FPGAs, ASICs, and microprocessors as well as other board circuitry. The LTM4644 is ideal for communications, data storage, industrial, transportation, and medical system applications.

The LTM4644 regulator includes DC/DC controllers, power switches, inductors and compensation components. Only eight external ceramic capacitors (1206 or smaller case sizes) and four feedback resistors (0603 case size) are required to regulate four independently adjustable outputs from 0.6 to 5.5 V. Separate input pins enable the four channels to be powered from a common supply rail or different rails from 4 to 14 V.

At an ambient temperature of 55°C, the LTM4644 delivers up to 13 A at 1.5 V from a 12-V input or up to 14 A with 200-LFM airflow. The four channels operate at 90° out-of-phase to minimize input ripple whether at the 1-MHz default switching frequency or synchronized to an external clock between 700 kHz and 1.3 MHz. With the addition of an external bias supply above 4 V, the LTM4644 can regulate from an input supply voltage as low as 2.375 V. The regulator also includes output overvoltage and overcurrent fault protection.

The LTM4644 costs \$22.85 each in 1,000-unit quantities.

Linear Technology Corp.
www.linear.com

# Q&A: Hacker, Roboticist, and Website Host

Dean “Dino” Segovis is a self-taught hardware hacker and maker from Pinehurst, NC. In 2011, he developed the Hack A Week website, where he challenges himself to create and post weekly DIY projects. Dino and I recently talked about some of his favorite projects and products. —Nan Price, Associate Editor

NAN: You have been posting a weekly project on your website, Hack A Week, for almost three years. Why did you decide to create the website?

Dean “Dino” Segovis at his workbench

DINO: One day on the Hack A Day website I saw a post that caught my attention. It was seeking a person to fill a potential position as a weekly project builder and video blogger. It was offering a salary of \$35,000 a year, which was pretty slim considering you had to live in Santa Monica, CA. I thought, “I could do that, but not for \$35,000 a year.”

That day I decided I was going to challenge myself to come up with a project and video each week and see if I could do it for at least one year. I came up with a simple domain name, www.hackaweek.com, bought it, and put up a website within 24 h.

My first project was a 555 timer-based project that I posted on April 1, 2011, on my YouTube channel, “Hack A Week TV.” I made it through the first year and just kept going. I currently have more than 3.2 million video views and more than 19,000 subscribers from all over the world.

NAN: Hack A Week features quite a few robotics projects. How are the robots built? Do you have a favorite?

Dino’s very first toy robot hack was the Rumble robot. The robot featured an Arduino that sent PWM to the on-board H-bridge in the toy to control the motors for tank steering. A single PING))) sensor helped with navigation.

The Rumble robot

DINO: I usually use an Arduino as the robot’s controller and Roomba gear motors for locomotion. I have built a few others based on existing wheeled motorized toys and I’ve made a few with the Parallax Propeller chip.

My “go-to” sensor is usually the Parallax PING))) ultrasonic sensor. It’s easy to connect and work with and the code is straightforward. I also use bump sensors, which are just simple contact switches, because they mimic the way some insects navigate.

Nature is a great designer and much can be learned from observing it. I like to keep my engineering simple because it’s robust and easy to repair. The more you complicate a design, the more it can do. But it also becomes more likely that something will fail. Failure is not a bad thing if it leads to a better design that overcomes the failure. Good design is a balance of these things. This is why I leave my failures and mistakes in my videos to show how I arrive at the end result through some trial and error.

My favorite robot would be “Photon: The Video and Photo Robot” that I built for the 2013 North Carolina Maker Faire. It’s my masterpiece robot…so far.

NAN: Tell us a little more about Photon. Did you encounter any challenges while developing the robot?

Photon awaits with cameras rolling, ready to go forth and record images.

DINO: The idea for Photon first came to me in February 2013. I had been playing with the Emic 2 text-to-speech module from Parallax and I thought it would be fun to use it to give a robot speech capability. From there the idea grew to include cameras that would record and stream to the Internet what the robot saw and then give the robot the ability to navigate through the crowd at Maker Faire.

I got a late start on the project and ended up burning the midnight oil to get it finished in time. One of the bigger challenges was in designing a motorized base that would reliably move Photon across a cement floor.

The problem was in dealing with elevation changes on the floor covering. What if Photon encountered a rug or an extension cord?

I wanted to drive it with two gear motors salvaged from a Roomba 4000 vacuum robot to enable tank-style steering. A large round base with a caster at the front and rear worked well, but it would only enable a small change in surface elevation. I ended up using that design and made sure that it stayed away from anything that might get it in trouble.

The next challenge was giving Photon some sensors so it could navigate and stay away from obstacles. I used one PING))) sensor mounted on its head and turned the entire torso into a four-zone bump sensor, as was a ring around the base. The ring pushed on a series of 42 momentary contact switches connected together in four zones. All these sensors were connected to an Arduino running some simple code that turned Photon away from obstacles it encountered. Power was supplied by a motorcycle battery mounted on the base inside the torso.

The head held two video cameras, two smartphones in camera mode, and one GoPro camera. One video camera and the GoPro were recording in HD; the other video camera was recording in time-lapse mode. The two smartphones streamed live video, one via 4G to a Ustream channel and the other via Wi-Fi. The Ustream worked great, but the Wi-Fi failed due to interference.

Photon’s voice came from the Emic 2 connected to another Arduino sending it lines of text to speak. The audio was amplified by a small 0.5-W LM386 amplifier driving a 4” speaker. An array of blue LEDs mounted on the head illuminated with the brightness modulated by the audio signal when Photon spoke. The speech was just a lot of lines of text running in a timed loop.

Photon’s brain includes two Arduinos and an LM386 0.5-W audio amplifier with a sound-to-voltage circuit added to drive the mouth LED array. Photon’s voice comes from a Parallax Emic 2 text-to-speech module.

Connecting all of these things together was very challenging. Each component needed a regulated power supply, which I built using LM317T voltage regulators. The entire current draw with motors running was about 1.5 A. The battery lasted about 1.5 h before needing a recharge. I had an extra battery so I could just swap them out during the quick charge cycle and keep downtime to a minimum.

I finished the robot around 11:00 PM the night before the event. It was a hit! The videos Photon recorded are fascinating to watch. The look of wonder on people’s faces, the kids jumping up to see themselves in the monitors, the smiles, and the interaction are all very interesting.

NAN: Many of your Hack A Week projects include Parallax products. Why Parallax?

DINO: Parallax is a great electronics company that caters to the DIY hobbyist. It has a large knowledge base on its website as well as a great forum with lots of people willing to help and share their projects.

About a year ago Parallax approached me with an offer to supply me with a product in exchange for featuring it in my video projects on Hack A Week. Since I already used and liked the product, it was a perfect offer. I’ll be posting more Parallax-based projects throughout the year and showcasing a few of them on the ELEV-8 quadcopter as a test platform.

NAN: Let’s change topics. You built an Electronic Fuel Injector Tester, which is featured on HomemadeTools.net. Can you explain how the 555 timer chips are used in the tester?

DINO: 555 timers are great! They can be used in so many projects in so many ways. They’re easy to understand and use and require only a minimum of external components to operate and configure.

The 555 can run in two basic modes: monostable and astable.

Dino keeps this fuel injector tester in his tool box at work. He’s a European auto technician by day.

An astable circuit produces a square wave. This is a digital waveform with sharp transitions between low (0 V) and high (+ V). The durations of the low and high states may be different. The circuit is called astable because it is not stable in any state: the output is continually changing between “low” and “high.”

A monostable circuit produces a single output pulse when triggered. It is called a monostable because it is stable in just one state: “output low.” The “output high” state is temporary.

The injector tester, which is a monostable circuit, is triggered by pressing the momentary contact switch. The single-output pulse turns on an astable circuit that outputs a square-wave pulse train that is routed to an N-channel MOSFET. The MOSFET turns on and off and outputs 12 V to the injector. A flyback diode protects the MOSFET from the electrical pulse that comes from the injector coil when the power is turned off and the field collapses. It’s a simple circuit that can drive any injector up to 5 A.

This is a homebrew PCB for Dino’s fuel injector tester. Two 555s drive a MOSFET that switches the injector.

NAN: You’ve been “DIYing” for quite some time. How and when did your interest begin?

DINO: It all started in 1973 when I was 13 years old. I used to watch a TV show on PBS called ZOOM, which was produced by WGBH in Boston. Each week they had a DIY project they called a “Zoom-Do,” and one week the project was a crystal radio. I ordered the Zoom-Do instruction card and set out to build one. I got everything put together but it didn’t work! I checked and rechecked everything, but it just wouldn’t work.

I later realized why. The instructions said to use a “cat’s whisker,” which I later found out was a thin piece of wire. I used a real cat’s whisker clipped from my cat! Anyway, that project sparked something inside me (pun intended). I was hooked! I started going house to house asking people if they had any broken or unwanted radios and or TVs I could have so I could learn about electronics and I got tons of free stuff to mess with.

My mom and dad were pretty cool about letting me experiment with it all. I was taking apart TV sets, radios, and tape recorders in my room and actually fixing a few of them. I was in love with electronics. I had an intuition for understanding it. I eventually found some ham radio guys who were great mentors and I learned a lot of good basic electronics from them.

NAN: Is there a particular electronics engineer, programmer, or designer who has inspired the work you do today?

DINO: Forrest Mims was a great inspiration in my early 20s. I got a big boost from his “Engineer’s Notebooks.” The simple way he explained things and his use of graph paper to draw circuit designs really made learning about electronics easy and fun. I still use graph paper to draw my schematics during the design phase and for planning when building a prototype on perf board. I’m not interested in any of the software schematic programs because most of my projects are simple and easy to draw. I like my pencil-and-paper approach.

NAN: What was the last electronics-design related product you purchased and what type of project did you use it with?

DINO: An Arduino Uno. I used two of these in the Photon robot.

NAN: What new technologies excite you and why?

DINO: Organic light-emitting diodes (OLEDs). They’ll totally change the way we manufacture and use digital displays.

I envision a day when you can go buy your big-screen TV that you’ll bring home in a cardboard tube, unroll it, and place it on the wall. The processor and power supply will reside on the floor, out of the way, and a single cable will go to the panel. The power consumption will be a fraction of today’s LCD or plasma displays and they’ll be featherweight by comparison. They’ll be used to display advertising on curved surfaces anywhere you like. Cell phone displays will be curved and flexible.

How about a panoramic set of virtual reality goggles or a curved display in a flight simulator? Once the technology gets out of the “early adopter” phase, prices will come down and you’ll own that huge TV for a fraction of what you pay now. One day we might even go to a movie and view it on a super-huge OLED panorama screen.

NAN: Final question. If you had a full year and a good budget to work on any design project you wanted, what would you build?

DINO: There’s a project I’ve wanted to build for some time now: A flight simulator based on the one used in Google Earth. I would use a PC to run the simulator and build a full-on seat-inside enclosure with all the controls you would have in a jet airplane. There are a lot of keyboard shortcuts for a Google flight simulator that could be triggered by switches connected to various controls (e.g., rudder pedals, flaps, landing gear, trim tabs, throttle, etc.). I would use the Arduino Leonardo as the controller for the peripheral switches because it can emulate a USB keyboard. Just program it, plug it into a USB port along with a joystick, build a multi-panel display (or use that OLED display I dream of), and go fly!

Google Earth’s flight simulator also lets you fly over the surface of Mars! Not only would this be fun to build and fly, it would also be a great educational tool. It’s definitely on the Hack A Week project list!

Editor’s Note: This article also appears in the Circuit Cellar’s upcoming March issue, which focuses on robotics. The March issue will soon be available for membership download or single-issue purchase.

# Basic Goertzel (EE Tip #120)

The basic Goertzel transform, which has been around since 1958, was derived from the discrete Fourier transform (DFT). It’s an extremely efficient method of detecting a single frequency component in a block of input data. Figure 1 depicts the signal flow for the basic Goertzel algorithm as each sample is processed.

Figure 1: The signal flow of the basic Goertzel transform produces an output (y0) for each sample processed. The output is a combination of the current ADC sample added to the product of the previous output (y1) multiplied by a constant minus the previous output (y2). After a block of samples has been processed, the sum of the squares of y1 and y2 are computed to determine the relative amplitude of a particular frequency.

Figure 1 may be written as Equation 1. y0 is the current processed output. x0 is the current ADC sample. y1 is the previously processed output, and y2 is the next previously processed output. m is the frequency domain bin number. N is the sample block size. Input samples are processed on a sample-by-sample basis. Processing continues over a block of input data of the length N. After a block of data has been processed, magnitude and phase information for the signal of interest is contained in the y1 and y2 variables.

Equations 1 – 4

One of the advantages of the Goertzel transform is that the magnitude (and phase) computation needs to be performed only at the end of a block of data. After a block of data has passed through Equation 1, the relative magnitude may be determined by computing the sum of the squares of the real and imaginary components.

The real component (RC) is described as Equation 2. The imaginary component is calculated with Equation 3. The squared magnitude is computed with Equation 4.

For tone detection only, phase information may be ignored. It’s sufficient to compute the square of the magnitude to determine the relative power of a signal.—Eric Kiser, “Digital Decoding Simplified,” Circuit Cellar 182, 2005. The issue is available in the CC Webshop.

# An Organized Space for Programming, Writing, and Soldering

Photo 1—This is Anderson’s desk when he is not working on any project. “I store all my ‘gear’ in a big plastic bin with several smaller bins inside, which keeps the mess down. I have a few other smaller storage bins as well hidden here and there,” Anderson explained.

Photo 2—Here is Anderson’s area set up for soldering and running his oscilloscope. “I use a soldering mat to protect my desk surface,” he says. “The biggest issue I have is the power cords from different things getting in my way.”

Al Anderson’s den is the location for a variety of ongoing projects—from programming to writing to soldering. He uses several plastic bins to keep his equipment neatly organized.

Anderson is the IT Director for Salish Kootenai College, a small tribal college based in Pablo, MT. He described some of his workspace features via e-mail:

I work on many different projects. Lately I have been doing more programming. I am getting ready to write a book on the Xojo development system.

Another project I have in the works is using a Raspberry Pi to control my hot tub. The hot tub is about 20 years old, and I want to have better control over what it is doing. Plus I want it to have several features. One feature is a wireless interface that would be accessible from inside the house. The other is a web control of the hot tub so I can turn it on when we are still driving back from skiing to soak my tired old bones.

I am also working on a home yard sprinkler system. I laid some of the pipe last fall and have been working on and off with the controller. This spring I will put in the sprinkler heads and rest of the pipe. I tend to like working with small controllers (e.g., the Raspberry Pi, BeagleBoard’s BeagleBone, and Arduino) and I have a lot of those boards in various states.

Anderson’s article about a Raspberry Pi-based monitoring device will appear in Circuit Cellar’s April issue. You can follow him on Twitter at @skcalanderson.