Lc meter circuit KM409 with Atmega

LC meter KM409 circuit with Atmega measures inductor (coil) and electrolytic capacitor, using Lm393 voltage comparator.

Theory
A capacitance + inductance they form a resonant circuit. He is vibrating. The frequency of vibrations depends on the capacity and inductance. When we add to the resonant LC circuit, the coil (in series to the coil) – or the capacitor (parallel to the capacitor), then the resonant frequency will decrease.

Practice (resonant method)

Get new posts by email:

L/C circuit is cooperates with the LM393D comparator, from which the output is fed back loop to the LC circuit. Thanks to this, the vibrations do not expire. The comparator output also gives a rectangular signal to the input pin of the microcontroller. This signal has the resonance frequency of the LC circuit. The frequency of this signal is measured by the microcontroller.
Knowing the inductance values and capacities of the LC generator based on the frequency difference, we can calculate the value of the attached capacitance or inductance to the LC circuit.

Project drawing — schematic diagram.Lc Meter Schematic Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

Used formulas:

Lc Meter Formula 6 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

Where:
Cown – capacitance of LC circuit [pF]
Cref – a referential knowing value of capacitance which was added to LC circuit (generator) [pF]
F1 – a resonant frequency of LC circuit before add Cref capacitor [Hz]
F2 – a resonant frequency of LC circuit after add Cref capacitor [Hz]

Lc Meter Formula 5 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

Where:
Lown – a own inductance of LC circuit (without added any other inductor) [uH]
Cown – a own capacitance of LC circuit (without added any other capacitor) [uF]
F1 – a frequency of resonant LC circuit [Hz]

Lc Meter Formula 4 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

Where:
Cx – is a unknown value of capacitance which was added to LC circuit (generator) [pF]
Cown – a own capacitance of LC circuit [pF]
F1 – a resonant frequency of LC circuit before add Cx capacitor [Hz]
F2 – a resonant frequency of LC circuit after add Cx capacitor [Hz]

Lc Meter Formula 3 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

Where:
Lx – is a unknown value of inductance which was added to LC circuit (generator) [uH]
Lown – a own inductance of LC circuit [uH]
F1 – a resonant frequency of LC circuit before add Lx inductor [Hz]
F2 – a resonant frequency of LC circuit after add Lx inductor [Hz]

MEASURE FOR BIGGER CAPACITORS – ELECTROLYTIC
Charging time to capacitance by constant voltage.
When we charging capacitor by constant voltage we can observed a curve of charge:

Lc Meter Formula 2 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

We can see the charging time if depend from resistance and capacitance. And these two values form a time constant called tau τ which units is the seconds [s]
So from above diagram we can get the known:
After one τ the voltage on the capacitor get the 0.632 E value
So if our E have 5V, after the τ time on the capacitor voltage will present 3.16V.
AND FINALLY – when we charge the capacitor up to 0.632E, knowing the value of R and measuring the charging time, we can very easily calculate the capacity of the capacitor.

Lc Meter Formula 8 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

If we look at the diagram, notice that the capacitor can be charged by one or two parallel resistors RES1 and RES2.
Therefore, the program uses one more formula:

Lc Meter Formula 7 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

WHAT YOU MUST DO TO GET A HIGH ACCURACY OF MEASUREMENT.
Start with RES1 and RES3 soldering, and then measure and store their values. After assembling the whole and connecting the power supply, the VCC supply value should be measured, then the PR1 potentiometer should be set to 0.632 VCC at TP (arround 3.16V).

The FIRMWARE
Wrote in assembler in two options – for ATmega8A or ATmega328P – why 328P? Cause I got a few unused Arduino  so I don’t need to purchase M8A
After power on we can see three screens:

Lc Meter Display 11 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

Honestly, after the first power on third screen going to calibrate menu, which I’ll describe later.
After reset we can put capacitor into the socket and measure capacitance.
After pressed the left button we can see the L measure screen or the second one after put inductor into the left socket.

Lc Meter Display 10 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

Next one press the left button invoke the third menu for CE measure:
In the right socket we can do measure of electrolytic capacitors.

After this, the left button go back to small capacitors measure menu.

Al the time by press right button we can invoke 7 specials menu. In this mode the right button select menu, and after the select any one by pressing left button execute it and go inside.

Lc Meter Display 9 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

How the program calculate capacitance:

  1. Simply start charge of the capacitor and counting the clocks edges.
  2. After charging capacitor program multiply by 125 value of counted clock edges, cause crystal have 8MHZ for translate to decimal relation to seconds. And divide by 10.
  3. After that value is divided by RES2100 (for better precision) or by RES3 (two parallely connected resistors RES3=RES1RES2/[RES1+RES2] ) – result in [uF] or in 0.01 [uF]

MEASURE MENU

Lc Meter Display 8 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

MENU COMPENSATE:

Lc Meter Display 7 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

After select his menu program compensate the frequency value, which can be a bit floating depend from thermical values. And go back to last used menu of measure.

MENU RESET:

Lc Meter Display 6 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

Simply restart of firmware, and lose the compensate value.

Most probably don’t need describe this menu, everything is on the following step by step screens.
Note: You can choose in the next menu the reference value of the calibrate capacitor, which you’ll use.

MENU SET REF VALUE # – you can change the referential value your cap. for calibrate if you need.

Lc Meter Display 5 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

MENU SET COWN VALUE:
You can change the value of capacitor in LC generator circuit, after this the coil value will be recalculated.
In the last 4 menu you can set the value by pressing left button and right button for confirm.

Lc Meter Display 3 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

MENU SET RES1 VALUE:
Here you should set the RES1 value, which you measured after soldered RES1.

Lc Meter Display 2 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With AtmegaMENU SET RES2 VALUE:
Here you should set the RES2 value, which you measured after soldered RES2.

Lc Meter Display 1 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

ADDITIONS and CURIOS
A bit unrolling the second one formula for clarity and understand how to do it on the integers numbers.

Lc Meter Formula 1 Lc Meter Capacitor, Circuits, Inductor, Lc Meter, Measure, Microcontroller, Tester, Transistor Tester Lc Meter Circuit Km409 With Atmega

We got here a constant 1/4PI^2, also we dividing by [pF] so we can do sth like that:
100 000 000 000 000 000 000/4/Pi/Pi = 2 533 029 591 058 444 286
And now:
2 533 029 591 058 444 286 /F1/F1/C
BECAUSE the 2 533 029 591 058 444 286 value is oversized by a few decades the result is in 0.01 [uH] what gave resolution in 10 [nH].
Just for example how program calculate Cx or Lx and don’t going to to lower values using integers:
Cx = (Cown x [(F1 x F1)-(F2 x F2)])/F2/F2
So the first result = (Cown x [(F1 x F1)-(F2 x F2)]) is huge enough to divide by square of F2…

KNOWN PROBLEMS:
C9 10uF doesn’t work properly, breaking oscillations – solution – replaced to unpolarized
LM393D damaged under soldering probably – breaking oscillations – replaced to new.

Bom Lc meter circuit KM409 with Atmega

Last update: 23/09/2023 17:18

ValorNomeDescriçãoQuantidade
Resistors
10k (103)PR1,PR2,PR3Trimpot 329Y3
1M (105)R1Resistor SMD 12061
100k (104)R2,R3,R4Resistor SMD 12063
10k (103)R5,R6,R10Resistor SMD 12063
2.2k (222)R7Resistor SMD 12061
4.7k (472)R8,R9,R15Resistor SMD 12063
3k (302)R11Resistor SMD 12061
300 (301)R12Resistor SMD 12061
1k (102)R13Resistor SMD 12061
Capacitors
1000uC1Electrolytic Capacitor1
100uC2Electrolytic Capacitor1
100nFC3,C4,C5Capacitor SMD 12063
100nC6Capacitor SMD 12061
33pC7,C8Capacitor SMD 12062
10uC9Capacitor tantalum SMD CASE-A_32161
470nFC10Capacitor film1
1nF 2%C11Capacitor film1
Semiconductors
LM393DU1soic8 SMD voltage comparator1
16×2 LCD (HD44780)U4Display LCD 16×21
LM7805CTU712V voltage regulator, TO-2201
BC857T1Transistor SMD SOT-231
BC847T2,T3Transistor SMD SOT23-32
MEGA8-PU3Microcontroller1
2W10D1Rectifier bridge1
BUZZERHMB1275-12BBUZZER1DIP-BUZZER-12X7.51
LL4148D2Diode SMD LL-341
Miscellaneous
POWERSUPPLY_DC21MMXG$1Power connector1
HK19F-DC_5V-SHGK25V relay1
10uHL1brown,black,black,silver1
100uHL2brown,black,brown,silver1
Momentary switchS1,S2Touch switch2
ARK3U8Terminal block 3 via 5.08 mm,1
8MHzX1Crystal HC-49S1

 

Download Gerber and PDF PCB.

Source: https://oshwlab.com/wegi1/km409-l-c-ce-meter

 

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

As you found this post useful...

Share on the social networks!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Photo of author
About the author
Xtronic.org blog author. Electronics technician for the technical school of Brasilia - Brazil. Interested in electronics, circuits and technology in general.
Share:

Leave a Comment