# Little Desktop Connection Machine

## Overview

https://youtu.be/nXfV3WG0Mdo

The [_ **Connection Machine** _](https://en.wikipedia.org/wiki/Connection_Machine) was a groundbreaking massively parallel supercomputer of the mid-1980s and 90s. Just as incredible as the machine’s _performance_ was its _industrial design:_ an ominous black cube-of-cubes, with system activity conveyed through thousands of red LEDs. It looks straight out of sci-fi…but it’s _real!_

There are a handful of truly iconic computer designs, like the distinctive “C” shape and built-in bench of early Cray supercomputers, but the Connection Machines are simply _the best,_&nbsp;period. I’m sorry, this isn’t mere subjective opinion, it’s _irrefutable science._ Look at it!

Not only are Connection Machines exceedingly scarce, with just a few dozen existing in museums and private collections, but their size and power requirements would make them impractical to own.

But now, thanks to 3-D printing and some Adafruit components, you can build a _ **Little Connection Machine** _ for your desk. This can house a **Raspberry Pi 4** computer…or, if you don’t want or need the whole Linux-based computer and just want the _blinkenlights_…a **Pico microcontroller board**.

![raspberry_pi_hero-printers.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/836/medium640/raspberry_pi_hero-printers.jpg?1650236862)

https://youtu.be/kROJoixSFDY

## Modular Design

The case features an open design with lots of room to mount fans, sensors or even a speaker. Vents on the top, back and bottom help keep components cool.

The case is assembled with screws and press-fit parts that make it easy to customize. One could fit a USB battery bank to make a portable CM-1.&nbsp;Or, keeping on-theme with parallel processing, ambitious folks could probably fit a whole mini Linux cluster inside there using several Raspberry Pis!

## Black LED Acrylic

Sheets of black LED acrylic slide over the matrices and diffuses the LEDs.

![raspberry_pi_acrylic-close.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/844/medium640/raspberry_pi_acrylic-close.jpg?1650238712)

![raspberry_pi_vents.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/845/medium640/raspberry_pi_vents.jpg?1650238766)

## Powered by LED Charlieplexed Matrix

There are eight 9x16 “Charlieplexed” LED matrices inside this cube. Each is actually a _pair_ of boards: an IS31FL3731 driver “backpack,” and then a 9x16 matrix that gets sandwiched atop this.

The matrices come in different colors if you really want…but classic red is authentic to the Connection Machine design.

Eight of these comprise a whopping 1,152 LEDs!

![raspberry_pi_Charlieplexed-boards-hero.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/837/medium640/raspberry_pi_Charlieplexed-boards-hero.jpg?1650236972)

![raspberry_pi_parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/840/medium640/raspberry_pi_parts.jpg?1650238344)

## Programmed in Python!

If building with a **Raspberry Pi** , there is example code for three different animations. For the **Pico** microcontroller board, only the first of these is provided, but it’s the one most folks want anyway…

 **Random Blinkenlights**

The classic!

**Raspberry Pi:** the number of lit elements (0–100%) depends on current CPU load. Since&nbsp;the program itself comprises part of that load, this will never be 0. Try opening a second window and doing a “sudo apt-get update” or “sudo apt-get upgrade” and watch the lights get angry!

**Pico:** you can configure a percentage or lit elements (0–100%) in the code. The lights simply blink randomly, it doesn’t reflect anything real-world…unless you decide to customize the code to read sensors or other nifty ideas.

![raspberry_pi_blink-loop.gif](https://cdn-learn.adafruit.com/assets/assets/000/110/842/medium640thumb/raspberry_pi_blink-loop.jpg?1650238479)

 **Chaser Lights**

This animation is inspired by the **CM-5** in the&nbsp;_Jurassic&nbsp;Park_&nbsp;control room. This was a later Connection Machine model that took a different shape, but still had the LEDs…we’ve adapted that pattern to run on the original cube form-factor.

This doesn’t depend on CPU load or anything, it’s simply passive animation.

![raspberry_pi_chaser-loop.gif](https://cdn-learn.adafruit.com/assets/assets/000/110/841/medium640thumb/raspberry_pi_chaser-loop.jpg?1650238425)

 **Audio Visualizer**

A trippy sound-reactive display.&nbsp;This requires adding a [USB microphone](https://www.adafruit.com/product/3367) and some additional software setup on the Raspberry Pi, explained later.

![raspberry_pi_audio-lop.gif](https://cdn-learn.adafruit.com/assets/assets/000/110/843/medium640thumb/raspberry_pi_audio-lop.jpg?1650238523)

## Parts from Adafruit

Required and/or recommended parts for this build:

The full design requires **eight** each of the **LED drivers** and **matrices**.

The “brains” can be one of:

- Any model of Raspberry Pi 4. The basic 1 GB model is adequate if you just want to run the demo code…or opt for bigger models if you expect to be doing real work. _Older Pi models could also work, using USB micro-B instead of USB-C for power._
- A Raspberry Pi Pico microcontroller board.

One or other, you do not need both!

At the time this is being written, Pi 4 supplies are constrained…one could build with the Pico for now, and swap out for a “real” Pi later.

### LED Charlieplexed Matrix - 9x16 LEDs - Red

[LED Charlieplexed Matrix - 9x16 LEDs - Red](https://www.adafruit.com/product/2947)
These are 9x16 Charlieplexed LEDs designed to match with the&nbsp;[Adafruit 16x9 Charlieplexed PWM LED Matrix Driver -&nbsp;IS31FL3731](https://www.adafruit.com/products/2946). You don't get any resistors or driver chips with this grid, its just a mess of LEDs in a charlieplexed...

In Stock
[Buy Now](https://www.adafruit.com/product/2947)
[Related Guides to the Product](https://learn.adafruit.com/products/2947/guides)
![Assembled and powered matrix board emitting red LEDs](https://cdn-shop.adafruit.com/product-videos/640x480/2947-04.jpg)

### Adafruit 16x9 Charlieplexed PWM LED Matrix Driver - IS31FL3731

[Adafruit 16x9 Charlieplexed PWM LED Matrix Driver - IS31FL3731](https://www.adafruit.com/product/2946)
The IS31FL3731 will let you get back to that classic LED matrix look, with a nice upgrade!&nbsp; **This I2C LED driver chip has the ability to PWM each individual LED in a 16x9 grid** &nbsp;so you can have beautiful LED lighting effects, without a lot of pin twiddling. Simply tell...

In Stock
[Buy Now](https://www.adafruit.com/product/2946)
[Related Guides to the Product](https://learn.adafruit.com/products/2946/guides)
![Angled shot of PWM LED matrix driver board.](https://cdn-shop.adafruit.com/640x480/2946-06.jpg)

### Black LED Diffusion Acrylic Panel - 10.2" x 5.1"

[Black LED Diffusion Acrylic Panel - 10.2" x 5.1"](https://www.adafruit.com/product/4749)
&nbsp;nice whoppin' rectangular slab of some lovely black acrylic to add some extra diffusion to your LED Matrix project. This material is 2.6mm (0.1") thick and is made of special cast acrylic that makes it perfect for glowy projects, especially matrices or NeoPixels.

Unlike...

In Stock
[Buy Now](https://www.adafruit.com/product/4749)
[Related Guides to the Product](https://learn.adafruit.com/products/4749/guides)
![LED RGB matrix 10.2" x 5.1" with "Adafruit Industries LED Matrix" text showing, and LED acrylic slowly covering to make it nicely diffused](https://cdn-shop.adafruit.com/product-videos/640x480/4749-02.jpg)

These wires and heat-shrink bits make for a luxurious build…though if you’ve been doing electronics for a while you might already have suitable bits around:

### Premium Silicone Covered Female-Female Jumper Wires - 200mm x 40

[Premium Silicone Covered Female-Female Jumper Wires - 200mm x 40](https://www.adafruit.com/product/4447)
These premium female-female jumper wires are handy for making wire harnesses or jumpering between headers on PCBs. They're&nbsp;200mm (~7.8") long and come loose as a pack of 40&nbsp;(10&nbsp;pieces of red, blue, yellow, and Adafruit black). They have 0.1" female header contacts...

In Stock
[Buy Now](https://www.adafruit.com/product/4447)
[Related Guides to the Product](https://learn.adafruit.com/products/4447/guides)
![Angled shot of Premium Silicone Covered Female-Female Jumper Wires - 200mm x 40](https://cdn-shop.adafruit.com/640x480/4447-01.jpg)

### Heat Shrink Pack

[Heat Shrink Pack](https://www.adafruit.com/product/344)
Heat shrink is the duct tape of electronics, it keeps your stuff all safe and kept together. Especially when wiring and soldering, use heat shrink to add mechanical strength to cables. We use this stuff all the time and having a zip-lock bag of all the possible sizes is super...

In Stock
[Buy Now](https://www.adafruit.com/product/344)
[Related Guides to the Product](https://learn.adafruit.com/products/344/guides)
![close up of ends of various small heat shink tubes](https://cdn-shop.adafruit.com/640x480/344-00.jpg)

You do _not_ need this Pico RP2040 board if building around a Raspberry Pi 4:

### Raspberry Pi Pico RP2040

[Raspberry Pi Pico RP2040](https://www.adafruit.com/product/4864)
The Raspberry Pi foundation changed single-board computing [when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new **Raspberry Pi Pico**. This...

In Stock
[Buy Now](https://www.adafruit.com/product/4864)
[Related Guides to the Product](https://learn.adafruit.com/products/4864/guides)
![Angle shot of Raspberry Pi Pico RP2040](https://cdn-shop.adafruit.com/640x480/4864-00.jpg)

You _only_ need the following right-angle connector if building with Raspberry Pi 4. Pico does not require it.

Using this particular right-angle connector _does_&nbsp;unfortunately block the HDMI ports; it’s implied that such a Pi would be used “headless,” as in an [OctoPrint](https://octoprint.org) server. If you _require_ HDMI out, you might find an upward-facing USB-C adapter elsewhere, a super-flexy cable, or more advanced folks might change up the wiring to allow using a 5V power adapter into the Pi’s breakout header (shared with the matrices).

### Right Angle USB Type C Adapter - USB 3.1 Gen 4 Compatible

[Right Angle USB Type C Adapter - USB 3.1 Gen 4 Compatible](https://www.adafruit.com/product/4432)
As technology changes and adapts, so does Adafruit, and speaking of _adapting_, this **_right angle_** &nbsp;_ **adapter** _&nbsp;is USB C socket-to-plug.

USB C is the latest industry-standard connector for transmitting...

In Stock
[Buy Now](https://www.adafruit.com/product/4432)
[Related Guides to the Product](https://learn.adafruit.com/products/4432/guides)
![Angled Shot of the Right Angle USB Type C Adapter - USB 3.1 Gen 4 Compatible.](https://cdn-shop.adafruit.com/640x480/4432-07.jpg)

## Parts Sourced Elsewhere

A well-stocked local hardware store might carry metric fasteners…but if not, these can be ordered online…

### Part: M2.5x8mm Screw
quantity: 12
M2.5x8mm Screw
[M2.5x8mm Screw](https://www.albanycountyfasteners.com/2-5-MM-x-45-Phillips-Flat-Head-Machine-Screw-p/1011-1002.htm)

### Part: M2.5x12mm Screws
quantity: 4
M2.5x12mm Screws
[M2.5x12mm Screws](https://www.albanycountyfasteners.com/2-5-MM-x-45-Phillips-Flat-Head-Machine-Screw-p/1011-1002.htm)

### Part: M3x6mm Screw
quantity: 4
M3x6mm Screw
[M3x6mm Screw](https://www.albanycountyfasteners.com/3-MM-x-5-Phillips-Flat-Head-Machine-Screw-p/1011-1006.htm)

## Other Tools and Materials

**You will need a soldering iron and related paraphernalia.** None of the soldering is especially challenging…but with eight of those matrices, it does require _patience._

**Wire cutters/strippers, small screwdriver,** typical electronics workbench stuff.

**Most of the case is 3-D printed** , so you’ll need a printer, or access to one. This can be made with basic black filament, or read on for alternatives…

![](https://cdn-learn.adafruit.com/assets/assets/000/110/850/medium800/raspberry_pi_hero-shelf.jpg?1650238921)

# Little Desktop Connection Machine

## 3D Printing

## Parts List

STL files for 3D printing are oriented to print "as-is" on FDM style machines. Parts are designed to 3D print without any support material. Original design source may be downloaded using the links below.

We used [Sparkly Glitter PLA Filament from ERYONE](https://amzn.to/3Ev5hIJ "Sparkly Glitter PLA Filament from ERYONE")

Minimum print bed dimensions are 150x150x150mm&nbsp;

![raspberry_pi_3d-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/883/medium640/raspberry_pi_3d-parts.jpg?1650240872)

[Edit Design](https://a360.co/4aXcela)
[Download STLs](https://www.thingiverse.com/thing:5359817)
[Edit STEP File](https://cdn-learn.adafruit.com/assets/assets/000/110/941/original/CM1_Cube_Connection_Machine-step.zip?1650412531)
[Download Acrylic Panel Template DXF](https://cdn-learn.adafruit.com/assets/assets/000/110/942/original/arcrylic-panel-template.zip?1650460402)
## Slicing Parts

&nbsp;

Supports are required. Slice with setting for PLA material.&nbsp;

The parts were sliced using CURA using the slice settings below.

- PLA filament 220c extruder
- 0.2 layer height (charlie-frame @ .15)
- 10% gyroid infill
- 60mm/s print speed
- 60c heated bed

![raspberry_pi_slice.gif](https://cdn-learn.adafruit.com/assets/assets/000/110/882/medium640thumb/raspberry_pi_slice.jpg?1650240788)

## Supports

&nbsp;

- Support Extrusion Width: .2
- Support Density: 4%
- Support Overhang Angle: 70
- Support Z Height: .21
- Interface: Off
- Support Roof: Off
- Support Pattern: Zig Zag

## Build Plate Adhesion&nbsp;

&nbsp;

- Type: Brim
- Line Count: 4
- Brim on outside

![raspberry_pi_supports-clean.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/884/medium640/raspberry_pi_supports-clean.jpg?1650242998)

## Acrylic Panels

The four LED diffusion panels are slightly rectangular: 62 mm wide by 60.5 mm tall. There are a few ways these can be made:

- The score-and-snap method, using a straightedge and plastic scoring tool or back of an X-Acto blade. Wear eye protection!
- CNC milling.
- Laser cutting. If purchasing the LED diffusion acrylic from a retail source like TAP Plastics,&nbsp;some offer laser cutting services for a modest fee…or some makerspaces have a laser cutter for member use.

![](https://cdn-learn.adafruit.com/assets/assets/000/110/916/medium800/raspberry_pi_hero-dino.jpg?1650375825)

# Little Desktop Connection Machine

## Assemble

Here’s a wiring schematic for the **Raspberry Pi** version. Refer back to this when getting to later steps:

![](https://cdn-learn.adafruit.com/assets/assets/000/110/902/medium800/raspberry_pi_cm1-pi-frotz.png?1650317019)

Color-coded by function:

Notice there are _two groups_ of _four matrices_ each. Each group gets wired to a different I2C bus.&nbsp; **Specific pin numbers will be discussed later.**

And here’s a similar diagram for **Pico RP2040** :

![](https://cdn-learn.adafruit.com/assets/assets/000/110/904/medium800/raspberry_pi_cm1-pico-frotz.png?1650318627)

## Build Steps
## Prep Wires

Silicone female-to-female jumper wires will be used to link the matrices to header pins on the Raspberry Pi or Pico.

**5 each** of **four colors** are sufficient to build two sets of wiring harnesses. **Cut these in half** to produce **40 half-wires** total, and **strip** about 1 cm of insulation from all the cut wire ends.

Twist **four same-color wires** together facing the same way, then twist **one more wire from the other direction** to produce a **four-way splitter** cable. **Solder** where these wires all meet, then cover the exposed solder joint with **heat-shrink tubing**.

![raspberry_pi_jumpers-heat-shirk-sq.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/860/medium640/raspberry_pi_jumpers-heat-shirk-sq.jpg?1650239185)

![raspberry_pi_jumpers-bundle.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/861/medium640/raspberry_pi_jumpers-bundle.jpg?1650239685)

 **Repeat** the process above to produce **eight** such 4-way splitters in total, two each for power, ground, I2C data and clock.&nbsp;You can optionally use a bit more heat-shrink to tidy up the wire bundles.

## Connect Cases

Align the case parts and use four M2.5x12mm screws to fasten together.&nbsp;

## Attach Frames

Use M2.5x8mm screws to attach the LED frames to the stand-offs inside the case.

![raspberry_pi_case-screw.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/862/medium640/raspberry_pi_case-screw.jpg?1650239354)

![raspberry_pi_case-frames.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/863/medium640/raspberry_pi_case-frames.jpg?1650239391)

## Solder Driver&nbsp;

Solder the longer end of the header pins towards the back of the driver board. The short side of the header pins face the LEDs and the acrylic sheets.

## Solder Address Pads

Each matrix controller within a group of four must be assigned a unique I2C address, settable with solder bridges on the back. The first matrix can be left alone, using the default address of 0x74. The other three should get a single solder bridge, setting them to address 0x75, 0x76 and 0x77, respectively. Repeat for both sets of four.

![raspberry_pi_charlie-ids.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/864/medium640/raspberry_pi_charlie-ids.jpg?1650239524)

![raspberry_pi_charlie-layout.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/865/medium640/raspberry_pi_charlie-layout.jpg?1650240278)

Assembling the matrix-and-driver sandwich is explained in greater detail [in this guide](https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver/assembly).

## Solder Connection headers

Solder four header pins to each matrix. Solder the shorter pins to the driver board. The longer pins face away from the driver board and connect to the female jumper wires.

Primary: 

## Attach Charlie LED Matrices&nbsp;

Position each matrix in the order shown in the schematic at top, and with the four pin header connection towards the bottom. Leftmost matrix _as seen from the front_ will be 0x74. From the back, these will be in the opposite order.

## Attach Acrylic

The Black LED Acrylic slides over the matrices.

![raspberry_pi_case-charlie-attach.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/872/medium640/raspberry_pi_case-charlie-attach.jpg?1650240540)

![raspberry_pi_case-acrylic-attach.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/873/medium640/raspberry_pi_case-acrylic-attach.jpg?1650240544)

## Plug in Jumpers

Connect each jumper to the corresponding header pin on each matrix, and to the Pi or Pico as shown in the corresponding wiring diagram at the top of this page.

## Attach Vents

The back vents press fit into the walls around each cube.

![raspberry_pi_jumpers-charlie-connect.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/874/medium640/raspberry_pi_jumpers-charlie-connect.jpg?1650240654)

![raspberry_pi_vent-attach.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/879/medium640/raspberry_pi_vent-attach.jpg?1650240658)

## Mount Pi or Pico

&nbsp;

Use M3x6mm long screws to mount Raspberry Pi computer. The USB port align the cutout on the bottom case.

The Raspberry Pico mounts what an addition frame over the stand-offs on the bottom case.

&nbsp;

## Attach Bottom Case

Use four M2.5x8mm screws to attach the bottom case.&nbsp;

![raspberry_pi_pi-right-angle-mount.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/875/medium640/raspberry_pi_pi-right-angle-mount.jpg?1650240157)

![raspberry_pi_pico-mount.jpg](https://cdn-learn.adafruit.com/assets/assets/000/110/876/medium640/raspberry_pi_pico-mount.jpg?1650240224)

As mentioned on the Overview page, **the USB right-angle connector will block the HDMI ports**. This is fine for “headless” use, as with an [OctoPrint](https://octoprint.org) server. If you _require_ HDMI out, you’ll need to improvise with a different USB adapter or cable.

![](https://cdn-learn.adafruit.com/assets/assets/000/110/880/medium800/raspberry_pi_hero-cnc.jpg?1650240462)

# Little Desktop Connection Machine

## Code (Raspberry Pi)

![](https://cdn-learn.adafruit.com/assets/assets/000/110/877/medium800/raspberry_pi_code-pi.jpg?1650240246)

Glad you’re here! The **Raspberry Pi** code has _all_ the bells and whistles. This will be discussed in a moment, but first…

## System Setup

Basic Raspberry Pi setup is [already covered in other guides](https://learn.adafruit.com/adafruit-raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi/raspberry-pi-imager)… so if this is your first time, start there. You can do these initial steps with the Pi outside the case and without the matrices wired up.

Pi power users may have their own setup ritual, but for most folks we recommend using [Raspberry Pi Imager](https://www.raspberrypi.com/software/) to create a bootable micro SD card.

Choose “**Raspberry Pi OS Lite (32-bit)**” as the operating system. If you require a GUI, use “Desktop (32-bit)” instead…but see prior notes that the HDMI ports may be inaccessible once in the case. **Avoid the 64-bit OS versions** for now…these are cutting-edge and often problematic.

![raspberry_pi_pi-imager.png](https://cdn-learn.adafruit.com/assets/assets/000/110/917/medium640/raspberry_pi_pi-imager.png?1650386476)

Click the gear icon, or&nbsp;press Control+Shift+X (Windows) or ⌘+Shift+X (Mac), to show advanced options. Essential system info (hostname, WiFi network, etc.) can all be configured before the system is even booted the first time…it’s _so much_ easier this way! _Tip: remember to also set the Wireless LAN country to get WiFi working._

So suppose at this point you have a Raspberry Pi that’s booted and accessible via an _ssh_ remote session…

## Prerequisite Software and Setup
First is to edit the system **/boot/config.txt** file, which must be done as root via the “sudo” command:

```auto
sudo nano /boot/config.txt
```

(You can substitute your editor of preference in place of “nano.” I’m strange and actually like _vi._)

Append the following two lines to the end of the file. Just copy-and-paste them verbatim, as the syntax is very persnickety:

```auto
dtoverlay=i2c-gpio,bus=2,i2c_gpio_scl=17,i2c_gpio_sda=27,i2c_gpio_delay_us=1
dtoverlay=i2c-gpio,bus=3,i2c_gpio_scl=23,i2c_gpio_sda=24,i2c_gpio_delay_us=1
```

Save changes to the file.&nbsp;This will enable two “soft” I2C buses on specific GPIO pins. _You can use different pins if both the software and wiring are changed to match, but don’t do this unless other hardware you’re interfacing specifically demands it. Most users should stick with the plan._

### Extra Steps for the Audio Visualizer Only

This optional part of the project requires the [Mini USB Microphone](https://www.adafruit.com/product/3367) mentioned on the Overview page. **If you don’t have this part or don’t want the visualizer, you can skip ahead to “Continue Setup” below.**

We’ll do the audio setup&nbsp;_before_ the other software, as it then requires fewer reboots.

Enter these commands:

```auto
sudo apt-get install python3-pip libatlas-base-dev libportaudio2
pip3 install numpy pyaudio
```

Answer “Y” when asked about installing packages.

Following installation, one must then edit the system’s&nbsp;_ALSA_ configuration, which is related to sound input and output:

```auto
sudo nano /usr/share/alsa/alsa.conf
```

(As before, substitute your editor of preference in place of _nano._)

Look for these two lines, starting around line 76:

```auto
defaults.ctl.card 0
defaults.pcm.card 0
```

Change these to:

```auto
defaults.ctl.card 1
defaults.pcm.card 1
```

Save changes to this file and exit the editor.

### Continue Setup

With or without the audio visualizer, _all_ installations will require the following sequence of commands (please use the “Copy Code” button and paste into the Pi’s terminal window…some of these are single long lines that might appear wrapped here):

```auto
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3-pip libopenjp2-7 subversion
sudo pip3 install --upgrade setuptools adafruit-python-shell psutil adafruit-extended-bus adafruit-circuitpython-is31fl3731 pillow
wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/raspi-blinka.py
sudo python3 raspi-blinka.py
```

Answer “Y” when asked about upgrading or installing packages.

That last step—the **raspi-blinka.py** script—will ask to **reboot** the system when finished. Play along, answer “Y,” and log back into the system once it’s rebooted.

FYI: _Blinka_ is a package for running CircuitPython (microcontroller) code on “real” computers like Raspberry Pi. It allows leveraging hardware-specific libraries for talking to the LED matrices, for instance. Pretty cool. [There’s an entire guide](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux) if you’d like to learn more.

## Download Project Code and Test

All the system configuration is done, and now to fetch the project code:

```auto
svn export https://github.com/adafruit/Adafruit_Learning_System_Guides/trunk/LittleConnectionMachine
cd LittleConnectionMachine/RaspberryPi
```

Start with the simplest of the examples, some animated lights inspired by the CM-5 control room computer in _Jurassic Park_:

**python chaser.py**

If all goes well, this will simply run, lighting all 8 matrices with animated bit patterns. Press CONTROL+C to stop.

If you’re seeing a **RuntimeError** or **ValueError** message from the system, it’s usually one of these things:

- An SDA/SCL wire pair is swapped, either on the Raspberry Pi header or on one or more matrices.
- SDA and/or SCL are connected to the wrong pin(s).
- Address select pads on one or more matrices are not correctly set; multiple matrices on the same I2C bus are set to the same address.
- A poorly-soldered connection in one of the 4-way splitters.

Remember there are _two_ I2C buses at play here, each with _four_ matrices, each of which should have a unique address on that bus.

For posterity, here’s that wiring diagram again:

![](https://cdn-learn.adafruit.com/assets/assets/000/110/932/medium800/raspberry_pi_cm1-pi-frotz.png?1650393839)

From a programming perspective, **chaser.py** is the simplest of the examples, as it doesn’t tie into any obscure system services…it just animates the lights. If creating your own programs for the Little Connection Machine, this is a good starting point.

Then there’s the classic supercomputer _blinkenlights:_

 **python cpuload.py**

The amount of pixels lit is proportional to the current system workload.&nbsp;Left running in the background…when compiling and debugging two million lines of code to run a dinosaur theme park, you’ll see this really light up! CONTROL-C to stop.

If you have the **USB microphone** installed and did the **extra setup** earlier, you can try the third example:

 **python audio.py**

This will react to music and sounds within earshot…higher frequencies toward the top of the matrices, lower frequencies toward the bottom. CONTROL+C to exit.

If this fails to run, double-check the ALSA configuration that was described earlier. It’s notoriously picky.

If this runs but the image appears jumbled, the LED matrices are arranged in the wrong order. The wiring diagram shows the address for each matrix.

## Auto-Starting on Boot-Up
The preferred way to do this nowadays is via the _systemd_ service. Begin by creating&nbsp;a _unit file_ for this service…

```auto
sudo nano /lib/systemd/system/cm1.service
```

Copy-and-paste the following into the new file, editing the “ExecStart” line to reference which of the Python scripts you’d like to run. Can also change the directory name, if you’ve moved or called it something else:

```auto
[Unit]
Description=CM-1 Service
After=multi-user.target

[Service]
Type=idle
ExecStart=/usr/bin/python /home/pi/LittleConnectionMachine/RaspberryPi/chaser.py

[Install]
WantedBy=multi-user.target
```

Save this file and exit the editor.

A few commands then enable this new service and will launch it on startup:

```auto
sudo systemctl daemon-reload
sudo systemctl enable cm1.service
sudo reboot
```

To change which program is loaded on startup, just edit&nbsp; **/lib/systemd/system**** /cm1.service **and change the** ExecStart** line, and reboot. No need to repeat the systemctl commands.

# Little Desktop Connection Machine

## Code (CircuitPython)

![](https://cdn-learn.adafruit.com/assets/assets/000/110/912/medium800/raspberry_pi_code-pico.jpg?1650325456)

If you’d be satisfied with just the _blinkenlights_ part of the project (this is what most people are after!), we can do this with a **Pico RP2040 microcontroller board** replacing the Raspberry Pi 4. No complex operating system to boot up, it’s even easier to set up and use.

If you know your way around code and hardware a bit, actually _any_ CircuitPython-compatible board with two I2C buses can work. The Pico is super inexpensive and readily available though, so it is used as the reference design.

## **If this is your first time using CircuitPython on the Pico RP2040 board, [please begin with this guide](https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython) which provides an introduction and download & installation instructions.**
So at this point, you should have CircuitPython installed on the Pico board.

To download the code for this project, click the “ **Download Project Bundle** ” button below. This brings together some required CircuitPython libraries, so everything is quickly and easily copied to the **CIRCUITPY** drive.

**If you currently have a CircuitPython project on the Pico board, copy the files off to somewhere for safe keeping.**

Unzip the project bundle archive, look inside the resulting folder (a couple layers down if needed), and copy the **code.py** file and **lib** folder to the **CIRCUITPY** drive. The drive contents should then appear like so (you can ignore the **boot\_out.txt** file, it’s auto-generated on startup):

![](https://cdn-learn.adafruit.com/assets/assets/000/110/915/medium800/raspberry_pi_cm1-drive-contents.png?1650330629)

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/LittleConnectionMachine/CircuitPython/code.py

If everything’s connected correctly and the code and libraries installed in the right place, you should get the blinkies. And that’s it! Just plug it into USB any time you need it.

**If things do not work** , you’ll want to open a serial connection to the CircuitPython console (such as with the Mu editor) and see what error messages it’s displaying. **This is explained in the introductory CircuitPython guide previously mentioned.**

For posterity, here’s that wiring diagram, showing the connections for this board:

![](https://cdn-learn.adafruit.com/assets/assets/000/110/914/medium800/raspberry_pi_cm1-pico-frotz.png?1650327044)

If you see a **RuntimeError** or **ValueError** message in the serial console, it’s usually one of these things:

- An SDA/SCL wire pair is swapped, either on the Pico board or on one or more matrices.
- SDA and/or SCL are connected to the wrong pin(s).
- Address select pads on one or more matrices are not correctly set; multiple matrices on the same I2C bus are set to the same address.
- A poorly-soldered connection in one of the 4-way splitters.

Remember there are _two_ I2C buses at play here, each with _four_ matrices, each of which should have a unique address on that bus.

## “Do as I say, not as I do”

This code does things that would get you an “F” in any programming class, so please don’t look to it as a shining example of anything.

The **adafruit\_is31fl3731** library normally provides easy X/Y pixel-setting functions and robust exception handling. Any well-behaved code really should be using the functions provided there, [as documented in this guide](https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver/python-circuitpython).&nbsp;If you want to display other things on your Little Connection Machine and don’t need super-frequent updates, _please_ program it that way…or build the Raspberry Pi version.

In order to get fast updates on the LED matrices, this project’s code plays games with the **adafruit\_is31fl3731** library to dump data directly to the matrices, bypassing the aforementioned functions. It relies on the fact that it’s _just a random bit pattern,_ that there’s no coherent order that must be followed to produce an image. Handling that would add _inordinate_ complexity to this code.

Such complexity is something the Raspberry Pi is perfectly equipped to handle… and if you go looking into the Pi code, you’ll see it treats all the matrices as if a single contiguous image, with numerous drawing and image-loading functions available through _PIL,_ the Python Imaging Library. The CircuitPython blinky code is just parlor tricks…and that’s why it’s the only example we provide there.


## Featured Products

### Adafruit 16x9 Charlieplexed PWM LED Matrix Driver - IS31FL3731

[Adafruit 16x9 Charlieplexed PWM LED Matrix Driver - IS31FL3731](https://www.adafruit.com/product/2946)
The IS31FL3731 will let you get back to that classic LED matrix look, with a nice upgrade!&nbsp; **This I2C LED driver chip has the ability to PWM each individual LED in a 16x9 grid** &nbsp;so you can have beautiful LED lighting effects, without a lot of pin twiddling. Simply tell...

In Stock
[Buy Now](https://www.adafruit.com/product/2946)
[Related Guides to the Product](https://learn.adafruit.com/products/2946/guides)
### LED Charlieplexed Matrix - 9x16 LEDs - Red

[LED Charlieplexed Matrix - 9x16 LEDs - Red](https://www.adafruit.com/product/2947)
These are 9x16 Charlieplexed LEDs designed to match with the&nbsp;[Adafruit 16x9 Charlieplexed PWM LED Matrix Driver -&nbsp;IS31FL3731](https://www.adafruit.com/products/2946). You don't get any resistors or driver chips with this grid, its just a mess of LEDs in a charlieplexed...

In Stock
[Buy Now](https://www.adafruit.com/product/2947)
[Related Guides to the Product](https://learn.adafruit.com/products/2947/guides)
### Black LED Diffusion Acrylic Panel - 10.2" x 5.1"

[Black LED Diffusion Acrylic Panel - 10.2" x 5.1"](https://www.adafruit.com/product/4749)
&nbsp;nice whoppin' rectangular slab of some lovely black acrylic to add some extra diffusion to your LED Matrix project. This material is 2.6mm (0.1") thick and is made of special cast acrylic that makes it perfect for glowy projects, especially matrices or NeoPixels.

Unlike...

In Stock
[Buy Now](https://www.adafruit.com/product/4749)
[Related Guides to the Product](https://learn.adafruit.com/products/4749/guides)
### Raspberry Pi 4 Model B - 1 GB RAM

[Raspberry Pi 4 Model B - 1 GB RAM](https://www.adafruit.com/product/4295)
The Raspberry Pi 4 Model B is the newest Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing _better_! And what could make the Pi 4 better than the 3? How about a&nbsp;_faster_ processor, USB 3.0 ports, and updated Gigabit Ethernet chip with...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4295)
[Related Guides to the Product](https://learn.adafruit.com/products/4295/guides)
### Raspberry Pi Pico RP2040

[Raspberry Pi Pico RP2040](https://www.adafruit.com/product/4864)
The Raspberry Pi foundation changed single-board computing [when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new **Raspberry Pi Pico**. This...

In Stock
[Buy Now](https://www.adafruit.com/product/4864)
[Related Guides to the Product](https://learn.adafruit.com/products/4864/guides)
### Premium Silicone Covered Female-Female Jumper Wires - 200mm x 40

[Premium Silicone Covered Female-Female Jumper Wires - 200mm x 40](https://www.adafruit.com/product/4447)
These premium female-female jumper wires are handy for making wire harnesses or jumpering between headers on PCBs. They're&nbsp;200mm (~7.8") long and come loose as a pack of 40&nbsp;(10&nbsp;pieces of red, blue, yellow, and Adafruit black). They have 0.1" female header contacts...

In Stock
[Buy Now](https://www.adafruit.com/product/4447)
[Related Guides to the Product](https://learn.adafruit.com/products/4447/guides)
### Heat Shrink Pack

[Heat Shrink Pack](https://www.adafruit.com/product/344)
Heat shrink is the duct tape of electronics, it keeps your stuff all safe and kept together. Especially when wiring and soldering, use heat shrink to add mechanical strength to cables. We use this stuff all the time and having a zip-lock bag of all the possible sizes is super...

In Stock
[Buy Now](https://www.adafruit.com/product/344)
[Related Guides to the Product](https://learn.adafruit.com/products/344/guides)
### Right Angle USB Type C Adapter - USB 3.1 Gen 4 Compatible

[Right Angle USB Type C Adapter - USB 3.1 Gen 4 Compatible](https://www.adafruit.com/product/4432)
As technology changes and adapts, so does Adafruit, and speaking of _adapting_, this **_right angle_** &nbsp;_ **adapter** _&nbsp;is USB C socket-to-plug.

USB C is the latest industry-standard connector for transmitting...

In Stock
[Buy Now](https://www.adafruit.com/product/4432)
[Related Guides to the Product](https://learn.adafruit.com/products/4432/guides)

## Related Guides

- [IS31FL3731 16x9 Charlieplexed PWM LED Driver](https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver.md)
- [Raspberry Pi Care and Troubleshooting](https://learn.adafruit.com/raspberry-pi-care-and-troubleshooting.md)
- [Animated Flame Pendant](https://learn.adafruit.com/animated-flame-pendant.md)
- [I2C Addresses and Troublesome Chips](https://learn.adafruit.com/i2c-addresses.md)
- [CircuitPython Hardware: Charlieplex LED Matrix](https://learn.adafruit.com/micropython-hardware-charlieplex-led-matrix.md)
- [Mini Commodore PET with Charlieplexed LED Matrix](https://learn.adafruit.com/mini-commodore-pet-with-charlieplexed-led-matrix.md)
- [MIDI Breath Controller](https://learn.adafruit.com/midi-breath-controller.md)
- [Adafruit Wii Nunchuck Breakout Adapter](https://learn.adafruit.com/adafruit-wii-nunchuck-breakout-adapter.md)
- [Using EduBlocks with Circuit Playground Express](https://learn.adafruit.com/using-edublocks-with-circuit-playground-express.md)
- [Adafruit IO Basics: Digital Output](https://learn.adafruit.com/adafruit-io-basics-digital-output.md)
- [Bricktunes: LEGO Synthesizer Glove](https://learn.adafruit.com/bricktunes-lego-glove-synthesizer.md)
- [CircuitPython Hardware: MPR121 Capacitive Touch Breakout](https://learn.adafruit.com/circuitpython-hardware-mpr121-capacitive-touch-breakout.md)
- [File Glider](https://learn.adafruit.com/file-glider.md)
- [Pip-Boy 2040 Wrist-Mounted Prop](https://learn.adafruit.com/pip-boy-2040.md)
- [PyPortal IoT Weather Station](https://learn.adafruit.com/pyportal-iot-weather-station.md)
- [Four Channel Audio Passive Stereo Mixer](https://learn.adafruit.com/four-channel-audio-passive-stereo-mixer.md)
