Showing posts with label sweater. Show all posts
Showing posts with label sweater. Show all posts

Wednesday, November 7, 2018

Ugly Christmas Sweater 2018



I just finished working on an ugly Christmas sweater for 2018.  I started with this gem, which was a thoughtful donation from a friend.  The biggest challenge I first saw with this type of sweater is that it opens up in the front, requiring some thoughtful planning to ensure there is enough power distributed from one side to the other.  In order to reduce the amount of hand sewing I needed to do (and to reduce resistance), I ended up using a combination of silicone wire and conductive thread.
To get started, I ironed some fabric stiffener to the front and neck of the sweater, because I've learned the hard way that conductive thread doesn't work reliably with stretchy yarn (without a little help).  My original thought was that I'd keep the Neo-Pixels and sensors confined to one side of the sweater, while sewing LEDs onto both sides.

The fabric stiffener did its job, but I ended up having to cut some of it out, because the sweater ended up looking rigid and boxy in the shoulders.
The next thing I did was work on writing the code and prototyping the circuit.  This took a long time, because I wanted my sweater to have the following features:

1.  Neo-Pixels triggered by a light sensor
2.  Multiple songs triggered randomly
3.  The ability to turn the music off and on with the press of a button
4.  A light display triggered by a temperature sensor
5.  A motor that did something useful  (if only marginally)

After lots of experimentation, and some judicious remixing, I have a fully functioning program! The code compiles and circuit works!  While I kept the idea for the motor alive in my code, I ended up scrapping the idea. 







Next, I needed to figure out the best power supply to use.  Initially, I wasn't sure whether a 3.7 V lithium polymer battery would work, since I was using power-hungry sensors and NeoPixels; a lipo cell ended up working fine.

Of note, the LilyPad Arduino 328 Main Board doesn't have a JST socket soldered to it, so I sewed on a LilySimple Power to add an on/off switch, as well as a place to put the battery.

Based upon preliminary tests, I noticed that  powering the circuit directly from the LilySimple Power was interfering with my temperature sensor.  The interference didn't happen whenever the LilyPad was connected to a USB port through the FTDI cable.  After a lot of experimentation with different batteries, voltages, and plugs, I determined that my problem might be that I had too many things connected to the positive (+) pin on the LilyPad.  When using a LilySimple Power, which attaches to the positive pin of the LilyPad, I thought that I needed to come up with another way to send power to the temperature sensor. 

While trying to figure out how to solve my problem I came across this LilyPad Temperature Sensor Example code, which explained that I needed to declare a spare analog pin as an output, set it to high, and then connect the positive (+) pin of the sensor to it.  BRILLIANT!

But...even after I made those changes to the code, the temperature sensor was still reading higher than it should have whenever my LilyPad was powered via the LilySimple Power.  The simple solution, which I wish I'd thought of earlier, was to modify the sensor threshold in the code itself.

To save time, I used the cording foot on my sewing machine to attach the silicone wire used for the power and ground rails going up the center of my sweater.

Very carefully, I split the coating of the wire in places where it needed to come in contact with the NeoPixels, and I hand-sewed them to gaps in the wire.





All of the wires and hot glue look pretty messy inside, but I'm hoping they'll be strong enough they way they are. 




When I turn the power on, green and white LEDs flash in an alternating pattern.  If I cover the light sensor, the NeoPixels fill with green, red, and then blue.  When the temperature sensor gets triggered by warm hands (or a warm cup of coffee), red LEDs turn on and flash.  If I want to hear one of four random Christmas tunes, I simply toggle a momentary push button and a piezo buzzer kicks into high gear, in sync with the lights!

To have a look at the code, visit my Wearable Electronics repository on Github.







Monday, December 14, 2015

Program an Ugly Christmas Sweater with CodeBender

My daughter recently asked me to transform a red sweater vest into an ugly Christmas sweater for a special event at her school. Using a Gemma microprocessor and four neopixels, I made one that flashes and changes colors at the push of a button.  I originally used my PC to program the microprocessor, but a friend prompted me to see whether the same results could be achieved with CodeBender and a Chromebook. I'm pleased to report that the Chromebook worked like a charm. I simply connected the Gemma to the USB port, selected the buttoncycler sketch from the Adafruit Neopixel library, modified the code to match the pins on the Gemma and the number of neopixels used, and voila'.  In the past, I have found the Gemma to be a little finicky when programming in the cloud, but CodeBender is constantly improving.




In the process, I learned:

1.  how to program a Gemma with CodeBender (even though no ports were detected)

2.  how to use a multimeter

3.  the importance of using a stabilizer when sewing with conductive thread on a loosely woven material

Unfortunately, I had to learn a couple of lessons the hard way when threads in the stretchy sweater kept shorting out!

In order to increase the versatility of this sweater, I sewed the Gemma to three tiny snaps sewn to a piece of felt. When folded up, the felt supports the battery and fits into the sweater pocket.  This connects to three more snaps to complete the circuit.


I sewed the neopixels to a ribbon.


Originally, I sewed the neopixels directly to the sweater.  That didn't work out well, because I didn't stabilize the back of the fabric first, requiring me to have to rip out all of the stitches.

Afterward, I used what I learned from Adafruit's chameleon scarf tutorial to sew the neopixels onto a ribbon that I later sewed to the sweater using non-conductive thread.

I applied self-adhesive stabilizer on the back.