TinyLily Firework Wearable

TinyLily Firework Wearable

It's almost the time of year to barbecue and watch some fireworks with friends and family. Dazzle all your loved ones with this wearable project this July 4th!


Background:

Independence Day is an important holiday in The United States of America as it is the official date we declared our Independence as a Nation. This year, I wanted to wear something as cool as the fireworks we watch to celebrate the holiday, so I decided to make some tiny ones that fit on a shirt! 

I decided to embroider the fireworks, but you can use fabric paint or T-Shirt markers to make your fireworks.


Materials 

Hardware: 

    Software: 

    Extras:

    • A T-shirt 
    • Scrap Fabric
    • Embroidery thread (I used Red, White, and Blue, but you can pick any colors!)
    • Embroidery Needle
    • Thread the color of the T-shirt you choose
    • Suggested: An embroidery hoop - this helped a LOT when working with the soft fabric of the T-shirt I picked to keep my stitches taut and even

    Embroidery:

    You can embroider anything for this project with the Tiny RGB LEDs. Like some daisies with LED centers, a twinkling group of stars, or a cactus with orange flower blossoms, the possibilities are endless! 

    While embroidery is a fun hobby, it does take some patience. An embroidery hoop will help you make neat stitches with the correct tightness, and drawing some guidelines with chalk or a washable fabric marker will help you stitch everything exactly the way you want it to look. 

    I did not use any sort of line marker, and as a result not all of my lines are as perfect as I intended. My point of view is that fireworks are wild explosions anyways, so my wild stitches help evoke that reality. That's what I tell myself at least. 

    The basics of embroidery are this:

    • Keep all of the neat stitches that build a picture on the side you want to be seen
    • Keep all the knots and messy stitches on the side you do not want to be seen

    Pro-tip: Pull thread tight after every stitch, but make sure you're not pulling too tight to bunch up the fabric, or too loose to have extra thread floating around.

    There is a lot more that can go into embroidery with all the different types of stitches, threads, needles, fabrics, etc, but we don't need to think about that for this project.

    I built all of my fireworks using a bunch of lines going out of TinyLily RGB-sized circles. I accomplished this by first noting the position of circles on the shirt with a marker. I didn't worry about using a fabric marker since the TinyLily RGB's would cover it anyways. Then I built multicolored lines of small Basic Stitches going out from the circles I had drawn. I embroidered the lines by going back and forth between the sides of fabric, and then I retraced my line stitches to fill in the spaces I had missed in order to create a cohesive line. 

    Here's a video detailing some different embroidery lines in case you want to get a little fancier: 


    Conductive Stitching

    Let's just agree that my stitching is not a good example to follow (trust me) and so we created a nice diagram of the connections you need to sew to make the project work:

     

    Red - Power (+), Black - Ground (-), Blue - Pin 3

    Notice that there is a crossover to be aware of in this circuit, but don't worry, we'll cross those stitches when we come to them!

    Something that tripped me up when I was in my idea stage was the thread routing. The RGB LEDs must face the opposite direction if you want to keep the TinyLily microprocessor concealed on the other side of the shirt like me, and this is reflected in the diagram.


    Conductive Sewing Strategies:

    Conductive thread has some resistance in it, so you want to keep your threaded connections short. The span of a T-Shirt should not generate enough resistance to cause any problems for this project, but it's something to keep in mind for future projects. 

    The first connections I made in this circuit using conductive thread were ground, and power, in that order. I wanted to make these connections first so that all of my boards were connected to the shirt, and because they were the longest connections I would have to make. 

    To sew the ground connections, I knotted my conductive thread and started my stitch about an inch away from the ground tab on the TinyLily Processor that I wanted to make first. I did this so my knot wouldn't be close enough to the board to cause any shorts with frayed strands. When I got to the board, I threaded down through the ground hole to the other side (the pretty/embroidered side), back through, and threaded all the way through one more time. After making sure I made a tight connection, I stitched on to make Ground connections to all of the RGB LEDs. This way I had all of my boards sewn to the T-Shirt 

    To keep everything concealed other than the TinyLily RGB LEDs, I made my stitches on the surface of the shirt as small as possible, while keeping the hidden stitches as long as I felt comfortable stitching so that all you would see on the outside would be the fireworks and flickering LEDs. That would be the ideal case. Although, upon close inspection, you can see some of the small threads around the fireworks:

    Crossing stitches

    As circuits go, sometimes there are crossovers of different connections as there is in this circuit between Ground and the data line for the last LED. In wearables, these crossovers can lead to dangerous shorts in clothing you wear, so the best way to avoid any issues is to get a small piece of extra fabric and sew it in place between the threads wherever there is a crossover so that you never have to worry about the threads touching. 

    Pro-tip: When you sew fabric over a thread to make a crossover, be sure to note where the bottom thread is before sewing fabric over it so you don't have to guess where the top thread should go when you make the crossing stitch. You can do this with a marker or fabric pen. Like this: 

    Ignore the TinyLily Accelerometer board, this was used just as an example of good practices

    In the crossover, I used some clear tape, partly so you can see where the crossover is and how to place your extra fabric, and partly because I am lazy. You should use fabric as a more permanent solution in a wearable that will be used a few times, but yes tape will work as a shortcut.

    You'll notice the big square of blue fabric right next to my crossover. My last touch was to add a tiny pocket on the inside of the shirt to create a nice holder for the battery. I recommend doing this so that you can secure the battery to one spot and avoid the battery dangling for dear life (of your project.)


    FastLED library

    There is a fantastic FastLED library that makes the program for this project super easy. They have a ColorPalette example that already has the Red, White, and Blue color effect I was looking to create.

    To make the library usable for Arduino, you have to rename it, as noted in the README on the GitHub page of the library. But I already did that so you can download a ready-to-work copy in a zip file here:

     

    After you unzip the library, move it to your Documents/Arduino/libraries folder so that your Arduino sketch program can use it. 


    The Code!

    I was able to modify the ColorPalette example that is included with the FastLED library to suit my needs. Here's my adaptation for the TinyLily: 

     

    Download the program zip file, and open it in the Arduino IDE. Connect your TinyLily processor to your computer using the TinyLily microUSB adapter, and a microUSB cable.

    Make the correct tools selections to program the board:

    • Board: "Arduino Pro or Pro Mini"
    • Processor: "ATmega328P (3.3V, 8 MHz)"
    • Port:
      • Windows: "COM#"
      • Mac: "/dev/cu.usbserial-DMS00S##"

    And click that Upload button to see the Red, White, and Blue effect! 

    Changing Brightness

    The default brightness for the attached program is set to 64 out of a scale of 255, so the LEDs are set to 25% brightness. This was done to save power in my case, as will be discussed later on. If you want your LEDs brighter you would edit the line:

    #define BRIGHTNESS    64

    to a different value.

    Changing Colors

    I chose Red White and Blue, but you may decide to do your favorite kind of fireworks like the classic gold shimmery ones. You can change the colors, or color frequency in this definition:

    You can see all of the Predefined RGB colors in the header file pixeltypes.h starting at line 594: https://github.com/FastLED/FastLED/blob/master/pixeltypes.h 

    There are a LOT of colors.

    Changing Speed

    There are two lines you can adjust the values of to create a desired speed:

    // Toggle these to set speed of light show
    FastLED.delay(1 / UPDATES_PER_SECOND);
    delay(10);

    Depending on what effect you are trying to achieve, you may end up changing both of these values. 


    Powering the LEDs: LiPo Batteries

    You can make your project last longer by using a bigger battery, turning down the brightness of your LEDs, or adding in some power control like a switch so that you're only using power when you choose. 

    No matter what, it is good to know roughly how long a wearable project will last before you need to recharge, change batteries, or unplug it to conserve power. The current draw of the RGB LEDs depends on colors and brightness: 

    • Red: 30mA
    • Green: 20mA
    • Blue: 30mA
    • White: 65mA

    With three RGB LEDs, we have around 195mA to supply in the worst case of displaying white at the brightest setting, depending on your battery this might not last long at all.

    Fortunately, Red and Blue are in the mix and the colors are swapping between each other. A mixture of colors lessens power consumption a lot, sometimes by half. With Red and Blue in the mix, you're at the brightest drawing an average of about 125mA in the worst case. 

    That still seems like a large amount of power for 3 LEDs. Fortunately, the brightest setting of these LEDs is extremely bright and difficult to look at (you don't want your wearable to be hard to look at!) The power and color of the LEDs is controlled using Pulse Width Modulation (PWM) on a range of 0-255. 255 is the max brightness of 100%. 0 will visibly turn your LEDs off, but a small amount of current will still be supplied (around 1mA.) The duty cycle directly correlates to the power consumed, so I got away with 25% brightness ~ around 64 duty cycle to achieve a bright display of LEDs that isn't too difficult to look at. In the worst case, that puts the power consumption of my program at 125/4 = 32mA. 

    So I know with a full charged 150mAh battery that I will have around 5 hours of my project able to work continuously. Thanks, math!

     


    Beyond the LEDs

    Some ideas I had in improving this project would be to add a switch so that the LEDs are only on when I press a button. This would extend project usage throughout an occasion without me having to carry around a charger, or a larger battery.

    I also wanted to make the colors more stable when I wasn't moving, and I ended up adding a TinyLily Accelerometer later to accomplish this goal. I have the color palette set to update only when a movement above a threshold is detected by the Accelerometer. So now the LEDs will stop on one color when I sit still, and change when I walk or move.

    If you plan on adding in a TinyLily Accelerometer, I would advise you to wax your thread, or solder wires for the I2C connections since the lines for the SDA and SCL tabs are so close together and can short easily with the use of conductive thread that frays easily.

    Here's a diagram of the connections you would need to make along with the program I wrote: 

     

     


        Contact Us

        Show us what fireworks you make by tagging @TinyCircuits on Instagram, Twitter, or Facebook so we can feature it!

        As always, if you have any questions or feedback, feel free to email us at info@tinycircuits.com.

        Thanks for making with us!