Introduction: Weird But Fun Fingertip Neopixel Micro:bit Gloves - Wearable Tech Tutorial

I'm a computer science teacher at a high school where students collaborated to put on a show of how fashion could be infused with wearable technology. We called it the TechStyles Project! Nearlt all of the wearable tech students created used Micro:bits as controllers and were lit with Neopixel programmable LEDs. In this tutorial, I have recreated a small example project that will help introduce students and teachers to how you can get started with combining NeoPixels and Micro:bits into clothing.


You should be a little familiar with Micro:bit programming before attempting this project, but if you're a quick study at block-based programming, you're probably good to go.

Supplies

A Micro:bit and its battery pack.

An additional power/battery pack, preferably one that holds three AA batteries. I had one that holds four, so I ended up rigging it, but you should use a smaller pack for a small project like this.

Two M4 screws and their nuts

Hex driver or screwdriver depending on the head your screws have.

Tiny wire nuts

22 gage stranded PVC wire. I used a double-wire cable.

Wire cutters and strippers. I used flush wire cutters.

Electrical tape

Neopixel lights. Make sure you get the 5-volt kind for this project! - WS2811 12mm Individually Addressable Color RGB LED Pixel String Lights


A glove

AA batteries and AAA batteries, depending on what came with your Micro:bit and what kind of battery packs you have.

Step 1: Get to Know Your Addressable LED

Addressable LEDs (Neopixels are one type) operate through three wires: a ground wire or GND, a data signal wire or DI (for "data in"), and a power wire (+5v on these LEDs). They're called "addressable" because even though you might have a string of several LEDs, you can program them to light and color individually based on how far along they are on the string. Because each LED has its own controller, you can cut the string to make it whatever length you like. The LEDs will keep track of whether they're first, second, third, and so-on because of how they're designed to pass the signal along to the next one in the chain.

Look closely at a single LED. You'll see it has six wires (some will double up on the +5v and GND to make powering them easier -- we'll get to that, but you can ignore it for now). Three are the input wires, and three go to the next LED in the chain. If you're looking at the LED and you can see the labels and the arrow, congratulations! You're looking at the input side of the LED. The data wire on that side is for input.

In the 4th photo I'm holding the LED by its three output wires, covering them up. You can see three wires, blue (GND), white (DI), and red (+5v) stuck together. The two extra wires are blue and red. Ignore those for now; they're designed for people who have a specific kind of power device to plug into, but they're just duplicates of the


FIND THE START OF YOUR STRING. Even if you have cut the string previously, you can identify the start of the string because it will be the first LED in the string that has wires coming into the side that is labeled GND, DI, and +5v with an arrow pointing "in" or toward the LED light. If you turn over the LED so that you can see the back side of the board, you'll see there's no arrow on that side.

Always wire your LED string so that the data signal (DI) is coming in to the first LED in your string. The data will only work flowing in one direction - the direction of the arrow.


Step 2: Lay Out Your Design

Make sure your LEDs work for whatever project you're creating. I had white and black gloves and decided to make glowing fingertips. Here I've laid out the LEDs over the glove. If the wires between the LEDs aren't long enough, I'd have to cut them and splice in new wire. Luckily, for this project, I could make use of the existing wiring.

But these LEDs will work fine if you cut and splice in longer wires as needed.

Soon after this photo was taken I decided to switch to a white glove because of how the light would easily show through the thin fabric.

Step 3: Measure and Cut Your Wire/cable

This project is going to have a Micro:bit and its battery powerpack, and then a larger power pack to separately power the LEDs.

I decided that I wanted to run the wire for the larger powerpack to my pants pocket, and run the wire to the Microbit controller and its powerpack across my shoulders and into my opposite hand. I measured these distances and cut wire so that I'd have enough to wire both. That's two strands for each.


This black and red cable is what I have. For the large powerpack, one strand is the ground (GND, black) and the other is the power (+5v, red). For the Microbit, one strand will be for the ground (GND, black) and the other will be for data (DI, red). It would have been ideal to use white wire for the DI, since that's what the LEDs use, and blue for GND. But this is what I have.

Step 4: Wire Up the Grounds

All the GND wires can be wired together safely.

First, I snip off the wires after the last LED I'm using for this project. Then I strip all the ends of the GND wires.

Next, I line up the blue GND wire(s) from the LED with BOTH GND wires that I need for the Microbit and for the Large Powerpack. All the GNDs are wired together.

Then I twist all these exposed strands together and use a small blue wire nut to keep them connected. I tape off the nut with electrical tape to secure it.

(NOTE: I have two blue GND on the input side in my project because of the extra wires I showed you at the beginning. No worries, I'm just going to twist them together. They're both wired to the same place on the LED board anyway. On your strand you might just have one.)

Note, I have two input +5v wires left on this LED and one DI signal input.

Step 5: Wire the Large Power Pack

Take the two wires you measured for the large power pack and wire the GND (black) to the GND (black) of the power pack. Wire the +5v (red) to the red of the power pack. Strip the ends of the wires, twist them together, and tape them off with electrical tape.

I have chosen to wire this project without soldering. I could use wire nuts, but for these connections, some of which will be inside the glove, I decided to just twist and tape. If you want more sturdy and permanent wiring, I suggest soldering and using shrink tubing.

NOTE: four AA batteries supply more power than I need for this project. I could get away with three or even two AA cells. Sometimes too much power causes the LEDs to malfunction (it interferes with the data signal if the power voltage is too much greater than the voltage that's being used for the DI).

Back at the LED string, strip and wire together the +5v (red) input(s) to the red wire that leads to your large power pack. As I said earlier, you may have just one +5v (red) input on your LED, or two, as I did. Either is fine. See the photo in the next step.


Step 6: Wire the Control / Finish Wiring

When you begin this step you should have two wires left at the LED end. There will be a white DI data input wire from the LED and a red wire that's going to go to your Microbit. Strip the wires, twist them together, and tape them off.

Now the LED end is completely wired. One or two red +5v inputs are wired to a red wire leading off to the battery pack. One or two blue GND wires are wired to two black wires (one goes to the battery pack, and one will go to the Micro:bit).


At the Micro:bit we're connecting the wires with M4 screws. What I like to do is to put the strands of the stripped wire end into the hole for the contact on the Micro:bit, then put the screw in and secure it with a nut. It's a snug and secure fit.

Connect the black GND to the GND hole on the Micro:bit. Now, decide which contact pin will send your control signal. I like to use pin 2, as pictured. Screw the remaining red wire (that leads to the LED's white DI) into pin 2.

I have included a wiring diagram created in Tinkercad. (I've used red LEDs to show where wires of different colors were wired together because Tinkercad doesn't have a way to connect bare wires - those extra LEDs don't exist in the real project.) Instead of bulb light addressable LEDs, the wiring diagram shows Neopixels in a strip.

Step 7: Code the Micro:bit

To program your Micro:bit to light Neopixels, you will need to use the Neopixels extension.

Use a show icon block to set a pattern on the Microbit screen's LEDs; it will let you know if your program is running.

To get the Neopixels to light, you need to create a strip with the correct number of LEDs, and make sure you specify the correct pin! (Pin 2, in our case, which we wired to DI)

In this program, I have rigged the buttons to change the colors of the lights, and touching the logo (this is a Micro:bit v2, so the logo is touch-sensitive) causes the lights to cycle colors.

I've provided the program below, but it's also published on the Micro:bit website here.

For beginners, there's a link to a quick start Neopixel programming guide for Microbits here.

Step 8: Test the Code

Put the batteries into the packs. You have to make sure the power is on for the LEDs before you turn on the Micro:bit so that the LEDs are ready to accept the data signal.

I've provided a video of what it looked like to test the lights before I put them into the glove, and then afterwards. Here's that video on YouTube as well.



Step 9: Enhancements, Variations, and Tips

Neopixel Strips

It's possible to do this same sort of project with Neopixel strips instead of strings of lights. Such a strip is pictured here. This strip has 5 volt Neopixels, and just like the string of LEDs it has directionality. The data signal flows in the direction of the arrow.

Solderless Connectors

For a strip like this, you're more likely to need to solder wires onto it to get it to work. However, they also make solderless quick connectors that greatly reduce the work of connecting to these strips. I highly recommend using the quick connectors if you and your students are beginners at soldering.

Soldering

When I first had my students creating projects like this one, I taught them to solder and many of them found that to be one of the most enjoyable parts of learning how to make these projects. I have presented you with a solderless version in order to reduce the difficulty level. If you do decide to solder connections, I recommend using heat shrink tubing over the solder joints between wires. And I recommend starting your students early in practicing soldering.

The difficulty level of soldering two wires together for an LED string is low.

The difficulty level of soldering a wire to the contacts on a NeoPixel strip is much higher. You have to cut the LED strip across the contacts in a way similar to how you cut a string of LED lights. This often leaves two small targets for your solder.

One extremely useful tip about soldering to Neopixel strips is to cut off a sacrificial LED leaving as much of the contacts on each side as you can, rather than cutting down the middle. It wastes a single LED, but it makes your life much simpler when you're trying to get solder onto that little contact.

Power Requirements

This project has the lights separately powered from the Micro:bit. In truth, you can power 5 LEDs directly off the Micro:bit power with no difficulties. (You would wire this largely the same, but instead of the power coming from the extra battery pack, it would come from the 3v pin on the Micro:bit). I have heard you can safely power up to 8 LEDs this way, and have tested it myself with success.

However, if you try to power many more LEDs from the Micro:bit, the LEDs will attempt to draw more power than the Micro:bit can safely supply, and that will spike the current and damage the hardware. The method I've demonstrated in this project isolates the Micro:bit from that sort of danger, so you can scale up the number of pixels as long as your battery pack can supply approximately 5v and the necessary current to the lights.


Your Lights Won't Light?

There is a somewhat obscure problem caused by having too much voltage difference between the 3v-powered data signal coming off the Micro:bit and the power being supplied to the lights coming from the battery pack. If you're using 3 AA cell batteries with the lights, in some cases (like this project, when there are only 5 LEDs) the battery pack overwhelms the data signal, making it unstable or drowning it out entirely. Try reducing to two batteries in the battery pack. That worked for me in this project (I used a rolled-up piece of aluminum foil in place of one battery and a short wire to make up the distance between the contacts in the other battery).

See the Uberguide in the links section for more about how to safely scale up these projects.

Step 10: Useful Links for Advanced Projects