ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used...

22
ReBoots Animated LED Boot Laces Created by Erin St Blaine Last updated on 2018-08-22 03:46:41 PM UTC

Transcript of ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used...

Page 1: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

ReBoots Animated LED Boot LacesCreated by Erin St Blaine

Last updated on 2018-08-22 03:46:41 PM UTC

Page 2: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

2344

55

6669

10

131314

161616

18181818

2021

Guide Contents

Guide ContentsOverview

Other MaterialsTools Needed

WiringWiring

LED Assembly3D Printed CasesPower and Ground WiresData WiresAdding the Light Pipe

Sensor AssemblyHook it UpPlacement

Trinket AssemblyBattery ConnectorHook it All Up

The CodeSoftware SetupFastLED LibraryLibraries? Why? What's a Library?

If you encounter trouble…Finishing

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 2 of 22

Page 3: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

OverviewGlowing, animated boot laces. A sensor in each heel, watching you, weighing your every step, waiting for theopportune moment to light your stride and set your dance moves on fire. NeoPixels are glued to light pipe laces andprogrammed to animate and glow.

Zip into the ReBoots and become the cyborg you've always wanted to be.

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 3 of 22

Page 4: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

2 x Pro TrinketPro Trinket 5v

ADD TO CART

2 x Battery ConnectorJST Battery Connector

ADD TO CART

2 x NeopixelsIndividual Neopixels

ADD TO CART

2 x Battery500 mAh Lithium Polymer Battery

ADD TO CART

2 x FSRForce Sensitive Resistor

ADD TO CART

Other Materials

Killer Boots with Laces - I used Demonia's Gothika600UV in Silver (https://adafru.it/eCu). This project relies onthe laces being mostly a decorative feature, not load-bearing…the boots are actually adjusted and closed withbuckles and zippers.LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi (https://adafru.it/eCv)30awg silicone wire

Tools Needed

Soldering iron & accessories3d Printer (optional)Hot glue gunLighterStaplerSpray glueNeedle & strong thread (a thimble helps too)

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 4 of 22

Page 5: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

Wiring

Wiring

The force-sensing resistor (FSR) connects to Pro Trinket pins A5 and GND (it can connect in either direction).

Easy peezy.

Pro Trinket NeoPixel

BAT+ +

G (ground) –

Pin 3 Data In

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 5 of 22

Page 6: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

LED Assembly

3D Printed Cases

These little 3d printed cases snap onto your

NeoPixels and hold the light pipe shoelaces firmly in

place against the LED for maximum brightness.

Print them in white or transparent ABS or PLA.

https://adafru.it/eCw

https://adafru.it/eCw

If you don’t have access to a 3D printer, don’t worry! The light pipes and pixels could also be joined with caps of hotglue, Shapelock (aka Instamorph or Friendly Plastic), Sugru or Apoxie Sculpt.

Power and Ground Wires

Grab a tape measure and determine the distance between your shoelace holes.

Every 3D printer is a little different. Before committing to a whole pile of these, start with one and test the fit,adjusting scale as necessary.

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 6 of 22

Page 7: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

Double the shoelace-hole-distance measurement. Lay

out four 30awg wires (2 for each boot) and make one

mark for each NeoPixel's placement. I marked every 2"

since my shoelace holes are 1" apart.

Go outside. Grab a lighter with a hot, focused flame and

char the shielding at each mark. Let it cool off a bit.

Scrape off the ash and you'll have a nice bit of stripped

wire at each mark.

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 7 of 22

Page 8: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

String all the NeoPixels onto your wires, being sure

they're all aligned the same way -- all the "+" holes

should go along one wire and all the "-" holes along the

other.

Slide one NeoPixel to each bare wire spot and twist it

around 2-3 times to secure the bare wire to the solder

pad. Once you have them all in place, solder each wire

to each pad.

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 8 of 22

Page 9: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

Data Wires

Connect all the "out" pads to the "in" pad of the next pixel, making sure your NeoPixel spacing matches up with yourlace hole spacing.

Since my boot laces were exactly 1" apart, I cheated a little and simply stapled the data line holes together. If yours area different distance you'll need to fiddle with stripping and soldering wires to get them to end up the right distance, butfor 1" spacing, staples work brilliantly.

However, for the connections that go across the ankle this will NOT work. Any flexing of the strip will eventuallybreak the staples, so only staple the NeoPixels that will be on the shin or the top of the foot. Use flexible strandedwire to connect the pixels that are anywhere near the ankle.

Solder the staples and stranded wires into place.

This is a great time to hook up your pixels with some alligator clips and the NeoPixel Strandtestcode (https://adafru.it/dhv), and test to be sure all the pixels are working. I keep a Gemma pre-loaded with this codenear my workbench for just this purpose.

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 9 of 22

Page 10: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

Adding the Light Pipe

Get out your LED shoelaces and cut them down so they fit nicely between opposite shoelace holes in your boots.Remember they'll be a little longer for the top holes and shorter for the bottom holes, for most boots.

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 10 of 22

Page 11: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

Pop your 3D printed 'cases' onto your NeoPixels, add a

blob of hot glue right in the hole and shove the light

pipe in while the glue is wet. When it dries it will hold

the light pipe beautifully perpendicular to the LEDs.

Hooray! If needed, add another blob of hot glue to the

outside of the case for extra support.

Now you have a creepy glowing alien spinal column to

play with. Take some artsy photos.

Once the glue is set, thread the light pipes through the shoelace holes, making sure the first NeoPixel in the sequenceis at the top. I had to do some dissasembly on my boot to get them between the boot facing and boot liner -- each pairof boots is different so get a little creative. Sew or glue them in place.

Bend the pipes across and use hot glue to secure the other end in the opposite lace hole.

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 11 of 22

Page 12: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 12 of 22

Page 13: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

Sensor AssemblyAdding the force sensitive resistor (FSR) into the heel of the boots will give you an opportunity to trigger animations,change modes, or just flash to the beat when you step down with each heel.

Hook it Up

Hook up two long 30awg wires to the pads on your force sensitive resistor.

It's possible to solder these wires to the pads securely, but it is NOT easy to do. Be quick and neat, or the plastic tabsmay melt.

More connection options & info about FSRs (https://adafru.it/vNF)

For all that it's difficult, soldering is probably your best bet since this will go under your heel. Nobody loves a bulkyconnector stabbing them with every step.

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 13 of 22

Page 14: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

Placement

Open up the liner inside the heel of your boot and find a good spot for the sensor. (If there is any metal in there,screws or whatnot, cover it up with electrical tape first)

Poke a little hole in the boot right at heel level and thread the wires through to the outside. This will keep them safefrom pulling and tearing when you're dancing or putting the boots on. (A needle threader works great for getting smallwires through a very small hole.)

Feed the wires up the side of the boot to the cuff area, where they will attach to the Pro Trinket.

Later you'll want to use some spray glue to secure the sensor and liner back in place, but first let's test and make sureit all works.

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 14 of 22

Page 15: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 15 of 22

Page 16: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

Trinket Assembly

Battery Connector

Solder a JST battery connector to the pads on the back

of your Pro Trinket.

Hook it All Up

Decide where on your boots the Pro Trinket will live. You may want yours on the inside (for slickness) or the outside(for rocking your cyber style). Be sure the battery port and USB port are accessible, and be sure the reset button issafe from accidental squeezing when your boots are on.

Poke the wires from the NeoPixels and the sensor through the boots so they all happily meet at the Pro Trinket. Flexthe boot a bit and make sure you have enough slack in the wires that they won't break if you dance too hard.

Solder the wires on according to the wiring diagram. Take your needle and thread and stitch the Pro Trinket to theboot so it stays securely in place.

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 16 of 22

Page 17: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 17 of 22

Page 18: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

The Code

Software Setup

If this is your first time using Pro Trinket, take a look at Introducting Pro Trinket (https://adafru.it/iPe) to get a guidedtour.

Once you've got your Pro Trinket up and running with Arduino (https://adafru.it/dgt), you'll need to install the FastLEDlibrary.

FastLED Library

You will also need to install the FastLED library in Arduino ( Sketch > Include Library > Manage Libraries... )

Libraries? Why? What's a Library?

In a nutshell, Arduino libraries have a lot of pre-written functions that make your neopixels easy to command. You cando fancy stuff without being a code guru. Yay Libraries!

FastLED is a fast, efficient, easy-to-use Arduino library for programming addressable LED strips and pixels. It has a lotof features to get your animations up and running fast -- and it has a lot of code samples available if you're just learningto code.

All about Arduino Libraries (https://adafru.it/dNR) will tell you everything you ever wanted to know about libraries,including more detailed installation instructions.

Once your curiosity is satiated and your library is installed, copy and paste the code into your Arduino window.

Go to your Tools menu and select "Pro Trinket 5V USB" from the list of boards. Plug your Pro Trinket into yourcomputer via the onboard USB port. Press the "reset" button on your Pro Trinket and wait for the blinky red light, thenclick the upload button in Arduino.

#include <FastLED.h>

#define LED_PIN 3#define NUM_LEDS 16 //change this to reflect the number of neopixels in your boots

#define SENSOR_LOW 35 //these numbers will change the sensitivity of the sensor. Lower numbers = harder step to trigger#define SENSOR_HIGH 65

CRGB leds[NUM_LEDS];CRGBPalette16 currentPalette;TBlendType currentBlending;

uint8_t thishue = 0;uint8_t deltahue = -3; //controls how quickly the rainbow fades from one color to another. Negative numbers make the rainbow // aapear to crawl "down" and positive numbers make it crawl "up"

const int STEP_PIN = A5; // Analog input pin that the force sensitive resistor is attached toint sensorValue = 0; // value read from the potint ledMode = 0;

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 18 of 22

Page 19: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

void setup() { // initialize serial communications at 9600 bps: Serial.begin(9600); pinMode(STEP_PIN, INPUT_PULLUP); FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );

}

void loop() { // read the analog in value: sensorValue = analogRead(STEP_PIN); // print the results to the serial monitor: Serial.print("sensor = " ); Serial.println(sensorValue);

switch (ledMode) { case 999: break; case 0: rainbow(); break; //mode that's running all the time case 1: fire(); break; //mode that runs when sensor is triggered } if (sensorValue < SENSOR_LOW){ Serial.println("leds triggered"); ledMode=1;} if (sensorValue > SENSOR_HIGH){ Serial.println("leds not triggered"); ledMode=0;

} }

//RAINBOW EFFECT

void rainbow(){ thishue = thishue + 1; fill_rainbow(leds, NUM_LEDS, thishue, deltahue); FastLED.show(); FastLED.delay(100); //change delay number to speed up or slow down the animation}

//FIRE EFFECT by Mark Kriegsman

void fire(){ currentPalette = LavaColors_p; Fire2012WithPalette(); // run simulation frame, using palette colors FastLED.show(); // display this frame FastLED.delay(100); }

#define COOLING 55 // Less cooling = taller flames. Default 55, suggested range 20-100#define SPARKING 120 //Higher chance = more roaring fire. Default 120, suggested range 50-200

void Fire2012WithPalette(){

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 19 of 22

Page 20: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

Plug in your LiPo battery and the boots will come on in Rainbow mode. Step or press down on the sensor in the bootheel, and they will switch to Fire mode.

You may need to tweak the SENSOR_HIGH and SENSOR_LOW numbers until you have a satisfying rainbow-to-fireratio.

If you encounter trouble…

Any time you hit a roadblock with a neopixel project, we’ll usually ask that you start with the “strandtest” example fromour own Adafruit_NeoPixel library. This helps us narrow down whether it’s a hardware or software issue. The library isinstalled similarly to FastLED or any other in Arduino ( Sketch > Include Library > Manage Libraries... )

You’ll find the strandtest example under File→Sketchbook→Libraries→Adafruit_NeoPixel→strandtest

If strandtest fails to run, this suggests a hardware issue…for example, connecting to the wrong Gemma pin.

If you’re new to Arduino programming and LEDs, we usually suggest starting with the Adafruit_NeoPixel library…it’spretty basic, the strip declaration is more conventional, and we can stay on top of keeping it compatible with our ownproducts and the most mainstream Arduino boards.

As FastLED is a more “bleeding edge” third-party library, we can’t always guarantee compatibility across versions orwith specific boards. You can find help through their community on Google+ (https://adafru.it/ebn). This is potent stuff,written by people with a deep appreciation for LED art, and we wanted to showcase it.

{ random16_add_entropy( random()); static byte heat[NUM_LEDS]; for( int i = 0; i < NUM_LEDS; i++) { heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) / NUM_LEDS) + 2)); } for( int k= NUM_LEDS - 3; k > 0; k--) { heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3; } if( random8() < SPARKING ) { int y = random8(7); heat[y] = qadd8( heat[y], random8(160,255) ); } for( int j = 0; j < NUM_LEDS; j++) { byte colorindex = scale8( heat[j], 240); leds[ (NUM_LEDS-1) - j ] = ColorFromPalette( currentPalette, colorindex); //upside down fire!! reverse it: leds[j] = ... }}

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 20 of 22

Page 21: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

Finishing

Once you're happy with your sensor placement and the code is all working, use some spray glue to glue down thesensor and the heel pad inside the boot.

Plug in your battery and tuck it someplace safe.

Try them on, stomp around, and set the place on fire!

© Adafruit Industries https://learn.adafruit.com/re-boots-animated-dancing-boot-laces Page 21 of 22

Page 22: ReBoots Animated LED Boot Laces - Adafruit Industries€¦ · LED Shoelaces or Light Pipe - I used 3 sets of these shoelaces from Flammi ( 30awg silicone wire Tools Needed Soldering

© Adafruit Industries Last Updated: 2018-08-22 03:46:36 PM UTC Page 22 of 22