← Imperial College LondonMSc coursework · Imperial College London · 2024

Vector Impedance Meter

Most of my professional work is under NDA, so it isn’t shown on this site. This project is from my MSc and can be shared in full.

An LCR meter built for the Instrumentation module. It applies a sine wave to a component, measures the voltage across it and the current through it, and uses an FFT to find its impedance and phase. The phase tells it whether the part is a resistor, capacitor or inductor.

The meter in its printed case with the Kelvin leads wrapped around it
The meter in its case
Module
ELEC70055 Instrumentation, Imperial College London
Year
2024, MSc
Tools
KiCad, LTspice, FreeCAD, STM32CubeIDE
Result
Working at the final demo
01 · Exploded view

Inside the meter

Built from the KiCad board and the FreeCAD case. Scroll to take it apart.

Loading the 3D view…

02 · How it works

Measuring impedance

The STM32 outputs a sine wave from its DAC through the part. One path converts the current through the part into a voltage; the other measures the voltage across it. Both go through the same multiplexer, gain stage and ADC, so any offset affects both equally and cancels when one is divided by the other. An FFT gives the magnitude and phase at the test frequency.

Z = VDUT ÷ IDUT−90° capacitor · 0° resistor · +90° inductor
DACSTM32 · sine by DMAFilterSallen-KeyDeviceKelvin, 4-wireBridge → ITL071 · 4 shuntsAmp → VINA128MuxTMUX1204GainMCP4018ADC1 MHzFFTZ = V ÷ Icurrent pathvoltage path
03 · Results

Measurements

Frequency sweeps from 10 to 100 kHz on four capacitors. It measured capacitors from tens of picofarads to nanofarads, resistors from a few ohms to 200 Ω, and inductors in the millihenry range.

Phase across the sweepAn ideal capacitor measures −90°. The firmware treats anything between −70° and −110° as a capacitor. The measured phase drifts with frequency because the bridge holds virtual ground less well as frequency rises.
-120°-105°-90°-75°-60°102030405060708090100kHzphasecapacitor window · −90° ± 20°10 nF · 10 kHz · -70.3°10 nF · 20 kHz · -75°10 nF · 30 kHz · -84°10 nF · 40 kHz · -88°10 nF · 50 kHz · -96°10 nF · 60 kHz · -100°10 nF · 70 kHz · -104°10 nF · 80 kHz · -110°10 nF · 90 kHz · -114°10 nF · 100 kHz · -115°15 pF · 10 kHz · -60.8°15 pF · 20 kHz · -64.1°15 pF · 30 kHz · -69°15 pF · 40 kHz · -75°15 pF · 50 kHz · -78.2°15 pF · 60 kHz · -81.4°15 pF · 70 kHz · -92.9°15 pF · 80 kHz · -94.6°15 pF · 90 kHz · -106°15 pF · 100 kHz · -109°20 pF · 10 kHz · -59°20 pF · 20 kHz · -63.2°20 pF · 30 kHz · -68.9°20 pF · 40 kHz · -72.2°20 pF · 50 kHz · -79.9°20 pF · 60 kHz · -89.9°20 pF · 70 kHz · -93.4°20 pF · 80 kHz · -105°20 pF · 90 kHz · -109°22 pF · 10 kHz · -64.9°22 pF · 20 kHz · -65°22 pF · 30 kHz · -70°22 pF · 40 kHz · -75°22 pF · 50 kHz · -78°22 pF · 60 kHz · -95°22 pF · 70 kHz · -92°22 pF · 80 kHz · -98°22 pF · 90 kHz · -100°22 pF · 100 kHz · -111°
  • 10 nF
  • 15 pF
  • 20 pF
  • 22 pF
Signal at the ADCPeak-to-peak voltage after the gain stage. The picofarad capacitors give a large, steady signal. The 10 nF signal drops as its impedance falls with frequency.
0.4 V0.8 V1.2 V1.6 V2 V102030405060708090100kHzpk-pk10 nF · 10 kHz · 1.78 V10 nF · 20 kHz · 1.4 V10 nF · 30 kHz · 1.2 V10 nF · 40 kHz · 0.98 V10 nF · 50 kHz · 0.86 V10 nF · 60 kHz · 0.98 V10 nF · 70 kHz · 0.98 V10 nF · 80 kHz · 0.9 V10 nF · 90 kHz · 0.76 V10 nF · 100 kHz · 0.62 V15 pF · 10 kHz · 1.92 V15 pF · 20 kHz · 1.9 V15 pF · 30 kHz · 1.74 V15 pF · 40 kHz · 1.64 V15 pF · 50 kHz · 1.54 V15 pF · 60 kHz · 1.44 V15 pF · 70 kHz · 1.46 V15 pF · 80 kHz · 1.46 V15 pF · 90 kHz · 1.4 V15 pF · 100 kHz · 1.32 V20 pF · 10 kHz · 1.94 V20 pF · 20 kHz · 1.86 V20 pF · 30 kHz · 1.74 V20 pF · 40 kHz · 1.64 V20 pF · 50 kHz · 1.56 V20 pF · 60 kHz · 1.46 V20 pF · 70 kHz · 1.46 V20 pF · 80 kHz · 1.46 V20 pF · 90 kHz · 1.42 V22 pF · 10 kHz · 1.9 V22 pF · 20 kHz · 1.85 V22 pF · 30 kHz · 1.74 V22 pF · 40 kHz · 1.64 V22 pF · 50 kHz · 1.52 V22 pF · 60 kHz · 1.45 V22 pF · 70 kHz · 1.5 V22 pF · 80 kHz · 1.45 V22 pF · 90 kHz · 1.4 V22 pF · 100 kHz · 1.3 V
  • 10 nF
  • 15 pF
  • 20 pF
  • 22 pF
Calibration, 10 nFBars show the raw 12-bit ADC count. The line is that count converted through the look-up table. The dots are the voltage measured on the bench. The two agree to within 0.046 V at every point.
0.4 V0.8 V1.2 V1.6 V2 V102030405060708090100kHzvolts10 kHz · ADC 208020 kHz · ADC 162630 kHz · ADC 139840 kHz · ADC 108850 kHz · ADC 94960 kHz · ADC 107570 kHz · ADC 114480 kHz · ADC 97090 kHz · ADC 780100 kHz · ADC 66710 kHz · bench 1.78 V · calibrated 1.78 V20 kHz · bench 1.4 V · calibrated 1.414 V30 kHz · bench 1.2 V · calibrated 1.231 V40 kHz · bench 0.98 V · calibrated 0.981 V50 kHz · bench 0.86 V · calibrated 0.869 V60 kHz · bench 0.98 V · calibrated 0.97 V70 kHz · bench 0.98 V · calibrated 1.026 V80 kHz · bench 0.9 V · calibrated 0.886 V90 kHz · bench 0.76 V · calibrated 0.733 V100 kHz · bench 0.62 V · calibrated 0.642 V
  • ADC count (0–4095)
  • From ADC, calibrated
  • Bench measurement
Show the numbers · 10 nF
10 nF calibration sweep
kHzBench pk-pk (V)Phase (°)ADC countCalibrated (V)
101.78-70.320801.780
201.40-7516261.414
301.20-8413981.231
400.98-8810880.981
500.86-969490.869
600.98-10010750.970
700.98-10411441.026
800.90-1109700.886
900.76-1147800.733
1000.62-1156670.642
04 · Design choices

Why these parts

  • Microcontroller

    STM32F405, not ATmega328PB

    The test signal had to reach 100 kHz. With an external DAC the ATmega managed about 1 kHz. The STM32 has a DAC and DMA built in, and ADCs fast enough to sample at 1 MHz.

    ATmega328PB with an MCP4812 DAC

  • Current

    Auto balancing bridge

    An op-amp holds one end of the part at virtual ground, so all its current flows through a known shunt resistor. The voltage across the shunt gives the current.

    A series resistor, which loads the part

  • Connection

    Four wires

    Two leads carry the current and two sense the voltage. No current flows in the sense leads, so their resistance does not affect the reading.

    Two leads, which add their own resistance

  • Range

    Four switchable shunts

    If a reading saturates the ADC at 4095, the firmware switches to the next shunt and measures again. This widens the range of parts it can measure.

    One fixed shunt

  • Voltage

    INA128 instrumentation amplifier

    Its 120 dB common-mode rejection lets it measure the small voltage across the part while ignoring what both leads share.

    A discrete difference amplifier

  • Power

    Linear regulators

    Two MIC5205 LDOs make 5 V and 3.3 V from USB. A switching regulator would add ripple to the measurement.

    A switching regulator

05 · Problems

What went wrong

The board runs from a single 0–3.3 V supply. With the bridge referenced to 0 V, the negative half of the signal fell below the supply rail and was clipped. Adding a 1.65 V reference fixed it, but reduced the dynamic range.

VREF = 0 V3.3 V1.650 V

The negative half of the signal falls below the 0 V rail and is clipped, so the current reading is wrong.

VREF = 1.65 V3.3 V1.650 V

A 1.65 V reference moves virtual ground to the middle of the supply, so the whole signal fits.

Redrawn from the LTspice simulation in the final report.
The corrected board with patch wires, running on the bench
The board after rework, with patch wires
  • Two Kelvin lines were shortedLow potential and low current were joined in the schematic. Cutting tracks and adding patch wires restored the four-wire connection.
  • Too much gainThe gain stage assumed a small signal. After the 1.65 V offset the signal was already large, which narrowed the measurable range.
  • One op-amp too manyThe quad TLV9054 had a spare channel that could have replaced the TL071.
  • Above 100 kHzThe bridge cannot hold virtual ground at higher frequencies. Commercial meters add extra circuitry for this.
06 · Photos

The hardware

Based on Adil Malik’s STM32 FFT LCR meter.