Looking for information on how to assemble your prize?
Or maybe you're a curious soul who wants to get involved after the fact?
You're in the right place.
On this page, you'll find detailed instructions on how to wire up your own Black Box device.
Do it right, and you'll be able to compile code written in the editor and run it in the real world.
Ready? Let's go.
(Something wrong with this guide? Open an issue!)
What you need
Caveat emptor
You will need the following parts in order to follow these instructions:
- Raspberry Pi Pico or other RP2040-based microcontroller (1×)
- 8x8 LED matrix, common cathode (1×)
- Momentary pushbutton (5×)
- PS1240 piezo buzzer or similar (1×)
- Breadboard(s) (see note)
- Jumper wire (30×)
- USB micro B cable (1×)
If you are a prize recipient, meaning you completed a submission for Black Box before the deadline, you will have all of these parts already.
If not, you will have to source them yourself. Adafruit is one retailer which can provide all of the parts.
Depending on where your parts are coming from, some aspects may be different:
- Prize recipients will be receiving three half-size breadboards; however, if you're sourcing from elsewhere, you may find it cheaper to buy two full-size breadboards instead.
-
Prize recipients will be receiving an 8x8 LED matrix with the following pin assignments:
- Rows: 9-14-8-12-1-7-2-5
- Columns: 13-3-4-10-6-11-15-16
- Rows: 1-2-3-4-12-11-10-9
- Columns: 5-6-7-8-16-15-14-13
The shape
Vexata quaestio
There are multiple possible ways to lay out your device.
If your LED matrix is 0.8" square, you will be able to assemble your device using either two half-size breadboards or one full-size breadboard.
However, if your LED matrix is 1.2" square, you will need to use either three half-size breadboards or two full-size breadboards to account for the difference in size.
If you are a prize recipient, your LED matrix is 1.2" square.
The rest of this guide will assume that you are a prize recipient.
Take two of your half-size breadboards, and remove the bottom power rail from each one. Then, connect both of them together horizontally.
You can use a small utility knife to push back the plastic underneath the breadboards in order to remove the rails, but take care not to remove the plastic completely.
Next, take the third breadboard, and remove the top power rail from it.
Then, connect it vertically to the breadboard on the right.
The left half
Sic parvis magna
Let's assemble the left half of the device first, including the Raspberry Pi Pico and the piezo buzzer.
Place your Raspberry Pi Pico at the far left of the first board, with half of the pins on either side of the ravine in the middle, and gently push it into the board until it is fully seated. The Pico's USB micro B port should be on the left.
Then, place your piezo buzzer in the remaining space on the first board, making sure its two pins are in line with each other horizontally.
Next, let's add a few wires to the first board.
You will want to keep the following image around from now on:
The guide will refer to specific pins on this diagram.
Connect pin 38 (GND) on the Pico to ground (-) on the top of the first board.
Then, connect the left pin of the piezo buzzer to ground (-) as well.
Finally, connect the right pin of the piezo buzzer to pin 4 (GP2) on the Pico.
All of the other components will be placed on the second board.
The right half
Finis coronat opus
Let's assemble the right half of the device, including the buttons and LED matrix.
Starting at the left edge of the second board (the one next to the Raspberry Pi Pico), place each of your five buttons in line with each other, with half of each button's pins on either side of the ravine in the middle.
After that, place your LED matrix at the right edge of the third board, making sure that the text printed on it is facing you, and gently push it into the board until it is fully seated.
It may take some time to get the matrix aligned before you are able to push it into the board. Be very careful not to bend any of the pins on the matrix.
Next, we'll wire up the LED matrix.
If the text printed on the matrix is facing you, the pins on the matrix are laid out like this:
- Pin 1 is located in the bottom left corner
- Pin 8 is located in the bottom right corner
- Pin 9 is located in the top right corner
- Pin 16 is located in the top left corner
We'll wire up the columns first:
- Connect pin 6 (GP4) on the Pico to pin 13 on the matrix.
- Connect pin 7 (GP5) on the Pico to pin 3 on the matrix.
- Connect pin 9 (GP6) on the Pico to pin 4 on the matrix.
- Connect pin 10 (GP7) on the Pico to pin 10 on the matrix.
- Connect pin 11 (GP8) on the Pico to pin 6 on the matrix.
- Connect pin 12 (GP9) on the Pico to pin 11 on the matrix.
- Connect pin 14 (GP10) on the Pico to pin 15 on the matrix.
- Connect pin 15 (GP11) on the Pico to pin 16 on the matrix.
Then, we'll wire up the rows:
- Connect pin 16 (GP12) on the Pico to pin 9 on the matrix.
- Connect pin 17 (GP13) on the Pico to pin 14 on the matrix.
- Connect pin 19 (GP14) on the Pico to pin 8 on the matrix.
- Connect pin 20 (GP15) on the Pico to pin 12 on the matrix.
- Connect pin 21 (GP16) on the Pico to pin 1 on the matrix.
- Connect pin 22 (GP17) on the Pico to pin 7 on the matrix.
- Connect pin 24 (GP18) on the Pico to pin 2 on the matrix.
- Connect pin 25 (GP19) on the Pico to pin 5 on the matrix.
Because of the unusual ordering of the rows and columns, getting each adjacent wire near the matrix to fit in place will take some time.
Pay close attention during this stage to make sure you make all the right connections.
Finally, we'll wire up the five buttons.
Connect the bottom left pin of each button to ground (-).
Then, connect the top right pin of each button as follows:
- Connect pin 26 (GP20) on the Pico to button 1.
- Connect pin 27 (GP21) on the Pico to button 2.
- Connect pin 29 (GP22) on the Pico to button 3.
- Connect pin 31 (GP26) on the Pico to button 4.
- Connect pin 32 (GP27) on the Pico to button 5.
If done correctly, the five buttons will correspond to up, down, left, right, and select, respectively.
At this point, your device is finished being assembled, and all that's left is to test it.
Using your device
Fiat lux
To test your device, you will need to open the editor.
Select the puzzle example, then click Build .uf2.
This will create a .uf2 file which can be flashed directly to your Raspberry Pi Pico.
Plug your USB cable into your Pico; then, while pressing the Pico's BOOTSEL button, plug it into your computer. Your Pico should then mount itself to your computer as a filesystem.
Drag the .uf2 file into the Pico's filesystem; the filesystem will then disappear, and the example code should start running on your device immediately.
Where wiring is concerned, the matrix should be positioned with the printed text facing towards you, but when using your device, the matrix should be positioned with the printed text facing left. With this in mind, try pressing each of the buttons on your device one at a time; you should see a different pattern on the LED matrix and hear a different tone from the piezo buzzer for each button you press.
If anything seems like it isn't working, double-check your wiring to make sure you've connected everything properly; if you need to make a wiring change, unplug your Pico from your computer first.
You don't need to hold down the BOOTSEL button every time you plug the Pico into your computer – only when you want to change the code that's running on it.
You should now have a working Black Box device, suitable for running code in the real world. Congratulations!