# Severance Portable Macrodata Refinement Terminal

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/135/652/medium800thumb/raspberry_pi_playing.jpg?1741106752)

> The work is mysterious and important.

Welcome to Lumon Industries, making life better for all humankind since 1865. In your service to Lumon as a severed employee, you will partake in the Macrodata Refinement department. You will work on your newly designed terminal that allows for portability on the severed floor; a further commitment from Lumon to improve the conditions for severed employees ever since the Macrodat Uprising that your colleagues bravely organized. The next time you are granted a hall pass, feel free to carry the portable terminal by its sleek handle to your preferred area, whether it be the calming Plant Room, the inspiring Perpetuity Wing or the idyllic Mammalians Nurturable Department.

This project is built around a Raspberry Pi 5 running Python code inspired by the Macrodata Refinement program in the TV show Severance. A DRV2605L breakout vibrates a small haptic motor as your cursor gets closer to the intimidating numbers on the screen. A Raspberry Pi Touch Display 2 is used for the screen.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/656/medium640/raspberry_pi_edited_P1450730.jpg?1741108173)

You can toggle between the bouncing screensaver and your Macrodata file with the right-click button. When you right-click, you also save your progress on your file.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/653/medium640thumb/raspberry_pi_toggle.jpg?1741106813)

A piece of acrylic gives you access to the back of your MDR terminal, letting you store your trackball and power supply for on-the-go refining during your next overtime contingency protocol or ORTBO.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/654/medium640thumb/raspberry_pi_slidingAcrylic.jpg?1741106958)

When you complete your file, you'll be invited to praise Kier with the hopes of a waffle party in your future.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/655/medium640thumb/raspberry_pi_100percentAction.jpg?1741107395)

## Parts
### Raspberry Pi 5 - 4 GB RAM

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

In Stock
[Buy Now](https://www.adafruit.com/product/5812)
[Related Guides to the Product](https://learn.adafruit.com/products/5812/guides)
![Angled shot of green Raspberry Pi 5 microcontroller.](https://cdn-shop.adafruit.com/640x480/5812-01.jpg)

### Official Raspberry Pi 5 Active Cooler

[Official Raspberry Pi 5 Active Cooler](https://www.adafruit.com/product/5815)
The **Raspberry Pi 5 Active Cooler** is compatible with the [Raspberry Pi 5](https://www.adafruit.com/search?q=raspberry+pi+5) and the [Raspberry Pi 5 Case](http://www.adafruit.com/product/5816). Designed for anyone who wants to push the performance of their...

In Stock
[Buy Now](https://www.adafruit.com/product/5815)
[Related Guides to the Product](https://learn.adafruit.com/products/5815/guides)
![Angled shot of a cooling fan installed on a green microcontroller.](https://cdn-shop.adafruit.com/640x480/5815-04.jpg)

### Raspberry Pi Touch Display 2 - 7" 720x1280 with Capacitive Touch

[Raspberry Pi Touch Display 2 - 7" 720x1280 with Capacitive Touch](https://www.adafruit.com/product/6079)
 **Raspberry Pi Touch Display 2** is the sequel to the popular [Raspberry Pi Official Display](https://www.adafruit.com/product/2718).&nbsp;Like the original, it's a 7′′ touchscreen display for Raspberry Pi. Unlike the original, it has a much higher...

In Stock
[Buy Now](https://www.adafruit.com/product/6079)
[Related Guides to the Product](https://learn.adafruit.com/products/6079/guides)
![Overhead shot of a Black hand with red manicure drawing a rectangle on a touchscreen landscape-style.](https://cdn-shop.adafruit.com/640x480/6079-06.jpg)

### Panel Mount Glowing Trackball

[Panel Mount Glowing Trackball](https://www.adafruit.com/product/5060)
_"'There is one who may claim it by right. For this assuredly is the&nbsp;_palantír_&nbsp;of Orthanc from the treasury of Elendil, set here by the Kings of Gondor. Now my hour draws near. I will take it.'" –Aragorn II Elessar_

This...

In Stock
[Buy Now](https://www.adafruit.com/product/5060)
[Related Guides to the Product](https://learn.adafruit.com/products/5060/guides)
![Close-up of a hand on a blue glowing trackball.](https://cdn-shop.adafruit.com/640x480/5060-04.jpg)

### Adafruit DRV2605L Haptic Motor Controller - STEMMA QT / Qwiic

[Adafruit DRV2605L Haptic Motor Controller - STEMMA QT / Qwiic](https://www.adafruit.com/product/2305)
The DRV2605 from TI is a fancy little motor driver. Rather than controlling a stepper motor or DC motor, its designed specifically for controlling **haptic** motors - buzzers and vibration motors. Normally one would just turn those kinds of motors on and off, but this driver has...

In Stock
[Buy Now](https://www.adafruit.com/product/2305)
[Related Guides to the Product](https://learn.adafruit.com/products/2305/guides)
![Video of a haptic controller breakout board with a vibrating motor disc soldered to it. The disc vibrates against the surface.](https://cdn-shop.adafruit.com/product-videos/640x480/2305-05.jpg)

2x of the NeoKey Breakouts

### NeoKey Socket Breakout for Mechanical Key Switches with NeoPixel

[NeoKey Socket Breakout for Mechanical Key Switches with NeoPixel](https://www.adafruit.com/product/4978)
The only thing better than a nice mechanical key, is one that also can glow any color of the rainbow - and that's what the **Adafruit NeoKey Breakout** will let you do! This little 0.75" x 0.85" PCB can fit one **Cherry MX or compatible switch** and make...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4978)
[Related Guides to the Product](https://learn.adafruit.com/products/4978/guides)
![Video of breakout PCB installed on breadboard with key caps and switches. A finger reaches down to press the keys which light up rainbow colors.](https://cdn-shop.adafruit.com/product-videos/640x480/4978-07.jpg)

### 16mm Panel Mount Momentary Pushbutton -  Black

[16mm Panel Mount Momentary Pushbutton -  Black](https://www.adafruit.com/product/1505)
OK, this item is pretty simple - it's a panel mount pushbutton. It's not that exciting, no LEDs, no bells & whistles. But we really like it anyways – look at that lovely rounded shape, that elegant bevel. If you're going to go with a momentary pushbutton, let it be this...

In Stock
[Buy Now](https://www.adafruit.com/product/1505)
[Related Guides to the Product](https://learn.adafruit.com/products/1505/guides)
![Angled shot of 16mm black panel mount pushbutton.](https://cdn-shop.adafruit.com/640x480/1505-05.jpg)

### Part: Kailh Mechanical Key Switch
quantity: 2
Clicky Blue
[Kailh Mechanical Key Switch](https://www.adafruit.com/product/5123)

### Part: Cyan MA Keycaps
quantity: 1
for MX Compatible Switches - 5 pack
[Cyan MA Keycaps](https://www.adafruit.com/product/5174)

### Part: Vibrating Mini Motor Disc
quantity: 1
Vibrating Mini Motor Disc
[Vibrating Mini Motor Disc](https://www.adafruit.com/product/1201)

### Part: STEMMA QT / Qwiic JST SH 4-pin Cable
quantity: 1
Socket
[STEMMA QT / Qwiic JST SH 4-pin Cable](https://www.adafruit.com/product/4397)

### Part: SD/MicroSD Memory Card
quantity: 1
16GB Class 10 - Adapter Included
[SD/MicroSD Memory Card](https://www.adafruit.com/product/2693)

### Part: 27W PD Power Supply 5.1V 5A with USB C
quantity: 1
Official Raspberry Pi
[27W PD Power Supply 5.1V 5A with USB C](https://www.adafruit.com/product/5814)

### Part: Silicone Cover Stranded-Core Wire
quantity: 1
30AWG in Various Colors
[Silicone Cover Stranded-Core Wire](https://www.adafruit.com/product/2051)

### Part: Black Nylon Machine Screw and Stand-off Set
quantity: 1
M2.5 Thread
[Black Nylon Machine Screw and Stand-off Set](https://www.adafruit.com/product/3299)

### Part: Adafruit CSI or DSI Cable Extender Thingy
quantity: 1
Adafruit CSI or DSI Cable Extender Thingy
[Adafruit CSI or DSI Cable Extender Thingy](https://www.adafruit.com/product/3671)

### Part: Flex Cable for Raspberry Pi Camera or Display
quantity: 1
300mm / 12"
[Flex Cable for Raspberry Pi Camera or Display](https://www.adafruit.com/product/1648)

### Part: JST PH 2-Pin Cable
quantity: 1
Socket Connector 100mm
[JST PH 2-Pin Cable](https://www.adafruit.com/product/261)

### Part: JST PH 2mm 4-Pin to Pin Header Cable
quantity: 1
200mm
[JST PH 2mm 4-Pin to Pin Header Cable](https://www.adafruit.com/product/3955)

### Part: 2.0mm Pitch Connector Kit
quantity: 1
JST PH Compatible
[2.0mm Pitch Connector Kit](https://www.adafruit.com/product/4422)

### Part: Right angle USB A extender
quantity: 1
Right angle USB A extender
[Right angle USB A extender](https://www.amazon.com/dp/B0BY8ZFGWY)

# Severance Portable Macrodata Refinement Terminal

## Circuit Diagram

![](https://cdn-learn.adafruit.com/assets/assets/000/135/663/medium800/raspberry_pi_severance_fritz_bb.jpg?1741115123)

### Raspberry Pi

- Haptic breakout GND to Pi GND (black wire)
- Haptic breakout VIN to Pi 3.3V (red wire)
- Haptic breakout SDA to Pi SDA (blue wire)
- Haptic breakout SCL to Pi SCL (yellow wire)
- Haptic breakout + to vibration motor + (red wire)
- Haptic breakout - to vibration motor - (black wire)
- Pi Display VIN to Pi 5V (red wire)
- Pi Display GND to Pi GND (black wire)
- Button input to Pi power button input (red wire)
- Button GND to Pi power button GND (black wire)

### NeoKey Breakouts

- Left-click NeoKey A to JST-PH white wire
- Right-click NeoKey A to JST-PH black wire
- Left-click NeoKey C to JST-PH red wire
- Left-click NeoKey C to right-click NeoKey (red wire)

# Severance Portable Macrodata Refinement Terminal

## 3D Printing

![](https://cdn-learn.adafruit.com/assets/assets/000/135/598/medium800/raspberry_pi_edited_P1450696.jpg?1741036477)

You can 3D print all of the parts for this project. There is a terminal chassis and a mouse enclosure inspired by the design of the Macrodata Refinement terminals on Severance. The back of the chassis can utilize a piece of acrylic or be 3D printed.

The STL files can be downloaded directly here or from Printables.

[Severance_Terminal_CAD.zip](https://cdn-learn.adafruit.com/assets/assets/000/135/666/original/Severance_Terminal_CAD.zip?1741119214)
[Printables Download](https://www.printables.com/model/1216686-portable-macrodata-refinement-terminal)
## Parts

- Electronics mount - mount for the display, haptic breakout and Raspberry Pi. Print one, no supports.
- Terminal front plate - press fits in the front of the chassis. Print one, no supports.
- Terminal case - main enclosure for the terminal. Print one, supports required. More info below.
- Terminal back plate - slides into a track in the back of the chassis to allow for access to the electronics and storing the mouse. Can be cut from acrylic or printed with no supports.
- Terminal handle - handle for carrying and propping the chassis. Print one, build plate supports.
- Handle knobs - knobs to secure the handle to the case. Print two, no supports.
- Back plate knob - attaches to the back plate to provide a grip for sliding. Print one, no supports; color change for the knob.
- Mouse enclosure - enclosure for the trackball and NeoKey breakouts. Print one, no supports.
- Mouse mount - mount for the trackball and NeoKey breakouts. Print one, no supports.
- Mouse lid - flat lid that press fits into the mouse enclosure. Print one, no supports.

The terminal case is a really large print. You'll probably need to angle it and print it standing upright with supports to allow it to fit on your build plate if you have an average sized printer. Tree supports work really well for this print.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/640/medium640/raspberry_pi_Screenshot_2025-03-03_183208.png?1741044760)

## Acrylic
If you choose to use acrylic for the back of the case, you'll cut a piece that is 10" x 4" (25.4 cm x 10.16 cm).

![](https://cdn-learn.adafruit.com/assets/assets/000/135/642/medium640/raspberry_pi_edited_P1450690.jpg?1741045005)

## Design Inspiration

The terminal computers in Severance are inspired by the [Data General 6053 terminal](https://terminals-wiki.org/wiki/index.php/Data_General_6053). A [few 3D printed replicas](https://www.thingiverse.com/thing:6948380) have [been created](https://github.com/andrewchilicki/LumonMDR) and I thought it would be fun to imagine a portable version that could live within the Severance universe. I took inspiration from the [Sears Go Anywhere TV Radio](https://www.radiomuseum.org/r/sears_roeb_go_anywhere_tv_radio_3_way_50382_model_no.html) that were manufactured around the same time as the Data General terminal (late 1970s).

# Severance Portable Macrodata Refinement Terminal

## Python Virtual Environment Prep

As Carter writes in his [Python Virtual Environment Usage on Raspberry Pi guide](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi/overview):

> Starting with the October 10, 2023&nbsp;[Bookworm release](https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/)&nbsp;of the&nbsp;[Raspberry Pi OS](https://www.raspberrypi.com/software/), the use of&nbsp;[Python Virtual Environments](https://docs.python.org/3/tutorial/venv.html)&nbsp;(venv) when pip installing packages is required.&nbsp; **No more sudo pip**. This will break things and require learning new things. Yeah.

You will need to setup a Python virtual environment (venv) on your Raspberry Pi 5 for this project. Don't worry though! If you follow along with the guide step by step, you'll be just fine.

### Python Virtual Environment Usage on Raspberry Pi - Basic Venv Usage

[Python Virtual Environment Usage on Raspberry Pi](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi)
[Basic Venv Usage](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi/basic-venv-usage)
## Always venv

On the [Other Ideas page](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi/other-ideas) in the venv guide, there is a tip for having the virtual environment enabled automatically at boot by editing the `.bashrc` file (`sudo nano .bashrc`) and adding this line to the bottom:

```python
source home/user/venv/bin/activate
```

Where `venv` is the name of your virtual environment. You can take this a step further by [adding the alias](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi/usage-with-sudo#option-1-invoke-with-sudo-passing-environment-3157502) for running Python scripts as `sudo` to your `.bashrc` file as well:

```python
alias gogo='sudo -E env PATH=$PATH python'
```

You can change `gogo` to any command you want. This way, every time you boot up your Pi, you'll have your Python venv enabled and you'll be able to use your alias for running Python scripts.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/648/medium800/raspberry_pi_20250228_15h44m50s_grim.png?1741103373)

# Severance Portable Macrodata Refinement Terminal

## Installing Blinka on Raspberry Pi

Info: 

Warning: 

# Prerequisite Pi Setup!

In this page we'll assume you've already gotten your Raspberry Pi up and running and can log into the command line

Here's the quick-start for people with some experience:

1. Download the&nbsp;[latest Raspberry Pi OS or Raspberry Pi OS Lite](https://www.raspberrypi.org/software/operating-systems/)&nbsp;to your computer
2. [Burn the OS image to your MicroSD card](https://learn.adafruit.com/adafruit-raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi)&nbsp;using your computer
3. [Re-plug the SD card into your computer (don't use your Pi yet!) and set up your wifi connection by editing supplicant.conf](https://learn.adafruit.com/raspberry-pi-zero-creation/text-file-editing)
4. [Activate SSH support](https://learn.adafruit.com/raspberry-pi-zero-creation/text-file-editing)
5. Plug the SD card into the Pi
6. If you have an HDMI monitor we recommend connecting it so you can see that the Pi is booting OK
7. Plug in power to the Pi - you will see the green LED flicker a little. The Pi will reboot while it sets up so wait a good 10 minutes
8. [If you are running Windows on your computer, install Bonjour support so you can use&nbsp; **.local** &nbsp;names, you'll need to reboot Windows after installation](https://learn.adafruit.com/bonjour-zeroconf-networking-for-windows-and-linux#microsoft-windows)
9. [You can then&nbsp; **ssh** &nbsp;into&nbsp; **raspberrypi.local**](https://learn.adafruit.com/adafruits-raspberry-pi-lesson-6-using-ssh)

[The Pi Foundation has tons of guides as well](https://projects.raspberrypi.org/en/projects/raspberry-pi-getting-started)

Danger: 

# Update Your Pi and Python

Run the standard updates:

```terminal
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install -y python3-pip
```

and upgrade setuptools:

```terminal
sudo apt install --upgrade python3-setuptools
```

Info: 

Warning: 

# Setup Virtual Environment

If you are installing on the Bookworm (released in 2023) or later version of Raspberry Pi OS, you will need to install your python modules in a virtual environment. You can find more information in the&nbsp;[Python Virtual Environment Usage on Raspberry Pi](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi) guide. To Install and activate the virtual environment, use the following commands:

```terminal
cd ~
sudo apt install python3-venv
python3 -m venv env --system-site-packages
```

You will need to activate the virtual environment every time the Pi is rebooted. To activate it:

```terminal
source env/bin/activate
```

To deactivate, you can use `deactivate`, but leave it active for now.

# Automated Install

We put together a script to easily make sure your Pi is correctly configured and install Blinka. It requires just a few commands to run. Most of it is installing the dependencies.

```terminal
cd ~
pip3 install --upgrade adafruit-python-shell
wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/raspi-blinka.py
sudo -E env PATH=$PATH python3 raspi-blinka.py
```

If you are installing on an earlier version such as Bullseye of Raspberry Pi OS and not using a Virtual Environment, you can call the script like:

`sudo python3 raspi-blinka.py`

If you are installing an older version of Raspberry Pi OS, your system default Python is likely Python 2. If so, it will ask to confirm that you want to proceed. Choose&nbsp; **yes**.

![sensors_Python_Sys_Default.png](https://cdn-learn.adafruit.com/assets/assets/000/098/682/medium640/sensors_Python_Sys_Default.png?1610754382)

It may take a few minutes to run. When it finishes, it will ask you if you would like to reboot. Choose&nbsp; **yes**.

![sensors_Reboot_Now.png](https://cdn-learn.adafruit.com/assets/assets/000/098/683/medium640/sensors_Reboot_Now.png?1610754482)

Once it reboots, the connection will close. After a couple of minutes, you can reconnect.

![sensors_Connection_Closed.png](https://cdn-learn.adafruit.com/assets/assets/000/098/684/medium640/sensors_Connection_Closed.png?1610754544)

# Manual Install

If you are having trouble running the automated installation script, you can follow these steps to manually install Blinka.

### Enable Interfaces

Run these commands to enable the various interfaces such as I2C and SPI:

```terminal
sudo raspi-config nonint do_i2c 0
sudo raspi-config nonint do_spi 0
sudo raspi-config nonint do_serial_hw 0
sudo raspi-config nonint do_ssh 0
sudo raspi-config nonint do_camera 0
sudo raspi-config nonint disable_raspi_config_at_boot 0
```

### Install Blinka and Dependencies

Blinka needs a few dependencies installed:

```terminal
sudo apt-get install -y i2c-tools libgpiod-dev python3-libgpiod
pip3 install --upgrade adafruit-blinka
```

### Raspberry Pi 5 Adjustments

At the moment, RPi.GPIO is installed, which causes issues. Just remove it with the following command:

```terminal
pip3 uninstall -y RPi.GPIO
```

# Check I2C and SPI

The script will automatically enable I2C and SPI. You can run the following command to verify:

```terminal
ls /dev/i2c* /dev/spi*
```

You should see the response

`/dev/i2c-1 /dev/spidev0.0 /dev/spidev0.1`

![](https://cdn-learn.adafruit.com/assets/assets/000/056/782/medium800/sensors_ls.png?1530380749)

## Fixing CE0 and CE1 Device or Resource Busy Issue

In order to use the CE0 and CE1 pins in Python, you will need to disable them from OS usage. To do so, check out the [Reassigning or Disabling the SPI Chip Enable Lines](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/spi-sensors-devices#reassigning-or-disabling-the-spi-chip-enable-lines-3097985) section of this guide.

## Enabling Second SPI

If you are using the main SPI port for a display or something and need another hardware SPI port, you can enable it by adding the line

`dtoverlay=spi1-3cs`

to the bottom of **/boot/config.txt** and rebooting. You'll then see the addition of some /dev/spidev1.x devices:

![](https://cdn-learn.adafruit.com/assets/assets/000/059/554/medium800/sensors_image.png?1534951162)

## Pi 5 : Cannot determine SOC peripheral base address
comment out this line :

```auto
#dtparam=spi=on
```

# Blinka Test
Warning: 

Create a new file called **blinkatest.py** with **nano** or your favorite text editor and put the following in:

```auto
import board
import digitalio
import busio

print("Hello, blinka!")

# Try to create a Digital input
pin = digitalio.DigitalInOut(board.D4)
print("Digital IO ok!")

# Try to create an I2C device
i2c = busio.I2C(board.SCL, board.SDA)
print("I2C ok!")

# Try to create an SPI device
spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)
print("SPI ok!")

print("done!")
```

Save it, make sure your virtual environment is activated, and run at the command line with:

```terminal
python3 blinkatest.py
```

You should see the following, indicating digital i/o, I2C and SPI all worked.

![](https://cdn-learn.adafruit.com/assets/assets/000/056/785/medium800/sensors_test.png?1530381767)

# Severance Portable Macrodata Refinement Terminal

## Terminal Software

![](https://cdn-learn.adafruit.com/assets/assets/000/135/644/medium800/raspberry_pi_edited_P1450772.jpg?1741102748)

## Install the Required Libraries

You will need to install the DRV2605 library onto your Raspberry Pi. In the terminal, enter:

```terminal
pip install adafruit-circuitpython-drv2605
```

You'll also need some extra fonts:

```terminal
sudo apt install ttf-mscorefonts-installer
```

After installing, update the font directory cache with this command:

```terminal
sudo fc-cache -vr
```

## Download the Project Bundle

Once you've finished setting up your Raspberry Pi with Blinka and the library dependencies, you can access the Python code files and graphics by downloading the Project Bundle.

To do this, click on the **&nbsp;Download Project Bundle** &nbsp;button in the window below. It will download as a zipped folder.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Raspberry_Pi_Severance_MDR_Terminal/lumon.py

After downloading the Project Bundle, move the folder to your **/home/user** directory. Then, unzip the folder by **right-clicking** on the folder in the File Manager and selecting **Extract** or with your preferred command line tool. Keep the following files in the&nbsp; **/home/user** directory:

- **lumon.py**
- **data.py**
- **data\_bins.py**
- **palette.py**
- **lumon-logo.png**
- **lumon-logo-small.png**

## How the Code Works

The code consists of four files. Two of the files are helper files: **data.py** file handles the number grid graphics and **data\_bins.py** handles the bin animations and data. **palette.py** contains the color palette for the entire program. The main program file is in **lumon.py**. It handles the gameplay, graphics, mouse input and saving/loading the game progress JSON files.

## Special Features

The code is involved since it is basically a full game, but here are some fun features in it:

- Your username on your system is converted to the serial number at the bottom of the screen (0x000000 : 0x000000)
- You can change the goal number for numbers to refine at the top if you want to experience 100% faster
- JSON files are used to save and load progress
- As you move the cursor, the numbers will move out of its path
- As the cursor gets closer to the chosen numbers, the chosen numbers will jump around more and the vibration from the haptic motor will increase in intensity
- Since its written in CPython, it doesn't _have_ to be run on a Raspberry Pi. Most of the development was actually done on Windows. You'll just need to edit some of the file paths to make it fit your system.

## Code References

It could be that the Macrodata Refinement Terminal is the new PipBoy for maker prop recreations. I referenced a few open source code iterations when working on this Python version.&nbsp;[LumonMDR by andrewchilicki](https://github.com/andrewchilicki/LumonMDR) is written in C and [Macrodata-Refinement by Lumon-Industries](https://github.com/Lumon-Industries/Macrodata-Refinement) is written in Javascript.

# Severance Portable Macrodata Refinement Terminal

## Run on Boot

You probably don't want to be futzing with a full keyboard and terminal window to launch this project every time. Luckily you can configure it to run on boot by creating a&nbsp;`systemd` unit file that runs the Python script within the Python venv after the desktop environment loads.

## File Permissions

To allow for all of the files to run on boot without issue, you'll need to adjust the file permissions before running the `systemd` file. Run these commands in the terminal:

```terminal
chmod +x /home/USERNAME/lumon.py
chmod +x /home/USERNAME/data.py
chmod +x /home/USERNAME/data_bins.py
chmod +x /home/USERNAME/palette.py
```

Replace `USERNAME` with your username on your Raspberry Pi.  
  
Then, run this command for the folder that your saved JSON files are stored:

```terminal
chmod 755 /home/USERNAME/mdr_saves/
```

## systemd

In a terminal, use a text editor to create a systemd file called `mdr`:

```terminal
sudo nano /lib/systemd/system/mdr.service
```

Copy and paste the contents of the text file below into the systemd file:

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Raspberry_Pi_Severance_MDR_Terminal/mdr.service

Warning: Replace "pi-lumon" with the username on your Raspberry Pi. The default is usually "pi".

The file waits for the desktop environment to load and then launches the Python script within the virtual environment. If it fails, it will keep trying every 5 seconds.

Save the file. Then, in a terminal run these commands:

```terminal
sudo systemctl enable mdr
sudo systemctl start mdr
```

This enables the service and starts it. To test, reboot your Pi. After the desktop environment loads, you should see the script startup automatically with the bouncing Lumon logo.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/657/medium800thumb/raspberry_pi_bounce.jpg?1741108764)

# Severance Portable Macrodata Refinement Terminal

## Soldering

![](https://cdn-learn.adafruit.com/assets/assets/000/135/626/medium800/raspberry_pi_edited_P1450668.jpg?1741043098)

The 4-pin JST-PH cables are a match for the trackball mouse button input. This input lets you add left-click, right-click and scroll-click buttons. The cable pinout is:

- Black - right-click
- Red - GND
- White - left-click
- Green - scroll-click

![](https://cdn-learn.adafruit.com/assets/assets/000/135/628/medium640/raspberry_pi_edited_P1450664.jpg?1741043238)

Cut the green wire off of the 4-pin JST-PH cable. Scroll-click won't be used for this project.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/627/medium640/raspberry_pi_edited_P1450671.jpg?1741043109)

Cut the jumper headers off the wires and splice them.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/629/medium640/raspberry_pi_edited_P1450673.jpg?1741043387)

Solder the red wire (GND) to the C pin on a NeoKey. Solder an additional shorter piece of wire to the pin as well.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/630/medium640/raspberry_pi_edited_P1450675.jpg?1741043409)

Solder the white wire (left-click) to the A pin on the NeoKey. This will be the left-click key.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/631/medium640/raspberry_pi_edited_P1450677.jpg?1741043471)

Solder the black wire to the second NeoKey A pin. This will be the right-click key.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/632/medium640/raspberry_pi_edited_P1450681.jpg?1741043501)

Solder the shorter wire connected to the left-click NeoKey C pin to the right-click NeoKey C pin. This connects GND between the two NeoKeys.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/633/medium640/raspberry_pi_edited_P1450688.jpg?1741043534)

## Raspberry Pi Power Button
Solder a 2-pin JST-PH socket to the two power button pins on the Raspberry Pi.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/634/medium640/raspberry_pi_edited_P1450757.jpg?1741043589)

![](https://cdn-learn.adafruit.com/assets/assets/000/135/635/medium640/raspberry_pi_edited_P1450758.jpg?1741043601)

Prep a 2-pin JST-PH cable with heat shrink to solder to a button.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/636/medium640/raspberry_pi_edited_P1450761.jpg?1741043635)

Solder the wires to the button leads.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/637/medium640/raspberry_pi_edited_P1450762.jpg?1741043677)

Cover the leads with the heatshrink.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/638/medium640/raspberry_pi_edited_P1450763.jpg?1741043695)

Plug the button into the JST-PH port on the Raspberry Pi.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/639/medium640/raspberry_pi_edited_P1450765.jpg?1741043722)

# Severance Portable Macrodata Refinement Terminal

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/135/603/medium800/raspberry_pi_edited_P1450693.jpg?1741038988)

## Mount the Electronics
Install the active cooler to the Raspberry Pi 5. Plug in the right angle USB A extender to the Raspberry Pi.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/645/medium640/raspberry_pi_edited__P1450769.jpg?1741102897)

Mount the electronics mounting plate to the back of the display with four 8mm M2.5 screws.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/604/medium640/raspberry_pi_edited_P1450717.jpg?1741039007)

Mount the DRV2605L breakout to the plate with four M2.5 screws and nuts.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/605/medium640/raspberry_pi_edited_P1450719.jpg?1741039039)

Remove the adhesive backing from the vibration motor and stick it to the back circular area of the mounting plate.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/606/medium640/raspberry_pi_edited_P1450723.jpg?1741039083)

Attach three M2.5 standoffs and nuts to the Raspberry Pi section of the mounting plate.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/607/medium640/raspberry_pi_edited_P1450725.jpg?1741039139)

Push the front plate into the main case. Attach four M2.5 screws into the four holes to mount the Raspberry Pi.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/608/medium640/raspberry_pi_edited_P1450728.jpg?1741039169)

Attach the mounting plate to the Raspberry Pi with the M2.5 screws from the front plate to the three M2.5 standoffs.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/609/medium640/raspberry_pi_edited_P1450729.jpg?1741039224)

## Ribbon Cable
Insert the ribbon cable and the display ribbon cable into the CSI/DSI extender breakout.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/610/medium640/raspberry_pi_edited_P1450731.jpg?1741039270)

Insert the other end of the ribbon cable into the display.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/611/medium640/raspberry_pi_edited_P1450732.jpg?1741039297)

Insert the other end of the display cable into the port on the Raspberry Pi.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/612/medium640/raspberry_pi_edited_P1450733.jpg?1741039339)

You can cable manage the ribbon cables by sliding the longer ribbon cable underneath the electronics mount.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/613/medium640/raspberry_pi_edited_P1450736.jpg?1741039382)

## Pi GPIO
Plug the display power cable into 5V and GND on the Raspberry Pi GPIO header.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/614/medium640/raspberry_pi_edited_P1450738.jpg?1741039423)

Plug the STEMMA QT cable into the haptic motor breakout. Plug the socket headers into the Raspberry Pi GPIO:

- STEMMA 3V to Pi 3.3V (red wire)
- STEMMA SDA to Pi SDA (blue wire)
- STEMMA SCL to Pi SCL (yellow wire)
- STEMMA GND to Pi GND (black wire)

![](https://cdn-learn.adafruit.com/assets/assets/000/135/615/medium640/raspberry_pi_edited_P1450740.jpg?1741039451)

Insert the power button into the button cutout on the side of the case.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/646/medium640/raspberry_pi_edited_P1450766.jpg?1741102947)

Plug in the power button JST PH cable to the JST PH socket on the Raspberry Pi.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/647/medium640/raspberry_pi_edited__P1450767.jpg?1741102969)

## Knobs and Acrylic
Attach the handle to the case with a knob on each side. Secure them with M4 screws and nuts.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/616/medium640/raspberry_pi_edited_P1450744.jpg?1741039581)

Slide the piece of acrylic into the track in the back of the case.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/617/medium640/raspberry_pi_edited_P1450751.jpg?1741039636)

Place the acrylic pull tab at the edge of the acrylic. When you're happy with the placement, secure it with some glue.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/618/medium640/raspberry_pi_edited_P1450753.jpg?1741039660)

That completes the terminal assembly!

![](https://cdn-learn.adafruit.com/assets/assets/000/135/619/medium640/raspberry_pi_edited_P1450754.jpg?1741039708)

## Mouse Assembly
Attach the NeoKey breakouts to the mouse mount with M2.5 screws and nuts.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/620/medium640/raspberry_pi_edited_P1450701.jpg?1741040679)

Run the JST end of the mouse USB cable into the mouse enclosure.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/621/medium640/raspberry_pi_edited_P1450706.jpg?1741040704)

Place the mouse mount over the trackball with M3 screws. Plug the NeoKey JST cable into the BUTTON port.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/622/medium640/raspberry_pi_edited_P1450709.jpg?1741040731)

Plug the JST end of the USB cable into the USB port on the trackball.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/623/medium640/raspberry_pi_edited_P1450711.jpg?1741040773)

Secure the mouse assembly into the enclosure with the two M3 screws.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/624/medium640/raspberry_pi_edited_P1450713.jpg?1741040804)

Place the front plate into the mouse enclosure. Plug the MX keys with keycaps onto the NeoKey breakouts.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/625/medium640/raspberry_pi_edited_P1450715.jpg?1741040835)

# Severance Portable Macrodata Refinement Terminal

## Use

![](https://cdn-learn.adafruit.com/assets/assets/000/135/658/medium800thumb/raspberry_pi_closePlay.jpg?1741109611)

After your Raspberry Pi boots up, the Python program will start running. First you will see the bouncing Lumon logo screensaver. You can toggle between the screensaver and the program with the right-click key on the mouse. Right-clicking also saves your MDR file progress.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/659/medium640thumb/raspberry_pi_toggle.jpg?1741109647)

Your goal in Macrodata Refinement is to isolate the threatening numbers by drawing a box around them to send them to their respective bins. The threatening numbers will have increased movement on the screen. As your cursor moves closer to them, their movement will become more pronounced and you'll hear and feel an increasing vibration from the haptic motor.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/660/medium640thumb/raspberry_pi_playing.jpg?1741109764)

When you complete your file, you'll be greeted with "100% Praise Kier" on the display.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/661/medium640thumb/raspberry_pi_100percentAction.jpg?1741110271)

The power button on the side of the chassis lets you safely shutdown the terminal after a long day of refining.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/662/medium640thumb/raspberry_pi_powerButton.jpg?1741112099)


## Featured Products

### Raspberry Pi 5 - 4 GB RAM

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

In Stock
[Buy Now](https://www.adafruit.com/product/5812)
[Related Guides to the Product](https://learn.adafruit.com/products/5812/guides)
### Official Raspberry Pi 5 Active Cooler

[Official Raspberry Pi 5 Active Cooler](https://www.adafruit.com/product/5815)
The **Raspberry Pi 5 Active Cooler** is compatible with the [Raspberry Pi 5](https://www.adafruit.com/search?q=raspberry+pi+5) and the [Raspberry Pi 5 Case](http://www.adafruit.com/product/5816). Designed for anyone who wants to push the performance of their...

In Stock
[Buy Now](https://www.adafruit.com/product/5815)
[Related Guides to the Product](https://learn.adafruit.com/products/5815/guides)
### Raspberry Pi Touch Display 2 - 7" 720x1280 with Capacitive Touch

[Raspberry Pi Touch Display 2 - 7" 720x1280 with Capacitive Touch](https://www.adafruit.com/product/6079)
 **Raspberry Pi Touch Display 2** is the sequel to the popular [Raspberry Pi Official Display](https://www.adafruit.com/product/2718).&nbsp;Like the original, it's a 7′′ touchscreen display for Raspberry Pi. Unlike the original, it has a much higher...

In Stock
[Buy Now](https://www.adafruit.com/product/6079)
[Related Guides to the Product](https://learn.adafruit.com/products/6079/guides)
### Panel Mount Glowing Trackball

[Panel Mount Glowing Trackball](https://www.adafruit.com/product/5060)
_"'There is one who may claim it by right. For this assuredly is the&nbsp;_palantír_&nbsp;of Orthanc from the treasury of Elendil, set here by the Kings of Gondor. Now my hour draws near. I will take it.'" –Aragorn II Elessar_

This...

In Stock
[Buy Now](https://www.adafruit.com/product/5060)
[Related Guides to the Product](https://learn.adafruit.com/products/5060/guides)
### NeoKey Socket Breakout for Mechanical Key Switches with NeoPixel

[NeoKey Socket Breakout for Mechanical Key Switches with NeoPixel](https://www.adafruit.com/product/4978)
The only thing better than a nice mechanical key, is one that also can glow any color of the rainbow - and that's what the **Adafruit NeoKey Breakout** will let you do! This little 0.75" x 0.85" PCB can fit one **Cherry MX or compatible switch** and make...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4978)
[Related Guides to the Product](https://learn.adafruit.com/products/4978/guides)
### Adafruit DRV2605L Haptic Motor Controller - STEMMA QT / Qwiic

[Adafruit DRV2605L Haptic Motor Controller - STEMMA QT / Qwiic](https://www.adafruit.com/product/2305)
The DRV2605 from TI is a fancy little motor driver. Rather than controlling a stepper motor or DC motor, its designed specifically for controlling **haptic** motors - buzzers and vibration motors. Normally one would just turn those kinds of motors on and off, but this driver has...

In Stock
[Buy Now](https://www.adafruit.com/product/2305)
[Related Guides to the Product](https://learn.adafruit.com/products/2305/guides)
### Kailh Mechanical Key Switch - Clicky Blue - Single Piece

[Kailh Mechanical Key Switch - Clicky Blue - Single Piece](https://www.adafruit.com/product/5123)
For crafting your very own custom keyboard, a **&nbsp;Kailh&nbsp;Blue Linear mechanical key switches** &nbsp;is deeee-luxe! With smooth actuation and Cherry MX compatibility, they're lovely when you want a **clicky tactile** keystroke with a snappy feel and an...

In Stock
[Buy Now](https://www.adafruit.com/product/5123)
[Related Guides to the Product](https://learn.adafruit.com/products/5123/guides)
### Cyan MA Keycaps for MX Compatible Switches - 5 pack

[Cyan MA Keycaps for MX Compatible Switches - 5 pack](https://www.adafruit.com/product/5174)
Dress up your mechanical keys in your favorite colors&nbsp;with a wide selection of gumdrop-like, retro, curvy, and stylish MA profile keycaps. Here is a 5 pack of **Cyan MA Keycaps** for your next mechanical keyboard or&nbsp;<a...></a...>

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

## Related Guides

- [NeoKey Socket Breakout with NeoPixel for MX and CHOC Key Switches](https://learn.adafruit.com/neokey-breakout.md)
- [3D Print Ratcatcher 2 Controller Device](https://learn.adafruit.com/3d-print-ratcatcher-2-controller-device-wand.md)
- [PyPortal Titano Weather Station](https://learn.adafruit.com/pyportal-titano-weather-station.md)
- [Holiday Tree with Feather RP2040 Scorpio](https://learn.adafruit.com/holiday-tree-with-scorpio.md)
- [Circle of Fifths Euclidean Synth with synthio and CircuitPython](https://learn.adafruit.com/circle-of-fifths-euclidean-synth-with-synthio-and-circuitpython.md)
- [Computer Space Mini Arcade](https://learn.adafruit.com/computer-space-mini-arcade.md)
- [Personal and Portable ESP32-S2 Web Server](https://learn.adafruit.com/wordle-personal-esp32-s2-web-server.md)
- [Pi SSD Media Server](https://learn.adafruit.com/pi-ssd-media-server.md)
- [Modal MIDI Keyboard](https://learn.adafruit.com/modal-midi-keyboard.md)
- [PyPortal Weather Station](https://learn.adafruit.com/pyportal-weather-station.md)
- [No-Code Indoor Grow Monitor with PPFD and VPD Measurements](https://learn.adafruit.com/no-code-indoor-grow-monitor.md)
- [Monitor Your Greenhouse with a No-Code Environmental Sensor](https://learn.adafruit.com/monitor-your-greenhouse-with-a-no-code-environmental-sensor.md)
- [QT Py CH32V203 eInk / ePaper Daily Calendar and Clock](https://learn.adafruit.com/ch32v203-eink-epaper-calendar-and-clock.md)
- [NeoPixel Menorah](https://learn.adafruit.com/neopixel-menorah.md)
- [LLM Agent Embodiment Kit](https://learn.adafruit.com/llm-agent-embodiment-kit.md)
- [Raspberry Pi HQ Camera Case](https://learn.adafruit.com/raspberry-pi-hq-camera-case.md)
