Doom on a LEGO brick | The MagPi #129

If you have an appreciation of both LEGO and 1990s video games, read on. In the brand new issue of The MagPi, Nicola King digs out her glasses to admire a minuscule make.

We’ve seen portable games projects before, but nothing quite this small! Maker James Brown took on the huge challenge of embedding a playable game of the classic first-person shooter Doom in a LEGO brick, powered by Pico’s RP2040 chip and featuring a tiny OLED screen.

play Doom on a LEGO brick
Based around RP2040, the 3D PCB frame base is cast in epoxy resin to form the brick

James makes clear that it was an iterative process over many months. The first version was “very simple and not particularly well-planned. I figured I’d make a tiny computer, attach a 0.42″ OLED which just (only just!) fits in the face of a LEGO slope brick, and somehow encapsulate it in resin to look like the original. So, I drew up a PCB as big as I could go without it sticking out, populated it with the smallest microcontroller I could find in stock at JLCPCB, and sent it off to be manufactured.”

Subscribe to James’ YouTube channel

After the project garnered a positive response, he sought to make it accessible to more people. The question was, how could he create a version that could support a USB connection and be reprogrammed interactively? “RP2040 ticked all the boxes,” he shares, “and (crucially!) was available.”

3D construction

James ended up with a 3D PCB structure, taking what he’d learnt from the first iteration and improving it: “By soldering together a complete frame of PCBs, I get a very precisely machined brick shape, contacts for the battery, and a USB port tucked away inside.”

The frame consists of four panels, with the front one containing the driving forces including the RP2040, a 4MB flash chip, crystal oscillator, and 0.42″ SPI OLED screen. “Four lugs on the front panel provide the physical mounting points,” explains James, “as well as the electrical connections to the rest of the panels – two for power, two for data.”

RP2040 on a custom PCB ready to be fit inside a LEGO brick
The main PCB panel with RP2040 (left), which is built with the others into a 3D frame (right)

With 9 V contact strips on the side panels, along with a voltage regulator and some diodes, the rear panel has just enough room for a micro USB socket. The other three panels have castellated edges to provide “the mechanical and electrical connection, and can be designed as a single flat circuit which is later chopped up to make the 3D frame.”

Once James had assembled the circuit, he put it in a silicone mould to be encapsulated with epoxy resin. The biggest headache was getting the resin layer over the screen just right: “It needs to be very thin (around 0.1 mm), both in order to fit in the space between the outer surface and the studs of the bricks below, but also to be clearly visible.”

play Doom on a LEGO brick

Doom’s day

Sparked by questions from social media as to whether his LEGO creation could run Doom, James investigated the possibility but had initial issues running video on the screen. After some tinkering, he “took advantage of the RP2040’s second core to update the screen fast enough to create greyscale images.” With Doom now a practical proposition, James looked to Graham Sanderson’s “amazing” work on a Doom port, did a “horrible quick hack” and it now runs beautifully, ticking off “another entry on ‘things that run Doom’.”

Seeking to improve the pocket-sized project further, he’s now working on adding an internal battery. “I found some rechargeable cells which could fit, but only if I remove the USB port, and I’m still looking for a neat solution for this.”

As well as making a test board to try out the battery and charging circuit, James has copy-pasted the LEGO brick’s computer module onto it “to make a wearable ring (above) which can run all the same code as the bricks.”

The MagPi #129 out NOW!

You can grab the brand-new issue right now from Tesco, Sainsbury’s, Asda, WHSmith, and other newsagents, including the Raspberry Pi Store in Cambridge. You can also get it via our app on Android or iOS.

MAGPI 129

You can also subscribe to the print version of The MagPi. Not only do we deliver it globally, but people who sign up to the twelve-month print subscription get a FREE Raspberry Pi Zero Pico W!

1 comment

Nick avatar

Behold, the Ring of Doom! \o/

That’s impressive. :D

Comments are closed