December 1, 2019 · project

MVP Prototyping

The core functionality of my project is the detection of a stroking motion across a soft object, to allow for the delivery of feedback when a stroke is registered correctly. With this in mind, I decided to build on my practice with capacitive touch sensors in order to prototype a petting/stroking detection device. The prototype consists of 4 capacitive touch sensors, each with a 4.7MΩ resistor attatched to it, sandwiched between two pieces of felt, to both insulate the sensors and simulate a fabric over the top of them, which will be present in the final project.

I started by constructing the capacitive surfaces out of small pieces of folded tinfoil, roughly the same shape and size for consistency. I taped them to one piece of the felt, attatched some crocodile clips to secure a connection to each piece, and then pinned the whole thing together with another piece of felt, creating one surface with 4 capacitive sensors inside.

I wired each capacitive sensor up with a 4.7MΩ resistor, and two wires going into two separate pins on the Adafruit Metro. I chose the 4.7MΩ resistors as, in my previous experimentation with capacitive touch sensors, I found them to be a good middle ground between too sensitive and not sensitive enough.

After being pinned together, the surface upon which I would be testing a series of strokes across looked like this:

The design for this rough prototype was fairly straight forward, as can be seen from these Fritzing diagrams. The main concerns from a design standpoint were the spacing of the sensors from each other and fear of running out of pins on the Adafruit Metro.

The code for this testing consisted of two main core functions: a function responsible for checking if a particular sensor had been touched, and another to keep track of how many had been touched within a specific time threshold. If a touch times out, the program resets the count and one must begin a new stroking motion. As shown in the graph below (taken from the serial plotter in the Arduino IDE), the timing of each sensor's detection is consistent between strokes. Note that the blue, red, green and yellow lines spike in the same order both times.

This can also be seen in the below video. The data shown on the right is a binary representation of whether or not each of the sensors has passed the threshold within a given time limit. if all of them detect touches, the output confirms that a stroke has occured. The numbers change according to the direction of the stroke.

This can also be seen in the terminal capture I performed during testing. Notice how the multidirectional nature of the strokes doesn't matter, as the device is just detecting for touches within the time limit:

1	0	0	0	
1	0	0	0	
1	0	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	0	0	
1	1	1	0	
1	1	1	0	
1	1	1	0	
1	1	1	0	
1	1	1	0	
1	1	1	0	
1	1	1	0	
1	1	1	0	
1	1	1	0	
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	
0	0	0	0	
0	0	0	0	
0	0	0	0	
0	0	0	0	
0	0	0	0	
0	0	0	0	
0	0	0	0	
0	0	0	0	
0	0	0	0	
0	0	0	0	
0	0	0	1	
0	0	0	1	
0	0	0	1	
0	0	0	1	
0	0	0	1	
0	0	0	1	
0	0	0	1	
0	0	0	1	
0	0	1	1	
0	0	1	1	
0	0	1	1	
0	0	1	1	
0	0	1	1	
0	0	1	1	
0	0	1	1	
0	1	1	1	
0	1	1	1	
0	1	1	1	
0	1	1	1	
0	1	1	1	
0	1	1	1	
0	1	1	1	
0	1	1	1	
0	1	1	1	
0	1	1	1	
0	1	1	1	
0	1	1	1	
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	STROKE DETECTED!
1	1	1	1	
0	0	0	0	
0	0	0	0	
0	0	0	0	
0	0	0	0	

I am very pleased with the consistency of my prototype. It can reliably tell when a user has run a hand or a finger across the surface of the device, and can detect a swipe from multiple directions. I was concercned that having multiple capacitive sensors in close proximity, and under the same piece of fabric might cause the detection of touches between sensors. However, as far as I can tell from my testing, this isn't the case. I am confident that this design can be used going forward, with some tweaks to the code to allow for finer control over the timing of a stroke detection.

I had a lot of fun building this prototype. The progress I made over the course of developing it was extremely satisfying, particularly when the graphs started to display all the data in the way I expected. From this point I will start testing feedback options for the user. I'm not sure what type of feedback would be the best to give, yet. I am currently considering force feedback, to emulate purring, as well as considering audible meowing, and potentially some light-up element, perhaps emulating blinking or eye movement. I'm keeping my options open for now.