Thursday, October 14, 2010


Inductance and Capacitance Meter using Microchip's PIC18F2550 connected to USB using HID class (Plug-n-Play).

* f1, f2. and f3 are the frequencies defined by the equations stated on Digital LC Meter.

diagram using internal Analog Comparator and Timer Peripherals of PIC18:

schematic with actual values:
*simulation on Proteus 7 is NOT working (particularly the LC oscillator part and internal pull-up on RB0)

download link (HEX and PC app): forum link:   PIC18F2550 USB LC Meter

 # edit (10-20-10)
added "Calibration option" ( same PIC18F firmware )
  • reference capacitance range is 1.0nF +/- 5%
  • Fosc (20MHz crystal with PLL) frequency range is 48MHz +/- 200ppm

# edit (08-14-11)
 V1.2 ->  updated host-side application,
          -> should now work both on 32-bit OS and 64-bit OS hosts.


  1. hi, Great concept
    simply use the PC to read out instead of another LCD display.
    however, don't you feel such an instrument can better be standalone, Mr YUS !
    now I am trying to make a smaller version of Phil Rice design to be housed in DT38 model DMM cabinet. To make it possible , i have resorted to 8*2 display.
    All the best and hope to see many more projects from constantun

  2. hi sarma,
    It's nice to hear from you again.
    I agree with you, portable/standalone version is still the best option.
    My main purpose for this project is to study also the "usb interfacing" with pic18.

    Hope you'll finish your own version soon.
    It will be better if you use smaller (lower-power) LCD.

    best regards,

  3. When loading HEX programmer you see this message.

    Error in HEX file-Fuse Line:397


  4. YUS, I totally agree with you.
    If we get a glass display with the type of legend we need to display suffixes to the measured values, it is the best. In that direction, i sincerely feel that your earlier design with mobile phone TFT display is compact and superior.
    I have practically settled for Phil Rice design but with L&C selection using a relay. There are no hanging wires from main board to mechanical switch and back.It is working very fine with 16*1 display. BTW, what new projects did you take up?

  5. Hi.
    what is maximum inductance/capacitance measured by USB LC meter?

  6. Hello,

    Is it possible to get a copy of the source codes for PIC and host (C#)?

    I would like to add a LCD to this great project.

  7. hi ebpalomino,

    the firmware code for the PIC18 and the C# code for the host are based only on the "USB Device - HID - Custom Demos" of Microchip's Application Libraries. I just made some modifications. So, it's better to start from the original code of microchip.


  8. hi,

    it's the what i was looking for,most PIC based LC meters has LCD,can you plz give me the hex for 18F4550?because my development board got that

  9. Could you post the configeration bits for the 18f2550 as i get error in pickit 2 saying that it cannot find config bits in hex file

    If i burn the hex with default config bits the the usb is not working at all

    1. mine does also not work and I dont know why. I have looked data and clock lines with osciloscope and there are some data send but no response from program.

  10. hello

    Where possible i buy this meter

    PIC18F USB LC Meter

    good jop

  11. Hello,

    I need vb source code for this project..
    please give

    thanks in advance!
    Best Regards

  12. Hi,

    I too need the config bits for the PK2 :D
    i tried to guess those,is this correct,

  13. Hi,

    I've built this successfully using config words i guessed in a previous comment,
    I wrote a blog post too about this wonderful design.Thank you YUS :D

  14. Hello
    Can you send me the source code of the
    pic microcontroller?
    I would like to modify it because I need
    some device what is indicate on output line
    when the inductance is over than presetted

  15. would it be possible to get the full hex with config bits included, as i have built board and having problems setting bits shown in picture..
    this would be very much appreciated

  16. their is no polarity detail of C2 capacitors

  17. so i need use 20Mhz or 48hmz oscilator?

  18. Do you know the name of that oscillator? I cant understand how it works...

  19. @Paul He won't give the source and I can't d/l from 4shared, so I think of
    1) Get known with USB interfacing to pic 18F2550
    2) Get to know how it works & make my own program.
    Once you have own source code, it becomes possible to improve the hardware also.

  20. For Angello:

  21. Hello Friend,
    Can you please send me source file if it is in C? I shall be thankful to you.
    I am unable to download from 4shared due to having non paid account.


  22. Can i have the source code of the pc application?
    I have built the is working except it has a accuracy problem.I can make it more accurate if i got the mathematical conversion happening in the application.Or any link related would be helpful.The link about f1,f2,f3 is not working.Fixing the link also would do..

  23. USB DEVICE not detected ! i made the circuit, installed the hex file into the 18f2550 via pickit2 and inserted it into ckt ! when i connected it via usb port ! its unable to install its drivers nor the program is detecting it ?? :(

  24. I read your project's description
    and i intend to build a similar project adding a resistance meter for my end of year project. i wish to have the C code to work on it.

  25. hi Yus,

    I'd like to adapt this circuit to operate with a lcd display for that, you could provide the code * .c?


  26. ServoConnect Systems Offers Industrial Automation Products | Magelis XBT GC, GT/GK Control Human Machine Interface HMI | Programmable Logic Controllers (PLC) | Schneider Electric Products - Modicon - Magelis Controllers | Frequency Inverters | Programmable Automation Controller PAC

  27. Hello.
    Im gonna build this project of yours and I was wondering what kind of capacitors are C2 and C3? are they regular or tantalium cos in some other LC meter with 16F628A theese two are tantalium.

  28. Hello.
    I have build this LC meter but when I program the pic using easypic6 and put it on to my pcb and plug it into pc it doesn work like it doesnt wanna connect with the program. Drivers are installed automatic. The strange thing is that Microchip Custom USB Device driver doesnt wanna work.Code 10

  29. is this hex file fuesed with bootloader or I have to load bootloader myself?