This is an Instructable to show you how to make an interactive, fuzzy LED belt! Belt can be used in many ways, not just as a belt... wear it as a bandolier, hang it on the wall, wrap it around your backpack or bike... the options abound.
And the most exciting part is this belt is alive! Using two sensors -- a gyroscope and a microphone -- this belt responds to sound and also to being moved. So, when you dance with it at a music event, the colors of the LEDs reflect your movement and the brightness of the LEDs reflect the sound. So much fun! The belt never really looks the same. :)
I first made this belt in 2012 -- it was my first project with an Arduino and LEDs, and since then I've remade this belt a few times and added more LEDs and sensors. But this is a great project for someone starting in with electronics. And you don't have to add the sensors for this belt to be awesome and fun. Make it as challenging as you feel comfortable!
Note: this Instructable assumes some experience with soldering, wire stripping, sewing -- you do not actually need to have this experience, but I am not going to explain in detail how to do these activities because there are many places online that can explain these things quite well.
Step 1: Materials and Tools
Step 2: Solder the components together
Gyroscope (this assumes you are using the gyroscope I linked in materials):
You will need to solder four wires to the gyroscope.
Microphone (this assumes you are using the Electret microphone):
You will need to solder three wires to the microphone.
3-Way Slide switch:
Lipo charger (this assumes you are using the generic lipo charger I linked to in materials):
LED Strip (this assumes you are using one of the three-wire types of LED strip, such as the WS2811/2):
Note: the LED strip has an input end and an output end, so you must look at your strip to determine which end is which. Usually there are arrows marking the flow of data.
Now that the LED strip is connected together, we will add one end of the servo extension wire to the remaining input end -- this is where we will connect the arduino to the LED strip.
Arduino (this assumes you are using the Arduino Pro Micro):
When we've finished connecting everything together and ensuring it all works, I suggest hot glueing or electrical taping some of the connections to protect them from shorting out or getting ripped out. I'll explain this more later.
Step 3: Make the belt
Step 4: Install the software and libraries you'll need, and test that you wired up the components correctly.
Make sure you have the Arduino IDE downloaded and installed.
You'll also want to download and install the L3G gyroscope Arduino library, as well as the FastLED or Adafruit NeoPixel libraries.
And you will also need to install the drivers for the Pro Micro.
You'll need to plug the micro cable into the Arduino and connect it to a USB port on your computer. Make sure in the Arduino IDE that you select the pro micro board and one of the USB ports.
Open up an example file from one of the LED libraries, set the LED pin to 6 and mark the # of LEDs you are using. Upload the code to the board.
Connect the LED strip male servo connector to the female connector on the Arduino. If you connected things correctly, the LEDs should light up and go through some default patterns.
Next you'll want to add the gyroscope library to your sketch. Look that library's example code and documentation to see how to do that properly. You can test if the gyroscope works by uploading example gyroscope code and having the data ouput to your serial monitor. Then move your arduino with gyroscope around to see if the output data changes.
You can test the microphone as well by using the Arduino's example Analog Input sketch, and write the sensorValue to the serial monitor. Upload this code and make some sounds into the microphone -- you should see changing values in the serial monitor.
Step 5: Program the Arduino
This is where you can get creative! However, some simple input mapping can actually generate a fairly interesting and dynamic output pattern on the LED strip.
Simply read in the gyroscope position data and scale it to a manageable number. I keep a running variable for the gyroscope input data (ypos) and every time I loop through an LED position, add a new y value read that I scale down by .0004. I then turn that ypos into a value that can be used to set the hue of an LED -- so I % 255 it: ypos = ypos % 255;
Similarly, I read in the microphone analog data, scale/map it to between 1-255 (I did to 200 because otherwise the belt ends up too bright).
This all goes in a loop where I progress through each of the LEDs, starting at 0, and set the hue of the LED to the ypos value and the brightness of the LED to the audio value.
I actually break the LED counting loop into two parts, one for the upper strip and one for the lower strip, so that we're lighting both strips all the time / are mirroring the data.
Test that you've programmed your board correctly... the colors of the belt should change when you move the arduino with gyroscope around, and the brightness of the LEDs should increase when you make loud sounds at the microphone.
Step 6: Seal up the electronics
I like to cover up the exposed solder points/joints with hot glue, namely: the spot where the wires connect to the switch, where all the ground/black wires connect to the master ground wire, where all the power/red wires connect to the master power wire, around the sides of the micro jack itself (I've found it's easy for the micro jack to get pulled off on many boards), and around the end of the LED strip where you've attached wire.
Then wrap some electrical tape around the gyroscope and the arduino, and play around with how you can compress/lay the parts down together to take up as little space.
I also like to wrap some electrical tape around the lipo battery where the wires connect, as that connection tends to be fragile and can often inadvertently receive a lot of stress.
Instead of using hot glue, you could also use heat shrink and a hot air gun or blow dryer. I use hot glue usually as it is quicker/easier and generally works just as well for me (or well enough).
Step 7: Mount the electronics onto the belt
Now slide the battery under the fur on the inner side of the belt. You can experiment with different ways of attaching and cover the electronics to the belt. What I did was take a piece of double sided tape and use that to stick the electronics onto the belt buckle. I then took a piece of rainbow duct tape and wrapped it around the whole thing a few times.
In an earlier iteration I design a 3D printed cover, but found that design was too bulky. I've also made an electronics cover/holder by taking a piece of thing polycarbonate/LEXAN and folding it into a rectangular shape, then sticking holographic sticker tape onto it and mounting that on the belt buckle. There are many options... explore! :)
Step 8: Celebrate!
Now you should be DONE! Put your belt on, turn on some music, and dance around with the lights off. :) Invite your friends over! Take a video in the mirror and share it online! Have fun and take joy in the awesome thing you just made -- that's alive!