HackerBox 0123: Matrix
by HackerBoxes in Circuits > Raspberry Pi
1413 Views, 1 Favorites, 0 Comments
HackerBox 0123: Matrix
Welcome to HackerBox 0123. Explore the Black Gold Pico 2 development board based on the Raspberry Pi RP2350A microcontroller. Assemble the HackerBox HUB75 Matrix Pi platform based on the Pico 2 and a LIS3DH triple-axis accelerometer. Consider various five volt power supply options. Leverage the Adafruit Protomatter Library to implement several example firmware projects including scrolling text, tilt-sensitive pixel dust, Conway's game of life, and a wacky mineshaft navigation game. Study the history of an early decentralized "Internet" based on independent bulletin board systems connected by dial-up telephone modems. Knock, knock, Neo.
There is a wealth of information for current and prospective members in the HackerBoxes FAQ. Almost all of the non-technical support emails that we receive are already answered there, so we'd really appreciate it if you can take a few minutes to read the FAQ.
Supplies
This Instructable contains information for getting started with HackerBox 0123. The full box contents are listed on the product page for HackerBox 0123 where the box is also available for purchase while supplies last. If you would like to automatically receive a HackerBox like this right in your mailbox each month, you can subscribe at HackerBoxes.com and join the party. Subscription members save at least $15 every month and automatically receive each new HackerBox shipped immediately off the production line.
A soldering iron, solder, and basic assembly tools are generally needed to work on the monthly HackerBox. A computer for running software tools is also required. Have a look at the HackerBox Workshops for tools and supplies along with a wide array of introductory activities and experiments.
The most import thing you will need is a sense of adventure, hacker spirit, patience, and curiosity. Building and experimenting with electronics, while very rewarding, can be tricky, challenging, and even frustrating at times. The goal is progress, not perfection. When you persist and enjoy the adventure, a great deal of satisfaction can be derived from this hobby. Take each step slowly, mind the details, and don't be afraid to ask for help.
WEAR SAFETY GLASSES WHEN SOLDERING, WHEN TRIMMING WIRE LEADS, OR WHEN CUTTING, DRILLING, ETC.
Enter the Matrix
Buckle your seatbelt Dorothy, 'cause Kansas is goin' bye-bye.
OK... different matrix...
A matrix is a rectangular array of numbers or other mathematical objects with elements or entries arranged in rows and columns. In linear algebra, matrices are used as linear maps. In geometry, matrices are used for geometric transformations (for example rotations) and coordinate changes. In numerical analysis, many computational problems are solved by reducing them to a matrix computation, and this often involves computing with matrices of huge dimensions. Matrices are used in most areas of mathematics and scientific fields, either directly, or through their use in geometry and numerical analysis.
Video: Programming Matrices with Numpy for Beginners
Video: Matrix Operations using Numpy
Video: Matrix Mathematics - Ultimate Study Guide
Video: Neural Network Explained from Scratch using Matrices
Notice that the neural network example is the same handwriting recognition task from HackerBox 0095.
RP2350A Black Gold Pico 2
This project can use the official Raspberry Pi Pico 2. The development board included with the HackerBox is referred to as the Black Gold variant, which features the same RP2350A MCU chip from Raspberry Pi, but includes a USB-C interface instead of microUSB.
(BEFORE SOLDERING) Initial Tests with the Pico 2 Development Board
Connect the Pico 2 to a computer using a USB-C cable.
Upon the first connection, the (green) LED on the board will blink as power is provided.
From here, we suggest following this Random Nerd Tutorial to:
- Install the Arduino IDE
- Add the Earle F. Phillhower Board Manager URL
- Install the Earle F. Phillhower Board Manager
- Select Tools > Board > Raspberry Pi Pico/RP2040 > Raspberry Pi Pico 2
- Loading the Blink Sketch
- Modify delay timing in the Blink Sketch to verify operation with the onboard LED (GP25)
Assemble the HUB75 Matrix Pi
Before opening the small bag of parts, take caution not to drop or lose the one tiny surface mount component found within. That component is a DSK16 Schottky Diode (datasheet).
As illustrated by the BLUE ARROW: First solder the DSK16 Schottky Diode to the front side of the HUB75 Matrix Pi PCB at position D1. Diodes must always be properly orientated. On the diode itself, there is a line mark across the top side along one edge. That edge must be oriented closest to the "D1" silkscreen label which is also towards the inside of the three-sided rectangle outline around the device's PCB footprint.
If you lose or damage the DSK16 diode, or just don't feel like soldering it, that is fine. Simply short the two pads of the D1 diode footprint with a blob of solder. However, with a short in place of the diode, you will need to avoid powering both the Pico 2 USB-C port and the 5V screw terminals at the same time. The D1 diode connects between the 5V screw terminal and the VSYS pin of the Pico 2. The D1 diode prevents current from flowing backwards from the Pico 2 out through the screw terminal.
There is a similar diode on the Pico 2 - next to the "39" silkscreen marking. That diode on the Pico 2 module is wired between the VBUS and VSYS pins. It prevents current from flowing back out through the USB-C port. Together, these two diodes form a voltage combiner as presented at time offset 15:50 in this video. Later in that video, there is an example of powering the Pico and some Neopixels from two supplies, which is basically identical to the circuit structure on the HUB75 Matrix Pi.
As illustrated by the GREEN ARROW: Solder the 2x8 pin Female Header onto the OTHER SIDE of the HUB75 Matrix Pi PCB. Important: The black plastic connector of the 2x8 header will be on the side the PCB with the white rabbit.
Assemble the HUB75 Matrix Pi (continued)
Solder the Pico 2 Development Board onto the HUB75 Matrix Pi PCB using the supplied header pins. Note the orientation shown in the image above and indicated by the "USB" label on the PCB. There is no need to solder the three debug pins to the PCB, although they can be soldered facing up (away from the PCB) should you later wish to use them with jumper wires.
Solder the LIS3DH Accelerometer Module to the HUB75 Matrix Pi PCB using the supplied header pins. Note the orientation shown in the image above.
Orient the two red terminal blocks onto the HUB75 Matrix Pi PCB such that the open ports for accepting wires are facing out towards the edge of the PCB. Solder the two terminal blocks into place.
Reconnect the Pico 2 USB port to a computer using a USB-C cable to make sure that it still starts up and runs code. You can even verify loading the blink sketch once again if you wish. Should there be any problems, look for soldering issues such as opens and shorts anywhere on the HUB75 Matrix Pi assembly.
Connect the HUB75 Matrix Pi
The HUB75 Matrix Pi can support various power options depending upon your power supply. The example detailed below assumes power is supplied by a single 4A USB-C power supply. However, any 5V power supply capable of providing up to 4A of current can be connected to the screw terminals instead of the USB-C breakout socket.
Connections for 5V Power
The power header on the LED Matrix panel is a four-pin JST-VH header (3.96mm pin pitch).
The provided HUB75 Matrix Power Harness has a four-pin JST-VH socket on one end, four wires (two red 5V and two black GND), and a couple of spade lugs on the other end.
Cut all four wires of the HUB75 Matrix Power Harness about 4-5cm from the square, white JST-VH socket.
Set aside the cut wires with the space lugs.
For each of the four wires left attached to the JST-VH socket, strip off about 5mm of insulation, and tin the exposed metal wire with solder.
Screw these four tined ends into four ports of the screw terminals as shown in the photo. Be sure to match the red wires to 5V terminal and the black wires to the GND terminal.
Return to the cut wires with the space lugs that we set aside a few steps back. Cut off, and discard, the spade lugs. Retain one each of the black and red wires.
For each of the two black and red wires, strip off about 5mm of insulation from one and and about 2mm of insulation from the other end. Tin the exposed metal wire with solder.
As shown in the top right portion of the image above: position the USB-C Breakout Socket.
Tin the G and V pads of the USB-C Breakout Socket. We will not be using the D+ and D- pads since this connection is only for power.
Solder the 2mm tinned end of the black wire to the G pad and the 2mm tinned end of the red wire to the V pad.
For now, it's probably best to just leave these USB wires at full length, but as you can see in the photo, we later trimmed one to about 7cm to meet the desired positioning of the USB-C power port in our example setup.
Connect HUB75 Data
With 5V off or disconnected, orient the HUB75 64x32 LED panel with the central arrows pointing UP - as shown in the image above. Align the 2x8 data header of the HUB75 Matrix Pi PCB onto the header pins on the left side of the panel - as shown in the image above. Be sure to have all 16 pins matched up as they can sometimes get shifted up or down by one pin. Proper alignment will result in the two mounting hole of the PCB being closely centered over the two leftmost threaded mounts in the LED panel.
Firmware
In the Arduino IDE, use the Library Manager to search for, and install, the Adafruit Protomatter Library.
Speaking of Adafruit, if you need more HUB75 LED panels, related accessories, or most any other electronic maker goodies, that's the place to go.
With the library installed, open the example sketch...
File > Examples > Adafruit Protomatter > doublebuffer_scrolltext
Replace all the I/O pin definitions (around lines 18-105) with the following:
Compile and upload the sketch. A nice scrolling text experience should ensue.
You can change the displayed text by modifying the sprintf call around line 70.
Next firmware example... Grab the HB_pixeldust.ino sketch attached below. This has been modified from the Adafruit example to work with the HackerBox HUB75 Matrix Pi, so give it a compile and upload.
You can modify most Protomatter projects to work with the HackerBox HUB75 Matrix Pi. In addition to the I/O pin setting shown above, the following setup covers the LIS3DH Accelerometer as integrated on the HUB75 Matrix Pi:
Additional firmware examples...
The attached conway_life.ino and mineshaft.ino sketches work directly with the HackerBox HUB75 Matrix Pi hardware.
Underground BBS Culture
The Underground Internet of the 1980s "Before the internet became one place, it existed as thousands of smaller civilizations. Inside them, complete digital societies formed... It was a global underground of rival art crews. A planetary network stitched together at night by home computers without the help of large companies, central servers, or anyone's permission."
Remove Before Launch
We hope you are enjoying this month's HackerBox adventures into electronics, computer technology, and hacker culture. We aim to curate a challenging and rewarding experience of learning through experimentation and exploration. Thank you for joining us on this journey.
Reach out and share your success in the comments below. Email support@hackerboxes.com anytime with questions or whenever you need some help.
Hungry for more? Surf over to HackerBoxes.com and join us as a monthly HackerBox subscription member. You'll get a cool box of hackable gear delivered right to your mailbox every month and you'll enjoy a generous member discount.
Please consider sharing this free Instructable with others who may be interested in learning about these subjects. Word of mouth advertising is the greatest compliment that we can receive. We sincerely appreciate your support.