- #1
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 :)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!)
To wire a capacitance sensor to a controller, you will need to connect the sensor's positive and negative terminals to the controller's corresponding input terminals. You will also need to connect the sensor's signal output to the controller's signal input. Make sure to follow the manufacturer's instructions for proper wiring.
No, it is important to make sure that the capacitance sensor is compatible with the controller you are using. Some controllers may only work with specific types of sensors, so be sure to check the specifications before purchasing a sensor.
In most cases, yes, you will need to calibrate the capacitance sensor after wiring it to the controller. This will ensure that the sensor is accurately measuring the desired parameter. Refer to the manufacturer's instructions for specific calibration procedures.
Some common issues that may arise include incorrect wiring, faulty connections, and compatibility issues between the sensor and controller. Make sure to double check all connections and consult the manufacturer's instructions if you encounter any problems.
Yes, you can wire multiple capacitance sensors to one controller as long as the controller has enough input terminals for all the sensors. However, keep in mind that each sensor will need to be calibrated individually to ensure accurate readings.