The storyI have a couple of industrial grade PCBs lying around that are used for audio measurements and was wondering what I could do with them. The boards have audio ADCs and DACs with I2S interface and BNC connectors for in- and outputs. Just for curiosity i dig into the theory of LCR meters. Basic LCR meters using frequencies in the audio range. So why not building an LCR meter with audio ADCs? I kept digging, reading stuff and found this very interesting document:
TIDA-060029 LCR meter analog front end reference design
https://www.ti.com/tool/TIDA-060029This demonstrates a LCR meter analog frontend using an auto balancing impedance bridge. Just a couple of OP amps and analog switches for ranging. Exactly what’s on the boards I have. Well, not exactly but more on that later.
However, it seems absolutely doable and I wanted to give it a go. This was my goal so far:
• build a working LCR meter with an I2S audio codec
• using the auto balancing impedance bridge principle
• using a Teensy as the micro to communicate with the audio codec
I chose the Teensy because there is lots of support for audio stuff.
The first attemptI started with one of the boards with a CS4272 audio codec, a Teensy 4.1 on a breadboard and some wires between them. Just putting a sine wave out and used the two inputs for measuring voltage and current was not a problem but I was not satisfied with the results. This was mainly because of the missing transimpedance amplifier (a crucial part of the auto balancing bridge). Modifying the board with some cuts and extra wires was not possible. This was the reason to design a new board from scratch to have something to play with.
The first prototypeI found existing designs that are using the same principle but most of them are using a single channel ADC and a relative complex phase detector. I wanted to use both inputs of the CS4272 to measure voltage and current at the same time and calculating the phase difference in firmware.
Great help was the TI reference design linked above and the documents for the Evaluation Board For CS4272
https://statics.cirrus.com/pubs/rdDatasheet/CDB4272-2.pdf.
I used EasyEDA for the prototype design. Schematics are attached.
As you can see, I used four BNC connectors for true Kelvin measurement. For the prototype I used the sample service from TI and Analog Devices to get the OP amps, analog switches, the LDO and switching regulators. I salvaged some other parts from the boards mentioned above. I placed a couple of pin headers to connect keypad and display later. There is an EEPROM to store calibration data and other settings. There is a I2C temperature sensor next to the codec to be able to compensate temperature drifts (not implemented yet).
After some excessive coding sessions with Arduino and the Teensy Audio Library I was able to measure voltage and current and did the phase calculation with help of the Audio Library. The phase calculation works exactly the same way as in the TI reference design document. No fancy FFT stuff, just complex math. And it works very well! It works surprisingly well!
The deviceI decided to go further and put the board with a display and a custom keyboard into a 19” case that I have laying around. Now I have a fully functional LCR meter. A very useful device:
Well, the case is quit big for just the main PCB, power supply, display and keyboard. I don’t wanted to buy or build a new case and size was not a limiting factor. But hey, plenty of space for future extensions (DC bias?).
Two 3D printed parts where made for the display and the keyboard front panel. I’ve used the keys of an old pocket calculator from the junk box.
The specsI did measurements with 0.1% resistors from 100 Ohm to 1 MOhm as reference. Results are within 0.5%. So I guess I got a basic accuracy of at least 1% (not for all impedance ranges of course). I think I can improve that further by reworking the calibration routine.
I set the display resolution to 5 digits, which means in fact 100,000 counts. This is quite much for an accuracy of 1%. But this helps me to find out the limits of the device.
Please note: The CS4272 is a 24 bit codec but the Teensy Audio Library uses 16 bit only.
There are four ranges: 100R, 1k, 10k, 100k. The range will be selected automatically according to the impedance of the DUT.
Selectable test frequencies: 100 Hz, 1 kHz, 10 kHz (48 kHz sample rate).
Selectable test levels: 300 mV, 600 mV, 1 V
The following complex parameter of the DUT can be measured (fixed combinations of them):
• Rs // equivalent series resistance (ESR)
• Rp // parallel resistance
• Cs // series capacitance
• Cp // parallel capacitance
• Ls // series inductance
• Lp // parallel inductance
• Phi // phase angle of impedance
• Xs // series reactance
• Z // impedance
• Q // quality factor
• D // dissipation factor
• G // conductance
• B // susceptance
Moving average of the readings can be set from 1 to 256.
Edit: updated schematics
GitHub project page:
https://github.com/wschuma/TeensyLCR