April – June 2026

Auto-Ranging Capacitance Meter

Course design project, B EE 425 (Microprocessor System Design)

A standalone meter on a custom mixed-signal PCB that measures capacitors by switching between a 555 timer and a constant-current source. ESP32-S3 firmware in C++ picks the range, times the measurement, and drives an OLED display.

  • ESP32-S3
  • C++
  • PlatformIO
  • KiCad
  • Mixed-signal PCB
The finished meter in its enclosure, reading 10.040 µF on the OLED with a capacitor clipped to the test leads
The finished meter measuring a 10 µF capacitor.

Overview

The goal was a capacitance meter that works on its own, without a PC attached, and picks its measurement range automatically. The design target was 20 pF to 200 µF.

I designed the circuit and PCB in KiCad, assembled the board and enclosure, and wrote the firmware. An Arduino Nano ESP32 (ESP32-S3) is the controller, an I2C OLED shows the reading, and relays switch between measurement circuits.

How it works

No single method covers that range well, so the meter has two measurement paths:

  • Small capacitors: a TLC555 runs in astable mode with the unknown capacitor as its timing capacitor, so the output frequency depends on the capacitance. The ESP32-S3's hardware pulse counter measures that frequency.
  • Larger capacitors: a constant-current source built from an LT1001 precision op amp, an LT1009 2.5 V reference, and a PNP transistor charges the capacitor through one of three relay-selected 0.1% resistors. The firmware uses the ADC to time how fast the voltage rises, and C = I · Δt / ΔV.
  • Every measurement starts with the 555. If the capacitor is too large, the firmware switches to the constant-current source and steps through the ranges until the charge time can be measured accurately.
KiCad schematic of the capacitance meter showing the power input, constant-current source, 555 timer, relay driver, capacitor input and discharge, and Arduino Nano ESP32 with OLED
Schematic: ±12 V input, constant-current source, 555 timer, relay driver, capacitor input/discharge, and the ESP32 module with OLED.

Hardware and firmware

The board runs from a ±12 V split supply; the Nano ESP32's onboard regulator supplies 3.3 V for the 555 and the OLED. Five 12 V relays, driven through a ULN2803 Darlington array, select the measurement mode, the current range, and a discharge path that empties the capacitor before each constant-current measurement. I put test points on the supply rails and the main signal nodes. They paid off during bring-up, making it quick to track down problems like cold solder joints. The enclosure has a window for the OLED and banana jacks for the test leads.

The firmware is C++ built with PlatformIO on the Arduino framework. Measurement and display code are kept separate, and every reading carries a status (such as timeout or out of range) that's shown on screen and logged over serial, so a bad reading says why it failed. On startup, an open-lead calibration measures the stray capacitance of the leads and subtracts it from later readings.

KiCad PCB layout of the meter with the ESP32 module, OLED header, relays, op amp, 555 timer, and labeled test points
Two-layer PCB layout in KiCad. The FPGA project page compares it with the four-layer board I designed next.
CAD model of the meter enclosure with an OLED window, red and black banana jacks on top, and two barrel jacks on the side
Enclosure model, with the OLED window, banana jacks for the leads, and the two supply jacks.

Testing and results

I compared the meter against a lab LCR meter, using capacitors from tens of picofarads up to about 150 µF, both before and after putting it in its final enclosure. Readings were repeatable but tended to read high, especially at low capacitance, where the leads, banana jacks, and case wiring add a few picofarads of stray capacitance.

The open-lead calibration reduced the mean error in the recorded low-pF readings from about 38% to 6.6%. The constant-current ranges still read several percent high; calibrating each range against the LCR meter is the next step.

What I'd do differently

  • The measurement routine is blocking: the display can't update while a long measurement is running. I'd rewrite it as a non-blocking state machine, which would also make relay timing easier to debug.
  • Testing the power input before populating the board paid off. The -12 V supply's plug was listed as center-positive but wasn't, and I caught it before any parts were on the board.
  • Late in final calibration, the Nano ESP32 developed an internal short from 3.3 V to ground at its flash chip, likely from electrostatic discharge. The board's rails measured correctly with the module removed. The LCR comparison above was recorded before that failure. Next time I'd keep spares of critical modules and be more careful about ESD.

Design files

This was a course project, and the same assignment is given every year, so I'm keeping the firmware source and full report private. I'm happy to walk through them in an interview.