The photo show the microcontroller whith the two relays. Everything is automatic and simple to handle. Improved LC-meter
This project has many new improvments compared to the old LC-meter.
Although, the theory and procedure is basically the same.
I have also developed a totally new software and a KIT for this project.

Inductors are not the most popular parts in constructions.
The bad reputation comes from the lack of good measuring instrument.
This project will explain how to build a very accurate and simple inductance,
and capacitance measuring tool.
You will also find information about the theory and math behind the measurements.
All contribution to this page are most welcome!

Why did I choose to build a LC meter from scratch,
when I could find so many projects out there on the internet?
The answer is simple:
Most of the projects does not explain the theory and worst of all, most of them use wrong calculations in the calibration procedures.
Some KITs use jumpers to set the prefix range as pF, nF, uF, nH, uH, mH.

I want a LC meter which calculate correct and handle everything automatically,
even the prefix should be handled automatically!
This is the last picture of  Dr. Hegewald also called proffessor Drövel So, the only way to build a fully functional LC-meter is to build one myself (as usual).
First I want to emphasise that the main LC-oscillator is NOT my construction.

Why invent the wheel two times?
(There is some evidence that the idea was first described by Dr. Hegewald)
who disappeared during an expedition of the Norwegian river "Overfloden".

Although, I did have to develop the hardware around the oscillator and a new working software,
which would measure frequencies and take all the theory into consideration.

Since we are dealing with math and many calculations, I had to implement floating point algorithm into the micro controller.
I now remember why I prefer developing hardware than software :-)
Well it took me eight months to develop, and many cups of coffee.

Specification of this LC-meter
  • 0 nH to 1mH, resolution 2nH
  • 0 pF to 1uF, resolution 0.1pF

  • Accuracy:
  • 1% of reading typical

  • Calibration:
  • Automatically calibration built in

  • Display:
  • 2 line 16 white chars, blue backlight display

  • Software controlled LCD contrast setting

  • Automatic prefix pF, nF, uF, nH, uH, mH

  • Software:
  • Easy to learn and to handle

  • Only 3 buttons to control software

  • Testing program built in

  • Hardware:
  • Easy to build and to test

  • A typical math genius! The theory behind the measurements
    This section will involve lot of math and theory.
    I was very lucky to have a great teacher, who really knew how to catch people's attention :-)
    If you don't like math, you can skip this section and jump down to the party below. Click here to jump down!

    The theory is not so complex at all so don’t worry.
    LC-meter will work equally good with or without your knowledge about the theory.
    The LC – meter is actually an LC oscillator based around the familiar comparator circuit LM 311.
    I have not changed the LC oscillator much from others projects, since this is an excellent oscillator.

    We are now dealing with an LC oscillator. The oscillating part is a parallel LC tank.
    We will use the well known parallel resonance formula (see formula 1. below).

    The formula say that if you connect an inductor parallel with a capacitor, it will have a resonance frequency (f).
    L is the inductance in the resonance circuit.
    C is the total capacitance in the resonance circuit.

    If we connect an unknown capacitor called Cx parallel to C, we will get a lower resonance frequency (f2), due to the increased capacitance.
    The formula would then look like this:

    As you see, we have a new resonance frequency (f2) and you can see how Cx has been added to C.

    Lets play around with the two resonance formulas and divide f1 with f2. (formula 3.)

    The inductance (L) in the formula disappeared!
    We now have a relationship between capacitances and frequency, Great! (formula 4.)

    So what does formula 4 show anyway?
    Well, if we know the value of C, and we can measure f1 and f2, we will be able to use formula 4 to calculate Cx.

    C is equal to all the parallel capacitance in the LC tank, but we do not know the C of the construction do we?
    No we do not, but by making a calibration with a well known Cx, we can go backward and calculate C.
    Don’t feel confused, I will explain this calibration phase more:

    Befor any measurement can be done, the LC meter need to perform a calibration to find out the constant value of C.
    To find C, we use the formula 4 and break out C. (formula 5.)

    The procedure start to measure f1 when only C exist.
    Then we add a well known capacitor Cx (reference capacitor) to the LC unit and measure the frequency again (f2).

    Since we know Cx (reference capacitor) and we have measured both f1 and f2, the micro controller will be able to calculate the constant value of C.

    The procedure above is called the calibration phase.
    In reality it is very easy, all you need to do is to press a button called calibrate and the micro controller handles it all for you!

    What is important is that you use a very good capacitor for the calibration, else you will add error to measurement.
    In my construction I use 440pF 0.5%. The calibration capacitor is mounted on the PCB and will be added automatically with a relay. (more info later)

    Now, when the micro controller knows the constant value of C, you can use formula 4 to measure any unknown capacitor at Cx.
    Are you confused enough? (* smiling *)

    Practical example:
    To make this even more understandable, I will make a small calculation example to verify the calibration formula:

    When I have no capacitor (Cx) connected to my LC-oscillator, I measure 503 673 Hz.
    I connect a well known capacitor (Cx) of 440pF 0.5% to the LC-oscillator and now the frequency drop to 421 115 Hz.
    (In this experiment I use an inductor L1 marked as 100 uH. Its exact value is 97.7 uH)

    Let’s use the calibration formula 5, above to calculate the value of C in the LC unit.
    f1 = 503 673, f2 = 421 115 Hz, Cx = 440pF. The formula gives C to be 1022 pF.
    (remember that C is constant and equal to all the parallel capacitance in the LC tank)

    Now, when I know C, let’s check if our calculation is correct.
    In my measuring example I had an inductor of 100uH in the LC-oscillator.
    I use the parallel resonance formula 1 :
    When no Cx capacitor is connected I have L= 97.7 uH and C=1022 pF, this gives resonance frequency = 503 673 Hz
    When Cx capacitor is connected I have L= 97.7 uH and C=1022 pF + Cx = 1462pF, this gives resonance frequency = 421 115 Hz
    If we compare the calculated frequencies with the measured we can see that the calculation of C = 1022 pF was correct. Great!

    Now when we know the value of C, we can use formula 4, to measure any unknown value of Cx.

    Lets look at the theory how to measure inductance.
    We will still use the parallel resonance formula (formula 1,) but in this case we will add an unknown inductance Lx in serial with the L1.

    We will have two states.
    One when we only have the main inductor L1 connected with C, and a second state when we have the extra inductor Lx in serial with L1.
    As you understand we will get two different resonance frequencies.

    First state is when I only have L1 connected to C, and the frequency f1 will be produced from the LC-oscillator.
    Formula 6 show you how I break out L1 from the parallel resonance formula. Only L1 exist. (Lx = 0)

    Second state is when I add Lx in serial with L1 to form L2. Since the inductance increase the frequency (f2) will be produced from the LC-oscillator.
    Formula 7 show you how I break out L2 from the parallel resonance formula. L1 and Lx are connected in serial to form L2

    What we search for is Lx. (formula 8.). I put formula 6 and 7 into formula 8 and get formula 9.
    After cleaning up we get formula 10. Let's look at this formula in more details. As you can see the main inductor L1 is gone.

    To measure Lx, we only need to know the C, f1 and f2 of the LC-oscillator.
  • C will be calculated in the calibration phase (as I described earlier).

  • f1 will be measured when the input is short circuited.

  • f2 will be measured when Lx is connected to the input.

  • Conclusion:
    It is possible to measure both capacitance and inductance as long as you have an accurate reference capacitor Cx for calibration of your measuring LC-meter.
    When it is calibrated you can connect either an unknown capacitor or inductor and measure its value. In this construction I have implemented the calibration so you only need to push a button. The microcontroller will then do all the work for you.

    Click here to view a larger schematic Hardware and schematic
    The main part of this project is a LCD, PIC16F870 and an oscillator based around LM311.
    The LCD is a standard 2 line 16 chars display connected in 4-wire mode to the PIC.
    At the bottom you will find a 4.000 MHz crystal to run the PIC16F870.

    The heart of this construction is the LC oscillator based around IC2. The frequency pops out at pin 7 and then enters the PIC at pin 11.
    Two relays have been added to make the measurement more automatic, and they will also prevent stray inductance/capacitance.
    Many LC meters use manually switches which will be conected with long wires. I prefer relays which will improve the accuracy and keep the stray capacitance/inductance down to a minimum level.

    The two latching relays are controlled by the PIC16F870, and the reason why I choose this construction was to keep the current consumption to a constant low level. If the current fluctuates, it will affect the measurement which is not good. The relays I use are "single-coil latch types".

    REL1 choose to measure between Inductance or Capacitance. (see bottom of schematic).
    When you measure inductance, REL1 will add the unknown inductor Lx in serial with L1.
    When you measure capacitance, REL1 will add the unknown capacitor in parallell with Cx.

    REL 2 has only one function and that is to add the reference capacitor during the calibration phase.
    C10, R10 is added to make sure the oscillator starts up correctly. At the left side of the schematic you find the LCD display. The contrast of the display is set by the PIC16F870 at RC2 (pin 13).

    A jumper J1 is added to choose if you want strong backlight or not.
    If jumper J1 is disconnected the LCD will have soft backlight because a low current will pass through R2.
    If jumper J1 is connected you will have strong backlight.

    You will also find three input pin headers (J3, J4 and J5)
    The inputs are connected parallel with the 3 buttons. If you wish, you can connect J3, J4 and J5 to external buttons.
    (If you only will use the buttons on the PCB, you can simply skip j3, J4 and J5.)

    The three buttons controls the unit and software. (L/C, Calibration, Test input)
    I will explain the function of each button later.

    Capacitor C7, C8 can be substituted with Cx to be a high precision silver micra capacitor.
    The capacitor Cx is just an option and at present stage, it is NOT used.

    As you can see the schematic is pretty simple.

    Below you will see the placement of parts on the PCB.
    Front side
    Click on rhe picture to enlarge.
    Click the picture above to enlarge!
    Back side
    Click on rhe picture to enlarge.
    Click the picture above to enlarge!


    Soldering and testing:
    The soldering of this unit is pretty basic if you solder the parts in correct order.
    I advise you to follow the instruction below.

    Start soldering the Front side :
  • X1 (4.00 MHz crystal laying down)
  • Buttons for L/C, CAL, TEST
  • Pin headers J3, J4, J5 (only necessary if you want external button connected)
  • L1 - (From beginning L1 was a smd inductor. To increase accuracy L1 has been substituted with a ferrite inductor which is standing up, see photo below)
    Solder the legs of the ferrite inductor directly to the pads of L1.

  • This pciture show the placement of inductor L1

  • C1, 28 pin IC socket for IC1, REL1, REL2, J1, J2, J6, J7, display

  • Back side :
  • IC2, V1, R2, R6, R8, R1, R3, R4, R5, R10, R7, R9, R11, C2, C3, C6, C7, C8, C4, C5, C9, C10, C11

  • Do not put PIC16F870 into its socket yet!

    Power up
    Take some time and verify that you have no soldering bridges!
    Connect power and control that you have stable + 5V at the power line (pin 20 at socket) and display between pin 2.
    Power off the unit and put PIC16F870 into its socket, and connect power again.

    If everything is OK you should see text on the LCD display.
    The contrast voltage a pin 3 of LCD should be around 1.5V DC.(more info about contrast later)
    There is a test function built in this LC-meter, and below you can read all details how to use it.

    PIC Software
    Let's have a look of the different menu choices of this LC-meter.
    All settings are made by the two switches L/C and Calibrate.
    The unit will always remember the last settings even if power is switched off.
    Figure below show all the different menu choices.

    Measure Capacitance:
    When the power is applied the LC-meter will enter menu 1. The display will show Capacitance measurement
    The LC-meter then enters menu 2.
    Here you are asked to Open circuit the input (no capacitor is connected to the input).
    When this is done, you should press the calibration button.
    The LC-meter will start the calibration procedure, and after 2 seconds the unit is ready and shows menu 3.
    The LC-meter then starts to measure the input and you can connect the unknown capacitor.
    Every second, you will get a new measurement (menu 4).

    Measure Inductance:
    When the power is applied the LC-meter will enter menu 1. The display will show Inductance measurement
    The LC-meter then enters menu 2.
    Here you are asked to Shortcircuit the input (the input is connected to ground).
    When this is done, you should press the calibration button.
    The LC-meter will start the calibration procedure, and after 2 seconds the unit is ready and shows menu 3.
    The LC-meter then starts to measure the input and you can connect the unknown inductor.
    Every second, you will get a new measurement (menu 4).

  • At any time you can press the calibration button to make a new calibration.

  • At any time you can press the L/C button to toggle between Capacitance and Inductance measurement.

  • The different menu choises in this LC-meter. It is very simple to learn and follow.

    There is one more menu in this LC meter, and that is the testing menu.
    I have added this function to make the building and testing easier for you.(An option most other KITs have forgotten)
    There is only one way to enter the testing menu, and that is to press the button Test during power up.
    The display will then toggle between the two pictures below.
    The input should not be connected to any object.
    The LC-meter starts to measure f1 (main oscillation).
    After 1 second, the relay 2 will connect the reference capacitor and the until will make a new measurement f2.
    After another second the unit will go back to measure f1 and it all repeats until you press Test button again.
    As you can see, my measurement was f1=503 673 Hz, and f2=421 115 Hz

    There can be variation in frequency from kit to kit, but in general you should have f1=500 kHz and f2=400 kHz

    Press the button test during power up and you will enter the test menu!

    LCD Contrast
    The contrast of the LCD display can be changed by software.
    To enter the contrast menu, you must press the button CAL during power up.

    The display will show the text as below.
    In this menu you can decrease the contrast by pressing the button L/C and increase the contrast by pressing the button CAL.
    To go out of the contrast menu, you press button TEST.

    This menu show the contrast test. By pressing the button L/C and CAL, you can change contrast.

    Accurate measurement
    To get accurate measurements it is very important to keep wires as short as possible.
    It is especially important when it comes to measuring small inductance.
    A straight wire of 10 mm can add up to 10-15nH, so it is very important to keep wires as short as possible during measurement.

    Temperature variation will also affect the measurement a little bit, since it will change the leakage current in LM311.
    Even if the temperature variation may be small, it is always good to perform calibration as often as possible.
    If you follow these few suggestions, you will be able to measure inductance and capacitance with accuracy beyond your dreams.

    Picture below show how I measure sensitive parts with high accuracy.

    The left picture show how I measure a small smd capacitor. You can see that i have soldered the capacitor to a 2 pin female header (black body).
    The middle picture show another pin header used for shortcircuit the input during inductance calibration.
    The right picture show a third pin header where I have soldered a small smd inductor ready for measurement.

    The procedure for measure capacitance is very simple. I remove the capacitor and make a capacitance calibration. After that I reconnect the capacitor and read the measurement.
    The procedure for measure inductance is also very simple. I attach the shortcircuit pin header and calibrate, after that I switch to the pin header with the inductor and read the measurement.
    This is just ONE way to measure small parts with high accuracy. I am sure there are many other ways as well.

    How to measure a varicap diode
    You can very easy measure the range of a varicap diode.
    The picture below show you how to connect it to the LC meter.
    Apply a DC voltage to Vin and you will get a capacitance measurement of the varicap. Any voltage from 0 to +35V will work good.

    This project is a must for all homebrewers, so therfore I have put together a complete kit with a factory made PCB.
    All components, PCB, LCD, and PIC16F870 for Iproved LC-meter are included in the KIT (Click here to download component list.txt).
    If you only want to buy a pre-programmed PIC16F870, Click here.

    Order a KIT
    which will include all parts listed below
    Factory produced PCB

    Click on the picture to see larger
    Click on the picture to see larger photo.
    The PCB is blue and factory made.
    1 pcs
  • Blue PCB factory produced - See photo at right
  • 1 pcs
  • 16x2 LCD w/ HD44780 Controller & Blue Backlight
  • 1 pcs
  • PIC16F870 PIC16F870 pre-programmed with software (DIP)
  • 1 pcs
  • 28 pin IC socket for PIC16F870 (DIP)
  • 1 pcs
  • LM311DT Comparator smd
  • 2 pcs
  • AL5WN-K smd Relay (REL1, REL2)
  • 1 pcs
  • Crystal 4.000MHz smd high performance
  • 1 pcs
  • TK15550+ 5 Volt Regulator (V1)
  • 1 pcs
  • 100uH (updated L1)
  • 2 pcs
  • 22pF smd (C4, C5)
  • 2 pcs
  • 220pF smd (C7, C8)
  • 1 pcs
  • 1 nF smd (C6)
  • 3 pcs
  • 100nF smd (C2, C3, C11)
  • 2 pcs
  • 2.2uF smd (C9, C10)
  • Download assembly maual

    Click on the picture to see larger
    Click on the picture or on pdf to download.
    1 pcs
  • 47uF smd (C1)
  • 1 pcs
  • Resistors 100 ohm smd (R2)
  • 2 pcs
  • Resistors 1k ohm smd (R6, R8)
  • 4 pcs
  • Resistors 3.3k smd (R1, R3, R4, R5)
  • 1 pcs
  • Resistors 42k ohm smd (R10)
  • 3 pcs
  • Resistors 100k ohm smd (R7, R9, R11)
  • 6 pcs
  • 2 pin header (J1, J2, J3, J4, J5, J6)
  • 1 pcs
  • 16 pin header (J7)
  • 1 pcs
  • Jumper (J1)
  • 1 pcs
  • soldering lead (Extra thin)
  • 1 pcs
  • Cleaning wick (to clean up bad soldering)

  • Order here

  • Cap: 0 pF to 1 uF, resolution 0.1 pF
  • Ind: 0 nH to 1 mH, resolution 2 nH
  • Accuracy: 1% of reading typical
  • Automatically calibration built in
  • 16 character by 2 line high contrast LCD
  • Automatic prefix pF, nF, uF, nH, uH, mH
  • Software controlled LCD contrast setting
  • 3 pushbuttons for user programming
  • Testing program built in
  • Small dimension 3.2" x 2.4" (80 mm x 62 mm)
  • Easy to build (one evening project)

  • Trouble Shooting section
    If you get a problem with your unit, you might find this section helpful.

  • I get no text on my display!

  • Make sure you have +5V to pin 2 of the LCD and that the background light is working.
    You should now test that the contrast voltage of the LCD is ok.
    The voltage at pin 3 of the LCD should be about 1.5V DC.
    This will give good contrast!
    You should also make sure you have 5, 7, 8, 9, 10 to ground.
    Now, you should test that the data signals is arriving to the LCD.
    Look at the signal of pin 14, 13, 12, 11, 6 and 4 and make sure you measure on the LCD.
    I often use a small speaker or piezo element and listen to the signals.
    You should hear clicking sound or beeping tones when the display is updating or during power on.
    If you don't have any data communication to the LCD the problem is with the PIC16F870, next section.

  • My PIC16F870 is not working!

  • Make sure you have +5V to pin 20 of the PIC.
    You should test that the Reset (pin 1) goes high when power is turned on.
    The oscillator should be running at 4 MHz. (Test with oscilloscope or equal equipment)
    Make sure that RC3, RC4, RC5 is high goes low when button is pressed.

    Check that you do not have any soldering bridges between legs or to ground.

  • My oscillator is not working!

  • Run the test program to check if the oscillator is working, or use an external frequency counter/oscilloscope and check pin 7 of IC2.
    You should measure about 400-600kHz
    Check that you have +5V volt to pin 8 of IC2.
    Make sure you have assembled the 2 relays in correct direction.
    Again check for soldering bridges!

  • Sometime the display will show 9.99 uF directly after calibration!

  • During the calibration phase, the LC meter measure the reference capacitance and internal capacitance + stray capacitances.
    The LC meter software will cancel out internal capacitances + stray capacitances.

    When no capacitor is connected to the LC meter, the reading on the display will be 0.00 pF
    The calibration takes about 1 second to execute.
    Like all semiconductors, the LM311 circuit is affected by temperature changes.

    Sometime the display will show 9.99 uF directly after calibration.
    How does this come?
    If the cancellation is affected by temperature, it can mathematically give negative capacitance.

    Example how this can happen:
    During calibration the internal capacitance + stray capacitances was 1000.1 pF
    When the first measurement was made the internal capacitance + stray capacitances was decreased to 1000.0 pF due to temperature changes.
    1000.0 - 1000.1 = - 0.1 pF (total change due to temperature)

    As you may understand it take only a fraction of pF to get this phenomenon, however
    you can also see that the total ERROR due to temperature change was only 0.1 pF.

    The LC meter math get confused with negative capacitances, since they do not exist and therefor write 9.99 uF.

    If you get 9.99 uF after a calibration, the calibration is still valid and accurate.
    The calibration was affected by temperature, although the ERROR is less than 0.1 pF.
    You do not need to make more calibration, but you can of course make a new calibration, and if the temperature is more stable you will now get 0.00 pF.

    Final word
    This project looked to be a simple project, but it took me four prototypes and eight month to finish it.
    The most difficult part was to develop the software, and to make it fit into the PIC16F870.
    When I made my first measurements with the unit I was amazed how well it worked, and how accurate the measurement become.

    One can find some cheap capacitance measuring tools on the market, but when it comes to inductance it is much more difficult.
    This project is a very helpful tool to measure both capacitance and inductance. You can now measure the inductance of your self made air-inductors and cans.

    Front side
    Here you have it. Few parts and perfect function.
    Back side
    Here you have it. Few parts and perfect function.

    Photo Gallery
    Some assembled counters people has mailed me. Please mail me more.

    Giovanni Calabro from Italy sent me this nice photo. Great work! Click the pic to see larger photo

    Back to main Page  |  Contact Me  |  Cheap components

    Copyright © Last modified on 18 June 2009.