1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

PIC based high-resolution cap meter

Discussion in 'Microcontrollers' started by Mr RB, Jun 27, 2011.

  1. Mr RB

    Mr RB Well-Known Member

    Joined:
    Jul 22, 2008
    Messages:
    4,716
    Likes:
    194
    Location:
    Out there
    Hi Burt, I'm not an opamp expert basically the "best opamp" depends on whatever the opamp will do. :)

    Personally I think a separate test instrument is best, and ESR meter should be optimised for what it has to do and a cap meter does a very different task. If you are measuring ESR on electros then the value is written on the electro in big letters anyway, so the cap meter is not needed.
     
  2. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,833
    Likes:
    138
    Location:
    morristown,tn
    ONLINE
    I found a good idea I was just thinking of using the same LCD but Your right It would make a better tester by it's self. I'll start a new thread and post something showing one.
     
  3. kripton2035

    kripton2035 New Member

    Joined:
    Jan 7, 2009
    Messages:
    16
    Likes:
    0
    for all those here that wantideas to make their esr meter, here is my esr repository with plenty of (free) ideas...
    http://kripton2035.free.fr/esr-repository.html

    then Mr Black, as I really appreciate your previous ideas in many domains, I really want to know more about your "few ideas to throw into the mix" ...;)
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Mr RB

    Mr RB Well-Known Member

    Joined:
    Jul 22, 2008
    Messages:
    4,716
    Likes:
    194
    Location:
    Out there

    Hi Kripton, well my usage of ESR meters has been from the late 1980's when I worked in electronics repair. Many of the caps that are suspect are in the 1 to 2 ohms ESR range and it's critical to have really pointy probes to reduce connection resistance, and an ESR meter that produces a reasonable amount of current and prefereably a very low voltage, under 0.1v?

    My ESR testers have a manual "zero ohms" button, but I think a smart designer could do an auto zero of connection ohms in firmware (invisible to the user), by testing the cap with multiple frequencies and the connection ohms would be common to all but the ESR ohms would be frequency dependent.

    It would be cool too if the display showed both stats;
    Probe ohms = 1.34
    ESR ohms = 2.11
     
  6. kripton2035

    kripton2035 New Member

    Joined:
    Jan 7, 2009
    Messages:
    16
    Likes:
    0
    esr doesnt really change with frequency ...
    see attached curve.
    esr versus frequency.jpg
     

    Attached Files:

  7. Mr RB

    Mr RB Well-Known Member

    Joined:
    Jul 22, 2008
    Messages:
    4,716
    Likes:
    194
    Location:
    Out there
    The ESR "effect" measured by the oscillator changes. That's exactly the point with ESR, it won't affect low freq power supplies much but has a drastic effect on high frequency power supplies.

    Anyway if you don't think you can do the auto zero/ auto compensate function then don't worry about it.
     
  8. davidbear

    davidbear New Member

    Joined:
    Jan 16, 2009
    Messages:
    48
    Likes:
    0
    Location:
    Kenosha, WI
    Mr. RB,

    In the figure that shows the square wave, the figure indicates oscillations between 1.3V and 3.7V. The text says 1/3 Vdd and 2/3 Vdd. If Vdd is 5 V, doesn't that make 1.67V and 3.33V? Any clarification would be helpful.
     
  9. dougy83

    dougy83 Well-Known Member

    Joined:
    May 18, 2008
    Messages:
    2,674
    Likes:
    215
    Location:
    Brisbane, Australia
    Nice project Mr RB. Have you considered an inductance meter along the same lines? ie inductor in place of the 10k, and 10k in place of the cap.

    Calibration unfortunately is not as simple as for the C meter however.
     
  10. Mr RB

    Mr RB Well-Known Member

    Joined:
    Jul 22, 2008
    Messages:
    4,716
    Likes:
    194
    Location:
    Out there
    I can't remember exactly, it was a while ago now! I had been doing some tests on the 'scope before doing the diagrams so I might have been influenced by remembering 'scope voltages, but it's just as likely it was brainfade and I simply got the numbers backward, and typed 1.3-3.7 instead of 1.7-3.3. :)

    Due to the PIC output not being exactly 0v and 5v the voltages won't be exactly 1.67 or 3.33 anyway, and it has no significant effect on operation so I can't be bothered changing the artwork now. But thank you anyway for mentioning it!

    To Dougy83; I did actually try some inductor tests, the results were most unsatisfactory. In theory it should work fine but the problem is the inductor performance (measured period) in RL osc is very dependent on current and inductor characteristics, much more so than the inductance value. With the low current from the PIC and resistors I could not get any useful results. To get accurate inductor performance you need an LC oscillator, as is used in all of the L meter kits. You may also be able to use a high current RL oscillator, depending on the inductor type but I'm thinking 100mA might be the minimum which means it's just not going to work from my design.

    I posted this link before but here it is again;
    http://www.rfcandy.biz/communication/imp_lc.html
    a very nicely designed LC meter kit.
     
    • Like Like x 1
  11. davidbear

    davidbear New Member

    Joined:
    Jan 16, 2009
    Messages:
    48
    Likes:
    0
    Location:
    Kenosha, WI
    Mr. RB,

    Thanks for that.
     
    Last edited: Feb 25, 2012
  12. davidbear

    davidbear New Member

    Joined:
    Jan 16, 2009
    Messages:
    48
    Likes:
    0
    Location:
    Kenosha, WI
    Mr. RB,

    In your original article, you give an example of a 10nF capacitor giving a 435 Hz frequency with a half period of 1.149 ms. When I calculate the RC time constant for a 10 nF capacitor and a 10K resistor, I get 0.1 ms. Does this mean that their are ~11.5 time constants per charging? I have been struggling to derive your scale constant of 919, and I think I must have a basic misunderstanding of your circuit.
     
  13. Mr RB

    Mr RB Well-Known Member

    Joined:
    Jul 22, 2008
    Messages:
    4,716
    Likes:
    194
    Location:
    Out there
    Total period is given by a charge and discharge.

    I can't remember off hand as it is an old project, but I just chucked a 9.94nF cap in the meter and checked the osc frequency, it was about 6570Hz at the osc itself, but the PIC would have used the capture compare module set to /4 or /16 (to increase accuracy) so the period actually measured might have been 1642Hz or 410Hz respectively.

    That's probably where the 435Hz figure came from, it would have been measured during the earlier testing. Some parts did change for the final version, but rest assured I spent some time calibrating the firmware with the parts shown in the final diagram, and the constant value in the firmware was carefully chosen.
     
  14. davidbear

    davidbear New Member

    Joined:
    Jan 16, 2009
    Messages:
    48
    Likes:
    0
    Location:
    Kenosha, WI
    Mr. RB,

    Thanks! It had not even occurred to me that the frequency that you were referencing might be divided by 16! I have no doubt that your firmware works as well as advertised, but for me to understand a thing, I need to work out the math. Would it be OK if I have some more questions later?
     
  15. dougy83

    dougy83 Well-Known Member

    Joined:
    May 18, 2008
    Messages:
    2,674
    Likes:
    215
    Location:
    Brisbane, Australia
    Yes, quite true re requiring a higher current; for low value inductors the oscillation freq will be very high with a 10k res.
     
  16. Mr RB

    Mr RB Well-Known Member

    Joined:
    Jul 22, 2008
    Messages:
    4,716
    Likes:
    194
    Location:
    Out there
    Sure, that's why I posted the project in a public forum. :)

    Yeah it's not easy to do a good RL based meter, which is probably why that method is reserved for some special inductor testors.
     
  17. abofar

    abofar New Member

    Joined:
    Feb 25, 2012
    Messages:
    35
    Likes:
    0
    great circut

    Hello,this circuit looks to me is the best I found in the net.
    I tried to simulate it using proteous isis with 16f628A because isis does not have component library for 16f628. It does not work.I tried to make similar one using 16f877A. I started making the oscillator first using pibasic pro,but the wave is ugly, pulse on cycle may be 10 times the off cycle and oscillate for 1s then stops.I am a retired elec. engineer d'nt have much experience with pic except making two projects in picbasic pro. can you mr.RB help me on this issue. I will be more than greatful to you. I love pic's it is most enjoiable but d'nt like ASM and d'nt know much about c.
    I did'nt build it i have just used isis.

    Obaid
     
  18. Mr RB

    Mr RB Well-Known Member

    Joined:
    Jul 22, 2008
    Messages:
    4,716
    Likes:
    194
    Location:
    Out there
    First I suggest you get the oscillator working, you can do that in ISIS with any of the comparator components, and the few resistors and cap shown on my schematic.

    Please note if the comparator does not have a push-pull output you will need to add a pullup resistor of 470 ohms on the comparator output.

    Once you have the comparator oscillator working in the simulator you can recreate it using the 16F628A comparator. The duty cycle should be close to 50:50, or in any case much better than 10:1 which would indicate a fault! :)
     
  19. abofar

    abofar New Member

    Joined:
    Feb 25, 2012
    Messages:
    35
    Likes:
    0
    Thank you Mr.RB I did as you suggested oscillator is working fine now.Thank you again.
     
  20. abofar

    abofar New Member

    Joined:
    Feb 25, 2012
    Messages:
    35
    Likes:
    0
    HELLO ALL
    Mr.RB good day to you. How can I measure capacitance smaller than 20pf since the timer1 tick at .2us when xt=20MZ. 20pf is =1tick (RC=T, C=T/R) in this case 0.2X10^-6/10000=2X10^11=20pf. Do you recommend changing the value of RT what is the max value of RT weil be practical.

    Obaid
     
  21. Mr RB

    Mr RB Well-Known Member

    Joined:
    Jul 22, 2008
    Messages:
    4,716
    Likes:
    194
    Location:
    Out there
    The project already measures very small capacitances down to 0.01pF.
     

Share This Page