Thursday, October 14, 2010

PIC18F USB LC Meter

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): PIC18F2550_USB-HID_LC-Meter.zip
elab.ph 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.


18 comments:

  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
    regards
    sarma

    ReplyDelete
  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,
    julius

    ReplyDelete
  3. When loading HEX programmer you see this message.



    Error in HEX file-Fuse Line:397
    :0100000024DB
    YOU CAN HELP

    Thanks

    ReplyDelete
  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?
    regards
    sarma

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

    ReplyDelete
  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. ebpalomino@hotmail.com.

    ReplyDelete
  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.

    rgds,
    julius

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  10. hello

    Where possible i buy this meter

    PIC18F USB LC Meter

    good jop

    ReplyDelete
  11. Hello,

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


    thanks in advance!
    Best Regards
    Hasnain

    ReplyDelete
  12. Hi,

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

    http://img407.imageshack.us/img407/770/82523799.jpg

    ReplyDelete
  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

    http://lab.buddika.info/2012/03/homemade-usb-lc-meter.html

    ReplyDelete
  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
    values.
    Thax
    mail:tpucz@juropnet.hu

    ReplyDelete
  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
    Paul

    ReplyDelete
  16. their is no polarity detail of C2 capacitors

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

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

    ReplyDelete