Contents
Part 1 · Signals and the screen 1. What an oscilloscope is for 2. Describing a signal 3. Reading the screen 4. Inside a digital oscilloscope Part 2 · From a voltage to numbers 5. Sampling: a scope takes snapshots 6. The ADC: turning a voltage into a number 7. The input: what your circuit sees 8. Too fast to sample: aliasing 9. Memory, record length and the time base Part 3 · A stable picture 10. The trigger: making the picture stand still Part 4 · From readings to a picture 11. More readings than points: decimation 12. Acquire modes 13. Equivalent-time sampling (ETS) 14. Drawing the picture Part 5 · Getting numbers 15. Automatic measurements 16. Cursors: measuring by hand 17. Maths channels: calculating with signals 18. The spectrum: signals as frequencies Part 6 · Signal sources and good habits 19. The built-in signal generator 20. Good habits and common mistakes 21. GlossaryOscilloscope fundamentals
The ideas behind every control of a digital oscilloscope: what it measures, how it turns a voltage into a picture, and where each of its limits comes from. Every idea is shown on this ESP32 Web Oscilloscope, most of them with real measurements from a test board. Version 1.11.2.
Who this page is for. Anyone who wants to understand what they see on a scope screen, including complete beginners. It assumes you know what a voltage is and roughly what a resistor and a capacitor do. Nothing else. Ideas come in order, and later chapters lean on earlier ones, so if you are new, read from the top. If you already know scopes, the contents on the left let you jump to any topic.
How this page fits with the others. This page explains why. The user guide says which button does what and how to wire things up. The technical reference has the exact formulas, algorithms, protocol and measured numbers. The verification guide is a set of experiments that check the scope on your own board. Each chapter here ends with links to the matching parts of those pages.
Following along
Every chapter can be tried on the scope. Two ways:
- Without hardware: open the scope, choose Source = Demo, and press Connect. The demo imitates an ESP32 measuring a small resistor–capacitor circuit driven by a square wave. It is good for the screen, the trigger, measurements and maths.
- With an ESP32 running the ESP32-DSO firmware (user guide, quick start) and one resistor:
GPIO25 → 1 kΩ → GPIO34. GPIO25 is the scope's own signal generator, GPIO34 is input channel 1 (CH1). This one wire is enough for most chapters. The safety rules in the user guide take two minutes to read: please read them before connecting anything else.
Figures whose caption begins Real data from the test board were measured for this page with this scope on one ESP32 (an ESP32-D0WD devkit, November 2026), using the wiring the caption gives; the others are calculated from the formulas they illustrate. Your board will give similar, not identical, numbers.
Boxes like this one suggest something to try:
Try it. Small experiments look like this. They take a minute or two.
and each chapter finishes with a short list of its key points, so you can check you have the important parts before moving on.
Units and prefixes used on this page
Scopes deal with tiny times and voltages, so you will see the metric prefixes everywhere. If they are new to you, this table is worth a minute: it is the same table you will use on every scope, meter and data sheet.
| Prefix | Means | Time example | Voltage / frequency example |
|---|---|---|---|
| M (mega) | × 1 000 000 | 1 MHz = one million cycles per second | |
| k (kilo) | × 1 000 | 250 kSa/s = 250 000 samples per second; 1 kΩ = 1 000 ohms | |
| m (milli) | ÷ 1 000 | 1 ms = a thousandth of a second | 500 mV = 0.5 V |
| µ (micro) | ÷ 1 000 000 | 1 µs = a millionth of a second | 100 µA = 0.0001 A |
| n (nano) | ÷ 1 000 000 000 | 1 ns = a billionth of a second (light travels 30 cm) | 100 nF = 0.1 µF |
| p (pico) | ÷ 1 000 000 000 000 | 14 pF = 0.000 000 000 014 F |
Two units appear constantly: Hz (hertz, "per second": how many times something happens each second) and Sa/s (samples per second: how many measurements the scope takes each second). A handy pair of facts: 1 kHz repeats every 1 ms, and 1 MHz repeats every 1 µs.
Part 1 · Signals and the screen
1. What an oscilloscope is for
Most people meet electronics measurement through a multimeter. Put its probes on a battery and it says "1.52 V". That single number is exactly what you want for a battery, because a battery's voltage does not change from one moment to the next.
Now put the same meter on a pin that is blinking an LED a thousand times per second. The LED is on half the time (3.3 V) and off the other half (0 V). The meter cannot follow that, so it shows something in between, perhaps "1.65 V", or a digit that keeps jumping. That number is not wrong, but it hides everything interesting: that the pin is switching at all, how often, how cleanly, whether it ever glitches. A voltage that changes over time is called a signal, and most of the voltages in a working circuit are signals, not steady levels.
An oscilloscope (scope for short) shows a signal as a graph of voltage against time. Time runs from left to right, voltage from bottom to top. The graph is drawn over and over, many times a second, so you see the signal "live", and it can freeze the picture so you can study it and measure it.
Three ways to think about what a scope does:
- A slow-motion camera for voltages. Things that happen in a millionth of a second are stretched across the screen so your eye can follow them.
- A graph plotter that never gets tired. It does what you could do with a meter, a stopwatch and graph paper, except that it takes hundreds of thousands of readings per second.
- A meter with a time axis. It still gives numbers (frequency, peak voltage, average, rise time), but each number comes with the picture it was measured from, so you can see whether it makes sense.
1.1 The questions a scope answers
Whatever the circuit, you usually come to a scope with one of a few questions:
- Is anything happening at all? Is the clock running, is the PWM pin switching, does the sensor respond?
- What shape is it? Is the square wave square, or are its corners rounded? Is the sine clean or distorted?
- How big? How high does it go, how low, what is the average?
- How fast, how often? What is the frequency, how long does an edge take, how long is a pulse?
- When, relative to what? Does the output change before or after the input? How long after a button press does the motor start?
- What else is there? Noise, ripple, a spike that comes once a second, a wobble you did not expect.
The chapters of this page follow from these questions. Part 1 is about describing signals and reading the screen. Part 2 is about how a digital scope turns a voltage into numbers and what that costs. Part 3 is about the trigger, which makes a picture stand still. Part 4 is about how readings become a picture. Part 5 is about getting numbers out: measurements, cursors, maths and the frequency spectrum. Part 6 covers the signal sources and good habits.
1.2 This scope in one paragraph
The ESP32 Web Oscilloscope uses an ESP32 microcontroller as the measuring part and your web browser as the screen. The ESP32's built-in analogue-to-digital converter (ADC) measures up to four input pins, up to 250 000 times per second in total on the test board, with 12-bit resolution, over a range of about 0.14 to 3.15 V. The browser draws the picture and does everything a bench scope's screen and computer do: triggering details, measurements, statistics, maths channels, a spectrum display. It is slower and less accurate than a bench instrument, and it has no protection circuitry, but every idea in this page works on it exactly as on a bench scope, and its limits are a good way to learn why bench scopes are built the way they are.
Key points
- A multimeter gives one number. A scope draws voltage against time.
- Most voltages in a working circuit change with time: they are signals.
- A scope answers "is it happening, what shape, how big, how fast, when, and what else".
Elsewhere: user guide, overview (what you need, the three ways to feed the scope) · reference, specifications.
2. Describing a signal
Before looking at how a scope works, it helps to have words for what it shows. Engineers describe signals with a small vocabulary that every scope, meter and data sheet uses. This chapter introduces it, slowly, with pictures. Every measurement the scope can make (chapter on measurements) is one of these words turned into a calculation.
2.1 Steady, changing, repeating
A voltage that does not change is called DC (direct current; the name comes from currents, but it is used for voltages too). A battery, the 3.3 V supply pin, the output of a voltage regulator: all DC, ideally. On a scope a DC voltage is a flat horizontal line.
A voltage that changes is called AC (alternating current) in the broad sense. Many signals are a mix: a DC level with something changing on top of it, like a 1.65 V bias with a small audio signal riding on it, or a 5 V supply with a little ripple. The DC part is often called the offset or DC level; the changing part is the AC part.
A signal that does the same thing over and over is periodic (or repetitive): a clock, a PWM output, the mains, a note held on a synthesiser. A signal that happens once is a single event (or transient): a button press, the power-up of a board, a spike when a motor starts. The difference matters a lot to a scope. A periodic signal can be measured again and again, and the scope can combine many measurements into one better picture (acquire modes, ETS). A single event must be caught the one time it happens (Single trigger mode).
2.2 Period and frequency
The period, written T, is the time one repetition takes: from a point on the wave to the same point one cycle later. The frequency, written f, is how many repetitions happen in one second. They are two ways of saying the same thing:
f = 1 / T T = 1 / fFrequency is measured in hertz (Hz): 1 Hz is once per second. Some pairs worth remembering:
| Period T | Frequency f | Example |
|---|---|---|
| 1 s | 1 Hz | a slowly blinking LED |
| 20 ms | 50 Hz | mains electricity in India and Europe |
| 1 ms | 1 kHz | a typical PWM or a test tone |
| 50 µs | 20 kHz | the top of human hearing |
| 1 µs | 1 MHz | the fastest square wave the generator makes |
| 4 µs | 250 kHz | the time between two readings of this scope (its sample rate is 250 kSa/s) |
A square wave repeats every 2.5 ms. Its frequency is 1 ÷ 0.0025 s = 400 Hz. Going the other way, a 400 Hz signal has a period of 1 ÷ 400 = 0.0025 s = 2.5 ms. With prefixes the arithmetic gets easier: 1 ÷ 2.5 ms = 0.4 kHz = 400 Hz (dividing by milli gives kilo).
2.3 How big: peak, peak-to-peak, amplitude
Several numbers describe the size of a signal, and it is easy to mix them up. Figure figure 2 shows them on a sine wave sitting on a DC level:
- Maximum and minimum: the highest and lowest voltage reached.
- Peak-to-peak (Pk-Pk, Vpp): maximum minus minimum. The total height of the wave on the screen. It is the easiest to read and the most common size figure in data sheets for AC signals.
- Amplitude (or peak, Vp): for a sine, how far it swings from its middle in one direction, which is half the peak-to-peak. For a square or pulse wave the scope uses amplitude to mean the height of the step between its two flat levels (Top − Base, explained in section 2.5).
- Mean (average, DC level): the middle level the signal spends its time around, more exactly the average of all its values over whole periods. For a symmetrical sine it is the centre line. A multimeter on DC volts shows the mean.
The ESP32 sine from the generator is a good real example: it is centred near 1.62 V (mean), swings ±0.8 V (amplitude 0.8 V), so it goes from about 0.82 V (minimum) to about 2.42 V (maximum), and its peak-to-peak is 1.6 V. On the test board the scope read 1.593 V peak-to-peak.
2.4 RMS: the "heating" size
One more size measure needs a little more explanation because it is everywhere: RMS, root mean square. The question it answers is: what DC voltage would deliver the same power into a resistor? A heater, a lamp or a loudspeaker does not care about the shape of the voltage, only about how much energy it gets. Power in a resistor is V² ÷ R, so the "equivalent DC" voltage is found by averaging V² over time and taking the square root:
RMS = √( average of v² ) "square every value, average them, take the root"For a sine wave the result is the amplitude divided by √2 (about 0.707). That is why mains electricity is called "230 V": that is its RMS value; its peaks actually reach about ±325 V. For a square wave that switches between +A and −A, the RMS is simply A, because v² is A² all the time.
When a signal has a DC level, two RMS values are useful. The plain RMS includes the DC level. AC RMS first subtracts the mean, so it measures only the changing part: the ripple on a supply, the noise on a signal, or the size of an audio signal riding on a bias. The two are related by RMS² = mean² + (AC RMS)². For the ESP32 sine above: mean 1.62 V, AC RMS 0.8 ÷ √2 = 0.57 V, RMS √(1.62² + 0.57²) = 1.72 V.
2.5 Square waves, pulses and duty cycle
Digital circuits produce signals that jump between two levels: a square wave if it spends equal time at each, a pulse wave or PWM signal if not. Their vocabulary is shown in figure figure 4:
- Top (high level) and Base (low level): the two flat levels the signal settles at. These are not the same as maximum and minimum: a real square wave often overshoots a little after each edge, or has a spike on it, and those make the maximum higher than the top.
- Amplitude (for these signals): Top − Base.
- Edges: the jumps. A rising edge goes from low to high, a falling edge from high to low.
- Rise time and fall time: how long an edge takes. Real edges are never instantaneous. They are measured from 10 % to 90 % of the way between Base and Top (and back for the fall), because the very beginning and end of an edge are hard to pin down.
- Pulse width: how long the signal stays high (+width) or low (−width), measured at the middle level.
- Duty cycle: the fraction of the period the signal is high, in per cent. A square wave is 50 %. A PWM output at 25 % is high a quarter of the time.
Duty cycle and mean are linked in a way that is extremely useful in practice. A signal that is at Vhigh for a fraction d of the time and at 0 V otherwise has a mean of exactly d × Vhigh. That is how PWM dims an LED or controls a motor: the load responds to the average. On the test board, the generator at 25 %, 50 % and 75 % duty, smoothed by a resistor and capacitor, measured 0.822, 1.652 and 2.482 V, against 0.825, 1.650 and 2.475 V expected from d × 3.30 V.
2.6 A gallery of common shapes
A handful of shapes cover most of what you will see in hobby electronics. Learning to recognise them, and what usually causes each, is half of using a scope.
| Shape | Where it comes from | What to look at |
|---|---|---|
| Square / PWM | Digital outputs, clocks, the scope's generator | Frequency, duty, levels, edges, ringing |
| Sine | Oscillators, mains, audio tones, the ESP32's DAC | Frequency, amplitude, distortion (flattened tops) |
| Triangle / sawtooth | A capacitor charged by a constant current; integrators; 555 timer capacitor (roughly) | Slopes (volts per second), peaks |
| RC curve ("shark fin") | A capacitor charging through a resistor from a square wave | The time constant τ = R × C (section on RC) |
| Ripple | A power supply's output: DC with a small wave on top | AC RMS or peak-to-peak of the ripple (use AC coupling) |
| Noise | Every real measurement; switching circuits nearby | Its size (AC RMS), whether it is random or has a pattern |
| Glitch / spike | Switching events, bad contacts, software bugs | When it happens, how often (Peak detect, persistence, Single) |
2.7 Noise
No real measurement is perfectly clean. Look closely at any flat line on any scope and it has a fine fuzz on it: noise. Some comes from the circuit you are measuring, some from the scope itself. On this scope the ADC's own noise is about 3 mV RMS: a perfectly steady 1.65 V reads as values scattered between about 1.64 and 1.66 V. Noise matters for three reasons:
- It sets the smallest detail you can see in a single reading.
- It makes single-sample measurements like maximum and minimum jump around (why Max jumps).
- Random noise can be reduced by averaging, which several of the scope's features do: Hi-Res, Average and the statistics.
Key points
- f = 1 / T. 1 kHz ↔ 1 ms, 1 MHz ↔ 1 µs.
- Peak-to-peak is the total height; amplitude is half of it for a sine, Top − Base for a square wave.
- Mean is what a DC meter shows. RMS is the "same heating" DC value; for a sine it is amplitude ÷ √2. AC RMS ignores the DC level.
- Rise time is measured from 10 % to 90 %. Duty cycle × high level = mean.
- Periodic signals can be measured many times; single events must be caught once.
Elsewhere: exact definitions of every measurement in reference §4.
3. Reading the screen
A scope screen is a graph with a grid. Reading it well is a skill of its own, and the grid is the key: it is your ruler for both time and voltage.
3.1 The grid and its two scales
The screen is divided into 10 divisions across and 8 divisions up. Nearly every scope ever made uses this layout. Each division is one square of the grid. Two settings say what a square is worth:
- Time per division (time/div, the horizontal scale, also called the time base). At 1 ms/div, one square across is 1 ms, and the whole screen shows 10 × 1 ms = 10 ms.
- Volts per division (volts/div, the vertical scale). Each channel has its own. At 500 mV/div, one square up is 0.5 V, and the 8 squares span 4 V.
A useful way to think of it: the signal exists independently of the screen, and the two scales are a window onto it. Changing time/div does not change the signal; it changes how much of it you see. A slower setting (more time per division) squeezes more periods in; a faster one stretches a single edge across the screen. Changing volts/div is like zooming a photo vertically.
3.2 The markers: where is 0 V, where is t = 0?
Two more things fix the window's position:
- Each channel's 0 V marker. A small coloured tag at the left edge marks where that channel's 0 V line is. You can drag it up or down to move the trace (this is the channel's vertical position). This lets you put several channels on one screen without overlapping, or move a signal that sits at 1.65 V down so that its wiggle is in the middle of the screen. The voltage of any point is always read relative to its own channel's 0 V marker, never relative to the bottom of the screen.
- The trigger point, a small triangle at the top, marks t = 0: the moment the scope "caught" the signal (the trigger is explained in chapter 10). Times to its left are before that moment (negative), times to its right are after it. By default t = 0 is the centre of the screen; the horizontal position setting moves it, so that you can see more of what happened before or after.
The trigger level marker at the right edge (◀T) shows the voltage the trigger is watching for. When the picture is triggered, the signal crosses that level exactly at t = 0.
3.3 Reading values off the grid
Everything you can measure with the automatic measurements, you can also read from the grid. It is worth practising, because it is how you check that an automatic number makes sense. The method is always the same: count divisions, multiply by the scale.
Period. From one rising edge to the next is 4 divisions across. At 200 µs/div that is 4 × 200 µs = 800 µs, so the frequency is 1 ÷ 800 µs = 1.25 kHz.
Peak-to-peak. The wave spans 5 divisions up. At 500 mV/div that is 5 × 0.5 V = 2.5 V.
Levels. The bottom of the wave is 1 division above the channel's 0 V marker: 0.5 V. The top is 6 divisions above it: 3.0 V.
Duty cycle. The high part lasts 1 division of the 4-division period: 25 %.
The small minor tick marks on the centre lines divide each square into 5, so you can read to about a fifth of a division: here 40 µs and 100 mV.
3.4 Choosing good settings
Some habits that every experienced scope user has:
- Two to five periods across the screen for a repeating signal. Fewer and the frequency measurement has too little to work with; many more and the details get too small to see.
- The signal four to six divisions tall. Big enough to see detail, with room to spare above and below so peaks are not cut off at the screen's edge.
- Zoom in on what interests you. To see an edge, use a fast time/div that stretches it across several divisions. To see a small ripple on a large DC level, switch the channel to AC coupling (it subtracts the average, section 3.6) and use a small volts/div.
- Press AUTO when lost. Autoset looks for a repeating signal and chooses time/div, volts/div and the trigger level for you. It is the scope's "show me something" button. Then adjust from there.
3.5 Zooming the screen does not add detail
One important difference between a digital scope and a photograph: the scope's settings decide what it measures, not just how it draws. When you change time/div, this scope changes its sample rate and the number of readings it takes (explained in chapter 9). So a faster time/div really does measure more finely in time, up to the ADC's limit of one reading every 4 µs.
Volts/div is different. The ADC always measures the full 0–3.3 V range with the same 4096 steps of about 0.8 mV (chapter on the ADC). Choosing 10 mV/div makes the trace taller on the screen, but it does not make each reading any more precise: at 10 mV/div you will simply see each 0.8 mV step and the noise much larger. Bench scopes have an amplifier in front of the ADC that really does increase the sensitivity at small volts/div settings; this scope does not. This is the reason for the advice in the user guide to keep small signals as large as possible at the pin.
3.6 DC and AC coupling
Each channel has a coupling setting. DC coupling shows the real voltage, DC level and all. AC coupling shows only the changing part: it removes the signal's average. On a bench scope this is done by a capacitor in series with the input; on this scope the browser subtracts the mean of the samples on screen, so the pin still sees, and the ADC still has to fit, the full voltage. Use AC coupling to look at a small ripple on a big DC level, or at an audio signal riding on a bias. The ripple can then be magnified with a small volts/div without the DC level pushing it off the screen.
Try it (Demo). Turn time/div with the mouse wheel over the screen and watch how many periods fit; the signal itself does not change. Count the divisions between two rising edges of CH2 and multiply by the time/div: you get the period. Compare with the automatic Frequency measurement under the screen. Then drag CH1's coloured 0 V tag up and down.
Key points
- 10 divisions across, 8 up. Time/div and volts/div say what one square is worth.
- Read voltages from the channel's own 0 V marker. t = 0 is the trigger point.
- Count divisions × scale = value. Aim for 2–5 periods across and 4–6 divisions tall.
- A smaller volts/div magnifies the picture but not the ADC's precision.
Elsewhere: every control on the screen, and the status bar, in the user guide §6; the order in which probe factor, coupling and other settings are applied in reference §2.
4. Inside a digital oscilloscope
To understand why a scope behaves the way it does, it helps to know its parts. They are the same in a 10 000-euro bench instrument and in this one; only their speed and quality differ.
4.1 Where the names come from
The first oscilloscopes were analogue. A beam of electrons in a glass tube (a cathode-ray tube, CRT) drew a glowing spot on a phosphor screen. A circuit swept the spot steadily from left to right, then snapped it back: the time base or sweep. The input voltage, amplified, pushed the spot up and down. So the spot drew voltage against time, live. To make a repeating signal stand still, each sweep had to start at the same point of the wave, so a circuit watched the signal and started the sweep when it crossed a chosen level: the trigger.
Modern scopes are digital (DSO, digital storage oscilloscope). Nothing sweeps any more, but the names stayed: time base, trigger, sweep, even the green colour of some screen themes. The big change is that a digital scope measures and stores the signal as numbers before drawing it. That brings huge advantages (freezing a picture, seeing what happened before the trigger, automatic measurements, maths) and some new pitfalls (sampling and aliasing, Part 2) that analogue scopes never had.
4.2 The parts of a digital scope
- Input and front end. The connection to your circuit. In a bench scope this is a probe and a carefully designed circuit: protection, an attenuator and amplifier that set the volts/div range, coupling, and a filter. This scope has almost none of that: the input is an ESP32 pin with a resistor you add yourself (chapter 7).
- ADC (analogue-to-digital converter). Measures the voltage and turns it into a number, again and again at a steady rate set by the sample clock (chapter 5 and chapter 6).
- Acquisition memory. Stores the readings. Its size, the record length, decides how long a stretch of signal can be kept at a given sample rate (chapter 9).
- Trigger. Watches the readings and decides which moment becomes t = 0 (chapter 10).
- Processing. Turns readings into what you see: averaging or peak detection (chapter 12), scaling to volts, maths, measurements.
- Display. Draws it (chapter 14).
4.3 How this scope splits the work
In this scope the parts are spread over two devices, joined by the USB cable:
- The ESP32 firmware does everything that has to be fast and exactly timed: it runs the ADC at a precise rate (using DMA, a hardware feature that moves readings into memory without the processor's help), stores the readings, checks every reading for the trigger, does peak detection and Hi-Res averaging, and then sends one finished capture.
- The browser does everything that needs a screen or maths: converting ADC numbers to volts with the board's own calibration table, placing t = 0 exactly between two readings, averaging captures, equivalent-time sampling, maths channels, measurements, statistics, cursors, the spectrum and the drawing.
- Each capture travels as one frame with a checksum (a CRC). A frame damaged on the way is thrown away rather than drawn wrongly. When you change a setting, the browser works out the best sample rate and number of readings and sends the new settings to the ESP32 as a short text command (CFG …), which you can watch in the log in the Data tab.
A bench scope does the same steps inside one box with faster chips. Thinking of it in these steps helps whenever something looks odd: is it the signal, the input, the sampling, the trigger, the processing, or the drawing?
4.4 What a bench scope has that this one lacks
Honesty about the limits is part of learning. Compared with an entry-level bench scope, this one has:
- No front end. No protection (more than 3.3 V or less than 0 V on a pin can damage the ESP32), no attenuator for big voltages (you build a resistor divider, user guide §5.3), no amplifier for small ones, no anti-alias filter (chapter 8).
- A slower ADC. 250 thousand readings per second on the test board, against hundreds of millions or billions on bench scopes. For repeating signals, equivalent-time sampling (chapter 13) recovers detail down to tens of nanoseconds.
- Less memory. 24 000 readings per capture against millions.
- A shared ground. Like most bench scopes, every input is measured against the ESP32's ground, which is connected through USB to your computer. Never connect the ground to anything that is not at the same potential as your circuit's ground.
None of that changes the ideas. Everything on this page applies to every digital scope; the numbers just get bigger.
Key points
- Input → ADC → memory → trigger → processing → display: the same chain in every digital scope.
- Here the ESP32 measures, stores and triggers; the browser converts, computes and draws.
- "Time base" and "trigger" are names from analogue scopes that drew with an electron beam.
Elsewhere: the processing steps in exact order in reference §2; the firmware in reference §7; the data format on the USB cable in reference §10.
Part 2 · From a voltage to numbers
5. Sampling: a scope takes snapshots
A real voltage changes smoothly and continuously. A digital scope cannot watch it continuously. Instead it measures it at regular instants, stores each measurement as a number, and draws the numbers. Each measurement is called a sample (this page also says reading; it means the same). Taking samples is called sampling.
5.1 Like the frames of a film
A film camera does exactly the same thing with pictures. It does not record motion; it records still frames, 24 per second, and your brain fills in the motion between them. That works well as long as nothing important happens between two frames. A hummingbird's wings, which beat 50 times per second, come out as a blur or, worse, seem to hover still. A scope has the same weakness, and most of Part 2 is about it.
Two numbers describe sampling:
- The sample rate fs: how many samples per second. Written Sa/s (samples per second), usually with a prefix: 250 kSa/s is 250 000 samples per second.
- The sample interval Δt: the time between two samples. It is simply 1 ÷ sample rate. At 250 kSa/s, Δt = 1 ÷ 250 000 = 4 µs.
The scope shows the current sample rate in the status bar above the screen (Sa), next to the number of points on the screen (Pts).
5.2 What the scope knows, and what it draws
Everything the scope knows about the signal is the list of samples: a value at each instant, and nothing in between. To make a readable picture, it normally joins neighbouring samples with straight lines. Those lines are a guess. They are a good guess when the samples are close together compared with how fast the signal changes, and a bad one otherwise.
The Display tab has a setting, Draw: Lines / Dots, that lets you see this directly. With Dots, only the real samples are drawn. Figure figure 11 shows the same real signal, a sine of about 2 kHz from the ESP32's generator, measured at three different sample rates and drawn both ways.
Look at how the picture changes. At 250 kSa/s there are about 128 samples per period, the dots almost touch, and lines and dots look the same. At 25 kSa/s there are about 13 samples per period: the dots are clearly separate but the joined-up picture is still a convincing sine. At 5 kSa/s there are only 2.6 samples per period: the lines draw a jagged zigzag that looks nothing like a sine, even though every dot is a correct measurement. The signal was the same every time; only the sampling changed.
5.3 How many samples are enough?
That depends on what you want to know.
- To see the shape of a wave, you want roughly 10 or more samples per period. With fewer, the straight lines between samples visibly distort it: corners are cut, peaks are missed.
- To measure the frequency correctly, you need more than 2 samples per period. With fewer, the frequency you measure is wrong, and wrong in a sneaky way: you see a convincing, slower wave that is not there. That is aliasing, and it gets its own chapter (chapter 8).
- To catch a short event (a spike, a narrow pulse), you need samples closer together than the event is long, or the special help of Peak detect (section 12.2).
Translated to this scope at its full 250 kSa/s with one channel: shapes are trustworthy up to about 25 kHz, frequencies can be measured up to just below 125 kHz, and events shorter than 4 µs can fall between two samples. Repeating signals can be shown in much finer detail with equivalent-time sampling (chapter 13).
5.4 More channels share the converter
The ESP32 has one ADC, which can measure only one pin at a time. With two channels switched on, it measures CH1, then CH2, then CH1 again, and so on. So the total rate is shared: 250 kSa/s for one channel, 125 kSa/s each for two, 62.5 kSa/s each for four. Bench scopes usually have one converter per channel; on this scope, switch off channels you do not need when you want the highest rate.
Sharing has a second consequence: the channels are not measured at exactly the same instant. CH2's sample is taken one ADC interval (4 µs at full speed) after CH1's. The scope knows this and draws each channel shifted by the right amount, so timing between channels on the screen is correct. Maths channels, however, combine sample number n of each channel, which were taken a few microseconds apart. For slow signals this does not matter; for fast ones keep it in mind (reference §3.3, channel skew).
Try it. Generator: Sine, 2 000 Hz. Display tab → Draw: Dots. Acquire: Normal, Time/div 200 µs (Memory auto). Watch Sa in the status bar and how far apart the dots are. (Memory only offers 500 and up; to get the low rates of figure figure 11, choose Memory 500 and slow the time base to 2 ms/div and 10 ms/div.) Switch Draw back to Lines and see which pictures you would have believed.
Key points
- A digital scope only knows its samples. The lines between them are a guess.
- Sample interval = 1 ÷ sample rate: 250 kSa/s ↔ 4 µs.
- About 10 samples per period to see a shape; more than 2 to measure a frequency.
- Channels share the ADC: 250 / 125 / 62.5 kSa/s each for 1 / 2 / 4 channels.
- Draw: Dots shows the real samples.
Elsewhere: how the sample rate is chosen for each time/div in reference §3.1; the DMA engine that makes 250 kSa/s possible in reference §3.6; Draw and Memory controls in the user guide.
6. The ADC: turning a voltage into a number
Each sample is made by the ADC, the analogue-to-digital converter. It looks at the voltage on a pin at one instant and answers with a whole number, called a code. Everything the scope shows comes from these codes, so the ADC's properties (its range, its step size, its accuracy and its noise) set the limits of every voltage reading.
6.1 Codes, bits and steps
The ESP32's ADC is a 12-bit converter: its answer is a number from 0 to 4095. (12 bits can count 212 = 4096 different values.) The lowest code means "the bottom of the range", the highest "the top", and every code in between stands for a small band of voltages. One step of the code is the resolution:
resolution ≈ range ÷ number of codes ≈ 3.3 V ÷ 4096 ≈ 0.8 mV per stepSo the ADC works like a ruler with marks every 0.8 mV. A voltage between two marks is rounded to one of them. This rounding is called quantisation, and the small error it leaves (up to half a step) is the quantisation error. Plotting the code against a slowly rising input voltage gives a staircase instead of a smooth line:
How the ESP32 finds the code is worth a sentence, because it explains why the ADC needs a moment for each reading. It is a SAR (successive-approximation) converter. It first asks "is the voltage above half the range?", then, depending on the answer, "above three quarters?" or "above a quarter?", and so on, halving the remaining range each time. Twelve yes/no questions give twelve bits, exactly like guessing a number between 0 and 4095 by asking "higher or lower?". Before asking, it takes a snapshot of the voltage on a tiny internal capacitor, so that the voltage does not change during the questions. That snapshot is the sample-and-hold, and it is the reason the pin behaves like a small capacitor (chapter 7).
| Bits | Codes | Step over 3.3 V | Where you meet it |
|---|---|---|---|
| 8 | 256 | 12.9 mV | Most bench scopes (their amplifier makes the range small, so the step is small in volts too); the ESP32's DAC |
| 10 | 1 024 | 3.2 mV | Arduino Uno's ADC |
| 12 | 4 096 | 0.81 mV | The ESP32's ADC, this scope |
| 16 | 65 536 | 0.05 mV | Precision ADC chips |
6.2 The range, and what happens outside it
The ESP32's ADC, set up as this scope uses it, measures from about 0.14 V to about 3.15 V (test board: 142 mV and 3.155 V). Outside that window it cannot tell voltages apart:
- Everything below about 0.14 V reads as 0.14 V. The scope marks this with a floor label on the channel. This is a property of the ESP32: its ADC simply does not respond in the bottom 0.1 V or so. A pin connected to ground reads 0.14 V, not 0.
- Everything above about 3.15 V reads as 3.15 V. The scope shows a red CLIP label. The tops of a 3.3 V square wave are clipped flat at 3.15 V.
Neither problem is visible in the reading itself: a clipped value looks just like any other number. That is why the scope warns you, and the labels stay lit for a second after the last out-of-range sample so that a brief excursion is not missed. In practice: keep signals between about 0.15 and 3.0 V for trustworthy readings, and be careful with anything measured near 0 V (an RC curve that starts at 0 V seems to start at 0.14 V; several of the measurements in the verification guide had to allow for this).
The range of the measurement is not the same as the range of what is safe. The pin itself must never see less than 0 V (minus 0.3 V absolute) or more than 3.3 V (3.6 V absolute). Outside that the ESP32 can be damaged. For larger signals, use a resistor divider (user guide §5.3); for signals that swing below 0 V, a bias circuit (§5.4).
6.3 Accuracy and calibration
Resolution (how finely the ADC divides its range) is not the same as accuracy (how close the reading is to the truth). A ruler with millimetre marks that has been printed 2 % too long has good resolution and poor accuracy. ADCs are like that. Every ESP32 chip's ADC is slightly different: its reference voltage, its gain (the slope of the staircase) and its offset (where the staircase starts) vary from chip to chip. Uncorrected, readings can be off by tens of millivolts or more.
The scope corrects this in two stages:
- Factory calibration. Espressif measures each chip at the factory and burns correction values into it (in "eFuses"). At connection, the firmware turns these into a table that converts every code to millivolts and sends it to the browser. On the test board, readings after this step were 17 to 39 mV high across the range.
- Your two-point calibration. With a multimeter you measure two voltages, one low and one high, and type in what the scope read and what the meter read (Data tab → ADC calibration). The browser fits a straight line through the two points and corrects every reading with it: a gain correction (slope) and an offset correction (shift). On the test board this brought the error down to a few millivolts, and a later check at 1.652 V agreed with the meter within 0.4 mV.
The ESP32's ADC is also slightly non-linear: its staircase bends above about 2.5 V, where each code is worth more millivolts than below. The factory table already includes that bend. It is one reason why the most accurate range is roughly 0.15 to 2.45 V.
6.4 Noise, effective bits and averaging
Measure a perfectly steady voltage many times and the codes are not all the same: they scatter around the true value by a few steps. That scatter is the ADC's noise (plus some from the board's supply). On the test board it is about 3–4 mV RMS, roughly 4–6 codes: figure figure 14 shows a steady 1.652 V read 1 382 times. Two consequences:
- The last two or three of the 12 bits are mostly noise. The resolution you can actually use in a single reading, the effective number of bits (ENOB), is about 9–10 bits for this ADC. A data sheet's "12-bit" is the number of digits, not the number of trustworthy digits.
- Small details, a few millivolts, are buried in the fuzz in a single capture.
The figure shows two more things worth knowing. A few readings stray 10–20 mV from the rest: the ESP32's ADC produces such occasional outliers, which is one reason single-point measurements like Max jump around (section 15.5). And the histogram is spiky rather than smooth: some codes come up far more often than their neighbours, the uneven step widths described at the end of this section.
Random noise has a useful property: it averages out. If you average N readings of a steady voltage, the noise of the average is smaller by a factor of √N:
noise of an average of N readings = noise of one reading ÷ √N 4 readings → noise ÷ 2 16 → ÷ 4 100 → ÷ 10Averaging even brings back detail finer than one step, because the noise makes the readings fall on neighbouring codes in proportions that depend on where between the steps the true voltage lies. The scope uses averaging in three places: Hi-Res averages the readings inside each point (section 12.3), Average averages whole captures (section 12.4), and Statistics average a measurement over many captures (section 15.5). On the same steady voltage as figure figure 14, Hi-Res with 25 readings per point brought the scatter from 2.7 mV down to 0.6 mV (√25 = 5 would predict 0.5 mV), and with Statistics the test board measured a steady 1.65 V with a spread of only 0.1–0.5 mV, less than one code.
One more imperfection shows up when you average: some codes are a little wider than others (differential non-linearity, DNL), so they turn up more often. It is visible in histograms of a noisy signal and as small steps in derivatives. It is normal for this kind of ADC.
Key points
- 12 bits = 4096 codes ≈ 0.8 mV per step over 3.3 V. Resolution is not accuracy.
- Readable range ≈ 0.14–3.15 V. floor and CLIP labels mean "this reading is not the real voltage".
- Factory table plus your two-point calibration take accuracy from tens of mV to a few mV.
- Noise ≈ 3 mV RMS: about 9–10 useful bits per reading. Averaging N readings divides random noise by √N.
Elsewhere: calibration controls in the user guide §6.11; how codes become volts in reference §2; the ADC's measured limits in reference §11; checking your own board: verification tests C1–C5.
7. The input: what your circuit sees
It would be lovely if a scope could measure a circuit without touching it. It cannot. Connecting any measuring instrument changes the circuit a little, and understanding how much is one of the most practical things you can learn about scopes. This chapter explains what the ESP32's input pin looks like to your circuit, and what that does to fast signals.
7.1 The pin is a small capacitor
Remember the sample-and-hold from chapter 6: to take a reading, the ADC connects a tiny internal capacitor to the pin and lets it charge to the pin's voltage. Add the capacitance of the pin itself, the chip's internal wiring and your jumper wires, and the input behaves, as far as your circuit is concerned, like a small capacitor from the pin to ground. On the test board we measured it: about 14 pF (14 trillionths of a farad).
That is tiny, but it matters, because your signal has to charge it through some resistance: the series resistor you should always put in front of the pin (1 kΩ is the standard here), plus whatever resistance the source itself has (the source impedance, or output resistance, of whatever drives the signal). A resistor feeding a capacitor is the most basic filter in electronics, the RC low-pass filter.
7.2 RC in the time domain: rounded edges
Imagine the source jumps instantly from 0 to 1 V. The capacitor cannot follow instantly: current flows through R to charge it, quickly at first and more slowly as the voltage across it approaches 1 V. The voltage at the pin follows a curve called an exponential:
v(t) = V · (1 − e−t/τ) with the time constant τ = R · CThe time constant τ ("tau") sets the speed. After one τ the capacitor has reached 63 % of the step, after 2τ 86 %, after 3τ 95 %, after 5τ more than 99 %. The rise time from 10 % to 90 % (the definition in section 2.5) works out at 2.2 τ:
rise time (10–90 %) = 2.2 · R · CFor the scope's input with 1 kΩ: τ = 1 000 Ω × 14 pF = 14 ns, rise time = 31 ns. A step at the source arrives at the ADC rounded over about 30 nanoseconds. Since the ADC takes a reading only every 4 µs, more than a hundred times slower, a 1 kΩ source is effectively perfect. We could actually see this 31 ns rounding on the test board with equivalent-time sampling (chapter 13): the edge measured 27–32 ns.
With 100 kΩ the time constant is 100 times longer, 1.4 µs, and the rise time 3 µs. That is comparable to the sample interval, and it rounds real signals noticeably.
Figure figure 16 shows this on the test board: the same fast edge from the generator, fed to the pin through 1 kΩ, 10 kΩ and 100 kΩ, and drawn with equivalent-time sampling so that nanoseconds are visible. The rise time is 26 ns, 236 ns and 2.55 µs: ten times the resistance, ten times the rise time, exactly as τ = R · C says.
Look at the number each panel gives for C: about 11–12 pF, a little less than the 14 pF that the frequency measurement in the next section gives. Both are honest measurements of the same pin; they differ because the input is not a perfect capacitor. Part of it is the sample-and-hold capacitor, which is connected only while a sample is being taken, and the pin's capacitance changes a little with voltage. For working out what your circuit will see, "about 11–14 pF" is the right answer, and the rule below does not change.
7.3 RC in the frequency domain: bandwidth
The same filter can be described by what it does to sine waves of different frequencies, and this is how scope specifications describe it. A slow sine passes through unchanged. A fast sine does not have time to charge the capacitor fully on each swing, so it arrives smaller. The frequency at which its amplitude has dropped to 71 % (−3 dB) is the bandwidth or cut-off frequency:
fc = 1 / (2π · R · C)These are two views of one thing: a filter that rounds edges in time is the same filter that attenuates high frequencies. A handy link between them: rise time ≈ 0.35 ÷ bandwidth. A scope's quoted bandwidth (say "100 MHz") tells you the fastest edge it can show (3.5 ns).
We measured this on the test board by feeding the ESP32's own sine generator into the input through two different resistors and measuring the amplitude at 24 frequencies up to 200 kHz:
With 1 kΩ the amplitude stays flat within 0.25 dB (3 %) all the way to 200 kHz: the cut-off, 1 ÷ (2π × 1 kΩ × 14 pF) ≈ 11 MHz, is far beyond anything the ADC can sample. With 100 kΩ the amplitude falls exactly like an RC filter: down to 71 % (−3 dB) near 116–120 kHz and to 51 % at 200 kHz. Fitting the curve gives C ≈ 14 pF, which is where that number comes from.
7.4 The practical rule
- Feed the pin from a low resistance, about 10 kΩ or less in total. 1 kΩ is ideal: it protects the pin and costs nothing in speed.
- If your signal comes from something high-impedance (a large resistor divider, a sensor with a weak output, a node in a high-value RC circuit), the scope's 14 pF will slow it down, and the sample-and-hold's charging can pull it slightly (about 10 mV on the test board with 100 kΩ). Put a buffer in between: an op-amp wired as a voltage follower has a very high input resistance and a very low output resistance.
- A capacitor from the pin to ground (10–100 nF) steadies the readings of slowly changing voltages, because it supplies the sample-and-hold's charge. But it forms a much slower RC filter with the series resistor (10 kΩ × 100 nF: cut-off 160 Hz), so use it only for slow signals.
7.5 Loading: the scope changes the circuit
The 14 pF also acts on the circuit you are measuring, not just on the reading. If the point you probe is a high-resistance node, adding 14 pF (plus the series resistor) slows down the circuit itself while you watch. This effect is called loading, and every instrument has it. A good habit: if connecting the scope seems to change how the circuit behaves, suspect loading, and measure at a lower-impedance point or through a buffer.
7.6 Why bench scopes have ×10 probes
Bench scopes face the same problem, with a twist: their probe cable adds about 100 pF. A plain "×1" probe would load the circuit badly. So most measurements use a ×10 probe: it contains a 9 MΩ resistor that, together with the scope's 1 MΩ input, divides the signal by 10, and a small adjustable capacitor across that resistor. Adjusted correctly (that is what the little screw and the square-wave "probe comp" terminal on a bench scope are for), the divider works equally at all frequencies, and the circuit sees about 10 MΩ in parallel with roughly 10 pF instead of 1 MΩ and 100 pF. You trade a factor of 10 in signal size for a circuit that hardly notices the scope.
This scope has no probe and no cable worth mentioning; it relies on you keeping the source resistance low. A resistor divider made from two resistors (user guide §5.3) is this scope's version of an attenuating probe; set the channel's Probe factor so that the scope multiplies the readings back. Keep the divider's resistors moderate (10–100 kΩ): its output resistance feeds the 14 pF too.
7.7 Ground: the other half of every connection
A voltage is always between two points. The scope measures each input pin against the ESP32's ground (GND). So your circuit's ground must be connected to the ESP32's GND, or the readings are meaningless. And because the ESP32's GND is connected through the USB cable to your computer, which is often connected to mains earth, the scope's ground is not "floating": never connect it to a point in a circuit that is not at ground potential (for example the middle of a mains-powered circuit, or the negative side of something powered from a different supply that is not connected to the same ground). That would short that point to your computer's ground through the cable. Bench scopes have exactly the same rule, and it is the most common way people damage scopes and circuits.
Key points
- The input behaves like about 14 pF to ground. With the source resistance R it forms an RC low-pass filter.
- τ = R·C, rise time = 2.2·R·C, bandwidth = 1 / (2π·R·C). Rise time × bandwidth ≈ 0.35.
- 1 kΩ: 31 ns rise, flat to well beyond 200 kHz (measured). 100 kΩ: −3 dB at ≈ 116 kHz (measured).
- Keep the source resistance below ≈ 10 kΩ, or buffer it. A probe or divider is part of the circuit.
- The scope's ground is the ESP32's ground, which is your computer's ground.
Elsewhere: wiring inputs, dividers, biased AC inputs and current shunts in the user guide §5; the bandwidth measurement in reference §11; check it yourself: verification test D6.
8. Too fast to sample: aliasing
chapter 5 ended with a warning: with fewer than two samples per period, a scope does not just show a rough picture, it shows a wrong one. This is called aliasing. It is the most important pitfall of digital scopes, because the wrong picture looks perfectly believable. This chapter explains it from several sides, with real measurements.
8.1 The wagon wheel
You have probably seen it in films: a car speeds up, and its wheels seem to slow down, stop, and turn backwards. The camera takes 24 frames per second. If a wheel's spokes move almost exactly one spoke spacing between frames, each frame shows the spokes almost where the previous frame had them, slightly behind, and your brain sees a wheel turning slowly backwards. Nothing about the individual frames is wrong; it is the interpretation of the frames that goes wrong, because many different motions produce the same frames.
A scope is in the same position. It sees a list of samples and joins them up in the simplest way. If the real signal changed a lot between samples, a slower wave can pass through exactly the same samples, and the scope draws that slower wave.
8.2 Watching it happen
Figure figure 18 samples a sine wave at a fixed rate while its frequency goes up. The grey curve is the real signal; the dots are the samples; the coloured line is what joining the dots draws.
- At 10 samples per period the picture is a good sine.
- At 4 samples per period it is rough, but the frequency is right.
- At 2.2 samples per period it is a strange, beating shape, but on average the frequency is still right.
- At exactly 2 the samples can land anywhere on the wave, even on the zero crossings, showing a flat line.
- At 1.25 samples per period (a signal faster than half the sample rate) the dots trace out a smooth sine with a period of 5 samples: four times slower than the real signal, and not there. That is an alias.
- At 1.1 samples per period the alias is even slower (one period every 11 samples) and even more convincing.
8.3 The rule: half the sample rate
The boundary is exactly two samples per period. Put the other way round: a sample rate fs can only represent frequencies below fs ÷ 2. This frequency is called the Nyquist frequency, after Harry Nyquist, who worked out the theory in the 1920s.
Nyquist frequency = fs / 2 (250 kSa/s → 125 kHz)A signal above the Nyquist frequency appears at a false frequency. The false frequency is the distance from the real frequency to the nearest whole multiple of the sample rate:
apparent frequency = | f − k · fs | (k = the whole number that makes it smallest)At 250 kSa/s, a 130 kHz signal appears at 250 − 130 = 120 kHz; a 200 kHz signal at 50 kHz; a 245 kHz signal at 5 kHz; and a 250 kHz signal at 0 Hz, a flat line, because every sample catches it at the same point of its cycle. The frequencies "fold" back and forth between 0 and fs/2 like a strip of paper folded into a zigzag. The bandwidth measurement of section 7.3 recorded exactly this: it fed the ESP32's sine at frequencies up to 200 kHz into the scope at 250 kSa/s, and above 125 kHz the scope measured the folded frequencies.
8.4 The scope cannot tell
The uncomfortable truth: from the samples alone, there is no way to know whether a wave is real or an alias. In figure figure 18, the 1.25-samples-per-period samples are exactly the samples of the slow wave. A scope never complains. You have to protect yourself, and there are good habits for it:
- Know what to expect. If a circuit that should run at 100 kHz shows 3 kHz, be suspicious.
- Change the time base. A real signal keeps its frequency when you change time/div. An alias changes, because changing time/div changes the sample rate (when the scope is not already at its maximum, chapter 9). This is the single best test.
- Look at the sample rate. The status bar shows Sa. If half of it is not comfortably above the frequencies in your circuit, aliasing is possible.
- Use Hi-Res for slow time bases. Hi-Res averages all the readings inside each point, which removes fast signals instead of folding them (section 12.3).
8.5 How bench scopes defend themselves
The proper cure for aliasing is to remove frequencies above fs/2 before sampling, with an analogue low-pass filter, the anti-alias filter. Audio converters always have one. Bench scopes rely mostly on two other things: their front end's bandwidth is set well below half their maximum sample rate (a 100 MHz scope typically samples at 1 GSa/s), and their deep memory lets them keep a high sample rate even at slow time bases.
The ESP32 has no anti-alias filter, and its input passes frequencies far above 125 kHz (we measured it flat to 200 kHz, section 7.3). So this scope uses the other two defences: Normal mode keeps the sample rate as high as memory allows at every time base (deep memory, chapter 9), and Hi-Res averages away fast content at slow time bases. If you know your signal contains fast components you do not care about, a resistor and capacitor in front of the pin make a simple anti-alias filter of your own (user guide §5.4 shows one for audio).
8.6 Square waves alias too, in parts
A square wave contains much more than its basic frequency: its sharp edges are made of a series of higher frequencies called harmonics (at 3, 5, 7 … times the basic frequency; see chapter 18). Even when the basic frequency is well below the Nyquist frequency, those harmonics may be above it, and they alias. The visible effect is that the edges of a fast square wave wander or look uneven from capture to capture. It is one reason a square wave needs many more samples per period than a sine to look right.
8.7 Sample rate, bandwidth and seeing the shape: three different limits
People often confuse these, so here they are side by side for this scope (one channel, 250 kSa/s, 1 kΩ source):
| Limit | Set by | Value here | What happens beyond it |
|---|---|---|---|
| Input bandwidth | Source resistance × 14 pF (chapter 7) | ≈ 11 MHz with 1 kΩ | Signals get smaller and edges rounder |
| Nyquist frequency | Half the sample rate | 125 kHz | Signals appear at false frequencies (aliasing) |
| Shape | About 10 samples per period | ≈ 25 kHz | The shape is distorted (frequency still right) |
On a bench scope the input bandwidth is the lowest of the three, by design. On this scope it is the highest, which is why aliasing deserves so much attention here. Equivalent-time sampling (chapter 13) gets around the shape limit for repeating signals, but not around the Nyquist limit.
Try it. Generator: Square, 1 000 Hz. Acquire: Normal, Memory: 1000; Horizontal: Y-T, Auto roll off (roll mode draws fast content as a band instead). Starting at 500 µs/div, slow the time base one step at a time and watch Sa and the Frequency reading. Somewhere below 2 kSa/s the picture becomes a slow false wave or a flat line at a wrong level. Change time/div by one step: the false wave changes. Switch to Hi-Res: it disappears. (This is verification test D5.)
Key points
- A sample rate fs can only show frequencies below fs/2 (the Nyquist frequency).
- Faster signals appear at false, slower frequencies: |f − k·fs|. The picture looks believable.
- Test: change time/div. A real signal keeps its frequency; an alias does not.
- This scope has no anti-alias filter. Deep memory and Hi-Res are its defences.
- Bandwidth, Nyquist and "enough samples for the shape" are three different limits.
Elsewhere: "Sample rate is not bandwidth" in reference §11; the Hi-Res box-car filter in reference §3.2.
9. Memory, record length and the time base
A digital scope stores its samples before drawing them. How many it can store, and how fast it can send them on, shapes almost everything about how it behaves at different time bases: its sample rate, how often the picture updates, and whether it can catch fast details at slow settings. This chapter puts those pieces together.
9.1 Captures and record length
A capture (also called an acquisition or a record) is one block of samples taken at one fixed rate, the raw material for one picture. The number of samples in it is the record length, or memory depth. Three numbers are tied together:
record length (samples) = sample rate × time covered time covered = 10 divisions × time/div (the screen time)So for a given screen time, a higher sample rate needs more memory. The ESP32 can hold up to 24 000 samples per capture (shared by the channels: 12 000 each for two). At the full 250 kSa/s that covers 24 000 × 4 µs = 96 ms. To fill a screen longer than 96 ms with samples, the scope must sample more slowly.
At 5 ms/div the screen covers 50 ms. Sampling at 250 kSa/s would need 50 ms × 250 000 /s = 12 500 samples: that fits. At 50 ms/div the screen covers 500 ms, and at 250 kSa/s that would be 125 000 samples: it does not fit in 24 000. The most the memory allows is 24 000 ÷ 0.5 s = 48 kSa/s.
9.2 The second limit: the USB link
A bench scope has its screen built in. This scope sends every capture over USB to the browser first, at 921 600 baud, which carries about 92 000 bytes per second. Each sample is 2 bytes, so a full 24 000-sample capture takes about half a second to send. While a capture is being sent, the ESP32 is not measuring: that gap is called dead time, and every digital scope has some.
Long captures therefore cost update speed. The scope's default, Memory: auto, balances the two: it keeps the sample rate as high as possible but limits each capture so that sending it takes no longer than half a screen time (and never less than 1 000 points). The result for one channel at 250 kSa/s:
| Time/div | Screen | Normal: sample rate | Normal: points | What limits it |
|---|---|---|---|---|
| 5 µs – 500 µs | 50 µs – 5 ms | 250 kSa/s | 20 – 1 250 | the ADC's maximum |
| 1 ms | 10 ms | 138 kSa/s | 1 382 | the link (½ screen) |
| 5 ms | 50 ms | 27.6 kSa/s | 1 382 | the link |
| 10 – 50 ms | 100 – 500 ms | 23 kSa/s | 2 304 – 11 520 | the link |
| 100 ms and slower | 1 s and more | 10 000 per screen | (streaming) | roll mode (below) |
You can override the choice with a fixed Memory setting (500 to 16 000 points). A bigger number gives a higher sample rate at slow time bases (more detail, less aliasing) and slower updates; a smaller one gives faster updates and a lower sample rate. At fast time bases the ADC is already at its maximum, the screen holds only a few hundred samples, and the Memory setting makes no difference.
Why the sample rate changes when you turn time/div. This catches out many beginners on every digital scope. A scope has a maximum sample rate and a maximum memory. At fast time bases it samples at its maximum and the memory is barely used. At slow time bases the memory (or here, the link) runs out, and the scope must lower the sample rate to cover the whole screen. Keep an eye on Sa in the status bar: it tells you how finely the current picture was really sampled, and therefore whether a fast detail could have fallen between samples (chapter 5) or aliased (chapter 8).
9.3 How often the picture updates
Each new picture needs: the part of the screen before the trigger to be recorded, a trigger to happen, the part after it to be recorded, and the capture to be sent. So a picture can never update faster than once per screen time, and slow time bases update slowly:
| Time/div | Screen time | Typical updates per second |
|---|---|---|
| 200 µs | 2 ms | ≈ 50–90 |
| 1 ms | 10 ms | ≈ 15–40 |
| 10 ms | 100 ms | ≈ 5–9 |
| 50 ms | 500 ms | ≈ 1.5–2 |
The status bar shows the actual rate at its right end (frames/s). A high update rate is more than a comfort: the more captures per second, the better your chance of seeing a rare event (a glitch that happens once in a thousand periods only shows up if the scope is looking at the right moment). Bench scopes advertise this as "waveforms per second".
9.4 Roll mode: for very slow signals
At 100 ms/div and slower, a screen takes a second or more to record, and waiting for a whole screen before showing anything would feel broken. So scopes switch to roll mode: instead of separate captures, samples stream continuously, and the trace scrolls across the screen from right to left like a chart recorder, with the newest sample at the right edge. There is no trigger in roll mode (nothing is waited for), and no dead time. The ESP32 sends samples in small chunks as it takes them, and the browser keeps up to about a million of them, so after pressing STOP you can drag back through the history.
Roll mode is ideal for slow things: a capacitor charging over seconds, a temperature sensor, a potentiometer turned by hand. The scope switches to it automatically from 100 ms/div (the Auto roll setting changes or disables that threshold), and you can choose it from 50 ms/div with Horizontal → Mode: Roll.
9.5 Text streams: someone else's samples
The scope can also display numbers printed by your own sketch (the ScopeProbe library, or any Serial.print of comma-separated values). Then the sketch decides when to take each sample, and sends a timestamp with each one. The scope just draws what arrives, in roll mode, and can trigger on it in the browser. The sample rate is whatever your sketch achieves: about 50 samples per second for the ScopeProbe example, up to a few thousand lines per second for a sketch that does nothing else. Everything in this page about sampling and aliasing applies: a sketch that reads a sensor 10 times per second cannot show anything faster than 5 Hz correctly.
Key points
- Record length = sample rate × screen time. The ESP32 holds 24 000 samples (96 ms at 250 kSa/s).
- Here the USB link also limits long captures; Memory: auto keeps the transfer within half a screen time.
- So the sample rate falls at slow time bases. Always glance at Sa.
- Pictures update at most once per screen time; long captures mean fewer updates.
- Roll mode (100 ms/div and slower) streams and scrolls, without trigger or dead time.
Elsewhere: the exact planning rules in reference §3.1 and update rates in §3.4; the Memory, Mode and Auto roll controls in the user guide §6.2 and §6.5; text streams and the ScopeProbe library in the user guide §3.3–3.4.
Part 3 · A stable picture
10. The trigger: making the picture stand still
A scope redraws its picture many times per second. If each capture started at a random moment, a repeating signal would be drawn at a different position every time and you would see a blur. The trigger fixes that: it picks the same point of the signal, say "the moment it rises through 1.65 V", as the start of every picture. It is the single most important control on a scope, and the one that confuses beginners most, so this chapter goes slowly.
10.1 The problem it solves
Figure figure 23 shows six real captures of the same 1 kHz sine from the test board, drawn on top of each other. On the left the trigger level was set above the signal, so the scope never triggered and simply captured whenever it was ready. On the right the level was inside the signal.
Untriggered, every capture shows the sine shifted by a random amount, and the six together are a meaningless tangle. Triggered, all six lie exactly on top of each other: the sine crosses the level, rising, at t = 0 in every one. That is what "a stable picture" means.
10.2 A trigger is a rule
The basic trigger, used by almost everyone almost all the time, is the edge trigger. You give it three things:
- a source: which channel to watch;
- a level: a voltage;
- an edge (or slope): rising (↑, the signal goes up through the level), falling (↓, down through it), or both (↕).
"Trigger on CH1, rising, 1.65 V" means: "make t = 0 the moment CH1 goes up through 1.65 V". The level is shown as a marker (◀T) at the right edge of the screen, and you can drag it. The 50% button puts it halfway between the signal's lowest and highest values, which is almost always a good place to start.
The level must be somewhere the signal actually crosses. A level above a signal's top, or below its bottom, never fires. A level near the top or bottom of a slow, noisy wave fires in uncertain places. The middle is safest.
10.3 How the scope finds the trigger
The ESP32 records continuously into its memory, round and round like a loop of tape: when the memory is full, the newest sample overwrites the oldest. All the while, it compares every new reading of the source channel with the level. When it sees the signal go past the level in the right direction, it marks that sample, records the rest of the screen, and stops to send the capture.
Because the memory was already full of samples when the trigger came, the samples before the trigger are available too. That is pre-trigger: you can see what happened leading up to an event, which an analogue scope could never do. By default the scope puts t = 0 in the middle of the screen, so half the picture is before the trigger and half after. The horizontal position moves it: drag the trigger triangle at the top of the screen to the right to see more of the past, to the left to see more of the future.
The firmware checks every conversion of the source channel, even those that are not kept as points (in Hi-Res and Peak modes, and when decimating at slow time bases, chapter 11), just as a bench scope's trigger circuit watches the signal itself rather than the stored points.
10.4 Placing t = 0 between two samples
The trigger moment almost never falls exactly on a sample: the signal crosses the level somewhere between two of them. If the scope simply put t = 0 on the first sample past the level, the picture would jitter left and right by up to one sample interval from capture to capture. So the browser looks at the sample before the crossing and the one after, works out where between them the straight line joining them crosses the level, and puts t = 0 exactly there.
This trigger interpolation is why the scope's triggered pictures are steady to a small fraction of a sample interval, and why, if you stop the scope and put a cursor at t = 0, it reads the trigger level almost exactly (verification test E1 found it within 1 mV at three levels on both edges).
10.5 Noise and hysteresis
A slow edge with noise on it does not cross the level once: it wiggles back and forth across it several times. A naive trigger would fire on any of those crossings, and the picture would jump. So triggers use hysteresis: after firing on a rising edge, the trigger is only allowed to fire again once the signal has gone back below the level by a small margin. Small wiggles near the level are ignored.
This scope's margin is 12 mV at the pin. If a noisy signal still triggers unsteadily, the Noise reject setting widens it to 60 mV. Bench scopes have the same option under names like "noise reject" or "HF reject".
10.6 Auto, Normal and Single
The trigger mode answers a different question: what should the scope do when no trigger comes?
- Normal: draw only triggered captures. If the signal never crosses the level, nothing new is drawn; the last picture stays and the status shows Wait. Every picture you see in Normal mode is a genuine triggered one. Use it for slow signals, for signals that come and go, and whenever you need to be sure.
- Auto: like Normal, but if no trigger arrives within a short time, capture anyway, so you always see something (status Auto instead of Trig'd). That is ideal when you do not yet know what the signal looks like, or when it is a DC level with nothing to trigger on. The wait is 0.6 of a screen time (at least 50 ms, at most 2 s). A signal that repeats more slowly than that is forced most of the time and drifts: switch to Normal for it. Bench scopes behave exactly the same.
- Single (the SINGLE key): wait for one trigger, capture it, and stop. For events that happen once: a button press, a reset, a power-up. Set up the trigger first (a level the event will cross), press SINGLE, then make the event happen.
- FORCE (key): capture now, whatever the trigger says. Useful in Normal or Single mode to see what the signal is doing when it is not triggering.
10.7 Holdoff, both edges and a hidden source
- Holdoff (text streams): after a trigger, ignore new triggers for a set time. Useful for a burst of pulses, where you want to trigger on the first pulse of each burst rather than on any pulse.
- Both edges (↕): trigger on rising and falling edges. On a periodic signal, consecutive pictures show a rising and a falling edge at t = 0 alternately, which overlaid in persistence looks like an X. Good for comparing the two edges.
- The source can be a channel you are not showing. Switch it off and the scope still acquires and watches it; the status adds "CHn hidden". Bench scopes do the same. (It still shares the ADC, section 5.4.)
10.8 When the picture is not stable
| What you see | Likely cause | What to do |
|---|---|---|
| Picture drifts sideways, status Auto | Level outside the signal, or wrong source | Press 50%, check the source channel |
| Nothing updates, status Wait | Normal mode and no crossing | Move the level into the signal, or press FORCE to look |
| Picture jumps between two positions | Two different places in the period cross the level the same way (complex waveform), or Both edges | Move the level to a part of the wave that crosses it only once per period; use a single edge |
| Small random jitter on a slow edge | Noise near the level | Noise reject; a steeper part of the wave; Hi-Res |
| Slow signal (a few Hz) mostly untriggered in Auto | It repeats more slowly than the Auto wait | Normal mode |
Try it (Demo or board). Drag the ◀T marker up and down. Inside the signal the picture is still (Trig'd). Drag it above the signal: in Auto the picture starts to drift; switch the mode to Normal and it freezes on the last picture (Wait). Switch the edge between ↑ and ↓ and watch which slope sits at t = 0. Then drag the trigger triangle at the top of the screen to the right edge: the whole screen is now the time before the trigger.
Key points
- The trigger makes t = 0 the same point of the signal in every capture: source, level, edge.
- The memory records continuously, so the time before the trigger can be shown (pre-trigger).
- t = 0 is placed exactly between two samples by interpolation.
- Hysteresis stops noise from re-triggering. Noise reject widens it.
- Normal: only triggered pictures. Auto: shows something even without a trigger. Single: one capture, then stop.
Elsewhere: trigger controls and the status chips in the user guide §6.4 and §6.1; exact rules (hysteresis values, Auto timeout, interpolation) in reference §3.3; check it yourself: verification stage E.
Part 4 · From readings to a picture
11. More readings than points: decimation
This short chapter explains one idea that the next chapter depends on completely. Without it, acquire modes such as Peak detect make no sense: how can a scope show a spike "between two points" if all it has is the points? The answer is that at most time bases, it has much more than the points.
11.1 Two different rates
So far this page has talked about "the sample rate" as if there were only one. In fact there are two:
- the rate at which the ADC converts: how often it actually measures the pin;
- the rate of the points the scope keeps and draws: the sample rate shown as Sa in the status bar.
At fast time bases they are the same: the ADC runs at its maximum, 250 kSa/s, and every conversion becomes a point. But at slow time bases the scope needs fewer points per second than the ADC can deliver (chapter 9: memory and the link limit the record length). At 50 ms/div with Memory set to 500, for example, the screen covers 500 ms with 500 points: one point per millisecond, 1 kSa/s. The ADC, however, does not have to slow down to 1 kSa/s. It can keep converting much faster: the firmware runs it at 40 kSa/s or more. Then there are 40 or more conversions for every point the scope keeps.
Reducing many conversions to fewer points is called decimation. The number of conversions per point is written D here. The question is simply: when there are D readings for each point, which value should the point get?
11.2 Three possible answers
There are three sensible answers, and each is one of the scope's acquire modes:
- Keep one of them (the first) and throw the rest away. That is Normal mode. It behaves exactly as if the ADC had sampled at the point rate in the first place: honest, simple, and with all the risks of a low sample rate (missed spikes, aliasing).
- Keep the lowest and the highest of the D readings: two values per point. That is Peak detect. Nothing that happened between two points can escape, because every one of the D readings was looked at.
- Keep their average. That is Hi-Res (high resolution). The average has less noise than any single reading, and anything that changes faster than one point interval is smoothed away instead of aliasing.
This is exactly the sentence that sums up acquire modes on every digital scope: the acquire mode decides what the scope stores for each point when it takes more ADC readings than it has points to show. The fourth classic mode, Average, is different: it averages whole captures over time, not readings within a point. The next chapter takes each mode in turn.
11.3 When there is nothing to decimate
At fast time bases (on this scope roughly 500 µs/div and faster with one channel) the ADC is already at its maximum and every conversion is a point: D = 1. Then there is nothing to choose between, and Normal, Peak and Hi-Res all give the same picture. The modes only differ where D is larger than 1. The Acquire box in the Trig/Acq tab shows what the board is doing, including the ADC rate and, in Hi-Res, how many readings each point averages (for example "×25 avg/pt").
| Time/div (one channel) | Point rate (Sa) | ADC rate | D, readings per point |
|---|---|---|---|
| 5 µs – 200 µs, any mode | 250 kSa/s | 250 kSa/s | 1 |
| Hi-Res, 1 ms | 100 kSa/s | 200 kSa/s | 2 |
| Hi-Res, 10 ms | 10 kSa/s | 250 kSa/s | 25 |
| Normal, 10–50 ms (Memory auto) | 23 kSa/s | 161 kSa/s | 7 (one kept) |
| Peak, Memory 500 at 50 ms | 1 kSa/s | 250 kSa/s | 250 (min and max kept) |
Key points
- At slow time bases the ADC converts faster than the scope keeps points: D readings per point.
- Normal keeps one, Peak keeps the lowest and highest, Hi-Res keeps the average.
- At fast time bases D = 1 and those three modes are identical.
Elsewhere: how the firmware chooses the ADC rate and D for each mode in reference §3.6, "From conversions to points".
12. Acquire modes
With decimation understood (chapter 11), each acquire mode is easy to explain. This chapter takes them one at a time: what each does, what it is good for, what it hides, and what it looks like on real signals. The last section is a guide to choosing.
12.1 Normal
What it does: each point is one real reading, the first of its group of D. The picture is the signal as sampled at the point rate, noise and all.
Good for: seeing the raw truth. Normal never invents anything and never hides noise. It also keeps the highest point rate at slow time bases (deep memory), which keeps aliasing away as long as possible.
Watch out: when D is large, Normal throws most readings away. Anything that happens between two kept readings is invisible, and a signal faster than half the point rate aliases (chapter 8). Figure figure 29 (left) shows how badly that can go.
12.2 Peak detect
What it does: for each point, the firmware looks at every one of the D readings and keeps two values: the lowest and the highest. The scope draws the band between them. The centre of the band, (min + max) ÷ 2, is used for measurements and maths.
So the answer to "how can Peak show a spike between two points" is: the spike is not between two readings. It is between two points, and the ADC took many readings in that gap. Peak mode looked at all of them, and the spike's reading became the "highest" of its group. The spike is then drawn as a tall band in the point where it happened.
Figure figure 29 is a real example from the test board. The generator made a 20 Hz pulse wave with 1 % duty: a 0.5 ms pulse every 50 ms. The time base was 50 ms/div with Memory 500, so one point per millisecond. In Normal mode each point is one reading taken every 1 ms; a 0.5 ms pulse lasts half of that interval, so whether it is caught depends on luck. In Peak mode the ADC ran at 250 kSa/s, 250 readings per point, and every pulse was caught at full height in every capture.
Notice the strange way Normal failed on the test board: whole captures showed either all ten pulses or none, never some. That is because the generator and the ADC run from the same crystal: the pulses repeat every 50 kept readings exactly, so the kept readings keep the same position relative to the pulses for the whole capture. With a signal from an independent source, missed pulses would be scattered randomly instead. Either way: if a short glitch might matter, use Peak detect (or a faster time base).
Watch out: Peak shows noise as a thick band, since the highest and lowest of many noisy readings are always far apart. It uses twice the memory per point. And it has no effect when the ADC is already at its maximum rate and D = 1.
12.3 Hi-Res
What it does: each point is the average of all D readings in its interval. (It is the default mode of this scope.) Averaging does two separate useful things:
- Less noise, more resolution. Averaging D readings divides random noise by √D (section 6.4). At 10 ms/div with one channel, each point averages 25 readings, so the noise drops about 5 times, and steps finer than one ADC code become visible. That is where the name "high resolution" comes from: the averaged points effectively have more bits than the 12-bit ADC.
- No aliasing of fast signals. An average over a whole point interval cancels anything that wiggles faster than that interval. A signal far above the point rate, which would alias in Normal mode, simply averages to its mean in Hi-Res. This kind of averaging is called a box-car filter, and it is a digital stand-in for the anti-alias filter this scope does not have (section 8.5).
On the test board (figure figure 30), the noise on a small sine fell from 4.4 mV RMS in Normal to 1.9 mV in Hi-Res with 10 readings per point. Theory says √10 ≈ 3.2 times less; the rest is the DAC's own 8-bit steps, which are part of the signal and do not average away.
Good for: slow and medium time bases in general; clean traces of slowly changing signals; measuring small changes; anything you want to take the derivative of (maths, chapter 17), because derivatives magnify noise.
Watch out: Hi-Res hides everything shorter than one point interval. A short spike is averaged into a small bump or vanishes; a fast signal becomes a flat line at its average. If you suspect something fast is going on, compare with Normal or Peak. Like Peak, Hi-Res makes no difference when D = 1 (fast time bases, or when several channels already use the full ADC rate).
12.4 Average
What it does: something different from the three modes above. Instead of combining readings inside one capture, it combines whole captures over time. Each new triggered capture is averaged, point by point, with the previous ones. You choose how many (2 to 64): with 16, the picture is the average of the last 16 captures (more exactly, each new capture counts 1/16 once the first 16 have been collected).
Because the trigger puts the signal at the same position in every capture, the signal itself is the same in all of them and survives averaging unchanged. The noise is different in every capture, so it averages away: 16 captures, noise ÷ 4. Unlike Hi-Res, this works even at fast time bases where D = 1, and it does not smooth fast details of the signal, because each point is still a single instant of the waveform.
Watch out: Average needs two things. First, a repeating signal: anything that happens once is diluted 16 times. Second, a stable trigger: if captures start at random moments, each shows the wave at a different position, and averaging them blends the wave into a flat line at its mean (figure figure 31, right). The picture then shows a shape that does not exist. Never use Average on an untriggered picture.
On the test board, Average 16 halved the noise on the sine of figure figure 31 (5.0 → 2.5 mV RMS), and lowered it from 2.9 to 1.8 mV on a flat part of an RC curve (verification test F2). Neither reached the full ÷ 4: the sine's own frequency drifts slightly between captures, and the "flat" part was still creeping up by 5 mV. Whatever differs between captures is not noise to Average, and it blurs instead of averaging out.
12.5 ETS
The fifth mode, equivalent-time sampling, also combines many periods of a repeating signal, but for a different purpose: to place readings between the ADC's sample instants and draw edges far finer than 4 µs. It has its own chapter, chapter 13.
12.6 Choosing a mode
| Mode | Each point is | Noise | Short spikes | Fast signals | Needs |
|---|---|---|---|---|---|
| Normal | one reading | as is | can be missed | alias | nothing |
| Peak | lowest and highest of D readings | shown as a band | always caught | shown as a band | D > 1 |
| Hi-Res | average of D readings | ÷ √D | averaged away | averaged to their mean | D > 1 |
| Average | average of N captures | ÷ √N | kept if repeating | kept | repeating signal, stable trigger |
| ETS | average of readings at one position in the period | reduced | only if repeating | detail down to tens of ns | repeating signal, DMA engine |
- Don't know what the signal is? Normal (or the default Hi-Res), and look.
- Looking for glitches or narrow pulses at a slow time base? Peak.
- Want a clean, precise trace of a slow signal, or about to take a derivative? Hi-Res.
- Want to dig a repeating signal out of noise at a fast time base? Average.
- Want to see a fast edge of a repeating signal? ETS.
Try it. Generator: Square, 20 Hz, Duty 1 %. Time/div 50 ms, Memory 500, Draw: Lines. Switch between Normal and Peak, and count the pulses. Then Generator: Sine, 300 Hz, Amplitude ±0.2 V; CH1 at 50 mV/div with the trace centred; time/div 5 ms; switch between Normal and Hi-Res and watch the fuzz.
Key points
- Peak keeps the min and max of every reading in a point interval, so nothing escapes between points.
- Hi-Res averages them: less noise (÷ √D), more resolution, no aliasing, but short events vanish.
- Average combines whole captures: needs a repeating signal and a stable trigger.
- Normal, Peak and Hi-Res are identical when the ADC is already at full speed (D = 1).
Elsewhere: the Acquire controls in the user guide §6.5; exact algorithms in reference §3.2; check it yourself: verification tests F1 and F2.
13. Equivalent-time sampling (ETS)
The ESP32 takes one reading every 4 µs at best. Many things worth seeing are far quicker: the edge of a digital signal takes tens of nanoseconds, a hundred times less than the gap between two readings. A single capture cannot show it. Equivalent-time sampling is a way around that limit, for one important kind of signal: signals that repeat.
13.1 The idea: many periods, one picture
If a signal repeats exactly (a clock, a PWM output, a square wave from a generator), then every period is the same. You do not need to see one period in fine detail: you can take a few readings from each of many periods, each reading falling at a slightly different point of the wave, and put them all together into one period. That is equivalent-time sampling. Sampling scopes have used the trick since the 1960s to show gigahertz signals with slow converters.
Three ways to picture it.
- A stroboscope flashing at nearly, but not exactly, the speed of a spinning fan shows the fan turning slowly. Each flash sees the blade a little further on; together the flashes show one turn in slow motion.
- A flip book drawn by many people: each person draws only a few frames, at scattered moments, but if everyone writes down exactly when their frame belongs, the frames can be sorted into one smooth animation.
- In video games, temporal anti-aliasing shifts the camera by a fraction of a pixel each frame and blends many frames into one sharp image: sharp when the scene is still, smeared when it moves. ETS is sharp for a steady repeating signal, and blurred when the signal changes or jitters.
13.2 Folding
The trick works because the signal's period is not a whole number of reading intervals. Take a 20 011 Hz square wave: its period is 49.975 µs, which is 12.494 reading intervals of 4 µs. Reading number 13 therefore lands 0.506 of an interval later in its period than reading 0 did in the first period, reading 26 another 0.506 later, and so on. Over a 96 ms capture (24 000 readings, about 1 900 periods) the readings visit every part of the period. Sorting them by "where in the period was I taken?" gives one period drawn with thousands of points instead of 12.
In maths: reading number k is taken at time k × Δt. Its position inside the period T is
position = fractional part of ( k · Δt / T ) (0 = start of the period, 1 = its end)and its value is drawn at time position × T. Placing every reading this way is called folding the record at the period T, because it is like cutting a long paper strip into period-length pieces and stacking them.
13.3 Measuring the period very precisely
Folding only works if the period is known extremely precisely: to about one part in a million. An error of only 0.001 % would shift the last of 1 900 periods by 2 % of a period, and the stacked pieces would no longer line up. So the scope measures the period from the capture itself:
- It finds every crossing of the trigger level (about 2 000 in a capture), each placed between two readings by interpolation.
- It fits a straight line through "crossing time against period number": the slope of that line is the period.
- It then tries periods very close to that one and keeps the one that makes the folded curve thinnest.
On the test board the period found this way agrees from capture to capture to about 0.2 parts per million.
13.4 What the dots are, and why their density changes
After folding, the scope has 24 000 readings scattered over one period. It divides the period into equal slots, called bins, averages the readings that fall into each bin, and draws one point per bin. With Display → Draw: Dots you see these points directly, and they behave in a way that surprises people at first: the dots get denser when you switch to ETS, and denser again as you choose faster time bases. Figure figure 35 shows it on the test board with a 30.9 kHz square wave: 12 real dots at 5 µs/div in Normal; in ETS 2 001 dots 25 ns apart at 5 µs/div, 1 187 dots 8.4 ns apart at 1 µs/div, and 185 dots 5.4 ns apart at 100 ns/div, where the 6 000-bin limit was reached.
Here is why:
- In Normal mode at 5 µs/div, a dot is a real reading, and they are 4 µs apart: about one dot per division. The edges are single jumps.
- Switch to ETS at the same 5 µs/div and the scope draws about 2 000 points across the screen: two hundred per division. Each is the average of the readings that fell into that thin slot of the period. The gaps are filled because readings from many different periods landed there.
- Go to a faster time base and the scope again aims for about 2 000 points across the screen, so each bin covers less time and the dots stay dense even though the screen now shows a much shorter piece of the period. The equivalent sample rate (Sa in the status bar, for example "94.9 MSa/s ETS", one point every 10.5 ns) goes up.
- That continues until the bins reach one of two limits: never more than 6 000 bins per period (a quarter of the 24 000 readings, so every bin averages at least 4 of them), and never finer than the readings actually fill (which depends on the signal's frequency, next section). After that the scope stops making bins finer, and the dots spread apart as you zoom in further. The status bar and the Acquire box always show the step that was really achieved.
A detail of the drawing: once there are more points than pixel columns on your screen, the scope draws only the lowest and highest dot of each column (section 14.1), so dense ETS dots merge into a line one or two dots thick. Zoom in (a faster time base) and the individual dots separate again.
Each dot being an average also means ETS pictures are less noisy than a single Normal capture: the 24 000 readings are shared among the bins of one period (never more than 6 000), so each dot averages at least 4 readings, and often a few dozen.
One more thing you may notice: the picture updates only once or twice a second. Each ETS picture needs a full 24 000-reading capture, which takes half a second to send over USB (section 9.2).
13.5 Locking: when ETS cannot help
If the period is a whole number of reading intervals, every period is read at exactly the same places, and folding adds nothing.
This happens easily with the ESP32's own generator, because the generator and the ADC run from the same crystal. 10 000 Hz is exactly 25 readings at 250 kSa/s; 50 000 Hz is exactly 5. It also happens near simple fractions: 21 737 Hz came out as 21 739 Hz on the board, which is exactly 11.5 readings per period, so only 23 different positions. The scope detects this and shows ETS: locked, little gain. The cure is to shift the frequency slightly (10 013 Hz instead of 10 000 Hz). A signal from another circuit, with its own clock, is almost never locked.
How fine the steps get depends on how evenly the readings spread over the period, which depends on the frequency. On the test board, 30 901 Hz filled steps down to 5.4 ns (the 6 000-bin limit), while 20 011 Hz only reached 25 ns: it is close to 2/25 of the sample rate, so its readings bunch together.
13.6 Sources that drift
Folding assumes the period stays the same for the whole 96 ms capture. A crystal-controlled signal does. A signal from a cheaper oscillator may not. The ESP32's sine generator is an example: its timing comes from a small RC oscillator inside the chip, and during one capture its frequency wandered by 100 to 290 parts per million on the test board. That sounds tiny, but folding needs about 1 ppm, and a drift of 200 ppm moves the end of the capture by about 1 µs, which is 18° of a 50 kHz sine. Folded with one period, the sine came out smeared (figure figure 37, left).
So the scope can follow the drift. Instead of one period for all 24 000 readings, it looks at the trigger-level crossings near each reading: a reading that lies 30 % of the way between two crossings is placed 30 % into that cycle (the crossing times are first smoothed over about 13 neighbours, which removes the noise of single crossings). This works for smooth signals like a sine. It does not work for fast-edged square waves, because an edge faster than the reading interval does not tell you where between two readings it crossed the level. The scope tries both methods on every capture and keeps whichever folds thinner; a steady square wave therefore always uses the single period. When drift following is used, the Acquire box says "follows the source's drift".
A bonus: with the drift removed, the folded sine showed a narrow dip on its falling half, 0.2–0.3 V deep and about 0.4 µs wide (figure figure 37, right). That is a real defect of the ESP32's DAC: a glitch when its 8-bit number passes the middle of its range, because its internal switches do not all change at exactly the same instant. It is invisible in Normal mode, being a hundred times narrower than the reading interval.
13.7 Limits: read these before trusting an ETS picture
- Repeating signals only. No single events, no glitches that happen once. Use Normal, Peak or Single for those.
- At least 20 periods per capture, so above about 210 Hz (the capture lasts 96 ms). Two channels halve the readings per channel and make the steps coarser.
- Below half the sample rate (125 kHz with one channel). The period is measured from the readings, so a signal above that limit is measured at its alias period and the picture is wrong without warning (chapter 8). The scope refuses when there are fewer than 2.5 readings per period ("signal too fast"). ETS shows detail within slower periods (edges, overshoot, small steps); it does not raise the frequency limit.
- The input's bandwidth still applies. ETS adds points, not bandwidth. An edge seen through 100 kΩ is still rounded by 100 kΩ × 14 pF (chapter 7). The fastest edge on the test board measured 27–32 ns: that is the RC of the input itself with 1 kΩ.
- Jitter becomes blur. If edges wander in time from period to period, the folded edge spreads by about as much as they wander. The picture shows an average, like a persistence display.
- The signal must stay the same for 96 ms. A changing amplitude blurs; a drifting frequency is followed only for smooth signals.
- Slow updates (1–2 per second) and only with the DMA engine. Time bases faster than 5 µs/div (down to 50 ns/div) are available only in ETS.
Try it. Generator: Square, 30 901 Hz. CH1 only, trigger CH1 ↑ 1.65 V. Acquire Normal, 5 µs/div, Draw: Dots, add the measurement Rise. Then Acquire: ETS. Watch the dots fill in, then step the time base down to 100 ns/div and watch Sa climb and the edge appear (Rise ≈ 30 ns instead of "3.2 µs"). Set the generator to exactly 10 000 Hz and read the trigger status (the second badge above the screen). Then try Generator: Sine, 50 000 Hz in Normal and ETS.
Key points
- ETS builds one period of a repeating signal from readings of many periods ("folding").
- It needs the period to about 1 ppm, and measures it from the capture.
- Each ETS dot is the average of the readings in one thin slot of the period; the scope aims for about 2 000 dots per screen, down to the finest step the readings can fill.
- It fails when the signal is locked to the sample clock, does not repeat, or is above half the sample rate.
- It adds points, not bandwidth.
Elsewhere: the ETS controls and status messages in the user guide §6.5; the exact algorithm and all measured numbers in reference §3.7; check it yourself: verification tests F3 and F4.
14. Drawing the picture
The last step from readings to picture is the drawing itself. It sounds trivial, but the way points are drawn changes what you notice, and a few display features reveal things that a single picture cannot.
14.1 Lines or dots
With Lines (the default) the scope joins neighbouring points with straight lines. That makes signals easy to read, but the lines are not measurements: they are the simplest possible guess about what happened between two points (section 5.2). With Dots only the points are drawn, and you see exactly what was measured and how far apart the measurements are.
Use Dots whenever the number of points per period is small, whenever an edge looks suspiciously straight, and whenever you want to know whether a detail is real. Some bench scopes draw a smooth curve through the points instead of straight lines (a mathematical method called sin(x)/x interpolation). It looks nicer for sine waves but can invent wiggles next to sharp edges; this scope keeps to straight lines, so what you see is never more than what was measured.
At slow time bases there may be more points than screen pixels. The scope then draws, for each pixel column, a vertical line from the lowest to the highest point in it (with Dots: just the lowest and the highest dot), so that no extreme is lost by drawing. That is why a noisy signal at a slow time base looks like a band.
14.2 Persistence: many pictures at once
Normally each new capture replaces the previous one. With persistence on, older captures stay on the screen and fade slowly (Short: about a quarter of a second, Long: about 1.5 seconds), or never fade (∞). This imitates the glow of an analogue scope's phosphor, and it shows things a single picture cannot:
- Jitter. If an edge does not happen at exactly the same time in every period, persistence draws it as a smear whose width is the jitter.
- Rare events. A glitch that appears once in a hundred captures flashes past too fast to see, but with persistence ∞ it stays on the screen.
- Variation. A signal whose amplitude changes, a noisy level, a wobbling frequency: persistence shows the whole range it covers, its envelope.
14.3 Layouts and labels
All traces can share one grid (Single), the maths traces can get a grid of their own below the channels (Split), or every trace can have its own grid (Stack). This is purely about readability: with several signals on one grid they can overlap and hide each other. Each grid can show its own volt labels, so you can read values without counting divisions from a 0 V marker.
14.4 X-Y mode: one signal against another
Normally the horizontal axis is time. In X-Y mode one channel drives the horizontal axis and another the vertical, and time disappears from the picture: each point is drawn at (voltage of X, voltage of Y). This is how scopes show the relationship between two signals:
- Two sines of the same frequency draw an ellipse whose shape shows their phase difference: a diagonal line when in phase, a circle when 90° apart (if equal in size).
- Sines at different frequencies draw Lissajous figures: the number of loops along each side gives the ratio of the frequencies.
- Voltage across a component on one axis and current through it on the other draws its characteristic curve: a straight line for a resistor, a bent curve for a diode.
Key points
- Lines are a guess between points; Dots show the real measurements.
- Persistence overlays many captures: it reveals jitter, rare glitches and the envelope of a varying signal.
- X-Y mode plots one channel against another: phase, frequency ratios, component curves.
Elsewhere: Display and X-Y controls in the user guide §6.9 and §6.2; drawing and persistence details in reference §6.
Part 5 · Getting numbers
15. Automatic measurements
Reading values off the grid (section 3.3) is a good skill, but slow and only as precise as your eye. Every digital scope can compute the common values from its samples. This chapter explains how those calculations work, because knowing how a number is made tells you when to trust it.
15.1 What a measurement looks at
Every automatic measurement uses the points that are on the screen, as displayed (after calibration, probe factor, coupling and so on). Two consequences that matter all the time:
- What is off-screen does not count. Changing time/div changes what the measurement sees.
- Measurements that need a whole period, or several, need those periods to be on the screen. Frequency and period need at least two edges of the same kind: show at least two full periods. Mean and RMS are only meaningful over whole periods (or so many periods that a partial one does not matter): averaging 1.5 periods of a square wave gives the wrong mean.
15.2 Level measurements
- Max and Min: the highest and lowest single point. Pk-Pk: Max − Min.
- Top and Base: the two flat levels of a pulse or square wave. The scope finds them by making a histogram of all the points (how many points fall at each voltage) and taking the most common level in the upper half and in the lower half. Spikes, overshoot and ringing are rare, so they hardly affect Top and Base. If a signal has no clear flat levels (a sine), Top and Base fall back to Max and Min.
- Amplitude: Top − Base.
- Mean: the average of all points. RMS: the square root of the average of the squares. AC RMS: the RMS after subtracting the mean (section 2.4). For noise on a flat line, AC RMS is the noise level.
15.3 Time measurements
Time measurements are built from edges. The scope finds the middle level (halfway between Base and Top) and every place the signal crosses it, using a little hysteresis so that noise does not create false crossings. Each crossing time is interpolated between the two points either side, just like the trigger point (section 10.4), so it is much more precise than one sample interval.
- Period: the time from the first rising edge on screen to the last, divided by the number of periods in between. Averaging over every period on screen makes it more precise. Frequency = 1 ÷ Period.
- +Width and −Width: time high and time low, at the middle level. Duty: +Width ÷ Period.
- Rise and Fall: the time from 10 % to 90 % of the way from Base to Top on the first edge (or 90 % to 10 %). If the signal does not settle to flat levels (an RC curve on a fast square wave), Top and Base are not the final levels and the rise time comes out short.
- Area: the integral of the voltage over the screen, in volt-seconds: the area between the trace and 0 V, with area below 0 V counting negative.
15.4 How precise can a measurement be?
A measurement can never be better than the samples behind it:
- Edges faster than a sample interval cannot be measured: the rise time comes out as about one or two sample intervals. On the test board, a digital edge measured "3.2 µs" in Normal mode at 250 kSa/s; the real edge was about 30 ns (seen with ETS). A rise time equal to one or two sample intervals means "faster than I can see", nothing more.
- Frequency is measured very precisely when many periods are on screen, because every crossing is interpolated and averaged. On the test board, 1 kHz from the generator read 1.000 kHz.
- Voltage measurements carry the ADC's accuracy (a few mV after calibration, section 6.3) and its noise.
15.5 Statistics, and why Max jumps
Turn on Statistics and every measurement is repeated on every capture, and the scope shows, besides the latest value:
- μ (mu): the average of all values so far. This is the number to read when you want a steady, precise result.
- σ (sigma): the standard deviation, how much the values scatter from capture to capture. Roughly two thirds of single readings fall within μ ± σ. σ tells you how much to trust one reading.
- min, max: the extremes seen so far, and n: how many captures were measured.
Statistics restart by themselves whenever you change a setting that changes the numbers.
Turn on Statistics and add Max and Top on a square wave, and you will see that Max jumps around while Top barely moves. Max is a single point: the most extreme reading in the capture. Every capture has different noise, so the most extreme reading changes every time, by several millivolts on this scope. Top is the most common level, built from hundreds of points, so noise averages out. That is not a fault; bench scopes do exactly the same. The lesson:
- For the levels of a pulse or square wave, use Top, Base, Amplitude.
- For a steady number, read μ with Statistics; σ says how much a single value can be trusted.
- Use Max, Min and Pk-Pk when you really want the extremes (overshoot, spikes, worst-case ripple), ideally with Peak detect.
A PWM signal at 50 % duty was smoothed by 10 kΩ and 10 µF to a nearly steady voltage, and its Mean measured with Statistics over 45 seconds: μ = 1.6524 V, σ = 0.48 mV. A multimeter read 1.652 V. A single capture's Mean scatters by about half a millivolt; the average of a hundred captures agrees with the meter within 0.4 mV, less than one ADC step.
Key points
- Measurements use the points on screen: show whole periods, at least two for frequency.
- Top/Base use the most common levels and ignore spikes; Max/Min are single noisy points.
- Time measurements interpolate crossings at the middle level.
- A rise time of one or two sample intervals means "faster than this scope can see".
- Statistics: read μ for a steady number; σ is the scatter of single readings.
Elsewhere: the Measure controls in the user guide §6.6; exact formulas in reference §4.1, statistics in §4.2.
16. Cursors: measuring by hand
Automatic measurements cover the common cases. For everything else, there are cursors: lines you place on the screen yourself, with the scope telling you exactly where they are.
16.1 Time cursors and level cursors
- Time cursors are two vertical lines, A and B. The scope shows the time of each, the difference ΔT = tB − tA, its inverse 1/ΔT (the frequency, if A and B are one period apart), and every trace's voltage at A and at B.
- Level cursors are two horizontal lines on one chosen trace. The scope shows each level and their difference Δ.
You drag them with the mouse. They work on a stopped picture too, which is usually the easiest way: press STOP, then measure at leisure.
16.2 When cursors beat automatic measurements
- Delays between two signals: put A on an edge of CH1 and B on the matching edge of CH2; ΔT is the delay.
- Something the automatic list does not cover: the time a capacitor takes to reach a certain voltage, the length of one particular pulse in a burst, the height of one step in a staircase.
- Checking an automatic number: if a measurement looks strange, measure the same thing with cursors and see whether you agree.
- Single events captured with SINGLE, where statistics have nothing to average.
A capacitor charges through a resistor after a step (section 7.2). After one time constant τ it has reached 63 % of the step. With the Demo (10 kΩ and 100 nF, so τ should be 1 ms): set the generator to 50 Hz so the capacitor charges fully, press STOP, put time cursor A where the curve starts rising and drag B until the cursor readout shows the curve at 63 % of its full step (for the Demo's 0 → 3.3 V step, 2.08 V). ΔT is τ: about 1 ms. The same method on real hardware is verification test G1.
Key points
- Time cursors give ΔT and 1/ΔT, and every trace's value at each cursor. Level cursors give Δ volts.
- Use them for delays, one-off events, and anything the automatic list does not cover, and to check automatic numbers.
Elsewhere: cursor controls in the user guide §6.7; exactly what the readout computes in reference §6.
17. Maths channels: calculating with signals
A scope measures voltages. But often the quantity you care about is something else: a current, a power, a charge, a rate of change. Maths channels (M1 to M4) compute a new trace from the measured ones, point by point, with a formula you write. This chapter explains the ideas behind the most useful formulas, including the two pieces of calculus that describe capacitors and inductors: the derivative and the integral.
17.1 Point by point
A maths channel takes, for each point in time, the values of the channels at that point and puts them through your formula. v1 means "CH1's voltage at this point", v2 CH2's, and so on. v2 - v1 is the voltage between the two points the channels are connected to. (v2 - v1) / R, with a constant R = 10e3 (10 kΩ), is the current through a resistor between those two points, by Ohm's law (I = V ÷ R). Add a unit (A) and the scope shows it in amperes with the right prefix (µA, mA).
This is how a scope measures current: it cannot measure current directly, but it can measure the voltage across a known resistor. A small resistor placed in the current path for this purpose is called a shunt.
17.2 The derivative: how fast it changes
The derivative of a signal, written dv/dt, is its rate of change: how many volts per second it is rising or falling at each moment. On the screen it is the slope of the trace. Where the trace climbs steeply the derivative is large and positive; where it is flat, zero; where it falls, negative.
Why care? Because capacitors work by it. A capacitor's current is proportional to how fast its voltage changes:
i = C · dv/dtWhen a capacitor's voltage rises quickly, a big current is flowing into it; when its voltage is steady, no current flows, whatever the voltage. (An inductor is the mirror image: v = L · di/dt.) So the maths channel C * dv1, with C set to the capacitor's value, shows the capacitor's current, computed from nothing but its voltage.
On the test board both methods were compared on the same capacitor (verification test G2): the current computed from the voltage across a 10 kΩ resistor, (v2 − v1) ÷ R, peaked at 102 µA, and the current computed as C · dv1/dt from the capacitor's voltage alone peaked at 98–99 µA. Two completely different calculations, the same answer within 4 % (a second run, with app 1.10.2: 100.7 µA and 99.3 µA). figure 43 shows that run.
17.3 Derivatives magnify noise
There is a catch. The derivative of a noisy signal is very noisy, because noise consists of small, quick wiggles, and quick wiggles have steep slopes. Taking the slope between two neighbouring points 4 µs apart, 3 mV of noise becomes a slope of up to 750 V/s. To control this, the scope does not take the slope between two neighbours. It fits a straight line through several points on each side (the d/dt window, 3 points on each side by default) and uses its slope. A wider window averages away more noise, but it also smooths the derivative of fast changes, rounding sharp corners.
Practical advice: before taking a derivative, reduce the noise. Use Hi-Res mode (section 12.3), a wider d/dt window, or a slower time base where each point averages more readings. Keep the window shorter than about a tenth of the fastest period you care about.
17.4 The integral: adding up over time
The integral, written ∫ v dt, is the opposite of the derivative: it adds up the signal over time, which on the screen is the area under the trace from the left edge up to each point. A constant voltage integrates into a steadily rising line; a square wave integrates into a triangle (the slope of each side equals the voltage), a positive pulse into a step.
It is useful because charge is the integral of current:
q = ∫ i dt and for a capacitor: q = C · ΔVIntegrating a capacitor's charging current over a charge cycle gives the charge it took in. On the test board (test G3) the Area of the current came to 204 nC, against C × ΔV = 115 nF × 1.67 V = 192 nC: within 6.5 % (a second run: 195.9 nC against 189.1 nC, +3.6 %), with the difference explained by the ADC's floor (the voltage started at 0 V, below the 0.14 V the ADC can read).
The integral has the opposite character to the derivative: it smooths noise away (random wiggles add up to almost nothing), but it is sensitive to any offset. A constant error of 10 mV integrates into a steady upward slope of 10 mV·s every second. AC coupling removes the mean before integrating, which removes that drift (along with any real DC part).
17.5 Using the scope's own measurements in a formula
So far a maths channel has worked point by point: at each sample it looks at the voltages at that instant and computes one number. But the scope also produces numbers that describe the whole picture: the frequency, the peak-to-peak size, the mean, the rise time, and the rest of the Measure list (chapter 15). These are live readings, and a formula can use them by name. That closes a loop. Measure turns a picture into numbers; a maths channel turns numbers back into a picture; with live readings, the numbers of the first step feed the second.
A good way to see why this is useful is to build something that needs both kinds of information. Suppose you want a copy of a sine on CH1, shifted in phase by 60°. A sine is completely described by three numbers:
v(t) = mean + A · sin(2π · f · t + φ)- mean, the level it oscillates around (the reading
mean1); - A, the amplitude: how far it swings from the mean. That is half the peak-to-peak size, so
pp1 / 2; - f, the frequency (the reading
freq1); - φ, the phase: the only one you choose. 60° is π/3 radians, about 1.047.
Written as a formula for a maths channel, this is mean1 + pp1 / 2 * sin(2 * pi * freq1 * t + 1.047). There is no sample of CH1 in it: nothing is copied. The channel calculates a brand-new sine from the three readings, and because the readings are live, it follows CH1 if its size or frequency changes.
Read the figure (figure 45) from the left. The measured sine (CH1) is drawn first; next to it are the three readings, as the arrows show: the dashed middle line is mean1, the vertical arrow is pp1 (half of it is the amplitude), and the horizontal arrow is one period, which is 1 ÷ freq1. The second curve is the formula. A positive φ moves the whole wave to the left, because the sine reaches each value sooner; a negative φ delays it. The shift in time is φ ÷ (2π · freq1) seconds, which for 1 radian at 1.3 kHz is about 122 µs.
Where does t start? At the trigger point. The rebuilt sine therefore has phase φ relative to the trigger, not relative to CH1 itself. The two lie exactly on top of each other (for φ = 0) only when the trigger fires at the moment CH1 crosses its mean while rising; if the trigger level is elsewhere, the rebuilt wave starts with a fixed offset. For the phase to be the same as CH1's, set the trigger level to the mean reading and the slope to Rise.
Some facts about live readings that are worth knowing, because they decide how far you can trust the result:
- One value for the whole screen. A reading is computed over the part of the record that is on the screen, once per acquisition, like the number in the Measure list. Inside the formula it is a constant: the same at every sample. The wave you build is smooth, even if the reading wobbles a little from one acquisition to the next.
- It is only as good as the measurement. A frequency needs at least two edges of the same kind on the screen (a little more than one full period; several periods give a steadier value); with less,
freq1is not a number and the trace disappears (the same rule as everywhere else: a result that is not a number is not drawn). Noise adds to peak-to-peak: a spike makespp1too large. For a sine,acrms1 * sqrt(2)(the RMS of the signal without its mean, times √2) is a good alternative that ignores single spikes; it is exact for a whole number of periods. - The readings have to measure the right thing.
amp1(Ampl, the distance from Top to Base) is meant for square-ish signals. On a sine the "top" is the most common value in the upper half, a little below the real peak, soamp1came out 0.7 % low on a test sine;pp1 / 2was exact. - A frequency error becomes a phase error far from t = 0. The wave is exact at the trigger point, and drifts from CH1 by 2π · (error in freq1) · t. With a 0.01 % frequency error (0.13 Hz at 1.3 kHz), 5 ms from the trigger it is about 0.004 rad, a fifth of a degree: invisible.
The same idea works for other jobs. v1 / pp1 scales a signal so that its peak-to-peak size is always exactly 1, whatever the input; v1 - mean1 subtracts the DC level (compare AC coupling, which does the same with the mean of the screen); freq1 / freq2 is the ratio of two frequencies, which is 1 when two signals are locked together. Names, and which readings exist for which channel, are in the reference §5.8.
17.6 More useful formulas
Power in a resistor (v² ÷ R), energy stored in a capacitor (½ C v²), a theoretical curve drawn over the measured one (for example the RC charge curve 3.3 · (1 − e−t/τ), to check a value of τ by eye), gain in decibels between two signals: the user guide §6.8 has a table of them, and the reference §5 describes the whole formula language.
Pitfall: the ADC floor. Maths uses the values as measured. If a signal goes below about 0.14 V, the ADC reads 0.14 V (section 6.2), and every formula built on it inherits the error. On the test board this made the computed peak current about 14 µA low (102 instead of 116 µA), because the capacitor voltage at the start of charging was really 0 V. Keep signals inside the ADC's range when you want accurate maths.
Key points
- Maths channels compute a trace point by point: (v2 − v1)/R is a current by Ohm's law.
- The derivative is the slope: i = C·dv/dt gives a capacitor's current from its voltage. Derivatives magnify noise: use Hi-Res or a wider window.
- The integral is the area: charge q = ∫ i dt = C·ΔV. Integrals smooth noise but accumulate offsets.
- Live readings (
freq1,pp1,mean1…) bring the Measure numbers into a formula: a sine is rebuilt from its level, size and frequency, with a phase you choose.
Elsewhere: maths controls and useful formulas in the user guide §6.8; the formula language, the names of the live readings and exactly how d/dt and ∫ are computed in reference §5; on real hardware: verification tests G2–G3.
18. The spectrum: signals as frequencies
Everything so far has looked at signals in the time domain: voltage against time. There is a second, equally valid way to look at any signal: as a mixture of sine waves of different frequencies, each with its own size. Plotting size against frequency gives the spectrum, the frequency domain view. The scope computes it with the FFT (fast Fourier transform), a method for finding those sine waves in a list of samples.
18.1 Any signal is a sum of sines
A pure sine wave is one frequency, so its spectrum is a single line. Anything else is several sines added together. A square wave, surprisingly, is a sine at its basic frequency (the fundamental) plus sines at 3, 5, 7, 9 … times that frequency (the odd harmonics), with sizes 1/3, 1/5, 1/7 … of the fundamental. Add enough of them and the corners get sharper and sharper.
Seen this way, several earlier ideas connect. A sharp edge needs high harmonics, so a filter that removes high frequencies (the input's RC, chapter 7) rounds the edge. A square wave's harmonics can lie above the Nyquist frequency even when its fundamental is far below it, and alias (section 8.6). Ripple, noise, mains hum: each shows up as its own line or hump in the spectrum.
18.2 Reading the spectrum display
Turn on FFT in the Display tab and the scope shows the spectrum of the on-screen samples of one trace:
- The horizontal axis is frequency, from 0 up to half the sample rate (the Nyquist frequency: the FFT cannot show anything above it, and anything above it in the signal appears folded below it, chapter 8).
- The vertical axis is the size of each frequency, in dBV: decibels relative to 1 V RMS. 0 dBV is 1 V RMS, −20 dBV is 0.1 V, −40 dBV is 10 mV, −60 dBV is 1 mV. Each 20 dB is a factor of 10 in voltage. A logarithmic scale like this lets you see a 1 V signal and a 1 mV hum on the same picture.
Figure figure 47 shows real spectra from the test board. The sine from the ESP32's DAC is one tall line, with much smaller lines at its harmonics (its distortion) and a floor of noise far below. The square wave from the generator shows the odd harmonics stepping down as 1/3, 1/5, 1/7 … : measured −9.7, −14.4 and −17.7 dB below the fundamental against −9.5, −14.0 and −16.9 dB in theory. The even harmonics are almost absent (the 2nd is 38 dB down) because the duty cycle is exactly 50 %.
18.3 Resolution and windows
- Frequency resolution. The FFT divides the frequency range into equal bins of width Δf = sample rate ÷ number of samples. More samples on screen (a slower time base at the same sample rate, or more memory) give finer resolution. To separate two frequencies 10 Hz apart you need at least 0.1 s of signal.
- Windowing. The FFT assumes that the piece of signal it gets repeats forever. If the screen does not contain a whole number of periods, the join between the end and the start is a jump, and that jump spreads energy into neighbouring frequencies ("leakage"). To reduce it, the samples are first multiplied by a smooth bell-shaped curve (a Hann window) that fades the ends to zero. The price: each line becomes a few bins wide, and a sine that falls between two bins reads up to 1.4 dB low. Because the window's bell shape is known exactly, the height ratio of the three top bins tells where between them the tone really is and how tall it really is: the scope's peak label uses this, so it reads the tone itself rather than the nearest bin.
18.4 When the spectrum misleads
The FFT does its arithmetic exactly; what can go wrong is what it is given. On this scope:
- Aliases. There is no filter before the ADC (chapter 8), so anything above half the sample rate is folded back below it and looks exactly like a real line. A square wave has harmonics far above that. If the number of samples per period is a whole number, every folded harmonic lands on top of a real one and the spectrum looks deceptively clean; otherwise the folded ones fall between the harmonics as extra "spurs". Test: change the time base. Real lines stay at the same frequency; aliases move.
- Too few periods. With fewer than about 2 periods on screen the FFT cannot tell the frequency (resolution = 1 ÷ the time on screen). The pane warns.
- The acquire mode. Normal gives the samples themselves: use it for numbers. Hi-Res averages within each point, which is a filter, so high frequencies read lower (12.3). Average combines captures that start at slightly different places relative to the signal (the trigger moves by up to one sample), so it smooths edges and lowers the high harmonics too (on the test board the 9th harmonic of 1 kHz by about 4–5 dB at 10 ms/div) (12.4). Peak stores the minimum and maximum of each stretch, not samples, so it has no spectrum at all. ETS rebuilds one period on a fine time grid, so it shows harmonics far above 125 kHz; but when it is locked (13.5) on an odd number of samples per period, the samples fold odd harmonics onto even ones, and a square wave seems to have even harmonics it does not have.
- Between bins. A sine that falls between two bins reads up to 1.4 dB low (the window's price). The peak label corrects this for the strongest line when it is a single clean tone; for the other lines, read levels to about ±1.5 dB and frequencies to half a bin.
18.5 What the spectrum is good for
- Finding the frequency of something hidden in a messy signal (a hum, a whine, an oscillation).
- Checking how clean a sine is: the harmonics show its distortion.
- Seeing what a filter does: compare the spectrum before and after.
- Understanding noise: is it spread evenly (random), or concentrated at certain frequencies (interference)?
How far below the main signal you can see depends on the noise and on the bin width (narrower bins collect less noise each). On the test board, with 15 Hz bins, the noise floor of figure figure 47 lay about 70 dB below the sine, and the DAC sine's largest harmonic (its 3rd) 48 dB below it. That is good enough to see the shape of a signal's spectrum, hum and ripple, but it is not a precision audio analyser.
Key points
- Any signal is a sum of sines; the spectrum shows their sizes against frequency.
- A square wave = fundamental + odd harmonics at 1/3, 1/5, 1/7 … of its size.
- dBV: 0 dBV = 1 V RMS; every 20 dB is a factor of 10.
- Resolution = sample rate ÷ number of samples. The FFT shows only up to the Nyquist frequency.
Elsewhere: FFT controls in the user guide §6.9; exactly how the spectrum is computed in reference §6.
Part 6 · Signal sources and good habits
19. The built-in signal generator
A scope needs something to look at. Bench labs have a separate signal generator; this scope's firmware turns one ESP32 pin into a simple one. Knowing how it makes its signals explains several effects met earlier: the frequencies it cannot hit exactly, why its square wave locks to the sampling, and why its sine drifts.
19.1 Square waves from a clock divider
The Square mode uses the ESP32's LED-PWM hardware (LEDC), which makes a square wave by counting the chip's 80 MHz clock: high for so many counts, low for so many. Two consequences:
- Not every frequency is possible. The frequency is 80 MHz divided by a whole number of counts (with a few more constraints), so at high frequencies the possible values are spaced apart. The panel shows the frequency the ESP32 actually set next to the one you asked for. Duty cycle is adjustable from 0 to 100 %. Below 100 Hz the firmware uses a software timer instead (edges accurate to about 0.1 ms).
- It runs from the same crystal as the ADC. So the generator and the sampling never drift against each other. That makes test pictures rock steady, but it also causes two effects you have met: at low sample rates, narrow pulses are caught either in every capture or in none (section 12.2), and ETS locks at "round" frequencies (section 13.5). A signal from any other circuit, with its own clock, does neither.
19.2 Sine waves from the DAC
The ESP32 also has a DAC (digital-to-analogue converter: the opposite of the ADC, it turns a number into a voltage) on GPIO25 and GPIO26, fed by a built-in cosine generator. The Sine mode uses it (130.6 Hz to 200 kHz; below one frequency step, about 130 Hz, the generator gives no output). It is a very different kind of source:
- Its timing comes from a small RC oscillator inside the chip, not from the crystal. Its frequency can only be a whole multiple of one step, about 130.6 Hz: 130.6, 261.2, 391.8 and so on. There is nothing in between, so the Frequency field in Sine mode works in steps too: type 1 000 and it jumps to the nearest one (1 044.8 Hz); the arrow keys move one step at a time. (Without that, typing 1 000 and 1 040 would both give the same output.) The step itself is only promised to about ±5 %, and it drifts slowly with temperature, so read the real frequency from the scope, not from the panel. (On the test board it was much better than that: twelve steps from 130.6 Hz to 199.8 kHz all came within +0.06 % of n × 130.6 Hz; see the reference §10.1. Another board's oscillator can differ by several percent.)
- Because it is independent of the ADC's crystal, it is a good stand-in for "a signal from another circuit": it never locks in ETS, but its drift has to be followed (section 13.6).
- It has only 8 bits (256 steps), so it is a fine staircase rather than a smooth curve, and it has a small glitch once per cycle where its code passes the middle of its range (section 13.6).
- Its amplitude can be set to ±0.2, ±0.4, ±0.8 V or ±1.6 V around about 1.62 V. The largest setting goes beyond the ADC's range and is clipped at the top and bottom.
19.3 Using it safely
The generator pin swings between 0 and 3.3 V and can supply only a few milliamps. Always connect it through a series resistor (330 Ω at the very least; 1 kΩ is the standard here), and never connect it to anything that has its own power supply. The output is switched off (high impedance) every time the scope connects.
Key points
- Square: crystal-derived, frequencies in steps, shares the ADC's clock (steady pictures, but locking effects).
- Sine: DAC with an internal RC oscillator: frequency in ≈ 130.6 Hz steps, ±5 %, drifts, 8-bit steps, one small glitch per cycle.
- Always through a series resistor.
Elsewhere: generator controls in the user guide §6.10 and §5.6; the GEN command and measured frequencies in reference §7.1.
20. Good habits and common mistakes
This chapter collects the practical lessons of the whole page into a checklist. Most wrong measurements, on any scope, come from one of these.
20.1 Before connecting
- Grounds together. The circuit's ground and the ESP32's GND must be connected, and the ESP32's GND is your computer's ground (section 7.7).
- Stay inside 0–3.3 V at the pin. Bigger or negative signals need a divider or a bias circuit first. Check unknown voltages with a multimeter before connecting.
- A resistor in series with every input (1 kΩ) and with the generator output.
- Wire with the USB cable unplugged, check, then plug in.
20.2 While measuring
- Press AUTO when lost, then adjust.
- Glance at Sa. Is the sample rate high enough for what you expect to see (chapter 5)? Is half of it comfortably above the frequencies in the circuit (chapter 8)?
- Suspect aliasing whenever a frequency surprises you. Change time/div: a real signal keeps its frequency.
- Watch for floor and CLIP. They mean the reading is not the real voltage (section 6.2).
- Trigger in the middle of the signal (50% button), on a part of the wave that crosses the level once per period. Normal mode for slow signals.
- Use Dots when in doubt about whether a detail is real (section 14.1).
- Choose the acquire mode for the question: Peak for glitches, Hi-Res for clean slow traces, Average for noisy repeating signals, ETS for fast edges (section 12.6).
- Keep the source resistance low or buffer it (section 7.4). If connecting the scope changes the circuit's behaviour, suspect loading.
20.3 Before believing a number
- Does the picture agree? Count divisions and check the automatic value roughly.
- Are there whole periods on screen (at least two for frequency)?
- Use Top/Base/Amplitude for pulse levels and μ with Statistics for steady numbers, not single-point Max/Min (section 15.5).
- Is the result limited by the sample interval? A rise time of one or two intervals means "too fast to see".
- Has this scope been checked on your board? The verification guide compares it with a multimeter, with physics and with a stopwatch. Every number on this page is what one test board did.
20.4 Common mistakes and what they look like
| What you see | Common cause | Chapter |
|---|---|---|
| A slow wave, or a flat line, where a fast signal should be | Aliasing: sample rate too low | chapter 8 |
| Picture drifts sideways | Trigger level outside the signal, or wrong source | chapter 10 |
| A signal that should start at 0 V starts at 0.14 V | The ADC's floor | chapter 6 |
| Flat tops at about 3.15 V | Clipping: signal above the ADC's range | chapter 6 |
| Edges rounder than expected, amplitude lower at high frequencies | High source resistance with the input's 14 pF | chapter 7 |
| A narrow pulse appears in some captures, not others | Normal mode at a low sample rate | chapter 12 |
| A smooth "shape" that changes as soon as the trigger changes | Average on an untriggered signal | chapter 12 |
| Rise time reads exactly one or two sample intervals | The edge is faster than the sampling | chapter 15 |
| A very jagged derivative | Noise magnified by d/dt | chapter 17 |
| Random values on an unconnected input | Nothing is connected: a floating pin picks up anything | — |
Elsewhere: symptoms and fixes for the software and connection in the user guide §8; safety rules in the user guide §2.
21. Glossary
Every technical word used on this page and in the other documents, with the chapter that explains it.
| AC coupling | Showing only the changing part of a signal by removing its average. section 3.6 |
| AC RMS | The RMS value after subtracting the mean: the size of the changing part, or the noise on a flat line. section 2.4 |
| Acquire mode | What the scope keeps for each point when it has more readings than points (Normal, Peak, Hi-Res), or how it combines captures (Average, ETS). chapter 12 |
| ADC | Analogue-to-digital converter: measures a voltage and answers with a number (a code). chapter 6 |
| Alias, aliasing | A false, slower wave produced by sampling a signal at less than twice its frequency. chapter 8 |
| Amplitude | For a sine, half its peak-to-peak; for a pulse or square wave, Top − Base. section 2.3 |
| Anti-alias filter | A low-pass filter before the ADC that removes frequencies above half the sample rate. This scope has none. section 8.5 |
| Auto (trigger mode) | Captures even without a trigger after a short wait, so something is always shown. section 10.6 |
| Autoset (AUTO key) | Finds a repeating signal and sets time/div, volts/div and trigger level. section 3.4 |
| Average (acquire mode) | Averages successive triggered captures; reduces noise on repeating signals. section 12.4 |
| Bandwidth | The frequency at which the input's response has dropped to 71 % (−3 dB). section 7.3 |
| Bin | A small slot of time (in ETS) or of frequency (in the FFT) into which samples are collected. section 13.4, section 18.3 |
| Bit | A binary digit. A 12-bit ADC gives 212 = 4096 different codes. section 6.1 |
| Box-car filter | Averaging over a fixed time window; what Hi-Res does inside each point interval. section 12.3 |
| Capture (acquisition, record) | One block of samples taken at one fixed rate, the raw material for one picture. section 9.1 |
| CLIP | Label shown when the signal went above the ADC's top (≈ 3.15 V): readings there are not the real voltage. section 6.2 |
| Code | The ADC's output number, 0 to 4095. section 6.1 |
| Cursor | A line you place on the screen to read times and voltages by hand. chapter 16 |
| DAC | Digital-to-analogue converter: turns a number into a voltage. The generator's sine uses it. section 19.2 |
| dBV | Decibels relative to 1 V RMS. Every 20 dB is a factor of 10 in voltage. section 18.2 |
| DC | A steady voltage, or the steady part (mean) of a signal. section 2.1 |
| Dead time | Time between captures when nothing is measured. section 9.2 |
| Decimation | Reducing many ADC readings to fewer points. chapter 11 |
| Derivative (d/dt) | The rate of change of a signal: the slope of the trace. section 17.2 |
| Division | One square of the screen grid. 10 across, 8 up. section 3.1 |
| DMA | Direct memory access: hardware that moves ADC readings into memory without the processor, which allows 250 kSa/s. section 4.3 |
| DNL | Differential non-linearity: some ADC codes are wider than others. section 6.4 |
| Duty cycle | The fraction of the period a pulse signal is high. section 2.5 |
| Edge | A transition from low to high (rising) or high to low (falling). section 2.5 |
| ENOB | Effective number of bits: how many bits of a reading are above the noise. About 9–10 here. section 6.4 |
| ETS | Equivalent-time sampling: rebuilding one period of a repeating signal from readings of many periods. chapter 13 |
| FFT | Fast Fourier transform: computes the spectrum of a list of samples. chapter 18 |
| floor | Label shown when the signal went below the ADC's bottom (≈ 0.14 V). section 6.2 |
| Folding | Placing every reading at its position inside the period. section 13.2 |
| Frame | One capture as sent over USB, with a checksum. section 4.3 |
| Frequency (f) | Repetitions per second, in hertz. f = 1 / T. section 2.2 |
| Fundamental, harmonics | The basic frequency of a repeating signal, and the whole multiples of it that make up its shape. section 18.1 |
| Glitch | A short, unwanted spike or dip. section 2.6 |
| Hi-Res | Acquire mode that averages all readings inside each point. section 12.3 |
| Holdoff | A time after a trigger during which new triggers are ignored. section 10.7 |
| Hysteresis | A margin the signal must go back past before the trigger can fire again; stops noise re-triggering. section 10.5 |
| Integral (∫ v dt) | The running area under the trace. section 17.4 |
| Interpolation | Estimating a value between two samples (here with a straight line). section 10.4 |
| Jitter | Small random variation in the timing of an edge from period to period. section 14.2 |
| Live reading | A number of the Measure list (freq1, pp1 …) used by name inside a maths-channel formula. section 17.5 |
| Loading | The change a measuring instrument causes in the circuit it is connected to. section 7.5 |
| Locked (ETS) | A period that is a whole number or simple fraction of reading intervals, so the readings fall on the same few places in every period. section 13.5 |
| Mean | The average voltage; what a DC meter shows. section 2.3 |
| Memory depth, record length | The number of samples in one capture. section 9.1 |
| Noise | Random unwanted variation on a signal. section 2.7 |
| Normal (acquire mode) | One reading per point. section 12.1 |
| Normal (trigger mode) | Draws only triggered captures; waits otherwise. section 10.6 |
| Nyquist frequency | Half the sample rate: the highest frequency the samples can represent. section 8.3 |
| Peak detect | Acquire mode that keeps the lowest and highest reading of each point interval. section 12.2 |
| Peak-to-peak (Pk-Pk) | Maximum minus minimum. section 2.3 |
| Period (T) | The time of one repetition. section 2.2 |
| Persistence | Keeping older captures on screen, fading slowly. section 14.2 |
| ppm | Parts per million: 100 ppm = 0.01 %. Used for tiny frequency differences. section 13.6 |
| Pre-trigger | The part of a capture recorded before the trigger point. section 10.3 |
| Probe factor | The factor by which a divider reduces the signal; the scope multiplies readings by it. section 7.6 |
| Quantisation | Rounding a voltage to the nearest ADC step. section 6.1 |
| RC low-pass filter | A resistor feeding a capacitor: rounds edges, attenuates high frequencies. section 7.2 |
| Resolution | The smallest step a measurement can show (≈ 0.8 mV for the ADC). Not the same as accuracy. section 6.1 |
| Rise time, fall time | Time taken from 10 % to 90 % of an edge (or back). section 2.5 |
| RMS | Root mean square: the DC voltage that would give the same power. Sine: amplitude ÷ √2. section 2.4 |
| Roll mode | Continuous streaming at slow time bases; the trace scrolls, no trigger. section 9.4 |
| Sample, reading | One measurement of the voltage at one instant. chapter 5 |
| Sample-and-hold | The tiny capacitor inside the ADC that holds the pin voltage still while it is converted. section 7.1 |
| Sample rate (Sa/s) | Samples per second. 250 kSa/s = one every 4 µs. section 5.1 |
| SAR | Successive-approximation register: an ADC that finds its code by halving the range bit by bit. section 6.1 |
| Shunt | A small resistor used to measure current from the voltage across it. section 17.1 |
| Single | Wait for one trigger, capture, stop. section 10.6 |
| Skew (channel) | The time between the readings of two channels that share one ADC. section 5.4 |
| Source impedance | The resistance of whatever drives the signal; with the input's capacitance it sets the bandwidth. section 7.1 |
| Spectrum | The sizes of the sine waves that make up a signal, against frequency. chapter 18 |
| Statistics (μ, σ) | Average and spread of a measurement over many captures. section 15.5 |
| Time constant (τ) | R × C: the time an RC circuit takes to reach 63 % of a step. section 7.2 |
| Time/div, volts/div | The horizontal and vertical value of one grid square. section 3.1 |
| Top, Base | The two flat levels of a pulse or square wave (most common levels). section 15.2 |
| Trigger | The rule (source, level, edge) that decides where t = 0 is, so captures line up. chapter 10 |
| X-Y mode | One channel plotted against another instead of against time. section 14.4 |