Introduction: Micro:bit - LED Matrix
In this guide I will go through how to build a LED matrix for the micro:bit out of LED strips. I will be using a 4x4 matrix and a 10x10 matrix as my examples. Since I work at a school, where we do a lot of building we would end going through a lot of battery holders, power supplies and micro:bit if everything had to be build into the project. On the other hand it doesn't look very good if you just connect the micro:bit with alligator connectors, so in this guide I will also show how we build things to be taken appart again.
I have already made a short guide on how to program neopixels, but I will upload another guide latter with a bit more focus on how to program a neopixel matrix.
4 mm plywood
1 x TO220-3 voltage regulator
2 x 10 uF electrolytic capasitor
1 x 5 volt power supply 2 A is enough for a 4x4 matrix, but you want 4 A for a 10x10 matrix
3 x M3 25 bolts
12 x M3 Nuts
1 x Micro:bit
1 x 330 ohm resistor
1 x Two way screw terminal block connector
A strip of Micro:bit compatible neopixels. Preferable 60 LED/meter. You will need just over half a meter for the 4 x 4 matrix and just under 2 meter for the 10 x 10 matrix.
A few meters of wire. It is good if you have different colours
A small piece of soldering board
A bit of electrical tape
Hot glue gun
4 alligator jump wires
Step 1: Cut Out the Wood
First use the lasercutter to cut out the wood. I have uploaded files to cut out both a 4x4 matrix and a 10x10 matrix.
Step 2: Assemble Grid and Foot
Use wood glue to assemble the grid. I used an old brush to apply the glue, but you can use anything. Be aware that two of the grid pieces are a bit thinner than the rest. Those are the end pieces. We will have wires go through and so put them in opposite ends of the grid.
The perspective on the photo is a bit confusing. You should glue the backend to the second longest part of the triangle and not the longest. The backend is the square with 5 holes in it.
Step 3: Cut Your Neopixel Strip Out
You want to cut out the neopixel strip at the white line. If you are making a 4x4 matrix, then you want to cut out 4 strips with 4 neopixels on it and if you are making a 10x10 matrix, then you want to cut out 10 strips with 10 neopixels on each. Factories make long neopixel strips, but soldering shorter strips together. These soldering places will be a problem latter, so try to cut the strips in such a way that you cut where the factories have soldered together. It might mean tha you are wasting a few neopixels, but it will make your latter work much easier.
Step 4: Assemble the Neopixels
Take the largest square that was cut out. Use the grid you have assembled to mark where the neopixels should be on it with a pen. Most neopixels strips have tape on them, so it is easy to just tape them in place. If yours doesn't, then you need to use glue.
Be aware that neopixels are directional, since data only can go one way. It is importent that all the neopixel strips go the same way, you that you have Din in one side and Do at the other side.
Step 5: Connecting the Neopixels
When connecting the neopixels remember that power, ground and data is going to run from the first strip to the next strip and then the next strip and so on.
Strip -> Next strip
5v + -> 5v +
gnd -> gnd
Do -> Din
Power and ground can run both ways in a neopixel, so it isn't importent how you connect each strip there, which means you can go the short way, but data can only go one way, so make sure that you connect Do to Din.
Step 6: Test the Matrix
Before we glue the grid on top of the neopixels, we want to make sure that everything is working. Runing to many neopixels from your micro:bit can short circuit it, but you can actuelly run 16 neopixels from the micro:bit without external power, as long as only a single neopixel is turned on at a time. Upload the test program to the micro:bit, connect it to the LED matrix with the alligator wires.
In theory that can also be done with 100 pixels, but that is a bit risky, instead use alligator wires to connect the power supply to the the neopixel matrix and then upload the test program to the micro:bit and connect it to ground and data using alligator wires.
For the 4x4 matrix
Micro:bit -> Neopixels
GND -> GND
3 v -> 5v +
Pin 0 -> Din
For the 10x10 matrix
Micro:bit -> Neopixels
GND -> GND
Pin 0 -> Din
Powersupply -> Neopixels
GND -> GND
Power -> 5v +
Power up the micro:bit and push the A button a few times to test that all strips are working.
I use this program to test the 10x10 matrix.
I use this program to test the 4x4 matrix.
Step 7: Glue the Grid on to the Neopixels
Assuming that everything worked you now need to glue the grid on to the nepixels. Remember that we want the two thinner pieces that you put on each end to cover the two sides where you have soldered or else you wont be able to get the grid to level properly. If you have any factory solderings that isn't placed at the end, then you will find it impossible to get the grid to level, so grind a small hole in the grid that the factory soldering can fit into.
After you have glued the grid to the neopixel plate, put something heavy on top of it and leave it to dry while under preasure.
Remember that wood glue is conductive until it dries, so do not connect the matrix grid to power, before you are sure that it is dry.
Step 8: Soldering the Voltage Regulator Board
Now we are going to solder the voltage regulator board. You can see my diagram for the final circuit in the picture above, but be aware that some of the connections will be made with screws and not soldering.
The legs in the To220-3 are placed a bit odd. You have gnd to the left, power in to the right and 3.3 V out in the middle. We want to solder a capacitors to betwen gnd and 3.3 V to stabilize the power for the micro:bit and betwen gnd and 5 volt to stabilize the power for the neopixels.
You then want to solder the neopixel matrix to Vin and GND.
Neopixel -> To220-3
5 v + -> Vin
gnd -> gnd
You then want to solder a wire to the middle leg. That wire will be for the micro:bit.
Then you want to solder an extra wire to Vin on the right leg. That wire will latter go to the power supply.
At last you want to solder two extra wires to gnd. One wire will go to the power supply and the other wire will go to the micro;bit.
Step 9: Resistor on Data Wire
According to adafruits neopixel guide you should always put a 300+ ohm resistor on the data wire to the first neopixel. So we solder the 330 ohm resistor on to the data wire and solder a new wire on to the other end of the resistor.
Then to prevent short circuits we cover the soldering and resistor in electrical tape.
Step 10: Adding Screws
Now take one of the M3 screws, wrap the gnd wire you want to connect to the micro:bit around it and keep it in place with one of the nuts. Do the same for the data wire and 3.3 V wire.
Then put the screws through the holes. Gnd through the left most hole, 3.3 V through the second most to the left and data throught the right most hole. Use two nuts on each to keep them in place. We use two instead of one,because we also need to vreat some distance for when we connect the micro:bit.
Step 11: Hot Glue It All Together
We now hot glue the terminal connector on to the side, then we hot glue the voltage regulator board in place an in the end we hot glue the foot and the neopixel board together.
Be aware that there is two different way that you can connect the neopixels. you can connect them so that the strips goes from side to side or up and down. If the neopixels go up and down then it will be easier to make animations that go up and down and if the neopixels go from side to side, then it will be easier to make animations that goes from side to side. Here the 4x4 matrix will go up and down, while the 10x10 matrix goes from side to side.
Step 12: Prepare the Power Supply and Connect It
Cut the end of the power supply cable of and expose the wires. Then screw it into the screw terminal. Remember to connect power to power and ground to ground.
Step 13: Adding the Micro:bit
Program your micro:bit and then screw it on.
Step 14: Test It
Now connect the neopixel matrix to power and test the matrix. Afterwards you can add your own defusion material on top.