CapSense muliple inputs

Hi there.

I am using paulb's capSense library for a schoolproject. I have connected 3 cobber plates to an ArduinoUno, via a 516K resistor.

As long as i only touch one cobber plate at a time, the readings are fine and stable, an about 3 times as high as if i don't. But if someone else is touching a plate, and i touch a plate, the readings go crazy and jump a lot for both plates. Each plate has its own sender and receiver pin.

The readings when untouched is about 300, and 900 when touch. I don't know if it is relevant, but it is suggested to use a small capacitor from receiver to ground, and one in parallel with the cobberplate, but if I apply these, the results explode to around 500 000, no matter the size.

Hope you guys can help me.


did u cover the copper plates with an insulator? :) like duct tape?

The edge of the cobber plates are covered with a thin piece of duct tape, but i cant get a readable result by touching it. I have tried to use a isolated wire instead of cobberplates, but again i cant register a touch with the isolation. If I touch the wire directly though, I get the same results as with the cobberplates.

The important thing to understand is that using a cap sense input like this is not a stable and reliable technique. It is a novelty designed to illustrate a process. You can't just wire up multiple inputs and expect it to work. You have to understand what you have physically and how that interacts with your software.

What do you mean by "cobberplates" do you mean copper plates ?

The cobberplates are made up by a few millimeters of plastic in the buttom, and a piece of cobber tape ontop.

It is important never to touch the plates. If you do you inject interference directly into the chip and that ruins the subtle effect you are trying to measure.

I have just covered one of the cobber plates entirely with duct tape.
The difference in the reading between touched and un-touched is now so small that it would be almost impossible to work with.
What can i do to make this difference bigger?
Adding a larger resistor is not helping, only making the process slower.

What can i do to make this difference bigger?

Make the plates have more area.

This doesn't seem to make the difference bigger, just the readings larger. When I see people posting their results, the touched reading is many times higher than the untouched reading. Mine is only about 2-3 times higher.

I'm also having a problem about using the same 'send' pin. Paulb mentions that multiple sensors can have the same sendpin, but if I use the same sendpin on my three sensors, my results get very jumpy and unstable.

Btw, i just noticed i have spelled copper plates wrong. So sorry, in Danish we spell it with b ;).

This doesn’t seem to make the difference bigger, just the readings larger.

You have to consider your whole set up and look at the physics of the situation. You have to use construction techniques that minimise stray capacitance and interference pickup.
It might help to post a picture of your setup.

Remember I told you that this is not a reliable robust technique, and it surprises me not that you are having difficulty.

Maybe if you said what you are actually trying to do it would help.

I made a chorded keyboard with this.
the resistors r about 1MOhm (i forgot the exact value)…

i think the capacitance of the “key” at the base of the BJT is multiplied by the circuit…
like this:

it works quite reliable, but it needs a grounded ground plate, i think… for EM shielding…
when i used just a pizza box, some (not all) keys fired without permission with no good reason… :slight_smile:

I’m trying to make a game, much like slapsies, where we have 4 touch sensors.
The game requires two players, an attacker and a defender. Each player start by touching their ‘start touchpad’.
The attacker has to rush over to a touchpad just in front of the defenders start touchpad, before the defender can remove himself from his start touchpad. The attacker gains point by touching the pad before the defender can remove himself. The defender gets to be attacker by removing himself before the attacker touch the pad infront of the defender.

So basically i need to be able to register two touches in the start, and then register whether the defenders pad go low, or the pad infront of the defender rises, first.

I will try to post a picture later, but i have attached a schematic viewing the setup.
All the things to the left of the MEGA8-P is a standard ArduinoUno stand-alone setup.

That sounds like the touch pads are going to be quite some way appart and also remote from the Arduino. If this is correct it might explain why you are having difficulty.

Well, right now there aren't more than a few centimeters between them and if the distance turns out to be a problem, that is changable. It seems like this is a very unreliable method, like you mentioned. Do you know any alternative methods, preferably running on an ArduinoUno?

Well the simplest method is just to use a mechanical push switch. A micro switch has a good feel. There are cap sense boards that do a proper capacitave sensing, these would be mounted close to your switch and the output feadbtomthe arduino. You could use an IR proximity switch of the reflective optical type. There are lots of choices, try googling some.

I'll borrow this thread as I have also some problems with CapaSense lib with multiple inputs.

I use one send pin and four sensor pins for some general on/off light switching. Actual touch plates (short aluminum bars) are connected to duino with ~1m long shielded wires. I use 1M resistors for send pin and 1K for sensor pins. I grounded the touch plates with 1pF caps. Resistors and caps are in arduino end, so only wires are going to the touch sensor. I also grounded Arduino and other chips to earth ground.

Everything works ok if I touch one sensor at a time. I get idle readings around 15 and touch readings around 1500. Problem is that if I touch multiple sensors at a time, readings go mad and they wont return to the normal level in idle, but jump to around 300 for each sensor input. Resetting duino fixes it.

I've tried with different auto calibration function values and also triedt to disable it but can't see any difference in behavior. I should probably play with raw values instead but just wanted to ask if someone knows what is causing this?

Well it was just that the calibration routine couldn’t ever revert if sensor value decided to drop under normal level for a second. Re-wrote calibration routine like this:

if (abs((long)total - (long)leastTotal) > ((long)total/10) && !baseCalMem) {
		baseCalMem = true;
		baseCalMillis = millis();
	if (abs((long)total - (long)leastTotal) < ((long)total/10) && baseCalMem) {
		baseCalMem = false;
	if ( (millis() - baseCalMillis) > CS_AutocaL_Millis && baseCalMem) {
		leastTotal = total;
		baseCalMem = false;