Learn

Measure it: reading a circuit with the scope and plotter

Sign up freeor see every lesson
  • 192parts on the bench
  • 25boards running now
  • 1.00xreal time, on every board
555 on the benchlive0.000 s 0.00x
Click to open it in the editor
A 555 astable with the scope, the generator and the meter on it. Press Run, then open the Scope tab along the bottom.

The circuit above is a 555 astable with all four instruments on it, and by the end of this page you will have read its frequency three different ways, watched its capacitor charge, seen its spectrum, and walked away with a table of readings you can paste straight into a write-up.

Clip a probe on and see a waveform stand still, because the trigger is doing its job. Drag two cursors across an edge and read the time between them. Print a number from a sketch and watch it draw itself. Every one of those is a real bench skill, and every one of them is three clicks away here, on a circuit nobody can break and nothing can shock.

Nothing here is a picture of an instrument. The scope is a part with two 1 megohm probes that are in the matrix with everything else, and the plotter reads the same serial lines the monitor prints. What you measure is what the engine solved.

Start with the trace, and make it stand still

Press Run. The scope's face fills with a trace, and under it a strip prints four numbers: peak to peak, true RMS, frequency and duty. If the waveform is crawling sideways, the trigger has not found an edge, and the corner of the screen will say so rather than pretending.

A trigger is one idea: do not draw a new screen from wherever the samples happen to be, draw it from the moment the signal crossed a chosen level going a chosen way. That is the whole of it, and it is why a repeating waveform looks nailed down instead of swimming. Open the Scope tab along the bottom of the editor and the six controls are there: source, slope, level, mode, hold-off, and a re-arm button when you are in single shot.

Leave the level on auto to start with. Auto means the middle of that channel's own swing, which is the right answer for almost everything. Clear the box and type a number and the level appears on the screen as a dashed line, which is the moment the control stops being a word and starts being a place. Normal mode keeps the last screen that really triggered instead of drawing something that did not happen, and Single catches one event and holds it: a reset pulse, the first edge after a button goes down.

Nine measurements, and what each of them is honest about

The Scope tab reads nine numbers off each channel, off the 256 samples that are on the screen and off nothing else. Peak to peak, the two peaks, the mean, the true RMS, the frequency, the period, the duty, and the 10 to 90 rise time.

The crossings are interpolated between samples, so the frequency does not step in units of the sample rate: on the 555 above it reads 484 Hz, which is the number the astable actually runs at rather than the nearest one the sampling could name. The duty reads 67 percent, which is the two thirds a 555 with these resistors gives you.

Two of them come with a warning printed under the table, and it is worth reading once. The mean and the RMS are over the whole screen, so they are the mean and the RMS of the waveform only when the trigger has put a whole number of cycles on that screen. That is a real oscilloscope's answer too. And a `--` in the table is not a zero: it means the screen does not hold that answer, which is the honest thing for a flat line with no frequency.

Cursors are the other half. Switch them on and four dashed lines appear, two across and two down. Drag them with the pointer and the readout gives you the time between the two time cursors, one over that time, and the volts between the two voltage cursors. Put them on the two edges of one pulse and you have measured a pulse width with your hands, which is the thing every scope lesson is really teaching.

XY, and the spectrum

Two more views sit beside the trace. XY puts channel 1 across and channel 2 up, and draws one against the other instead of either against time. It is the view for a Lissajous figure, for a transistor's transfer curve, and for anything where the shape of the relationship is the answer.

FFT is the spectrum of the window that is on the screen, in decibels against a logarithmic frequency axis, with the strongest peak marked. On the 555 it shows you something a trace cannot: the fundamental at 484 Hz and a row of harmonics above it, which is what a square wave is made of and is why a square wave through a filter comes out looking nothing like a square wave.

The line under the plot says the three things that make a spectrum readable, because a spectrum with no window and no resolution written beside it is a picture rather than a measurement. The window function is Hann. The resolution is one bin every one over the time base, so a 20 millisecond time base resolves 50 Hz and no finer, and widening the time base is how you sharpen it. And the transform is over 256 points, once, with no averaging at all.

Plot what the sketch prints

The Plot tab is the Arduino IDE's serial plotter, against Mokxi's own serial stream. Print a number and it draws a curve. Print several separated by spaces, commas or tabs and it draws several. Write `temp:23.4` and the curve gets a name in the legend instead of a number.

The graph auto-scales over whatever is switched on, so one reading that swings from 0 to 1023 cannot flatten the four beside it: click its key in the legend and it steps out of the picture and out of the scaling together. Pick a time window from one second to five minutes, pause the graph without pausing the board, and download the lot as CSV when you are done.

One choice is yours to make, and the button in the panel head makes it. Numbers anywhere picks the numbers out of a line that also has words in it, which is what makes the weather station's `reading 3: 23.4 C, 48 %RH` plot without a line of the sketch being changed. Whole line only is the Arduino IDE's stricter rule: the line plots only if every token on it is a number. The first is friendlier, the second never lets a stray number in, and the panel says which one is running.

Decode the bus, and keep the numbers

The logic analyzer is the instrument for the other question: not what shape is that signal, but in what order did those things happen. Clip its four probes on, set `decode` to `uart`, `i2c` or `spi`, and the bytes appear over the trace at the times they were sent. Open the desk clock example and watch a real transfer: a start, the address `0x68` with a write bit, a register pointer, a repeated start, and seven bytes of the time coming back, each with its acknowledge.

Switching decoder re-reads the capture that is already on the screen. Nothing runs again, because a decode is a reading of the edges rather than a change to them.

Then there is the part that turns all of this into homework you can submit. Beside every reading on the scope panel, beside every cursor difference, and beside every line of the operating point, there is a small pin. Press it and that reading lands in the Measurements tab with the words the instrument used, where it came from and the simulated time it was taken at. Name it, write a note beside it, and when the experiment is done press Copy markdown and paste the table into your write-up.

The notebook is saved with the project, so it travels with a share link, with an export and with a submission. A pinned reading is a copy rather than a live link: it does not change when the circuit does, which is exactly what a lab book is for. We cannot wait to see what you measure next!

Questions

Do I need to install anything to use the oscilloscope?

No. The scope is a part in the parts panel: drag it onto the canvas, clip CH1 and GND to your circuit, and press Run. Everything runs in the browser tab on your own machine, and nothing is sent to a server to simulate.

Why does my trace crawl across the screen?

The trigger has not found an edge, so the scope is free running and the corner of the screen says AUTO rather than TRIG. Check that the trigger source is the channel your signal is on, and that the slope matches the edge you want. On a signal with two edges a cycle, turn the hold-off up until it settles on one of them.

What is the resolution of the FFT?

One bin every one over the time base. A 20 millisecond time base gives 50 Hz bins, a 2 millisecond time base gives 500 Hz bins. The window is Hann, the transform is over the 256 samples on the screen, and nothing is averaged. The panel prints all three numbers under the plot.

Can I get the measurements out of the simulator?

Yes, three ways. The Measurements tab exports as CSV or copies as a markdown table, the serial plotter downloads every point as CSV, and the logic analyzer exports its whole capture as CSV.

Build this for real

Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.