12 July 2015

An Arduino/accelerometer controlled LED dance suit (1 of 3)

This is part 1 of a three part series on an LED light dance suit (harness?). It's Arduino-based, and the lights are controlled by the motion of an accelerometer.
- Part 1 (this post): motivation, result, and parts list
- Part 2: making the harness, board, and enclosure
- Part 3 (coming): code and further ideas/plans

Background and motivation
For my birthday, my sister-in-law asked for any gift wishes, and I promptly provided information for the MicroPython. I'd been drooling over it every since it's Kickstarter campaign, and I had just missed the backing deadline when I first found out about it. I'd begun to dabble with the Arduino, and have wanted to learn python anyway, so I thought it would be an awesome second microcontroller for the arsenal. In any case, I felt it was a bit much for a birthday gift and gave plenty of freedom not to buy it... but I did get it -- thanks Rachel :)

I loved that the MicroPython came with an accelerometer built in, and used an RGB LED to make a little "thank you" video after receiving it:

After that, I started messing with a cutoff value for the accelerometer. In this way, it would respond to an impulse above the cutoff, but wouldn't be lit all the time (due to gravity alone setting it off). I added in a fade over time as well to create pulses (so every, say, 30 milliseconds, it would subtract a value from the current brightness). It was quite mesmerizing... the night I finished it, I turned off all my first floor lights, camped out on the couch with headphones in, and rocked out staring at an LED for probably an hour while listening to various bass-heavy songs. Totally worth it!

At that point, it was already dawning on me that this could be pretty cool for dancing, and I conceived the idea to make a suit/suspenders/harness of some sort. I was trying to do this on a budget, so I settled on a basic 12V RGB LED strip (30 per meter); these are not individually addressable, which means I can have the entire strip set to any color, but all of the LEDs will be that color. Using addressable LEDs would allow for an insane amount of options/patterns/behavior and also only require 5V (just a 4 x AA pack), but the strips are maybe 3-5x the non-addressable kind. I wasn't ready to splurge yet... or perhaps my wife just wasn't ready for me to splurge yet :)

The result
Rather than go through all the details, I figured it's probably more fun to just see the result so here you go!

the suit and power supply (8 x AA battery pack)

the enclosure

And a video of me flailing around a bit with the suit on:

Parts list
Having built my first Arduino on a breadboard for my daughter's robot project, I knew I'd do the same here (smaller, and I'm not giving up my only Arduino!). I ended up using two circuit of LEDs, both of which require 12V and PWM signals x 3 channels. Power to come through MOSFETs since the Arduino can't supply the necessary voltage or current (you can read more on this at Adafruit's excellent tutorial). I also wanted some ability to control the LED behavior on the fly, so I tossed in some rotary encoders and a switch. Everything is powered via an 8 x AA battery pack (with a split after 4 AAs to power the Arduino with 6V and another positive output lug after all 8 AAs to provide 12V to the strips). 

Here's the parts I ended up using:

component source price qty total
atmega 328p digikey 3.31 1 3.31
16 MHz crystal digikey 0.30 1 0.30
irlb8721 mosfet digikey 0.73 6 4.38
22pF cap amazon 0.091 2 0.18
lm7805 regulator digikey 0.56 1 0.56
10uF cap digikey 0.33 2 0.66
28 pin socket digikey 0.72 1 0.72
adxl 345 ebay 5.00 1 5.00
pcb ebay 0.93 1 0.93
battery holder ax-man 1.50 1 1.50
3-way toggle switch ax-man 1.50 1 1.50
rotary encoder mouser 1.44 3 4.32
encoder knob mouser 0.46 3 1.38
rgb 5M led strip amazon 17.99 0.5 9.00
9-pin plug (male) ax-man 0.50 1 0.50
9-pin plug (female) ax-man 0.50 1 0.50
15-pin plug (male) ax-man 0.50 1 0.50
15-pin plug (female) ax-man 0.50 1 0.50
total 35.74

Some notes/comments:
  • I know when I bought mine in April, I thought ~$18 for 5 meters was a good price... magically they all appear to be ~$10 now. No idea how I would have missed saving 50% if they were that much a few months ago!
  • I used the IRLB8721 MOSFET based on reading at Adafruit, but if you google around there are plenty of other options. Since I used two separate circuits of LEDs (to make them toggle-able), I needed 6. If you just use one run of LEDs, you only need 3.
  • Originally, I was using the adxl335, but found that I easily maxed out the +/- 3g limit, so I ended up getting the adxl345, which requires one less wire and can be programmed to 2/4/8/16 g's for the upper limit.
  • I used a bunch of 10k's for the encoders and switch, and one 2.2k for the switch, and the cost isn't factored in above. I bought a kit from Amazon (so more of an investment/tool I just have around), and they're so cheap I just consider them as not worth listing above.
  • I didn't count the 22ga solid and stranded hook-up wire I used for reasons similar to the resistors. I bought a bunch of it and consider it just inherent to a project and not adding that much cost.
  • I also bought nylon webbing, thread, and suspender clips from Hancock Fabrics
  • For the enclosure, I used spare wood laying around from cribbage boards I've made and a piece of scrap metal for the back (costs aren't counted). The polycarbonate cover was perhaps $10 from a hardware store and I used ~1/4 of the sheet.
  • An Arduino is needed (obviously), for sending flashing the bootloader and code to the atmega328 on the board. I don't count this as it's more of a "tool" and not actually consumed in the project, at least in my case.
  • Optional: a 12V power supply. I used a female 2.1x5mm jack with terminals where I could insert a couple wires, which I soldered to the LED strips. This way, I didn't have to futz with a battery pack. Small convenience, just wanted to mention it.
Regarding total costs, the components are listed above with links to where I purchased things. The harness was another $30 (webbing + hardware), but if I did it again I might use some ~$5 junk suspenders off of Ebay for my starting point. The hardware alone cost me that much at Hancock Fabrics.

The enclosure is up to you... as stated, I used mostly what I had around, and just had to purchase the plastic top. I could have just used the same scrap metal, but the cheap cost of the polycarbonate sheeting seemed worth having it be see through. The screws and related hardware might cost ~$5.

For equipment, here's what I recall using:
  • electronics gear: soldering iron, wire cutter/strippers, flush cutters, helping hands, a nail set (like a little center punch) as a heat sink and to hold wires until the solder cooled, multimeter, heat shrink tubing, electrical tape
  • harness: sewing machine, needle/thread
  • misc: small backcut fine-toothed saw, file, sandpaper, paint gun/paint, 4-40 round head cap screws/nuts/washers, miter saw, 3" pneumatic buffer and compounds, paint/equipment needed for decoration, some good glue (I used a 2 part polyurethane adhesive from 3M, but I believe it's discontinued). Epoxy would probably work fine.
Alright, see part 2 for the build!


  1. Love the idea - looks really amazing. And thanks so much for such a detailed how to guide!! great pics and demos and links.

  2. John, nice meeting you yesterday. See this story for the LEDs that are syncronized:

    Your idea is much more individualized and unique, but getting the groomsmen synced would be an additional consideration.


formatting help: <i>italics</i>, <b>bold</b>