Shop OBEX P1 Docs P2 Docs Learn Events
Capacitance sensing demonstration program — Parallax Forums

Capacitance sensing demonstration program

Mike GreenMike Green Posts: 23,101
edited 2010-07-10 14:36 in Robotics
Here's a simple program to demonstrate capacitance sensing using a Propeller DemoBoard and Prop assembly language. It's based on a description of capacitance touch sensing for the Arduino. The comments at the beginning of the code explain how it works and give some suggestions for using the cog counters to do the same sort of thing possibly from Spin with the same sort of precision.

Although the extra capacitance of the probes throws off the timing of the RC circuit, it's fun to see it work using the PropScope with one probe on either side of the 1M resistor.

Post Edited (Mike Green) : 12/13/2009 5:03:19 PM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-12-13 21:43
    Here's the equivalent program that's written entirely in Spin and uses the counters to do the timing as described in the comments in the source code in both versions.

    Post Edited (Mike Green) : 12/13/2009 10:10:06 PM GMT
  • LuckyLucky Posts: 98
    edited 2010-01-19 20:32
    Whats the advantage of using capacitive sensing rather than tactile switches?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "You do not really understand something unless you can explain it to your grandmother."


    -Lucky[size=-1][/size]
  • John R.John R. Posts: 1,376
    edited 2010-01-19 21:36
    For openers, no moving parts. You can also make the "switch" different shapes, and going further, could potentially "print" switches.

    Going other directions, changes in capacitance can also be used to sense fluid levels, etc.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John R.
    Click here to see my Nomad Build Log
  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-20 01:30
    Other advantages ... The sensor can operate through a sealed insulating film with information printed on it.

    Disadvantages ... No feedback unless it's provided somehow else and there's no positive actuation, no mechanical threshold
  • LuckyLucky Posts: 98
    edited 2010-01-20 07:22
    Thats really cool. I know my uncle had a metal strip under his wall cabinets in the kitchen that uses something like this so the lights mounted under the cabinet turn on.
    Too bad you can't make capacitive switches or sensors yourself like ipods use for the scroll wheel

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "You do not really understand something unless you can explain it to your grandmother."


    -Lucky[size=-1][/size]
  • AJMAJM Posts: 171
    edited 2010-01-20 14:14
    Thanks for doing this Mike, I was interested seeing how this would be accomplished for some time now but hadn't had the time to look into it
  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-20 14:52
    @Lucky - You could make something like the iPod's scroll wheel. It's just harder. Read some of the application notes and datasheets for the commercial touch sense ICs like those from MAXIM, ST Microelectronics, Atmel, and others. You'll see all sorts of examples of their use including scrolling. This is usually done by placing several (maybe 20) touch pads in a circle. The microcontroller reads the capacitance of all of them quickly and looks for the one or ones that have the highest capacitance. That's where the finger is located. By tracking changes, it can determine which way the finger is moving and how fast.
  • DgswanerDgswaner Posts: 795
    edited 2010-03-01 22:22
    Mike, I'll send you some ipod scroll wheels if you want to mess with them. From what I can tell the hard part is done on the click wheel, and you just need read the values via serial.

    http://jasongarr.wordpress.com/project-pages/ipod-clickwheel-hack/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DGSwaner

    "When in doubt, use C4" - Jamie Hyneman, Myth Buster
  • KPRKPR Posts: 189
    edited 2010-06-05 13:51
    Neat idea.. I'm waiting for my units from ebay... I hope I got the right ones....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I always have someone watching my back.
  • edited 2010-07-08 16:17
    I've been looking for something like this. In aviation it's common to use a capacitance type system to measure fuel quantity. Basically two tubes, one inside the other. The fuel acts as the dialectric and as the fuel level rises the capacitance increases. Since the capacitance is based on the density of the fuel it's possible to determine fuel load by weight instead of by volume. Pilots are more interested in the weight of the fuel then they are the volume. That way they can tell if they're exceeding the aircraft weight limits. I'm designing a water tank system and I need to know the weight of the water as opposed to just the volume.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-07-08 16:39
    Unfortunately, water, unless it's highly purified, is normally a conductor, not an insulator.

    Water varies much less in density than fuel with temperature changes and the composition of water (particularly potable water) varies little. If you know the volume, you know the weight to fairly high accuracy and a simple temperature measurement allows you to correct for that if you need to.
  • LeonLeon Posts: 7,620
    edited 2010-07-08 16:58
    Here are details of Microchip's mTouch technology:

    www.microchip.com/en_US/technology/mTouchButtons/index.html

    Some of the techniques could be used on other hardware.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • Hugh AnglinHugh Anglin Posts: 1
    edited 2010-07-09 22:02
    They use capacitance probes in bottle making to test wall thickness. As the bottle travels down the conveyor, one side is moved along with a belt to cause the bottle to rotate while the other side goes across a long capacitive probe that detects the glass thickness from changes in the signal. Thanks for posting your capacitance sensing demo!
  • edited 2010-07-10 04:56
    Mike

    Thanks for the information about water density versus fuel density. I didn't realize that. Just the same is might be better to measure the capacitance rather than the actual water height since the capacitance system wouldn't have any moving parts.

    Sandy
  • LeonLeon Posts: 7,620
    edited 2010-07-10 14:36
    Pressure at the bottom of the tank is often used for measuring liquid quantity. The technique probably isn't very useful for aircraft, though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
Sign In or Register to comment.