Back to Cap Touch
After some interesting experiments with velostat, the core functionality of my project seems to have come back around to capacitive touch sensors. My last attempt at using an array capacitive touch sensors was quite limited in it's scope. It used 4 sensors, arranged in a line. This basically allowed for a single direction of stroking, meaning that getting any response from the prototype was frustrating and unsatisfying. With the testing I did today, I aimed to improve on the design of my MVP in 3 key areas:
- The resolution of the "stroking area".
- Flexibility in terms of stroking direction and force required
- Optimised data inputs and outputs, and reformated code, to improve performance
The beginning of this involved rethinking what sizes and shapes the sensors themselves could be. Why do they have to be the same size Can they be different shapes? After some brainstorming I settled on the design below. The corners in each sensor mean that there are multiple angles you can approach it from to touch it. The way they bend around each other also benefits this aspect. This also made it easier to fit more sensors in a denser area. I used copper tape to attatch each sensor to the small sheet of cotton. The finished sensor is approximately 9 by 13 cm. I also increased the resistor strength from the last design.
Rather than using 4.7m ohm resistors, the ones used in this iteration are 10m ohms each. I did this in an attempt to address point two above, and to enable me to use the fabric that I wanted. Increasing the resistance in each sensor meant that the thicker faux fur could be used, rather than the thinner material pictured below.
After construction, it was time for testing. Like last time, I connected the sensors to crocodile clips, and then each to their own set of sensor pins on the Arduino. The circuit looked like this:
For testing I completely rewrote the code for detecting touch input. The previous version relied heavily on the serial bus for passing data between different parts of the program. I improved this by looking more carefully at the documentation for the CapSense library for Arduino. There is a particularly nice example of how to set a threshold for detecting when a sensor has been touched.
And voila! Touches are recorded! The Serial bus isn't being bombarded by huge numbers, it just gets pinged every time more than 4 of the sensors reach the determined threshold set in the code. This flexibility means that not every sensor has to detect a touch every time a user pets the device. I decided that this was a good compromise, given the unpredictable readings that capacitive sensors can spit out, especially in close proximity to each other.
As can be seen in the gif below, the software rejects both phantom touches and deliberate poking (for the most part). I'm very pleased with the outcome of this testing, and am excited to implement this design into my final project.