Shop OBEX P1 Docs P2 Docs Learn Events
Capacitance Meter demo on VGA — Parallax Forums

Capacitance Meter demo on VGA

Peter JakackiPeter Jakacki Posts: 10,193
edited 2013-02-18 18:43 in Propeller 1
Last night I was sorting out some SMD parts off their reels as I was making up a new prototype. To save myself time I placed the various components down into their respective places onto the overlay sheet so it would be ready for assembly. This was to save time as I would otherwise manually pick and place from my prototyping component bins (pill boxes).

So there were all these components neatly laid out on the paper sheet (which I never really do) and it was important not to knock anything because most of the smd capacitors look the same and have no markings. Well, guess what? I immediately knocked the sheet (dumbo) and the caps were everywhere.

What could I do? Well, I could just scrape the parts into a "dunno" bin and just use new parts. But I thought "What I need is a capacitance meter so I can probe these little parts". I do have a DMM with capacitance function but it's made for parts with long leads etc. So I thought I would go one better and just hack some code I had for the RPM display and get it to display capacitance. In less than an hour it was up and running.

Here's the result
capmeter2.jpg


It's rough and ready but surprisingly good. Try it yourself and just uncomment the "#define demoboard" and specify your test pin on line 159. The code will autorange and hold as well as smooth out the reading etc. I might do some further enhancements and get it to automatically detect and measure resistance, capacitance, and inductance, why not?

EDIT: Updated the archive and added an extra feature that displays the three digit cap code so 100nf also reads as "104"

Comments

  • jmgjmg Posts: 15,173
    edited 2011-08-10 20:12
    Cool! Do you have a PAL version ? ;)

    What VGA pixel ratio is that, as it does not look like the usual aspect ratio ?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-10 21:10
    jmg wrote: »
    Cool! Do you have a PAL version ? ;)

    What VGA pixel ratio is that, as it does not look like the usual aspect ratio ?

    PAL? All the analog TVs we have here handle NTSC just as well. I modified the original graphics driver so that I could scale the Propeller font in the X and Y directions so this is probably what you are seeing. You could easily use this code with a TV text object and simply disable the special scaling commands etc.
  • jmgjmg Posts: 15,173
    edited 2011-08-10 21:29
    PAL? All the analog TVs we have here handle NTSC just as well.

    The idea was that PAL has a higher chroma Freq, and so better pixel bandwidth room, but I have not tried a side by side comparison
    on a real TV set.

    I guess the Dual-mode LCD ones, convert to a third raster anyway, so it may be a moot point ?
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-10 22:24
    ...So I thought I would go one better and just hack some code I had for the RPM display and get it to display capacitance. ...

    Fan-tastic! I've always wanted something like this. Thanks for sharing!
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-08-11 02:05
    Nice and simple Peter :)
    Just shows what the prop can do so easily.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-11 04:22
    Yes, and the Prop, just like the kitchen blender is more likely to be used when it is easily accessible. That is why I'm leaving one of these babies on the workbench just for this purpose. I am already looking at implementing the other test functions such as Frequency and timing, signal generation, measure capacitance, inductance, resistance etc. Of course with my little PuppyProp modules I have ADC functions, the kitchen sink and everything else on them so I might leave one of these setup on the bench for this purpose. That leads to smart DMM functions and of course oscilloscope and LA functions, but the basics first.

    EDIT: The other thing I always wanted to do was implement a voltmeter that measured the source resistance and extrapolated if necessary. What this means is that 3.3V through a 10K pull-up would report that it exhibited a 10K source resistance whereas a power source might well report only a few ohms etc.
  • ErNaErNa Posts: 1,752
    edited 2011-08-11 14:18
    Hello, I wanted to test this application, but use the proptool on windows, so experience problems with ifdef,.. Tried to install BST for windows (BST 19.3) and run into problems:

    con
    #ifdef demoboard
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000
    #else

    _clkmode = xtal1 + pll8x
    _xinfreq = 10_000_000
    #endif

    creates error. It seems that #else is interpreted as else, because it is bold! What to do? BST is no longer officially supported?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-11 20:40
    ErNa wrote: »
    Hello, I wanted to test this application, but use the proptool on windows, so experience problems with ifdef,.. Tried to install BST for windows (BST 19.3) and run into problems:

    con
    #ifdef demoboard
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000
    #else

    _clkmode = xtal1 + pll8x
    _xinfreq = 10_000_000
    #endif

    creates error. It seems that #else is interpreted as else, because it is bold! What to do? BST is no longer officially supported?
    Easy way around this is to implement "manual preprocessing" and cull the unnecessary sections yourself :)
    30 seconds later.....compile.....that's it!
  • avsa242avsa242 Posts: 452
    edited 2013-02-17 04:56
    Peter,

    I just tried this out (remembered seeing it awhile ago and something reminded me of it earlier today) - such a neat project! Just out of curiosity, does it read quite high for most caps you've tried? Any of the ones I've tried read a few hundred pF high (for small value ceramics, e.g. 496pF for a 27pF cap), 83uF for a 47uF electrolytic. I know most of the caps I have are pretty wide tolerance (my ceramics all vary from J to M), but this still doesn't seem to account for how far off it is. This is with a demoboard, have tried all I/O pins that are broken out to the header, and both resistors as the spin source prescribes. Do you think the breadboard could have this much effect on capacitance?
    Also did you ever implement the other meters you were talking about (inductance, resistance, voltage, etc)?

    Cheers,
    Jesse
  • pedwardpedward Posts: 1,642
    edited 2013-02-17 22:46
    Peter, Good Work! This is very cool and is a great lab for newbies!
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-02-18 18:29
    avsa242 wrote: »
    Peter,

    I just tried this out (remembered seeing it awhile ago and something reminded me of it earlier today) - such a neat project! Just out of curiosity, does it read quite high for most caps you've tried? Any of the ones I've tried read a few hundred pF high (for small value ceramics, e.g. 496pF for a 27pF cap), 83uF for a 47uF electrolytic. I know most of the caps I have are pretty wide tolerance (my ceramics all vary from J to M), but this still doesn't seem to account for how far off it is. This is with a demoboard, have tried all I/O pins that are broken out to the header, and both resistors as the spin source prescribes. Do you think the breadboard could have this much effect on capacitance?
    Also did you ever implement the other meters you were talking about (inductance, resistance, voltage, etc)?

    Cheers,
    Jesse

    The large eletrolytics will always vary quite a lot especially at test current levels. The tests that I did were straight from a pcb out onto a header and the readings were what I would expect especially when I had some caps with tight tolerances. But like all "meters" there is a limit to the range so that even the common multimeter has probe and contact resistance which limits it's low end so you end up reading a few ohms just with shorted probes. The cap meter "demo" is no different and will not be able to accurately measure very small caps plus you will have some stray capacitance around anyway although the 496pF reading sounds very high.

    I never did get around to the other measurements but I might have a look at them and allow for character LCDs as well as VGA output, that way the device could be portable.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-02-18 18:43
    pedward wrote: »
    Peter, Good Work! This is very cool and is a great lab for newbies!

    Thanks, I will take a look at measuring other components as well plus allow for a character LCD.
    With a stable resistance and capacitance it's possible to measure other resistors and capacitors using the RC time method plus one method of measuring inductors is by connecting them in a tank circuit and exciting them with a short pulse and measuring their resonant frequency. Of course frequency measurements are easy to do too using a combination of cycle time measurement or pulse counting.

    Diodes, LEDs, and transistors are fairly easy to check so it's possible for the meter to tell you that it's an NPN darlington or P channel FET for instance along with gate capacitance readings. Gain measurements could also be incorporated but this is where an ADC (perhaps a NAU7802) would be desired in which case we could also do all those voltage and current readings along with ESR measurements to discern whether the 3.3V you are reading is a voltage source, an output, or a pull-up. Where do you stop?

    But I would probably write the software in Tachyon Forth since is so easy to use and fast.
Sign In or Register to comment.