Lessons and the learning game

Build your own bench tools

Five bench tools on one Uno: a frequency counter, capacitance meter, resistor tester, battery tester and signal generator, all in one box with an LCD menu.

What you build

Five instruments that work the way real bench gear does, each one small enough to read in a sitting, then one sketch that puts them all behind a 16x2 LCD and a MENU button.

How it works

Frequency is edges per second. An interrupt on pin 2 counts every rising edge, and once a second the loop takes the count. That one-second gate sets the resolution: 1 Hz, plus or minus one count. At 50 kHz the Uno's millis() timing shows as a few dozen hertz of error.

Capacitance is a time. Charged through a resistor, a capacitor reaches 63.2% of the supply after R x C seconds. Time it to 647 on the ADC and divide by 10k: 10 uF reads 10.16 uF in 101 ms.

Resistance is a divider. The middle of 10k over the unknown sits at a voltage that gives the unknown away: Rx = 10k x adc / (1023 - adc). It is sharp near 10k and blunt at the ends, and the sketch prints the color bands.

Capacity is current times time. The INA219 reads the cell's voltage and current every second, and the sketch adds mA x seconds / 3600 until the cell sags under 0.9 V.

A DAC makes real voltages. The MCP4725 turns a number from 0 to 4095 into 0 to 5 V in 1.2 mV steps. A table of 32 values read out on a steady beat makes a sine.

The course

Build your own bench tools has six lessons, all on the same wiring:

  1. A frequency counter: an interrupt, a one-second gate, and where it stops being right.
  2. A capacitance meter: the RC time constant, and why small and huge capacitors are hard.
  3. A component tester: a divider run backwards, and color bands.
  4. A battery tester: an INA219, a load, and milliamp-hours to a cutoff.
  5. A signal generator: steady voltages and a sine from an MCP4725.
  6. Project: one box, five tools: an LCD menu over all five.

Every step is checked against the running circuit, apart from the last, where you make the box your own and share it.