I had a lot of trouble this week, especially because I have a tendency to start with complicated things, and then make mistakes and learn form my mistakes. In electronics, there are so many different mistakes possible that I really struggled to solve anything. In most cases, I solved my problems by going back to the basics (after hours and hours of trying the complicated version. Did I tell you? I'm really stubborn.)
At first, I played with the Arduino uno and the examples included in the program. I blinked a led, made sond from a little speaker, tested different resistors to see the effects ont the led. I made a parallel circuit and a series circut on the bread board to see how the lights would spread the energy.
I had major problems when I tried to fade an Led. I learn the difference between a normal digital pin and a PWM digital pin. Since a normal digital pin can only work with zeros and ones, the light did not fade, it only blinked. I only had to change to a PWM digital pin and the problem was solved. I learned to use a multimeter, mesuring the voltage and mesuring the resistance. Once I was sure I undersand at least the basics of electronics I started doing some more important tests with sotf materials.
I mesured the resistance of every material, every thread end tested some snaps and buttons I had at home. A lot of my metalic beads were very conductives, and I didn't have any metalic zipper that was conductive enough. None of my beautiful chains were conductives!
Analog (digital PWM pin) Capacitive Sensors
My first test was with this wonderful foam I hoped to use for a pressure sensor. The foam had a big resistance, so I put 7 volts to be sure to see the led light up. When I pressed it hard enough, I was reducing the resistance, and by doing so augmenting the insentity of the light.
I took everything and pinned everything to a breadboard. I was so lost, but I had a bit of help. I wanted to do something out of the foam, something that would change state depending if it was pressed or not. I learn that in my case, I would need to do a Capacitive sensor. Capacitive sensor also work with PWM digital pins, so I had to be careful wich pin I choose as an output. I used an exemple code from arduino and placed my cables according to these instructions.
IT WORKED!! The input printed in the arduino serial monitor. The numbers got higher the more pression I put on the material. It could even sense when I got closer. I tried different materials and the all reacted differently. On the left, this foam was very stiff and coudl sense my had at about one inch from it. it reached about 2500 when I pressed on it. The other foam was much more flexible, and had more trouble sensing the pression. I had to fold it in half to reach higher numbers. But still, every material I tried had a big enough difference for me to program a reaction of the led.
Button from Beads
I found this conductive ring and I though I could do an analog read from it. Since the ring was not closed, I linked one end of my circuit to one end of the ring, and the other one to a set of conductive beads. My intention was to read different voltages depending on where the bead would touch. BUT IT NEVER WORKED! at least not in the way I intended. The resistance in the ring was so low that the arduino didn't see any difference.
With the button example from arduino and a bit of help, I was still able to program a simple button out of it. All my threads were sewn in the seam allowance, and hidden inside the sample. To connect it to the arduino, I simply made sure my knot at each end would show on the outside of the sample.
My sewing is kind of "floting", since I wanted to be able to undo everything in case of a major mistake. It's safe for now. I would have to cover all my threads with fabric painting if I'd want a final product, because my fabric can't be folded without creating a short circut.
So nervous! I was always testing with the multimeter to see if the connections were good.
It took me a long time to understan what was happenning on my board since first: I gave my buttons a number according to the pins, but when I fliped my fabric, my button 1 was not the first, since everything was inverted. I was afraid my buttons didn't work well, but they worked perfectly. Also, somewere I inverted the programation; when my buttons are pressed, they are identified as "released".
Once my buttons worked individually, I had to fully understand my Neopixel LEDs, since it wasn't as simple as "if button 1 is pressed, Led pin = High". Those neopixels did not have a high or low state, and 5 different lines just to turn them on... I red again and again the instruction for coding a Neopixel LED I had with the example code.
Embroidery; inkscape and sewart
There is a lot of things I would make differently if I had to redo this project. One of the first things I would change is the embroidery part. I fell like our machine had a lot of potential that I did not use. I would definietly use embroidery instead of glueing conductive fabric on.
We have this sweet software to transform a vectorial image in ... .
This is an open source project. Feel free to use all the files you need!