I have a big-ish electrode (10cm x 10cm) that works fine for detecting touch over the whole electrode (as a boolean - simple touch vs. release) but I was wondering if there was a way to detect where on the electrode there was a touch, using filtered data or something? I saw this link where the person made a capacitive touch grid. All their copper tape rows/columns are touching. When I try to connect multiple clips to a single electrode though (more-or-less what they did) my MPR121 becomes unresponsive.
I'm using an Arduino Uno, a Sparkfun MPR121 capsense breakout, and this library for interacting with the MPR121.
Here's a basic program I have running at the moment just to check out an average of filtered data readings to see if there's a pattern. There isn't. The readings are anywhere between 250 and 580 no matter where the electrode is touched.
#include <MPR121.h>
#include "Wire.h"
int readingSum = 0;
void setup() {
Serial.begin(9600);
Wire.begin();
MPR121.begin(0x5A);
MPR121.setInterruptPin(2);
MPR121.setTouchThreshold(50);
MPR121.setReleaseThreshold(40);
delay(1000);
}
void loop() {
if (MPR121.touchStatusChanged()) {
MPR121.updateAll();
if (MPR121.isNewTouch(0)) {
for (uint8_t i = 0; i < 8; i++) {
readingSum += MPR121.getFilteredData(0);
}
Serial.println(readingSum / 8);
}
readingSum = 0;
}
}