Computing stuff tied to the physical world

Do I need an oscilloscope?

In Hardware on Apr 9, 2012 at 00:01

As I’ve mentioned before, an oscilloscope is a pretty nifty piece of test equipment. It can also be very expensive.

The following comment in my series on oscilloscopes is still a good summary of what it’s all about, IMO:

Oscilloscopes are the “printf” of the electronics world. Without a “scope” you can only predict and deduce what’s happening in a circuit, not actually verify (let alone “see”) it. Here’s what an oscilloscope does: on the vertical axis, you see what happens, on the horizontal axis you see when it happens. It’s a voltmeter plus time-machine.

That doesn’t mean you can’t get anything done in Physical Computing without one. A simple multimeter is a lot cheaper and will get you a long way in figuring out the electrical behavior of a circuit – not to mention finding shorts and connection mistakes. So the first thing to get is a multimeter, not a scope. Always.

The trouble is that ATmega’s are so friggin’ darn fast. We can’t observe events on their time scale, and more importantly: many problems will zoom past us and get lost before we have a chance to see anything!

So I’m going to revise my advice about oscilloscopes somewhat: if you solder together kits and basic components, then yeah, a multimeter is plenty. But if you hook up non-trivial chips and need to debug the combination of hardware and software, then you really need all the help you can get. Be it a logic analyzer for digital signals, buses, and pulse-trains, or a scope to investigate the electric behavior of a fast circuit.

Note that a logic analyzer can be a lot cheaper than a scope. The reason being that they are electrically much simpler – they just need to collect a bunch of digital logic levels (rapidly), whereas a scope needs to collect much richer signals (ranging from millivolts to hundreds of volts, and with all sorts of signal processing to make sure you’re seeing the real thing and not some artifact of the instrument itself).

If you’ve been following this weblog a bit, you’ll have seen quite a few scope screen shots in some of the posts. One of the most important uses for my scope here at JeeLabs is to figure out power consumption while trying to optimize a JeeNode’s ultra-low power mode. Power consumption is an analog thing, so that’s where a scope comes in. And when you look at the amount of detail a modern scope can show, it’s clear that this level of insight really comes from such an instrument. See the recent Watchdog tweaking and Room Node analysis for some examples.

Does that mean you have to shell out a few thousand dollars to do something similar? Not at all.

First of all, visualization isn’t everything. A couple of years ago, I used one JeeNode to measure the power consumption of another JeeNode, see the Power consumption tracker post, and the software for it. Less insight perhaps, and no geeky screen shots, but plenty of info to try and optimize the power consumption by trial-and-error. Just tweak your sketch and measure, over and over again.

Second point I’d like to make, is that such power measurements are fairly slow, so any scope will do. Even a 10 MHz model will be able to accurately display changes from one microsecond to the next.

There are a couple of ways to get such a “low-end” scope (don’t let that term fool you, any oscilloscope can be extremely useful as long as things don’t change too fast):

  • Look for a second-hand unit, lots of them can often be found on eBay.
  • Consider getting a USB-connected scope such as the DSO-2090.
  • For PC’s there is software to create a basic scope using the sound card.
  • Check out the ultra-tiny Xmegalab, its under $50 (plus shipping).

These last two options are lower cost, but more limited since they don’t really include a full “front-end” to handle a wide range of input voltages. For circuits with only a few volts, they may still be sufficient.

Normal “sweeping” analog scopes are ok, but storage scopes (analog or digital) are considerably better because you can “capture” an event and keep it on the screen to investigate. Such a feature will cost more though.

Here’s an example of how a €100 second-hand Tek 475 (analog & non-storage) scope can be used to measure that same power consumption as in the Watchdog tweaking post – it’s the same waveform:

DSC 3023

Two essential tricks were used: 1) the watchdog is firing at ≈ 60 Hz, so the scope trace fires constantly, and 2) it triggers on one pulse but displays the next one, using x10 horizontal magnification.

The above screen shows 2 mA and 200 µs per division. The vertical scale could have been zoomed in further, but for the horizontal scale I’m sort of at the limit unless I start using delayed sweeps. Here’s the whole unit:

DSC 3014

No storage, no screen capture, no USB, so this was done by darkening the room and holding a camera in front of the scope. It took a couple of tries, but hey – it is possible to estimate power consumption this way!

What I’m trying to say is that you too can do this sort of work with an investment of €100 to €150.

If you intend to do more with electronics (and let me assure you: this sort of fooling around is geek heaven, and addictive!) – then consider holding off just a bit longer if need be, and save up for a Rigol or Owon scope. These “DSO’s” are mature, have tons of useful features, and they can store lots of detail (that’s the “S” in DSO).

Is this a case of “if you have a hammer then everything starts looking like a nail”? All I know is that my insight in ultra-low power consumption and optimization has increased significantly since getting an oscilloscope.

  1. Hi

    What are your thoughts on these small hand (relatively cheap) DSO’s. http://www.seeedstudio.com/depot/dso-quad-4-channel-digital-storage-oscilloscope-p-736.html?cPath=174

  2. Somehow this post reminds me of the poor man’s oscilloscope project: http://accrochages.drone.ws/en/node/90 It’s not even near what a real scope can do, but it’s in the class of the “upgraded multimeter” and it uses hardware most of us already have so the costs of “getting one” are practically 0.

  3. A well-balanced analysis – you can get useful work done without, but when you finally invest the money, a good ‘scope opens up many more useful avenues to explore.

    Chapeau! The 475 was working overtime for that trace capture – a brighter trace is available by using the ‘A del B’ triggering and dialling in the delay until the event comes centre screen.

  4. A few weeks ago I tried the PC scope. http://www.zeitnitz.de/Christian/scope_en. two resistors for voltage deviding and an old laptop. I was surprised with the possibilities.

  5. I would recommend a Rigol http://www.batronix.com/versand/oszilloskope/Rigol-DS1052E.html

    http://www.batronix.com/versand/oszilloskope/Rigol-DS1102E.html

    Or for low price Xmegalab , or this. I have a DSO062 and both of the above Rigols , the DSO062 is handy if i need to look at a waweform somewhere , remote. And works quite ok , if you know it’s limitations.

    I would prob select the DSO096 if i were to get one today. Note they are DIY (But all SMD’s come presoldered)

    http://www.watterott.com/de/JYEtech?x2f390=859a824ba83ba534c00426b9e5ab2b68

    /Bingo

  6. Thanks for all the feedback.

    There are indeed several intermediate alternatives. I’ve used a DSO-2090 USB-connected unit for a while, as well as a Rigol (predecessor of the 1052). I’ve also used an older single-channel DSO Nano and an Xmegalab.

    Budget vs capabilities are a very tough call when it comes to oscilloscopes. In my experience (and opinion), there are roughly two ranges: €40..400 is about compromises, whereas €400..4000 is about features (and accuracy, and convenience).

    Bandwidth is a bit like CPU clock rates and a car’s maximum speed: yeah, more is better, but you can do without it, most of the time. This is the playing field of marketeers, knowing that we all want to compare “ours”.

    If I had to start all over again, and had to start out with a very limited budget for the scope, I’d probably first buy one in the €40..50 range, just to be able to see stuff which is too fast to detect any other way. Probably spend quite some time on coming up with tricks and circuits to stretch the usefulness of such a scope to the limit.

    The main drawback with the bottom-end category is that single-channel gives a lot less flexibility when chasing difficult issues. With two channels, you can trigger on one signal (or logic level) and view another one. While single-channel is definitely better than nothing, it does limit the range of situations you can investigate.

    In hindsight, I’d skip USB-connected scopes and go for a €300..500 standalone scope as next step, most likely a Rigol or Owon, since they are easily available and have deep storage memory. The reason being that a self-contained unit with knobs and display lets you focus on the problem iso the instrument and hookup.

    Above that, you get into the Hameg, Agilent, Tek range and they make you pay dearly. Wouldn’t go there before having a bunch of other instruments, i.e. a good lab power supply, precise multimeter, frequency generator, etc.

  7. Excellent article, as usual! Since diving back into electronics and microcontrollers a couple of years ago I’ve acquired a couple of scopes (an early ’80s vintage 5-channel 100MHz analog, a Rigol DS1052E, a USB-based scope, and a Saleae logic analyzer). I find the Saleae logic to be indispensable for the kind of work that I do, closely followed by the Rigol DSO. I’d be hard pressed to decide between the two if given a choice. IMHO the USB scopes are little more than toys; save your money and pick up a Rigol DSO instead. My beast of an analog scope is doing an excellent job of collecting dust at the moment – the Rigol is infinitely easier to (properly) configure.

  8. While a ‘scope is invaluable for analogue signals (instantaneous voltages particularly), I’d be very reticent to promote it as the ‘printf’ of /digital/ electronics. A logic analyser is vastly more useful on a day-to-day basis for looking at and decoding digital signals.

    Obviously the ideal is a combined MSO, but for the cash-conscious home user, I’d unreservedly recommend a multi-channel USB logic analyser such as http://www.seeedstudio.com/depot/open-workbench-logic-sniffer-p-612.html?cPath=174 The only (relatively minor) gripe is the lack of a ‘rolling’ mode – you have to trigger and grab.

    • Agreed, but for some reason I’ve not needed a logic analyzer very often so far. The Logic Sniffer is a great board (I’ve got one) at a very good price – but I vastly prefer knobs for control these days. The software was OK last time I looked, but it’s not so intuitive if you don’t use it a lot, and I missed the ability to trigger on serial patterns (a feature which, admittedly, would require hardware support). Nowadays, I’m spoiled with an MSO, but even that doesn’t make me use the logic analyzer section as much as I’d have expected.

      My hunch is that for many debug situations you can get away with just trying and fiddling a bit (and using a scope on one or two pins, occasionally) to get things working. The digital nature makes such problems an all-or-nothing issue as well, most of the time. For debugging tricky timing problems on an SPI bus, for example, a logic analyzer will probably be invaluable. And a lot more cost effective than an oscilloscope.

  9. I’m rapidly getting to the point where I am going to need something more than guesswork and a multimeter.

    Most of my problems are to do with IR comms modulated over a 38Khz carrier, I assume the Logic Sniffer is more suited to this than a scope is (even if it is infinity less sexy :) )

Comments are closed.