One Box To Control Them All: Making an Automated LEGO Amusement Park
/Before we get started, I need you to watch this scene from GoldenEye:
I, like many of you, lost count of how many times I watched this James Bond movie. I spent a small fortune renting it over and over again at Blockbuster Video (R.I.P). I was taken by how cool the activation mechanism was. There are countless other examples of key-enabled doomsday machines from popular movies of the time, like WarGames, Crimson Tide, The Rock, Under Siege, etc.
Maybe the Cold War hangover that drifted into the 90s fueled a generation’s obsession with very powerful machines with elaborate activation methods, or maybe it just scratches some deep part of our brains that like mechanisms, buttons, and lights. Regardless, I have long dreamed of having a machine in my life worthy of key-activation. Today, with LEGO, an Arduino, and a small bit of coding, I have achieved that dream.
We Need More Power
I’ve built up my LEGO amusement park over the last eight years. From adding motors to moving to a MILS plate standard, as I have learned more about this hobby, the park has grown too. In its current state, it’s about 30 square feet with more than 10 motorized rides, LEDs, and sound. But over the years, consistently, my biggest hurdles haven’t been brick-related but power-related.
In the beginning, I had two battery boxes rigged with a Technic axle to be able to turn them at the same time. The biggest downside here is obviously batteries; they’re expensive and cumbersome. As the park grew and I needed more motors, more wires, more battery boxes, and more batteries to run it all, I had to step back and rethink things.
Around the same time, my son and I entered our first GBC module at BrickCon in Seattle. As I wrote here, all of the other builders were running their GBC machines off of 9V Transformer and Speed Regulators. After watching them perform, I bought four of them on eBay before I left the building. These boxes are easy to find on BrickLink or eBay, but as they haven’t been produced in years, their original power plugs have mostly disintegrated. Thankfully, you can order replacements like these on Amazon.
The Power Regulators are not only wall-powered, but they also can regulate how much power, and thus speed, a motor provides. Not only could I stop buying batteries, but I could remove a bunch of gears, pins, and Technic bricks that I had used to manually slow certain rides down using gear ratios! With my limited space, every stud gained back for more rides is exciting.
Virtually everything in my park runs on the old Power Functions standard because it was what shipped with my first motorized rides like the Carousel and Ferris Wheel. The longest Power Function cable you can buy is ~20 inches at an average cost of $10 these days, and at some point I realized I needed something like 40 feet. A few years ago, I taught myself how to solder to save myself a small fortune.
By taking an existing LEGO Power Functions cable and cutting it to splice in a much longer, cheaper cable, I could basically take my power anywhere I needed it. If you’re considering trying thing this, my soldering is by no means pretty and my first few attempts went directly in the trash. But, with the help of some YouTube videos and a cheap soldering kit, anyone can be a few hours away from custom-length Power Functions cables—just be careful, it gets hot.
The cables travel from the rides through holes drilled in the table and then are plugged into the Power Regulator at a max of four rides each regulator. To save myself from turning them all individually, I used extension cords to run them all into the same surge protector. When I started looking for external buttons to control the power to the surge protector, I found this beautiful device:
This tickled the GoldenEye part of my brain enough to get a solid idea going. This box was nice, but required some custom wire work, and at that point, why not just make it out of LEGO? I could finally achieve my goal of a key-activation-worthy device and build a unique MOC.
Computer Code
I didn’t know where to start with my idea, but I did know that it would involve coding. I have tried a number of my times to learn how to code. I can get started, but I can never get the training wheels off. I’m comfortable with a command line, but don’t know what to type in it. I turned to ChatGPT, and later Claude, to help get this project off the ground.
In my last attempt at learning how to code, I had bought an all-in-one Arduino circuit kit, so I dusted that off and asked the AI chat bot what to do. It helped me conceptualize the project, form a shopping list, and wire the project up. I would run the code the AI gave me, and then give any error messages back to the AI for debugging. It’s a time-consuming, boring way to code but having an AI chatbot on my side was all the difference I needed for this project.
From my brief experience, the core obstacle with coding using an AI assistant is that both of us would make assumptions about what the other was thinking. Since I don’t know what I’m doing, I don’t know the right questions to ask, and the AI doesn’t ask follow up questions before giving you code.
Here is small, but important example: If I ask ChatGPT a specific question like, “What wires do my LEDs need?” I will get an answer like, “Each LED needs power on one side, and ground wire on the other. You’ll need to run each wire the length between the LED and the Arduino.” I started cutting long sections of wire and got to work before I asked a clarifying question and came to the realization that I could daisy chain the ground wires, saving me a bunch of time and wire. So while these tools are helpful, it is no substitute whatsoever for actual life experience.
If I started this project from scratch, there’s already a bunch of things I would change based on what I learned making this box. I legitimately hope there are comments on this article from experienced hobbyists yelling at me for something I did wrong so I can learn more.
The Guts
After building a series of rough prototypes to test out the code, wiring, and buttons, I started to put it all together. I found the whole thing fit perfectly inside the small Ikea Bygglek box after cutting some holes for the components.
My prototype worked really well (and I didn’t feel like soldering anymore), so I simply hot-glued the cables to the breadboard to secure them and then nestled that into a brick-built box that lives under the table.
The wires running out of the box head into my power relay. This is a super simple, off-the-shelf, and, most importantly, safe way for the project to provide power to all the regulators. Here’s the one I bought:
This box effectively takes an on/off signal from the Arduino and uses that information to power up or down anything plugged into the outlets. The biggest advantage of this is that I only had to work with low-voltage, relatively safer wires and not the much more dangerous, high-voltage wires that carry power to the outlets.
Putting It All Together
After testing and building, we finally have a working, key-activated control box built out of LEGO! Here’s a video of this bad boy in action:
In the video, you’ll notice some construction next to the Halloween Town and Space Land. After I got my control box working, I realized I still had two rides that didn’t turn on automatically, the Haunted House drop tower and the Disney Train. Thus began Phase 2 of computer automation in my park. When I’m done coding and wiring, the Pi will watch for a signal from the Arduino, and in turn run the final two rides.
For the Haunted House, I used something called a Build HAT. This product is a collaboration between LEGO and the people behind Raspberry Pi. It plugs directly into a Pi, and with a little bit of code, can run up to four compatible LEGO motors or sensors.
I’ve also added some spooky music via some speakers. Someday I hope to add a vision sensor to help me get the ride car to hold at the top of the tower. Here’s how it works currently:
Making the train start automatically was harder, but I’m a tiny bit proud of my solution. For reasons outlined here, I couldn’t turn to 9V track and do it the easy way. I took the battery box that runs the train and replaced the firmware with something called PyBricks, which runs a very simple program. Press the button to start the train; press it again and it stops. This program only works when the box is ‘awake’ however.
A SwitchBot is a cool little box that, essentially, has a Bluetooth chip and an arm that comes out on command. I have a script on the Pi that tells the SwitchBot to press once to wake up the box and a second time to chuga-chuga!
When the ride is over, a single button press is sent to stop the train. The battery-saving features of the box will turn it off automatically. Sending commands to the SwitchBot works ~85% of the time, but I do have a Switchbot Hub coming in the mail to see if sending commands over that device makes it more reliable.
Pushing Buttons
This project started as a childhood dream fueled by movie buttons and evolved into a full-fledged, key-activated LEGO control system. Along the way, I’ve learned some LEGO math, how to solder, and a little bit of coding. While there were plenty of mistakes along the way, each one taught me something new—often the hard way.
With a working control box and an expanding network of automation, my LEGO park is entering a new era of interactivity. Now that I’ve got more experience, I’ve got a bunch of cool coding ideas to add features around the park. It is only going to get more fun from here! Who knew that a love for doomsday movie aesthetics and big red buttons would one day power a LEGO theme park?
If you had the resources, what would you build? Let us know in the comments below.
Do you want to help BrickNerd continue publishing articles like this one? Become a top patron like Marc & Liz Puleo, Paige Mueller, Rob Klingberg from Brickstuff, John & Joshua Hanlon from Beyond the Brick, Megan Lum, Andy Price, Lukas Kurth from StoneWars, Wayne Tyler, Dan Church, and Roxanne Baxter to show your support, get early access, exclusive swag and more.