Author Topic: Low cost tweezers type LCR meter  (Read 17432 times)

Offline Silvio Klaic

  • Administrator
  • Full Member
  • *****
  • Posts: 133
  • Karma: +24/-0
    • View Profile
    • Silvio Klaic Homepage
Low cost tweezers type LCR meter
« on: October 18, 2011, 06:43:02 PM »
I started new project; LCR tweezers - impedance measuring instrument, capable of measuring resistance, capacitance or inductance.
One of main reasons is lack of cheap instruments of this type on market.
Other one is that I have pile of SMD components that need testing and sorting out.

My other projects are currently in hibernation, mainly because they started to be too complex for my taste in current state of development.
In battery capacitance tester I replace 8bit ADC0804 with more precise and cheaper ICL7135 which also increase number of ICs for interfacing with parallel port.
At that point I was seriously thinking to use microcontroller with 10 or 12bit ADC, and replace entire circuit.
On pulse charger after numerous experiments I find out that complex charging signal is more effective, especially if contains complex charging/discharging sequences.
But to experiment with that I need to build far more complex hardware with standard ICs, at which point I decide to start working with microcontrollers.

My pile of SMD components is nightmare to sort out with standard multimeter. I have ability to measure capacitance, inductance and resistance on it, but switching between ranges to find out what is component value started to be never ending painfully slow process.
So I start to look for small tweezers type multimeters which can detect and measure components of inductance, capacitance and resistance. Sadly, existing ones are too expensive for my taste as amateur in electronics.
But this gave me idea to determine what exactly I need. Here is specification of tweezers which I want to construct:
  • Low cost – less than 30 euros.
  • Portable and small size, to easily fit into hand as tweezers.
  • Battery powered for easy handling – idle auto power off (bonus for integrated charger).
  • Based on KISS principle – fewer components as possible (single chip with few passive parts would be ideal).
  • DUT (Device Under Test) automatic type detection – L, C or R (bonus for diodes, etc.)
  • Fast type detection – under 1 second.
  • Fast measurement – under 1 second.
  • Low accuracy – 20% or better.
  • Wide measurement range if feasible:
    • Inductance – 1 uH to 1 H
    • Capacitance – 1 pF to 1 mF
    • Resistance 1 ohm to 10 Mohm
As you can see, I need small, cheap and simple sorting tool. I already have other instruments if I want more precisely testing/measuring.
After searching net I find this as possible project which may have something that fit/closely match or can be adapted to my specification:

I. group: Exact or closely matched
There are projects which involve measuring all three components.
They are based on measuring phase shift between voltage and current.
One is Russian version of LCR meter; you can find details at or (Russian language).
Other one is at

Now, these hardware projects are complex, expensive and big. Adopting them to my requirements is not feasible (my estimation).

II. group: Closely matched and can be adapted
Other instruments are mostly based to test LC, RC or only one L/C/R type and do not measure by default all three types.
There are many working principles from measuring charging time to change of frequency.
Here are some of those projects:
Adaptation any of this to my needs will require adding additional switching, some independent test hardware and then some way to determining what DUT it is.
However I find one version closest to my needs at there is also changed version at

This is simple, small and it can be made to measure all three types.
However measured range is limited and some measurements require up to few seconds or are unreliable, like inductance where entire device can hang and need resetting.

I can recombine these schematics by using more LC components for resonance to increase measurement range and resistors to achieve my specifications.
For switching it will be needed to replace relays with MOSFETs or analog switchers like CD4066.
And all of that must be built with SMD components to be small.
In short: feasible but I put this solution for last resort if all other possibilities are exhausted.

III. group: Create completely new device from available methods
On end I decide to build my own microcontroller based LCR meter using new methods with new approach.
After thinking I came to conclusion that first thing to do is to find a way to determine what type of DUT is.
So I need something what all three types have in common and the answer is resistance.
Not standard DC resistance, but AC resistance or impedance - reactance.

Simply put I need to measure impedance at two or more different frequencies.
If DUT maintain identical reactance on all frequencies, then DUT is resistor and measured reactance value is actually resistance.
On other hand if DUT reactance becomes higher at higher frequencies then it is inductor.
To find out inductance, we can use formula to calculate it:

And at last if DUT reactance becomes smaller at higher frequencies then it is capacitor.
To calculate capacitance from reactance we can use this formula:

So this is simple method to automatically detect what type of DUT it is and do measurement.
Now all that I have to do is construct impedance meter, which actually work similar as classical DC ohmmeter with addition of using AC with changing frequency and made calculations for capacitance and inductance from measured reactance.

Searching web for this type of instrument did yield some results.
There is solution based on the same method but using computer soundcard and PC software – ZRLC meter.
See details at
This software solution is nice and it’s worth using it, but it is not mobile and has limited measurement range because it uses max 40 kHz from soundcard with single resistor.
By my calculations for my range I’ll need selectable resistance and frequencies up to few MHz.
Nevertheless this is proof that this method works. Here is another example for this method:

Surprisingly I didn’t find any other complete projects which will be using solution like this.
All other projects are about special functions like ESR etc.
However I find some other useful information:

So that is idea, now I have to do more detailed research, crunch some data and make calculations to find out how to build it.
Guessing these would be primary key points:
  • Cheap digitally controllable frequency generator in range of 100 Hz up to 2 MHz
  • Digitally fast selectable resistance for range
  • Accurate measuring AC voltage with ADC

Offline Silvio Klaic

  • Administrator
  • Full Member
  • *****
  • Posts: 133
  • Karma: +24/-0
    • View Profile
    • Silvio Klaic Homepage
Re: Low cost tweezers type LCR meter
« Reply #1 on: October 30, 2011, 10:47:51 AM »
After doing some research and simulations, here is update by key points:

1. Cheap digitally controllable frequency generator in range of 100 Hz up to 2 MHz
After some research and thinking I decide to use clock pulse (square wave) from microcontroller as AC signal, generated by PWM module.
Using DDS is too expensive. Replacement can be made by using monolithic function generator like XR-2206.
Of course controlling frequency can be difficult.
By using 8 or more analog switches + shift register with different resistors at each output and joined at pin 7 or 8 of XR2206 in parallel, it is possible to get frequency control to some degree.
How detail it would be, depends on resistors in parallel combination.
Generated signal will have unknown frequency, so it must be measured at microcontroller, which bring additional complication.

When it comes to basic, it is totally irrelevant what type of signal is used. Wave type is only important for calculating exact values for DUT.
So by using square wave instead sine wave, I will need to calculate several first odd harmonics to get enough precise value of DUT.
That calculation is performed only once at end of all measurements, so it’s not time critical.

2. Digitally fast selectable resistance for range.
In this segment I did some extensive simulations.
After looking schematics of classical DMM and thinking, I decide to go with resistor in parallel combination rather than series.
Here is some schematic and links that I find useful:

First thing I was doing are simulations to see what resistors I need for selection.
I used at first standard set of 6 resistors; 100, 1k, 10k, 100k, 1M and 10M ohms.
However there was a problem, microcontroller can provide current of max 20mA, which means that I can’t use 100 ohm resistor.
First closest resistor for 5V supply with safe side of about 15mA is 330 ohms.

With this basic resistor set in place there is mater of frequency.
And after some thinking I decide not to make experimental version on microcontroller, but on PC similar to ZRLC meter.
With this I will have far better experiment environment to test different frequencies and wave shapes.
After I finish PC version I’ll have completed half of LCR meter, because PC with soundcard replaces only microcontroller and display.

So for simulating I use frequencies from 100 Hz to 22050 Hz, which classical 16bit soundcard can generate.
DUT detection is made by applying at lowest resistance low and hi frequency.
If voltage is identical on both readings and it is 0 or Vin, then test is repeated using highest resistance with low and hi frequency.
First reading non 0/Vin and closest to half of Vin is used to decide what type of DUT is.
According to that, it is calculated guessed value for DUT.

Here I got problem, I need to choose resistor and frequency to be the best for accurate measurement.
At first tests I use loop and go thru available resistors calculating frequency for each one and using only one with highest frequency.
This method produced strange readings with error difference of few percent at two closes DUT values.
After that I was made full frequency analysis to see what is going on.
Here is a result for capacitor calculations:

Blue line shows used resistors which have at least error difference (yellow line) in full frequency (100-22050Hz) scale.
Simply put if this resistor is used with any frequency it will produce lowest calculation errors than any other.
For analysis to get best accuracy I was using only resistors with error difference below 2% and in that region I see that graph is hyperbola.
After calculations I came to this formula:

So with this formula I can from guessed capacitor get the best resistor for measure (red line).
After that, there was left a problem to get right frequency in combination with that resistor to obtain the best measurement.
Then I was made another calculations with this result:

This graph shows full frequency calculations for 25pF capacitor with 10Mohms resistor.
Calculations for other capacitors are also done with similar results.
As you can see, error (yellow line) between real value and simulated reading do not pass 2% for entire frequency range.
To get the best frequency for testing we must target midpoint at certain frequency band.
Using filter for 0.5%, 0.25% and 0.15% errors I get frequency band in which is best to perform measurements.
Guessed capacitor is in most cases off the real value, so using bigger band of frequencies is logical choice, however by already selecting right resistor we done that.

So now it is only left to target more precise region, and using band with 0.15% error give us at midpoint 2.506V.
This is actually recommended value – half of Vin (5V in my case) for measurement in voltage divider setup.
After recalculations I get next formula for determining optimal frequency:
fmeasure= sqrt(3)/(2*pi*Cguessed*Rmeasure)

I was done similar simulation-calculations for inductors.
When it comes to selecting right resistor, result was identical as in capacitors, I only got inverted hyperbola.
So formula is slightly different:
Rmeasure= 25000*Lguessed

But when determining right frequency there I got much different results:

As you can see, frequency band for 0.15% error have midpoint at 3.103V.
This is not like capacitor and further tests + simulations confirmed that this is better than 2.5V.
So formula for getting right measuring frequency of inductor is:

On end I made simulations for resistors, but I was using DC voltage of 5V, not AC signal.
I use this to eliminate possible inductance and capacitance of resistor – DUT.
If I want to know what inductance or capacitance resistor have, I can manually set measurement for it.

Note for graph; I used resistors in exponential increased value, so error regions and midpoint don’t match visually.
Used resistors are in this increment: ...98, 99, 100, 110, 120...
But as you can see in lowest error region I got midpoint at 2.475V which I rounded to 2.5V, because this is more convenient.
So formula for selecting right resistor is:

After I performed these analyses and take simulations, I got far better results than with previous test methods:
Values below 200uH and 10pF can be far more accurate by using frequency of 1 or 2MHz.
Resistors below 30 ohms will remain inaccurate because I can’t use resistor lower than 330 ohms.
However I considering using 3V supply which will enable me to go low as 200 ohms, but for this I need to do more simulation and testing.

Off course this is all done in simulator with ideal DUT, and I place limit of 10bit ADC readout.
So actual testing/measuring will be worst, because of noise and other electrical leakage.
With all of this I got required range, but I was not happy with resolution.
Solution is to add more resistors and use analog switches to combine them in parallel to get far better range and thus better resolution.

3. Accurate measuring AC voltage with ADC.
For this last point I found that precision full-wave-rectifier (precise op-amp AC to DC converter) will be best for ADC. Here are some links for that:

So to continue work on my LCR tweezers, I decide to start with PC.
With PC I can generate from soundcard precise frequency, which can be sufficient to measure almost all DUT values of required range.
In this version I will construct and test analog part of LCR tweezers:
  • SMD probe
  • Protection from charged capacitors
  • Digitally selected wide range of resistors
    • Digital selector (shift register, microprocessor?)
    • Analog switchers or Reed relays?
    • Chosen set of resistors for optimal resistor range
  • Power supply from battery – in this case parallel PC port
  • Software for selecting and working with analog part
  • Optimized programming for detecting and calculating DUT

After this, I’ll have more than half job done.
Only thing what will be left to do are integration of precise full-wave rectifier, microprocessor and display.
« Last Edit: October 30, 2011, 10:50:05 AM by Silvio Klaic »

Offline Silvio Klaic

  • Administrator
  • Full Member
  • *****
  • Posts: 133
  • Karma: +24/-0
    • View Profile
    • Silvio Klaic Homepage
Re: Low cost tweezers type LCR meter
« Reply #2 on: November 07, 2011, 10:39:31 AM »
Progress so far:
1. SMD probe
For my tweezers I need some SMD probes.
At first I was planning to buy one, but pricing are too high for my taste.
So I search for alternatives on net and I find this:

I’m also planning to modify this, because for around 1MHz I need shielded probes.
Therefore I plan to use only wire in middle and GND all around.

2. Protection from charged capacitors
Almost all measurement tools for capacitors have warning not to connect charged capacitor.
My LCR tweezers have the same problem, so to solve it I decide to place something between probes to shorten them.
Then if I grab charged capacitor with probes, it will be discharged.
To perform measurement I plan using switch to signal device for breaking short point and begin measurement.
With that, tweezers will be protected from discharging current and consume less power, because it will do measuring only when button is pressed.

Big problem is what to use. Obviously choice will be relay, however they are all big.
Smaller ones are reed relays but they can sustain only small currents.
Another problem with relays is that they consume a loot of power during operation.
Using MOSFET is better solution however for this I need at least 10V for gate.
That means adding voltage doublers or more. Another problem is that this protection doesn’t work when device is powered off.
So on end I decide to use switch for shortening/breaking probes and signaling device to begin measurement.

3. Digitally selected wide range of resistors
Now, what I really need is not simple 6 point selector for predefined 6 resistors like in standard DMMs.
Main problem for accurate testing resistors in voltage divider setup is to get proper resistor pair for targeted output voltage.
In measuring capacitance and inductance this isn’t that significant because I can change frequency and match reactance to used resistor.
Ideal digital potentiometer for my need would be one with range from 0 to 10Mohm in resolution of 1 ohm.
Simply put, to achieve this I’ll need 10 million combinations and this can be done with 24 bit – at least 24 resistors + switches to get from 0 to 16777215 ohms in 1 ohm resolution.
This solution of 24 bits is too big and using single chip digital potentiometers have other problems.

Biggest digital potentiometer what I found have 1Mhom (AD5241BRZ1M) in 8bit increment.
That means increment of about 3.9 kohms. But I’ll need 10 of them in series to get 10Mohms.
Fine tuning to increment of 0.39ohms can be done by putting another two of 10kohm and 100 ohm in series, however big issue is frequency bandwidth which is limited to 6 kHz.
So for my purpose digital potentiometers are not good enough.

3.1. Digital selector (shift register, microprocessor?)
So I have to do it with switches and resistors.
When it comes to selecting it is big question how to do it.
Shift register is my first choice but having lot resistors to select means calculations for them how to select it.
Now my microcontroller for this purpose must already calculate guessed value for resistor, then find/calculate closest one available from list which contains calibrated values for each resistor and then set it up.
These calculations require a loot of memory, especially for storing calibrated values.
Another microcontroller can be handy, with extra memory designated to serve only for resistors.
I find out that price between shift registers and microcontrollers are almost identical, so I chose to go with another microcontroller as replacement for shift register.

There are some other advantages in using microcontroller; mainly entire device becomes modular with two separated programming.
Another one is that main microcontroller no longer stores detailed data for each resistor and don’t have to calculate for them.
Basically my idea is; when it calculate guessed resistor, it will send that value to second microcontroller.
That one would find/calculate closest resistance for measure and return that value + set up resistors to that value.

For numerous reasons which I wouldn’t discuss here I decide to go with Microchip PICs microcontrollers.
For my needs I require 16 pins for selecting resistors thru switches (see 3.3. for number) + 3 for SPI serial communication between main microcontroller/PC and this one.
This is total of 19 pins, so suitable PIC with at least 19 I/O and Serial Communication module are PIC16F1516 and PIC24F16KA102 series.
I deicide to go with PIC24 series and main reason is speed – faster calculations, even this series is double the price of PIC16 series.

3.2. Analog switchers or Reed relays?
Now about switches; the best would be to use reed relays but this can take up much of space and most important one: consume significant amount of current in operation.
So I discard them as solution.
Analog switches are worst solution especially if used in series, but there are now available better switches than old CD4066.
I find that FSA2267 with 0.35 ohm on resistance and 45 MHz bandwidth is far better solution.
So I chose to use this switches instead.

3.3. Chosen set of resistors for optimal resistor range
This was tough one and I spend a loot of time on this.
First there was problem of deciding what setup to use; resistors in series or parallel configuration.
There are advantages and disadvantages to both.

Parallel combination provides easier calibration and reduction in errors by division - to some degree.
A problem with this is non linear result due division and calculations for selected resistor must be performed in floating point math, which is problematic with microcontroller.

When using resistors in series like ladder, analog switches are adding up their resistance resulting bigger error and problematic calibration.
On other hand result is linear and easy to calculate/set.
So even I decide at first to go with parallel combination, low resolution vs. number of resistors at higher resistance range was too great to be satisfactory.
At end I decide to go with series setup.

Obviously 24 resistors are too much and 6 are minimum.
Usually minimal set of resistors to cover entire range would be 200, 800, 9k, 90k, 900M and 9M ohms – 6 bits to cover.
Now the question is why using these exponential values?
What is optimal resolution and accuracy?
To answer these questions, I make this graph:

Here is shown difference between two values at different ADC readout points.
10 bit ADC can distinguish about 4.89mV.
So in ideal environment using 1k for testing another 1k resistor, ADC readout will be 2.5024437928V or 2.4975562072V.
After calculation we get 1001.9569471624 or 998.046875 ohms.
In both results, difference or error from real value is 0.1953125%.

As can be seen on graph, this small error is only at mid point.
Going to any edge (bigger resistor difference) produces larger error.
Note that this error is identical for any voltage. So targeting half of input voltage will get the best possible result.
To reduce this error, 12bit ADC will be better solution, which I plan to use.
My soundcard have already 16bit ADC so designing for 12bit ADC will be better solution.

To get best resolution and accuracy is to have only ADC error.
In 10 bit ADC resolution for 100 ohm is 0.1953125 ohm, for 1 kohm 1.953125 ohm up to 10 Mohm and 19531.25 ohm resolution.
Using 10 kohm resolutions at 10 Mohm measuring range is waste, because it doesn’t affect reading at ADC.
However at 12 bit ADC this would have big difference, because minimal resolution for 10 Mohm is 4882.8125 ohms.

So from this math by rounding values of 12 bit ADC, I got these resolutions:
Resistor rangeresolutionx100x1000
Lowest safe resistor is 200 ohms (16.5mA at 3.3V) and best resolution at 200 ohm is 0.1 ohm (rounded).
Starting from here including possible errors and number of switches I decide to start with resolution of 1 ohm.
In range from 200 ohms to 10 kohms in resolution of 1 ohm, resistor in series must be: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096 and 8192 ohms.

This is 14 bits or 14 switches with these resistors to make that range and it’s obviously already too much.
If best resolution is multiplied by 100, errors in reading will increase by 0.000061% and will not cross 0.2% error of 10 bit ADC, which is acceptable.
For this, new resistor series in range 200 to 1 kohm would be: 10, 20, 40, 80, 160, 320 and 640 ohms with resolution of 10 ohms.
For 1k to 10k range 50 ohm resolution is needed and we use previous resistors to continue into this series: 800, 1600, 3200 and 6400 ohms.
So far 10 bits and to complete series to 10 Mohms another 12 bits are needed which is in total too much.

If resolution was increased by 1000 times, this will increase error by 0.00406% and become 0.101688021% well below 0.2% error.
Series for this resolution will be: 100, 200, 400, 800, 1k, 2k, 4k, 8k, 10k, 20k, 40k, 80k, 100k, 200k, 400k, 800k, 1M, 2M, 4M and 8M ohms.
Total of 20 bits, but this series can be optimized further, if lower resistances are combined together they form enough value to eliminate next bigger resistor.
100+200+400+800=1500 ohms which covers 1k range and with resolution in 1k-10k range of 500 ohms this fits perfectly next in line to 2k. So 1k resistor can be eliminated.
Optimization method will also eliminate others too; 10k, 100k and 1M ohm.

Now, this form series of 16 bits/switches and this is first case below 20bits which I find acceptable.
Maximal errors in reading/calculating when using combination of these resistors in 200 to 10 Mohm range for 12bit ADC is 0.102% and for 10bit ADC 0.4064%.

After simulating with new setup and 12bit ADC I got these results:
Resistor rangeMax resolutionReal resolutionError10bit ADC rez. 10bit ADC error
Max resolution colon is used to set up maximal resolution for 12bit ADC.
Real resolution colon contains simulated values of actual resolution.
As can be seen in error colon, errors from simulated/measured/calculated values do not go to maximal error of 0.102% and this is because combination of resistors from lover range actually adds better resolution in higher range.
To be precisely they add about 50% better resolution, which is seen as about 50% better readout.
For comparison I calculate/simulate resolution and errors for 10 bit ADC.
This shows that is possible to make decent measurement with it too, but price difference is so small and this is measure equipment after all.

With this setup I got far better results in simulation for measuring resistance.
There is slightly higher resolution and lower errors than in original setup.
Capacitance and inductance didn’t change much, only slightly at edges of measuring range.

Basically when using this detailed resistor ladder accurate measuring reactance can be done with only two frequencies.
In main measurement range there is frequency around 1.1 kHz for capacitors and 2.3 kHz for inductance – frequency are for targeted point of half input voltage.
Higher frequencies are needed only for measure lower ranges; for inductors less than 30mH to increase reactance and in capacitors less than 15pF for decrease reactance.
Lower frequency is needed for higher values; more of 700H in inductance to decrease and above 1uF for increase reactance in capacitor.

This also adds to justification of usage 16 resistors for digital potentiometer, especially if experimental PC version shows that square wave AC is far worst for measure than sine.
PWM module can generate almost sine wave in this small frequency range.

4. Power supply from battery – in this case parallel PC port
With all above I practically have finish setup for analog part of my PC/LCR tweezers device.
As I mention already I plan to use 3.3V power supply.
Source in PC version would be 5V from LPT port output pins, and in tweezers from dual NiMH 2.4V/300mA batteries (4.8V).
For stable 3.3V regulator I plan to use S-1132B33 LDO Regulator with shutdown pin.
For PC version I also need voltage level translator to enable normal communication between 5V LPT port and 3.3V MCU.