Portal Turret Build Guide V2.0

Table Of Contents

  1. Introduction
  2. About this guide
  3. Schematic
  4. Custom PCB
  5. Items Needed
  6. Tools Needed
  7. Firmware / Source Code
  8. 3D Print Files
  9. Audio
  10. Painting
  11. Assembly Guide
  12. How to use

Introduction

Ever since the release of Portal in 2007, the turrets featured in the game Portal are a true hit. The odd shaped white units lure you in with cute voicelines, but completely shoot you to pieces with one wrong move.

The reason I started this project was because now that I owned a 3D printer, I really wanted to create something cool that moved with servos and challenge myself in what I could achieve with Fusion 360.

I had a few goals I wanted to achieve:

I managed to hit a lot of these goals. There were some sacrifices here and there, but concidering the physical size of the turret, this was something to be expected.

About this guide

This guide was written after the full assembly of the turret. Since there were quite some requests about releasing the print files, I decided to write down the steps to build one yourself. A lot of the problems I encountered during the design process are fixed, so the build should be rather straightforward. The most challenging part will probably be the wiring, and routing of these wires. Cut your wires long enough, you can always shorten them. Take your time to study the schematics and maybe even take a look at the source code before doing a full assembly. Doing it step by step will certainly help getting your turret up and running.

Putting together the design for this turret was quite a challenge. Writing this guide even more so. But I also believe other people should be able to enjoy building cool things like this. That's why I'm releasing all the files and guide for free. If you feel like this is a fun project and want to support me somehow, you can use the button below to buy me a coffee or something.

Schematic

This is the schematic of the PCB. Note that not all components, like the LED ring, get their power from here. I've daisy-chained my 5V and Gnd lines from component to component.

Custom PCB

In order to save a lot of room and make things easier to assemble, you will need a custom PCB.

You can download the Gerber files here. I've ordered mine through JLCPCB.com with great results.

Items needed

Tools needed

3D Print files

The turret consists of many parts. The combined parts can be found below. I suggest using a program like Slic3r or Prusa Slicer to split them into individual parts. Most parts can be printed with no or minimal support. Prusa Slicer provides tools to paint support where needed. Settings like temperature and the use of brims is really up to your printer and the used filament. The most difficult parts to print will probably be the wings. I used quite a bit of support material and a big brim to make sure it could print upright and keep it in one piece. To get the glossy finish, make sure to use something like 0.10mm as a layer height for the outer shells. The internal parts can be printed with slightly bigger layer height, but this will ofcourse show more visible layer lines.

Download all files on Printables.com

Source Code

You can use this precompiled version that should be ready for the Wemos D1 Mini. Note that no other boards are supported with this binary.

The Wemos D1 Mini is the brain of the turret. This powerful little board has onboard WiFi and can be programmed like an Arduino. You'll need the Arduino IDE to install some libraries and program the board.

You can use this page to get started with programming the Wemos.

The full source code of the turret can be found here.

The turret plays a lot of voicelines from the game. Download this archive and put the contents on the SD card used in the YX5200.

Painting

I wish there was some sort of shortcut I could provide when it comes to painting the turret. But to get the shiny finish there's pretty much only one way to go about it:

This part will require a lot of patience. Take your time, don't spray too much paint at once. The smoother the surface before painting, the better the result will be in the end. The time spent will be worth it.

Assembly

Now that all the parts are printed and painted, it's time for the assembly. All these steps assume you know how the electronics should be hooked up.

Center

To help with print orientation, the base of the mechanics is done in 3 prints. Use 6 smalls crews to attach the parts together.

The 3 gears should slide right in. I've used an old allen key for the center axel. It should go in relatively easy, but the gear should get stuck on there. If it's too loose, the axel might slide out. The other two axels are 4mm rods cut to length. Make sure the gears are oriented the right way!

Use 4 small screws to attach the rear plate to secure the gears in place.

Install the 360 servo and the microswitch. This switch helps the controller to detect if the wings are open or closed.

Insert the rack gears. Make sure they line up on both ends. They should go in both all the way.

Now you can install the large gear. This one also needs to have a snug fit to ensure not falling off. A drop of super glue surely will help.

Attach the top part with 3 small screws. This should complete the inner mechanics. The screws should not stick out of the top, as this will hinder movement of the part.

Eye

The center piece is printed flat to make sure it's easy to print and doesn't show any layer lines. However, the shape should be slightly indented. A tiny "mold" is added to the models to help with this. After printing, place the eye in some hot water. PLA gets soft at these temperatures, so you can push it on the mold to get the desired shape.

The LED ring should exactly fit in the holder. Same for the red LED. The white part is a 'diffuser' to make the red light more even across the eye. Looks way better than directly looking into the LEDs of the ring.

All the parts should fit together front to back and should slide over the extruded edges of the main body. The red LED should help keep everything in place.

Main Body

Cut two pieces of M3 threaded rod to length and glue them in one side of the main body. Make sure the wires on your speaker are long enough, because it won't be easy to access it after this step.

Using some more glue, slide the second half of the shell in place.

The whole eye assembly should slide in place.

Bottom

There are multiple ways to power the turret. You can use a USB breakout board, or simply route the power wires directly in the build. Both options should fit underneath the little clamp that gets attached with two small screws.

The acceleromter goes in next. There are two standoffs provided to secure it in place.

6 screws are used to attach this plate to the bottom. The PIR motion sensor can be clamped in the front. There's not much room, but with some tight cable management it should be possible.

Screw the small gear on the 180 servo and attach it to the bottom plate.

Cut 2 4mm rods to length and run them through the bottom plate. They should stick out a few milimeters on each side.

Use a small piece of 4mm rod to create the hinge between the top and bottom part.

Most of the internal mechanics are now complete.

Slide the center mechanics in the hinge at the top. Slightly spread the outer shells at the bottom to slide them over the metal rods. If the shell doesn't keep the rods in place, concider some glue. However, this would fix things in place permanently, so only do this when you're sure everything works.

Wings

There is a new file for wings that have built-in supports. These supports break away somewhat easily but do require post processing (sanding, painting).

First up are the two guns. Insert the white LEDs in the metal holders. Insert a holder with LED in all of the muzzles. The LED holders should stay in place by itself.

The back of the guns provides a small path for wires. Use some hot glue to keep the LEDs and wires in place. Make sure the wires are long enough to reach the PCA9685. It's easier to cut some off than to resolder new wires later.

Cut some 4mm rods to length. I recommend smoothing them by inserting them into a drill and spin them in a piece of rough sandpaper. The smoother the better, but also keep in mind that they should fit as closely as possible to prevent the wings from wobbling too much. Roughen the outer tip a bit and use super glue to attach the rods to the wing. I suggest you insert the wings into the center mechanism to keep the rods in place while the glue dries. Make sure the wings don't touch the center mechanism though, as they could get stuck. Ask me how I know...

Attach the gun with 2 to 6 screws.

Cut some M3 threaded rod and use super glue to fix them in place in the wing. This will be the pin the rackgears will snap around so make sure they're tight.

When all the parts are glued and secure, you can slide in the wings and click the rack gears on the metal pins.

Legs

All legs consist of a piece of 4mm steel rod, 2 printed pieces and a small peg that can be cut from the M3 threaded rod. Use superglue to glue everything together. The peg should help with some strength.

Getting the metal parts in the correct shape can be quite tricky. Bending 4mm steel can be difficult. I suggest using something round of the approximate size to help with getting the right shape.

Completion!

Now it's time to glue in the antenna and the 3 legs. And that concludes the assembly.

How To Use

When booting up your turret, you should be seeing a WiFi network from the Wemos. Once you connect, you'll be brought to a captive portal to start controlling your turret.

The captive portal shows you the main options.

The homepage is the page you'll use the most. You can see a log of what the turret is doing, a graph of the accelerometer and a button to start controlling your turret manually.

Setup allows you to set your WiFi credentials to connect to your home network. This way you can access the turret through the IP your router provides, or by visiting http://turret.local

Allows you to change the settings of the turret.

The diagnose page allows you to test individual features in the turret to check if they work properly.