Part

Function generator

The bench box: four shapes, knobs on the face, and a real 50 ohm output that a load pulls down.

See every part
  • 2 pins
  • 5 settings
  • In 6 projects
  • In 5 lessons
Drawn live by the editor's own code, at the size you see it.
At a glance

The Function generator in brief

What it is, and every setting the properties panel gives it.

A bench function generator makes a repeating waveform at a frequency and level you dial in; it is the source for testing filters, amplifiers and anything a sketch must measure. Mokxi’s has two terminals, OUT and GND, and four shapes: sine, square, triangle, and the sawtooth that nothing else in the catalog produces. Frequency defaults to 1000 Hz and amplitude to 2.5 volts peak around a 2.5 volt offset, so the stock setting swings 0 to 5 volts and suits an Uno analog pin as it is; for an ESP32, lower the amplitude and offset to stay inside 0 to 3.3 volts, and always tie the generator’s GND to the board’s. The square wave has a duty property. Unlike the ideal signal generator part, this one drives through a real 50 ohm resistance in the circuit solver, so into 50 ohms you measure half the amplitude you set and into 1k about 95 percent, as on a real bench box. The solver lands exactly on every square edge. Distortion, rise time, noise, sweep, modulation and any output current limit are not modeled.

Family
Timers and analog
Pins
2
wave
sine (or square, triangle, sawtooth)
sine, square, triangle or sawtooth.
frequency
1000
in hertz, 1000 by default.
amplitude
2.5
the peak swing either side of offset, 2.5 by default.
offset
2.5
2.5 by default, so the stock settings give a 0 V to 5 V swing.
duty
50
the square wave's duty cycle, 50 by default.

A circuit built around it, running and explained: the Function generator simulator.

Pins

2 pins

Named as the editor names them, so a wire lands where you expect it.

Pin
Role
What it does
OUT
Input or output
The waveform, behind 50 ohms.
GND
Input
The reference the waveform is measured against.
How to use it

How to use a bench function generator

Wire OUT to the node you want to drive and GND to the circuit’s ground, then pick the shape, frequency and amplitude with the buttons on its face, which step 1, 2, 5 per decade the way a real dial is marked. Offset and duty are in the properties panel. An offset of 0 swings the wave either side of ground, as here; the default 2.5 V gives 0 to 5 V.

The circuit here sends a 100 Hz, 2 V sine into a 16 k and 0.1 uF low pass with a scope on both ends. Sweep it by hand: at 20 Hz the two traces nearly overlap, at 100 Hz the output is 0.707 of the input and 45 degrees behind, and by 2 kHz it has all but gone. The generator’s 50 ohms is nothing against 16 k.

Part pin
Board pin
OUT
The 16 k resistor, and scope CH1
GND
The ground rail
Scope CH2
The filtered node across the capacitor

Into an Arduino analog pin, keep the wave inside 0 to 5 V on an Uno and 0 to 3.3 V on an ESP32, and join the generator’s GND to the board’s.

RC filter on the benchlive0.000 s 0.00x
Click to open it in the editor
This is the simulator itself, running here. Click anything to open it in the editor.
How it is modeled

What is true about the Function generator, here

In its help article’s own words: what the simulation gets right, and where it stops.

Modeled

The waveform goes into the analog solver rather than being stepped by the part, so the solver puts a breakpoint on every square-wave edge and every sawtooth fly-back and lands exactly on it instead of integrating through it. The 50 ohms is a real element in the matrix, not a correction applied afterwards: into 50 ohms you measure half the amplitude you asked for, into 1 k about 95% of it, into a megohm all of it.

Not modeled

No distortion, no amplitude or frequency drift, no sweep mode. A sweep here is pressing the frequency button, which is a step rather than a glide. No modulation and no burst.

The waveform is mathematically exact: a square wave's edges are vertical with no rise time, a sine has no harmonics, and there is no noise floor, no jitter and no DC offset error. The 50 ohms is a pure resistance with no reactance and no frequency dependence. There is no output protection or current limit (the generator will drive a short circuit forever) and no upper frequency limit other than what the solver's own step can follow, so asking for a megahertz gives a megahertz rather than the rolled-off, distorted thing a real box would produce.

From Function generator, in full.

Projects

See the Function generator in a project

6 built-in projects use it. Each opens in the editor, already wired.

Boards

The boards it is shown on

This board has a built-in project with the Function generator in it.

Wire up the Function generator

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.