A signal generator produces a controlled electrical signal — sine, square, triangle, or arbitrary waveform — at a specified frequency and amplitude. They're essential for electronics testing and development: you need a known, clean signal to characterise a filter, test an amplifier's frequency response, verify ADC sampling, or inject a tone into an audio circuit. Understanding what's available (from the humble 555 to a modern DDS bench instrument) lets you pick the right tool for the job.
Types of Signal Generators
Type
Frequency range
Output waveforms
Accuracy
Cost range
555 timer (astable)
1 Hz – ~500 kHz
Square (approximate)
Poor (±10–20%)
Cents
MCU PWM
DC – ~1 MHz
Square (+ filtered sine)
Moderate (crystal-limited)
Already have one
AD9833 DDS module
0 – 12.5 MHz
Sine, triangle, square
Good (±0.1 Hz)
$2–5
Si5351 clock gen
8 kHz – 160 MHz
Square (3 independent outputs)
Good
$5–10
Analog bench function gen
0.1 Hz – 20 MHz
Sine, square, triangle, ramp
Good (DDS-based internally)
$50–500
AWG (arbitrary waveform gen)
DC – GHz range
Any user-defined waveform
Very good
$200 – $50,000+
RF signal generator
100 kHz – 40 GHz
Modulated RF carrier
Excellent (synthesised)
$500 – $100,000+
Function Generators
The classic bench instrument for audio and RF development. Modern function generators are DDS-based internally — a DAC clocked at high speed reads a waveform lookup table, producing the output frequency and shape. Key specs to look for:
Spec
What to look for
Why it matters
Max frequency
At least 10× your highest frequency of interest
Square wave edges contain harmonics well above fundamental
Frequency resolution
µHz to mHz resolution in DDS instruments
Fine-tune beat frequencies, PLL testing
Amplitude range
1mVpp to 10–20Vpp
Injecting signals into sensitive circuits needs small amplitudes
DC offset
Adjustable ± supply range
Biasing signals to ADC input range, testing with DC component
Output impedance
50Ω (standard)
Matches coaxial cable and RF equipment; affects amplitude at load
The AD9833 is an SPI-controlled DDS IC producing sine, triangle, or square waves
from DC to 12.5 MHz with 28-bit frequency resolution.
Frequency register = f_desired × 2^28 / f_MCLK
Example (f_MCLK = 25MHz):
1 kHz: FREQ_REG = 1000 × 268435456 / 25000000 = 10,737
10 kHz: FREQ_REG = 10000 × 268435456 / 25000000 = 107,374
1 MHz: FREQ_REG = 1000000 × 268435456 / 25000000 = 10,737,418
SPI write sequence (16-bit frames):
1. Write control register (reset, waveform type)
2. Write lower 14 bits of frequency word
3. Write upper 14 bits
4. Release reset — output begins
Si5351 Clock Generator
Three independent clock outputs, each 8kHz – 160MHz.
Commonly used as a variable frequency oscillator (VFO) for radio.
Control via I2C:
PLL A and B: each multiplied from crystal reference (25 or 27MHz)
Each output: divided down from PLL
Output frequency = (f_xtal × a + b/c) / d
where a, b, c, d are programmed dividers
Libraries (Si5351Arduino by NT7S) handle all the register math:
si5351.set_freq(1000000ULL * 100, SI5351_CLK0); // 100 MHz on CLK0
555 Timer as Signal Generator
555 timer astable circuit: RA, RB, and C connect to the discharge and threshold/trigger pins to set the output frequency and duty cycle.
f = 1.44 / ((RA + 2×RB) × C)
Duty cycle = (RA + RB) / (RA + 2×RB)
Note: standard 555 cannot achieve exactly 50% duty cycle in astable mode.
Use TLC555 or LMC555 (CMOS) with equal R and steering diodes for 50%:
Modified 555 timing network: steering diodes D1 and D2 separate the charge and discharge paths so equal timing resistors can produce an approximately 50% duty cycle.
Charge: through RA, D1 (bypasses RB)
Discharge: through RB, D2 (bypasses RA)
With RA=RB: duty ≈ 50%
Microcontroller as Signal Generator
PWM Square Wave
Any MCU with a timer peripheral can generate square waves:
Arduino (hardware PWM, pin 9):
TCCR1B = (TCCR1B & 0xF8) | 0x01; // no prescaler, ~31kHz base
analogWrite(9, 127); // ~50% duty, ~31kHz
Or: direct tone():
tone(9, 1000); // 1kHz square wave on pin 9, blocking
For precise frequency: use ICR1 mode (16-bit timer):
ICR1 = F_CPU / (prescaler × frequency) - 1
Sine Wave via DAC + Low-Pass Filter
Generate sine wave from lookup table via DAC:
1. Create table of N samples per cycle: sine_table[N]
2. Output each sample via DAC at rate f_sample
3. Sine output frequency = f_sample / N
4. Low-pass filter after DAC removes step artifacts
Arduino Uno with R-2R DAC (8-bit, 8 pins):
f_sample ≈ 40kHz (limited by loop speed + DAC settling)
For 1kHz sine: N = 40 samples per cycle
Raspberry Pi Pico with 12-bit DAC (MCP4725):
f_sample up to ~100kHz via DMA
For 1kHz: 100 samples per cycle, very clean output
Scope Usage with Signal Generator
Measurement
Signal generator setting
Scope setup
Filter frequency response
Sweep frequency, constant amplitude
Measure output amplitude at each frequency; plot
Amplifier gain
Known amplitude at target frequency
Compare output to input — gain = Vout/Vin
Amplifier distortion
Sine at rated frequency and amplitude
FFT mode on scope — harmonics show distortion
ADC sampling test
Sine at known frequency below Nyquist
Sample and reconstruct — check for aliasing
RC time constant
Low-frequency square wave (period >> 5τ)
Watch exponential charging on scope
References
Horowitz & Hill — The Art of Electronics, 3rd ed. Chapter 7