Wiring a capacitance sensor to a controller

Click For Summary

Discussion Overview

The discussion revolves around wiring a capacitance sensor to a controller, focusing on circuit design, component placement, and methods for measuring capacitance changes. Participants explore various approaches and configurations for implementing the sensor, including both AC and DC methods.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant inquires about the necessity and placement of resistors in their capacitance sensor circuit.
  • Another participant critiques the initial circuit design, suggesting that the signal input should connect directly to the plate and recommending a large resistance to control the potential on the plate.
  • There is a proposal to measure capacitance by applying a known alternating voltage to an RC combination and observing changes in voltage or phase when an object approaches.
  • An alternative method is suggested, involving sending a single pulse to the RC circuit and measuring the time for the voltage to rise, which could be more suitable for a controller setup.
  • Participants discuss the implications of resistance values on the timing and reliability of capacitance measurements, noting that larger resistances may be necessary for small capacitance values.
  • Concerns are raised about potential issues such as insulating the plate and interference from 50Hz or radio frequency sources.
  • A participant expresses optimism about testing the sensor, acknowledging the learning opportunity regardless of the outcome.

Areas of Agreement / Disagreement

Participants present multiple competing views on the best approach to wiring the capacitance sensor and measuring capacitance changes. There is no consensus on a single method or configuration, and several ideas are explored without resolution.

Contextual Notes

Participants mention various assumptions regarding the circuit design, potential interference issues, and the reliability of different measurement techniques. Specific mathematical relationships and component values are discussed, but no definitive conclusions are reached.

kolleamm
Messages
476
Reaction score
44
I'm trying to make a simple capacitance sensor to use with my controller. Do I need two resistors? And where do I place them? I drew a circuit diagram of what I'm thinking so far.
 

Attachments

  • 20160425_102743.jpg
    20160425_102743.jpg
    11.5 KB · Views: 347
Engineering news on Phys.org
As far as I can see, your circuit just connects the sig input directly to -ve. So that's the potential it will always see, unless there is a hidden resistance in the -ve connection (there will be, but it's probably too small to be useful.)
Connect the sig input direct to the plate, but connect from the plate via a big resistance to whatever DC potential you want on the plate.

Then explain:
what is going to happen to the plate,
and what your sig input is going to look for.

It looks to me as if you intended to charge the plate to a certain potential, then detect the change in potential when the capacitance of the plate (to earth) changes. Depeding how fast the capacitance changes, the resistance may have to be quite big because the plate capacitance may be quite small. I don't know how reliable that method is, as I've never tried it.
 
Thanks for your response, here is a diagram I found online of what it should look like, although I'm not certain.
 

Attachments

  • img.gif
    img.gif
    5.4 KB · Views: 449
With the Send & Receive, that looks more like an AC idea. You apply a known alternating voltage to the RC combination and effectively measure the capacitance by reading either the voltage or phase at the junction. When a hand comes near, the capacitance changes and so does the voltage and phase of the signal at the junction.
Oh! Or maybe you just send a single pulse to the RC and measure the time for the voltage to rise. That sounds much more likely if a controller is reading it.
Again I've not done that one, but my guess would be something like,
configure the input to trigger an interrupt when the voltage rises above a threshold. Mainly hold the send low, allowing the plate capacitance to discharge. Periodically, output high to the send, start a timer. When the interrupt triggers, stop the timer, reset the send to low and use the time as the value of the capacitance. Compare it with either a quiescent value or the previous value to decide if the capacitance has changed.
(If you don't want / can't use an interrupt, just keep measuring the ip voltage until it reaches threshold.)

The time to charge (to say 2/3 of Vsend) will be roughly proportional to the capacitance of the plate. (For 63% charge, T=RC) So you choose R to give you a reasonable time count for the quiescent C and expect it to double when a hand is within a cm or so. By reasonable, I mean something you can count reliably - a count of 1 or 2 doubling to 2 to 4 does not give much confidence, 100 doubling to 200 is more obvious, but you don't want to waste time nor risk counter overflow, so no need to use thousands.
The capacitance of the plate might be a few pF, so you get a few μsec for each MΩ of R. (maybe more if plate is covered with suitable dielectric?)

That's my quick off the cuff idea and back of envelope estimates, but, as said, I've not tried it myself. Snags I see are: insulating the plate if you need R too big, and what problems 50Hz pickup might cause (and these days, maybe pickup from radio sources like phones and wifi.)

I'm sure there are others here with more appropriate experience. And if not, try electronicspoint.com or similar.

Edit: Ok I've found where you got the diagram and IMO Arduino playground is a reliable source, so I'd go with their idea (which I'm pleased to see is about what I guessed, only simpler!)
 
Last edited:
  • Like
Likes   Reactions: kolleamm
Merlin3189 said:
With the Send & Receive, that looks more like an AC idea. You apply a known alternating voltage to the RC combination and effectively measure the capacitance by reading either the voltage or phase at the junction. When a hand comes near, the capacitance changes and so does the voltage and phase of the signal at the junction.
Oh! Or maybe you just send a single pulse to the RC and measure the time for the voltage to rise. That sounds much more likely if a controller is reading it.
Again I've not done that one, but my guess would be something like,
configure the input to trigger an interrupt when the voltage rises above a threshold. Mainly hold the send low, allowing the plate capacitance to discharge. Periodically, output high to the send, start a timer. When the interrupt triggers, stop the timer, reset the send to low and use the time as the value of the capacitance. Compare it with either a quiescent value or the previous value to decide if the capacitance has changed.
(If you don't want / can't use an interrupt, just keep measuring the ip voltage until it reaches threshold.)

The time to charge (to say 2/3 of Vsend) will be roughly proportional to the capacitance of the plate. (For 63% charge, T=RC) So you choose R to give you a reasonable time count for the quiescent C and expect it to double when a hand is within a cm or so. By reasonable, I mean something you can count reliably - a count of 1 or 2 doubling to 2 to 4 does not give much confidence, 100 doubling to 200 is more obvious, but you don't want to waste time nor risk counter overflow, so no need to use thousands.
The capacitance of the plate might be a few pF, so you get a few μsec for each MΩ of R. (maybe more if plate is covered with suitable dielectric?)

That's my quick off the cuff idea and back of envelope estimates, but, as said, I've not tried it myself. Snags I see are: insulating the plate if you need R too big, and what problems 50Hz pickup might cause (and these days, maybe pickup from radio sources like phones and wifi.)

I'm sure there are others here with more appropriate experience. And if not, try electronicspoint.com or similar.

Edit: Ok I've found where you got the diagram and IMO Arduino playground is a reliable source, so I'd go with their idea (which I'm pleased to see is about what I guessed, only simpler!)
Thanks for the advice! I'm going to to try out the sensor and hey if it doesn't work at least I'll learn something. But I'm really hoping it does work :)
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
1K
Replies
3
Views
1K
  • · Replies 37 ·
2
Replies
37
Views
5K
Replies
16
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
2
Views
1K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 26 ·
Replies
26
Views
3K
Replies
4
Views
2K