There are three major parts to this guide:
- Setting up the software
- Building the electronics
- Building the gauntlets
All three parts are interrelated…so take some time, do some sketches, read all the way through and do some planning before you start…
- How many LEDs do you want to use? More LEDs likely means a shorter battery life, but a bigger matrix will show image detail better
- Where will the battery fit most comfortably along your arm?
- Will the Feather board work better if it's placed horizontally or vertically?
- Do you plan to regularly add and update your SD card files? If so, can you reach your SD card easily?
- Do you want to be able to swap out batteries, or is stopping to charge your gauntlet with the battery in-place good enough?
- What super power(s) will these gauntlets give you? Will humanity as a whole benefit from your actions?
The technical parts of this guide build upon our Lightship LED Animation guide…but rather than WiFi, these gauntlets play back animation from a micro SD card*. Skim through that guide to familiarize yourself with all the pieces and terminology. Though this project is built a little differently, many of the same concepts apply, and this saves us a lot of explanation here.
* Though if you’d like WiFi gauntlets instead, that’s entirely 100% possible…substitute a Feather M0 WiFi rather than an Adalogger…same concepts apply, just use the original Lightship code instead.
Steps you'll need to follow:
- Install Feather board support in your Arduino IDE and get the "blink" sketch working.
- Download and install the necessary libraries: you'll need the Adafruit Dotstar library, the ASF Core library and the Adafruit_ZeroDMA library.
- Install Processing vesrion 2.2.1
- Download and extract the ZIP file containing the code for this project.
Set Up a Test Strip
Testing your LED strip first can save heartbreak later…this lets you know whether the whole strip is in good working order and that you’re making the right connections.
Dotstar strips come with a connector pre-soldered onto the ends. For testing purposes I like to just cut the connector head off and use the wires to connect directly to my project…or you can trim the plug with wires off the tail end and use that as a connector for the head end.
When connecting to a microcontroller, make certain you’re working from the INPUT end of the LED strip! If you look closely at the face of the strip, you’ll see a series of small arrows pointing from IN toward OUT. Connect to the “in” end…the arrows should be pointing away from the microcontroller.
Tiny solder pads on the strip should be marked + or 5V, D or DI (data in), C or CI (clock in) and – or G (ground) or similar. The wires on the end of the strip will be in the same order as the labels; typically a red wire for +5V, black for ground.
Temporarily solder your strand of Dotstars to the Feather M0 board:
Feather M0 Pin
D or DI (data in)
C or CI (clock in)
+ or 5V
– or G
There are spare power wires at the ends of the strip. Make sure the ends of these are covered (or just clip off) so they don’t accidentally contact anything and cause a short.
Later we’ll power the LEDs off a battery, but for testing, use the USB and GND pins.
Use the Arduino Library Manager to install the Adafruit_DotStar library (Sketch→Include Library→Manage Libraries…), or if you’re using an older version of the Arduino IDE, it can be downloaded and installed manually:
Library installation is a frequent stumbling block…if you need assistance, our All About Arduino Libraries guide spells it out in detail.
Once the Adafruit_DotStar library is installed, you can use the “strandtest” sketch to confirm that everything works.
You’ll need to make a few small changes in the code before uploading to the board. First, edit the number “30” on this line to reflect the actual number of LEDs in your DotStar strip (e.g. 60, 144, etc.):
Then a couple lines down, look for these:
Change these values to:
Make sure the right board type and serial port are selected, then upload this sketch to the Feather board. After a moment, you should see a set of red pixels chase along the strip, then green, then blue.
- Double-check all the connections between board and strip: Feather pin 11 to strip DI, 13 to CI, USB to + and GND to –.
- Make sure you’re connected to the input end of the strip (arrows should point away from the microcontroller board).
- Check that the spare power wires at each end of the LED strip aren’t touching each other or anything conductive around your desk.
Occasionally from batch to batch the manufacturer changes the order in which the LEDs receive color data. You can reorder this data using the last argument to the Adafruit_DotStar() constructor, e.g. try:
Adafruit_DotStar strip = Adafruit_DotStar( NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BGR);