Fareed Mohmed← All projects

Info page · no simulation · Arduino and electronics

Oscilloscope and Function Generator Basics

What an oscilloscope screen shows, how to read the time and voltage grid, and how an Arduino can give test signals.

This topic cannot be run safely or meaningfully in the simulator, so this page explains it with diagrams, calculations and sample code instead. Everything here is original.

What you will learn

  • How to read the time/div and volts/div controls
  • How to find the period, frequency and peak-to-peak voltage
  • What a function generator makes

In short

An oscilloscope draws voltage against time. The screen is a grid. Each square across is a set time (for example 2 ms) and each square up is a set voltage (for example 1 V). You read the signal by counting squares. A function generator is the opposite: it makes a clean sine, square or triangle wave at a frequency and height you choose.

Try this next

  • Measure the 490 Hz PWM from pin 3 and write the period and duty cycle.
  • Compare a 5 V USB supply with a switch-mode supply and look at the ripple.
  • Measure the time of a button bounce with a single trigger.

Reading the screen

CH1 1 V/div2 ms/divCH2 2 V/div

Using the probe

Caution: the scope ground clip is connected to earth. Never clip it to a mains live or neutral wire, and do not measure mains directly. Use an isolation transformer or a differential probe, and ask a teacher to help.

Function generator and Arduino test signals

A function generator gives a sine, square or triangle wave from a few hertz to many megahertz. A school Arduino can make simple square waves that are useful for practice.

SourceSignal
analogWrite on pin 3, 9, 10, 11 (Uno)About 490 Hz PWM, duty set by 0 to 255
analogWrite on pin 5 and 6 (Uno)About 980 Hz PWM
tone(8, 1000)1 kHz 50 percent square wave, from 31 Hz up
void setup() {
  pinMode(3, OUTPUT);
  tone(8, 1000);               // 1 kHz square wave on pin 8: look at it on CH1
  analogWrite(3, 64);          // about 25 percent duty, 490 Hz: look at it on CH2
}

void loop() { }

For a sine wave filter the PWM with a resistor and capacitor, or use a DAC module or a DDS module such as the AD9833.

Do and do not