Mar
29

Inductor & Capacitor Meter (LCMeter)


History

    Here is my new inductance & capacitance meter. I had took the analog oscillator part from a well know schematic found on the internet and adapt it for a AVR.  It's impressive to have a very accurate result with a so small circuit.  The way it's work is simple you chance a oscillator frequency with the part you want to find is value.

The frequency is read and with some math you get the value. Here is how it's work, At power-up you read the oscillator frequency without any thing connected to you probe, we will call this value f1.  After the calibration process via a relay put a very accurate capacitor of 1000pF, you read this new frequency f2. When the calibration is done you can place your unknown part value and read the frequency f3.  Now we go in math…

For capacitor:

a = ((f1/f3)^2)-1

b = ((f1/f2)^2)-1

result = (a / b) * 0.001

 

For Inductor:

a = ((f1/f3)^2)-1

b = ((f1/f2)^2)-1

c = 1000000000

d = (1/(2*pi*f1))^2

result = a * b * c * d

result = result * 1000000

Features

  • Inexpensive
  • High acuarity
  • Auto scale
  • Auto calibration
  • Can be use as a frequency meter with only small modification
  • Measure capacitance and inductance

 

Pictures

 

Download

LC Meter Schematic

LC Meter Source Code




79 Comments to “Inductor & Capacitor Meter (LCMeter)”

  • sukhpal singh April 2, 2010 at 3:43 pm

    i would like ot know in which compiler i do comiple that code .

    i shall be very thankful to you if u tell.
     
    with regard
    sukhpal singh

  • admin April 2, 2010 at 3:52 pm

    Hi,

    The compiler is ICCAVR from http://www.imagecraft.com

    Sylvain Bissonnette

  • Odilon De Moura April 18, 2010 at 6:39 pm

    Congratulations! great project, using ATMEGA 32.
    It is simple, ease to implement, have the source code, Schematics diagram, and Board layout,
    In other words it is complete.
    Before I start to make one I checked  the program and, I have problem compiling the souurce code.
    I f you publish or e-mail the compiled  Hex code, | will build one for me.
    Sorry I  can not  buy  and install one more compiler.
    Thank You.
    Odilon.

  • admin April 18, 2010 at 7:58 pm

    Hi,

    Like I say http://www.microsyl.com/index.php/2010/04/01/language/ I don’t give more then what is on my blog, I can help you what is the project you want to build

  • AMF April 29, 2010 at 11:12 am

    I build mega8 version compiled in CVAVR

    Sylvain, You are great ! :)

  • WP Themes May 4, 2010 at 7:02 pm

    Good fill someone in on and this post helped me alot in my college assignement. Gratefulness you for your information.

  • Swiss Ball Exercises May 9, 2010 at 11:16 am

    Wow this is a great resource.. I’m enjoying it.. good article

  • Ali May 11, 2010 at 5:44 am

    Hi
    Thanks for sharing the idea.I want to know the accuracy and range of your meter.
    thanks in advance.

  • admin May 11, 2010 at 11:53 am

    The result is good, as low as 5pf but you need a very exact mica reference capacitor

    Sylvain

  • weih May 14, 2010 at 7:11 am

    hi mr.admin, im a college student hoping to build a LC meter as my project.
    My target is to be able to measure up to 1mF capacitance and inductance of 100mH.
    My plan is to understand the basic idea of how to build a very basic capacitor which allows me to reach the range i stated, and the same goes for the inductor.Then i will combine them together.(In other words I hope to be able to understand the concept and come out with my own circuit)
    With you expertise, i hope u would be able to share with me your opinion and ideas.
    Thanks

  • admin May 14, 2010 at 1:20 pm

    This project don’t do 1mf, the max is about 1uF

  • Daniel Zhou May 15, 2010 at 1:53 pm

    The comments in your code shows that this projet was finished in May.2005,
    Hahaha, I finished a similar project in Apr.2005, I used ATMega16.
    http://www.ourdev.cn/bbs/bbs_content_all.jsp?bbs_sn=436997

  • rey May 16, 2010 at 3:13 pm

    nice project i would try to buildling but im using avr studio 4 i hope you have a the code written in avr studio 4

  • admin May 16, 2010 at 3:15 pm

    Stop, this code and all my code is written for ICCAVR, I don’t have anything for AVR Studio
    Sylvain

  • Sharon June 14, 2010 at 5:38 am

    I just wanted to say your website is one of the nicely laid out, most inspirational I have come across in quite a while. Thx! :)

  • Wordpress Themes July 25, 2010 at 7:14 am

    Nice dispatch and this mail helped me alot in my college assignement. Thanks you on your information.

  • will lewis August 3, 2010 at 1:41 pm

    theres something wrong with the post comment section.. it takes a long time to be able to write anything. Look dude.. i could really use help understanding the bit shift operators in your code. Like.. why do you use them and things like that? I know.. i know.. you say you cant help beyond whats in the post but if you find the time it would be a big help.. that is.. if you can explain in an easy to understand method, because ive tried c tutorials and nobody (i mean nobody) explains bitshift operators in an understandable way.

  • admin August 3, 2010 at 2:26 pm

    if you say bit shift like (1< Sylvain

  • elton August 30, 2010 at 5:57 pm

    Hi!
    Could you please provide some further info about this project?

    Specifically I would like to know the measuring range for inductors and capacitors and whether you have any info on the accuracy of the instrument.

    Also could you provide some explanation about the inductor L2 and the relay L1 and their connections? That part is confusing me a bit.

    Thank you for your time!

  • admin August 30, 2010 at 10:45 pm

    for capacitor it work from 10pf to 1uf, inductor 1uh to 1mh. The relay is there to switch pinpout when you pass from cap to inductor, the L2 is there with is capacitor to make a automatic calibration at start-up

    Sylvain

  • salva September 20, 2010 at 7:03 pm

    Hi Sylvain!

    I looked for a LC Meter with display, and I have found it! Thank  to you!
    I want to build it, but I have a problem with the relays that you have used in the scheme, L1, L3 from the type of relay that you have used, the contacts initially with  the relay without current, they are not in air like as is seen in the scheme, but they are surely in contact. Now my question: which is the contact initially when the LC meter is OFF , and when is ON? could you please show me out them in one scheme?
    Thank you many

    Sincere greetings
    PS: The relays that I have are from NAIS Mod. TQ2-5V
    here the datasheet    http://pdf1.alldatasheet.com/datasheet-pdf/view/86912/NAIS/TQ2-5V.html

  • admin September 21, 2010 at 12:19 pm

    You are right, it's not clear, Normaly OPEN is in UP state, and CLOSE is in DOWN state.  Is it a little bit more clear?

    Sylvain

  • salva September 21, 2010 at 4:55 pm

    Hi Sylvain!
    if I could send you a picture to make you understand what I mean:
    The relays: which of the two contacts is closed when the relay is not operating and which contacts closes the relay  when it work.
    for example: The  L1 have a  GND contact and one go to C2 and C9 and.. the other two contact are together with a bridge. L2 have only one contact the GND and the Capacitor C9 .
    Salva
     
     
     
        
     
     
     
     

  • admin September 21, 2010 at 5:29 pm

    powered =
     

                      o

    C o———o

  • ASV October 18, 2010 at 11:52 am

    Also can u eleborate how u are finding out frequency of oscillation using MesureLV( ) function.Please explain the HighByte stuff too(the interrupt one).Also I did'nt get why are u using uart?Any specific reason other than sending data to comp…

  • admin October 20, 2010 at 7:27 pm

    The High byte is increment each time the timer overflow and the low byte is the value of the TCNT1 (low byte).  In fact it's to have a 16bit counter

  • ASV October 22, 2010 at 9:22 am

    sir,there are a few corrections in the code as according to the schematic:
      #define SWITCH_BIT                (1<<PC7) instead of PB7
    #define RELAY_BIT                    (1<<PD3) instead of PB3
    #define CAP_REF                        (1<<PD7) instead of PB7
    Also sir could you please explain how are you using uart (serial port) as timer?? i want to know the logic of counting done using it..

  • admin October 22, 2010 at 12:48 pm

    In this project I need one more timer than what the MCU have, so with the serial port it's simple to do one, you know the baudrate, so you can find how many time it take to send x bytes

    Sylvain

  • pronto December 15, 2010 at 10:40 am

    hi mr.admin.
    i really appreciated for this material you provide.
    i'm very noob in DIY-electronics, heck i'm very noob  and i want to do something for myself.
    i started this project about a week ago and now i almost done with the board and components..
    what i want to ask you is why there is so many unattended holes near the microcontroller..
    and what are those 4 black square-shapped box (12 o'clock of the board )  that connected to 2 black square shapped box ( 9 o'clock of the board ) ?
    thanks so much mr,admin .

  • admin December 15, 2010 at 2:22 pm

    I don’t understand your question?

  • dhony January 11, 2011 at 11:09 pm

    hi Mr..

    i want to ask you about your project..
    1. would you like to explain about this logic operand "RELAY_PORT &= ~RELAY_BIT; "?? is that logic operand between 16 bit with 1 bit or not?? if yes..for that 1 bit is operated only with the LSB or MSB from Relay_port ( 16 bit ) ?
    2. May i know about a frequency for calculate f1??? cause i try to simulate it in multisim2001 but i think that frequency is low..
    3. For precision inductor.., Does it always connected to ground when i try to measure both of capacitor and inductor too??

    thank you for your helping.., sorry i have to ask you many question because i', still beginner..hehe^-^
    oh ya..could you send the answer too to mw email.., i'll be waiting for this.. thx

  • dhony January 12, 2011 at 1:21 pm

    Hi…

    sorry i want to ask you again….
    may i change a value of capacitor that connected with pin 3 of LM311 with a 100pF capacitor?? And does it will make an effect to measurement??
    thank you for your helping

  • Sylvain Bissonnette January 12, 2011 at 1:35 pm

    No you can't do this

  • dhony January 12, 2011 at 11:54 pm

    thx for your helping..but why the signal on my oscilloscope isn't like clock signal.., it still hold on 5 V but when  i try to change it with smaller value of capacitor it can be a signal????
    then i still stuck too in my first question about syntax that i had posted to you Mr..

    could you like to answer that..?

  • admin January 12, 2011 at 11:56 pm

    Did you have something connected to the terminal?

  • dhony January 13, 2011 at 12:48 am

    i don't think so.., cause i try to connect all of my component based on your schematics.. but i had read all of comment above and they told that they success.., so where the fault is??
    I tap signal on pin 7 of LM311, with PIN 1 and 4 are connected, PIN 5 and 6 connected too..
    should the output from LM311 generate clock signal Mr Sylvain ?? may i know its frequency??

  • Sylvain Bissonnette January 13, 2011 at 1:37 am

    It's make long time I had work with this project,  I don't really remember, but I'm shure at 90% that you need the external (inductor or capacitor) to get the opamp oscillate.

  • fullpronto January 14, 2011 at 12:53 pm

    Thank you for your generosity mr.admin
    The LCMeter is done and works great.
    Simple and accurate
    once again thank you

  • dhony January 15, 2011 at 1:37 am

    i get an error like this
      type error in argument 1 to `LCDWriteConstString'; found `pointer to char' expected `pointer to __flash char'|
    and type error in argument 2 to `csprintf'; found `pointer to char' expected `pointer to __flash char'|
    ay sugestion about that ? i'm usinng ICAVR8

  • fullpronto January 15, 2011 at 4:33 am

    @dhony
    just trying to help here..
    go to project-> option -> target
    on the printf section choose the float [+float, [needs > 8K]]
    then check the "String in FLASH only" box..then compile the code..
    hope it works

  • dan21 March 29, 2011 at 8:51 am

    Hi,
    First of all this is a project I was looking for a long time. I'm trying to port it to atmega8 (WINAVR).
    It requires to use different types, but that is piece of cake :-) . My question is what exactly should be done to use it as frequency meter ? And what would be the range ?
     
    THX
    Dan

  • admin March 29, 2011 at 12:05 pm

    It should work from 1Hz to 16.777Mhz you have 3 8bit register so it’s 2exp24 but I never try at this frequancy my generator only give upto 2Mhz

    Sylvain

  • dan21 April 1, 2011 at 11:09 am

    Hi,
    Question: Relay L1 (L3)  has "starting" position (contacts) . This means that C is connected to NC. But in your schematic contacts are open. Neither C-NC nor C-NO. Could you please make it clear ?
    THX, Dan

  • ASV May 29, 2011 at 7:57 am

    could you explain use of following lines in your code:
       
        for(i=0;i<65000;i++)
            for(j=0;j<50;j++)
                wdr();
      
     

  • Sylvain Bissonnette May 29, 2011 at 1:15 pm

    its's only a delay

  • ASV May 29, 2011 at 5:52 pm

    "wdr( )" what does it do?

  • ASV May 29, 2011 at 5:58 pm

    1)is "wdr" watch dog timer disable?
    2)
        "for(i=0;i<2;i++)
            f1=(float)MeasureLC();
        for(i=0;i<2;i++)
            f2=(float)MeasureLC();"
    for the above two commands ,what sense does it make in assinging f1 and f2 values twice in the loop?
    as in had it been taking two values and averaging it to get mean value ,it would be okay,
    but here why have you done so?

  • admin May 29, 2011 at 6:21 pm

    I don't remember… it make to long time

  • Vlad June 29, 2011 at 2:21 pm

    Hi Sylvain!
    Great project. I made your LC meter but something wrong.
    When It power ON and calibration ends it shows 1000pF and thats all.
    And no mater what capasitor I use all time the same inductance doesnt measure at all.
    P.S. Sorry for my English I am from Ukraine. Ill be glad for any help! Thanks!

  • admin June 29, 2011 at 2:26 pm

    Strange, I don’t know why, Did you change the code or the hardware?

Post comment

Please note

All my source codes were taken from my personal projects.

Everything is for your information only. The C/C++ codes have been written
with ICCAVR. You can find the header and source CRT files by downloading their compiler.

All is for your information and everything is AS IS without any warranty of any kind. No other files are available and I don't make any modification for any body.

Categories

Blogroll

Electronic Links

Tags

AGC Anemometer AVR AVR Bootloader Bootloader Capacitence Capacitor Clock Color Control DCC Debugger Devices Digital driver Function Generator High Gain Microphone Humidity Inductance Inductor Laser LCD LED 3W Library Lightning Detector MegaLoad Meter Moodlight Mood Light MS5534 Nixie OscilloScope projector Rain Fall Sensor rgb RGB LED Scop Sensor SHT75 Temperature Terminal Tipping Bucket Train Modeling Vintage Water Detector