Help with CAP1188 and a grid of touchpads

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
asymptote
 
Posts: 24
Joined: Mon Oct 24, 2011 8:35 pm

Help with CAP1188 and a grid of touchpads

Post by asymptote »

Hey all,

I'm working on a project where I'd like to make a 4 x 4 grid of touchpads using two of the CAP1188 sensors and an arduino. Each touchpad is a 4" x 4" square of clear ITO deposited on polyester (just like what Adafruit sells, but I'm purchasing mine from Sigma-Aldrich).

I prototyped it with a single square of ITO, and I was able to get all of the behavior I wanted, in terms of sensitivity and proximity. But once I started adding pads, the behavior became for erratic -- and I noticed that the wires leading from the microcontroller to the pads were actually touch sensitive! This isn't good at all; I really need the sensitivity to be focused on the pads.

I'm currently using alligator clips attached to the pads; I can put copper tape on the pads and then solder onto that, but I'm starting to wonder if I need insulated cable to run from the arduino to the touchpad. Or perhaps a capacitive sensing IC at each touchpad, with a minimal lead, and then have them all connected on a single I2C bus?

I'd appreciate any suggestions for how to make the wires less sensitive to proximity sensing.

thanks!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Help with CAP1188 and a grid of touchpads

Post by adafruit_support_rick »

That's a tough one. You might need a metal shield underneath the ITO. Run the wires up through holes in the shield.
Shielded cable might help.

You should probably check out the Documentation and Software section on this page for design guidelines:
http://www.microchip.com/wwwproducts/De ... ct=CAP1188

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Help with CAP1188 and a grid of touchpads

Post by adafruit_support_bill »

Long wires can result in a hyper-sensitive or unstable sensor. You probably want to mount the breakout board as close to the pads as possible and minimize the wire length. Your i2c wiring can be longer if needed.

User avatar
asymptote
 
Posts: 24
Joined: Mon Oct 24, 2011 8:35 pm

Re: Help with CAP1188 and a grid of touchpads

Post by asymptote »

Wanted to reply with my recent tests -- shortening the wires to as short and possible and playing with the sensitivity has reduced the issue substantially, but hasn't eradicated it. I'm planning on testing adding a large ground plane / metal shield next to see if that reduces the false positives on the wires.

User avatar
MCGEngineer
 
Posts: 20
Joined: Tue Mar 10, 2015 2:14 pm

Re: Help with CAP1188 and a grid of touchpads

Post by MCGEngineer »

I think that I am encountering a similar issue and am wondering how to address it. I started out with 1"x1" copper squares, but they were far too sensitive, so I've switched to very small copper circles on a (relatively) insulated square of electrical tape.
20150421_223450.jpg
20150421_223450.jpg (57.69 KiB) Viewed 691 times
However, I notice that if all five sensors are activated for a short period, it seems that one or a few tend to basically remain active until the Arduino is turned off and on again. Furthermore, the wires themselves seem to become sensitive after the device is on for a while. They're only 6" long. How do I address these issues?

I also notice that the 12-key and 8-key capacitive touch sensor instructions have different information about how to get readings (looks like it's digital for 8-key and analog for 12-key). Are they different in terms of functionality or is that just something about the instructions?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Help with CAP1188 and a grid of touchpads

Post by adafruit_support_bill »

Furthermore, the wires themselves seem to become sensitive after the device is on for a while. They're only 6" long. How do I address these issues?
As mentioned above, the wires are part of your touch pad. You should keep them as short as possible.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Help with CAP1188 and a grid of touchpads

Post by adafruit_support_bill »

Furthermore, the wires themselves seem to become sensitive after the device is on for a while. They're only 6" long. How do I address these issues?
As mentioned above, the wires are part of your touch pad. Long wires increase sensitivity. You should keep them as short as possible.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Help with CAP1188 and a grid of touchpads

Post by adafruit_support_rick »

MMEngineer wrote: I also notice that the 12-key and 8-key capacitive touch sensor instructions have different information about how to get readings (looks like it's digital for 8-key and analog for 12-key). Are they different in terms of functionality or is that just something about the instructions?
Not sure what you're referring to. Both are I2C. The 8-pin also supports SPI. That's all digital.

User avatar
MCGEngineer
 
Posts: 20
Joined: Tue Mar 10, 2015 2:14 pm

Re: Help with CAP1188 and a grid of touchpads

Post by MCGEngineer »

They can't be much shorter than about 2" - will that significantly improve the performance? I would think that 6" would still be pretty short.

Additionally, the actual "pads" that I am using (is there a better option for what to use?) seem to trigger each other, which would also seem to limit how close they can be together - and once touching the wires themselves triggers the device, I'm not sure how having shorter wires would help.

I didn't mean "digital" and "analog" literally - I mean that the instructions for the 8-key show that it gives out binary data, whereas the 12-key instructions show much more information about the data readings.
https://learn.adafruit.com/adafruit-mpr ... #downloads
https://learn.adafruit.com/adafruit-cap ... th-arduino

I will end up needing a few dozen of whatever solution I'm using for this application. Is there a product that would work better for detecting finger touches for each finger without having to have a separate analog input allocated on the Arduino for each finger?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Help with CAP1188 and a grid of touchpads

Post by adafruit_support_rick »

You don't need a separate analog input for each finger. These are I2C. It's a digital bus that only uses two pins. You can have up to 6 of the CAP1188 boards on the same I2C bus. You can have up to 4 of the MPR121 boards on the same I2C bus.

Several dozen touch controllers? You can't attach that many to a single microcontroller.

User avatar
MCGEngineer
 
Posts: 20
Joined: Tue Mar 10, 2015 2:14 pm

Re: Help with CAP1188 and a grid of touchpads

Post by MCGEngineer »

Right, I would like to avoid having a separate analog input for each finger, which is why I bought this. That's why I'm trying to solve the other problems I mentioned above (all of the inputs turning on at random after the microcontroller has been on for a while, the wires activating one another so that the device is unusable...)

I mean that I will need to buy several dozen Arduino/CAP1188 combinations, or several dozen of whatever tool will work for this application, so I would like to use the right solution.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Help with CAP1188 and a grid of touchpads

Post by adafruit_support_bill »

I've used leads up to 6" with good results. But you have to be very careful about how you route them because they are also touch sensitive. And because of their length, they the sensitive range is increased so that even a hand nearby can trigger them.

In general, shorter is better. And if you have multiple pads close together, route the leads perpendicular to the touch panel to avoid interaction between the pads.

https://learn.adafruit.com/adafruit-cap ... trol-panel

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Help with CAP1188 and a grid of touchpads

Post by adafruit_support_mike »

If cabling becomes an issue, you can use coax and a technique called 'shield bootstrapping':
bootstrap.jpg
bootstrap.jpg (17.38 KiB) Viewed 604 times
In coax, the capacitance between the inner signal wire and the outer shield dominates all other forms of capacitive coupling.

Capacitance is defined as the change in voltage between two plates as charge is added to or removed from one of the plates, and that presents an interesting loophole: if we force the voltage between two plates to remain the same at all times, the change in voltage is zero, and thus the effective capacitance must also be zero.

The circuit above does just that. The op amp is set up as a voltage buffer, and for a perfect op amp the voltage between the positive input (the voltage on the center wire) and the output (the shield) will be zero. For real op amps you'll get a few millivolts of offset, but that will remain nearly constant as the output follows the input. Capacitance doesn't care about offsets as long as they stay the same, so the effective capacitance of the cable will only depend on any lag between the center and the shield.

A good op amp will keep that lag down in the "incredibly small" range, so the effective capacitance along the cable will be almost zero.

User avatar
MCGEngineer
 
Posts: 20
Joined: Tue Mar 10, 2015 2:14 pm

Re: Help with CAP1188 and a grid of touchpads

Post by MCGEngineer »

Thanks for your help on the cabling. Is this the kind of op amp that would work for this project?
https://www.adafruit.com/products/808
I will also try using some conductive paint for this application.

There are a few other things that I mentioned above - if they were answered, I didn't see where. Please let me know if you have any ideas on these - I have tried to clarify:

1. "Additionally, the actual 'pads' that I am using (is there a better option for what to use than what is shown in the picture?) seem to trigger each other, which would also seem to limit how close they can be together... Is there a product that would work better for detecting finger touches for each finger without having to have a separate analog input allocated on the Arduino for each finger?" Basically, I would be as happy using an device that could just line up 5 buttons and organize them through two inputs instead of five...

2. "I also notice that the 12-key and 8-key capacitive touch sensor instructions have different information about how to get readings (looks like it's binary output for 8-key and integer output for 12-key). Are they different in terms of functionality or is that just something about the instructions?
https://learn.adafruit.com/adafruit-mpr ... #downloads
https://learn.adafruit.com/adafruit-cap ... th-arduino
"

3. "However, I notice that if all five sensors are activated for a short period, it seems that one or a few tend to basically remain active until the Arduino is turned off and on again."
Brainstorming about this the other day, I was wondering if I could set the 5v input (or reset?) to come from a digital output pin on the Arduino and turn it on and off every minute or so, since this problem doesn't seem to happen early on. Is there any downside to that/am I likely to accidentally fry the CAP1188?

4. Also, what is shielded cable?

Thank you very, very much.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Help with CAP1188 and a grid of touchpads

Post by adafruit_support_mike »

MMEngineer wrote:Thanks for your help on the cabling. Is this the kind of op amp that would work for this project?
Yeah, that should do.
MMEngineer wrote:1. "Additionally, the actual 'pads' that I am using (is there a better option for what to use than what is shown in the picture?) seem to trigger each other, which would also seem to limit how close they can be together...
If you put two capacitive sensors close to each other, you get capacitance between them. To prevent that, put a 'guard ring' of conductive material around each touchpad and connect it to GND. Once you have those, the dominant capacitance will be between the touchpad and its guard ring.
MMEngineer wrote:2. "I also notice that the 12-key and 8-key capacitive touch sensor instructions have different information about how to get readings (looks like it's binary output for 8-key and integer output for 12-key). Are they different in terms of functionality or is that just something about the instructions?
Both Arduino libraries return integer bit vectors that represent all the inputs. The CAP1188 has 8 inputs so an 8-bit integer will hold all the necessary information, but the MPR121 needs a 16-bit integer to hold information about all 12 inputs.
MMEngineer wrote:3. "However, I notice that if all five sensors are activated for a short period, it seems that one or a few tend to basically remain active until the Arduino is turned off and on again."
That's most likely to be the result of capacitive coupling between the pads. Adding guard rings should help.
MMEngineer wrote:Brainstorming about this the other day, I was wondering if I could set the 5v input (or reset?) to come from a digital output pin on the Arduino and turn it on and off every minute or so, since this problem doesn't seem to happen early on. Is there any downside to that/am I likely to accidentally fry the CAP1188?
That would work. The sensors don't use much current, so you can easily run one from a microcontroller pin.
MMEngineer wrote:4. Also, what is shielded cable?
it's a cable that has a tube of wire mesh or foil wrapped around all the other wires. The outer tube does roughly the same thing as the guard rings I mentioned above: the capacitive coupling between that and the wires running through it swamps out the effects from anything outside the cable.

The most common form (and easiest to get from a hobbyist's perspective) is the coax cable that runs from a TV antenna to the receiver. The official name for it is RG-6/U. It has an 18-gauge copper-clad steel wire down the center, the shield is usually a combination of aluminized mylar and aluminum braid, and the impedance at radio frequencies is 75 ohms. There are lots of other kinds with different sizes and performance specs, but they usually cost more.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”