Wearables 1

proof of concept

For this week assigment, my idea was to prototype my own interpretation of one of the most infamous 80's piece of fashion, the piano tie! I want to do a piano tie that is actually able to play sounds so we can have fun making simple melody using a piece of garnment. For my keys, I am gonna work with capacitive touch, so the first thing I had to do was to make sure that that would work without issue. To do so, I made a simple breadboard prototype and wrote a very basic code that would be able to read and print serial analog data and light up a LED using an capacitive touch input.

The idea of a capacitive sensor is pretty cool, the main idea for our use is to create a sensor that is able to sense the capacitance of the human body. All you really need to achieve this exept of software shananigans is a resistor and a piece of any conductive material.

The first prototype code I wrote is very basic, I did use the capacitive sensor library written by Paul Badger. So that I could set up my capactive touch keys without too much struggle. It only consist of around 35 very simple line of code that generally just sets my variable and then create an "if" loop that check the state of my capacitive sensor and light a led and send a certain frequency to a speaker if at a certain sensibility level.

Now that the we know for sure that the capacitive sensor library is working correctly, we can think about what we actually want to do with it. My final program will consist of an array of 12 sensors and 12 different tones, this will consist of an octave. In music theory, an octave consists of 12 identifiable pitches, and those pitches repeat in the same order throughout the complete span of human hearing. The code is pretty straight forward exept maybe for the definition of my capacitive touch sensor pins, one might ask why I didn't just use a normal array definition to set my variables, after a bit of strugglin I realize that the capacitive sensor lbr by Paul Badger does not offer 0 argument constructor, so I had to define each pin of my array manually.
For my Tone array, the number are not selected randomly, I use this chart to convert each piano note into it's equivalent frenquency, unfortunaly, I could'nt use float since the tone function is only looking for integer.

So to keep it short, each time I pass trough to my loop, I will check the state of my 12 sensors and also attribute them a note, as soon as none of my sensors are triggered, I will make sure everything is set back to it's original state and start over.


I used eagle to draw my schematic, using eagle is pretty straight forward, you have a command line and whatever you want to do, you just type it. It is in a way very similar to the interface of Autocad or Rhino, exept your doing pcbs instead of 3D Cad model. The default Eagle Library already have a bunch of component that we can add to our design, but I still had to go fetch some library for my arduino micro and my speaker. Sparkfun have an amazing set of lbr for all kind of utility. Here is my final schematic:

I have no need to do an actual board design for this perticular job since I won't have to mill a pcb, all I needed was to make my schematic so that my head would be clear about what goes where when doing my tie.

As you can see from my schematic, we are able to use the same send pin for each of my sensors, that's why there is a blue bus bringing all my resistors to a single arduino micro pin. I use the arduino micro since it is small and convenient while still having plenty of pin for my needs. From what I've read, there shouldn't be any reason that the code would not be able to be read on the micro.

making the tie

Before starting this segment, let me be honest, never in my life have I learned to sew or work with any kind of fabric. This here is the real challenge for me this week. I was super nervous to start this part of the assigment, I am a very cluncky person and really tought that I would struggle doing any kind of sewing. To make things as easy as possible, I found a tie pattern that was very well documented and even had a step by step video that was very understandable. The only downside was the fact that the pattern cost around 5 canadian dollar. I decided to go ahead and buy it, I really wanted things to go as smooth as possible and I think this was worth the investment. I then went ahead and made print of the pattern so that I could cut my pieces.

Once I had my different pieces, I start using the sewing machine. Again this was my first time, I am very lucky that Noemie was there to help me get started, I was amazed at the straight line that I was able to do! I was absolutely certain that I would be a total mess using the sewing machine.

Soft circuit

When starting my soft circuit sewing, I had the understanding and the layering of my schematic perfectly set in my mind. I thought that the integration of my circuit into my fabric would be the easy part of this weekly assigment. boy how I was wrong...

The thing that I didn't took into consideration turns out to be the more crucial aspect for the functionnality of the design. First of all, the space, I had in mind that all of this would fit very well inside my tie, while I was not wrong per se, I definitively underestimate the space required for all of this circuitry to fit without creating any short. I am used to create 2 layer pcb that I can bridge and create optimal path that are able to condense the space of the actual circuit, here was not the case, I guess that I was so stressed about the sewing part that I totally forgot to worry about the placement and the isolation of eveything.

Time was the next thing I greatly underestimated, I tought that I would be able to assemble the circuitry in a couple of hours, it took me over 10 hours to sew everything together, and the more I was progressing, the more I started to realize that this may now work in the end. I felt very overwhelmed by everything that was goin on inside my tie and was thinking about solution to probleme that didn't even appeared yet. But I knew for sure that short circuit and connectivity problem were gonna occure. Oh well..

As I was anticipating, it only works in a very particular position when I pull the fabric and play the keys at the same time, and even then it sounds horrible.

back to basics

After the strugle I encounter with my soft circuit, I decided to try again but not without getting rid of some of the complexity of my design. I didn't want to get stuck with the claustrophobic space of a tie, so I just took a big square of wool and lay my design on it. Got rid of the surface mount resistors, no need. And to save me another 10 hours of sewing I went ahead and try to reproduce the circuit using copper tape and solder joints. I only hand sew the arduino so that I could extend it's leg a bit further to give me space. Once all of this was done, I was not happy with the look of the whole thing, but at least, I was a bit more confident of the functionality of it. until I test it... A lot more responsive but still far from perfect, reading the value from my serial monitor shows me all kind of non sense parasite and the one that were good, were very low, It looks like the conductivity of my whole circuit is being a bit supressed by a bunch physical variable. At this point, i'm gettint a bit frustrated so what I did was to modify the code so that lower state of capacitance would be recognize and play a tone.

It kinda work... it's far far far from what I intended, while testing on a bread board, the keys was so responsive I could play as fast as on a real piano, here, it's just not the same, values often does not recognize my finger, I want to have a chat with my instructor so that we can brainstorm on how I could handle thing differently.

you can download the arduino code here