Geek Out! Build Your Own Arduino Portal Turret

In Arduino by Mark A. Barros

I’m a big time gamer. Always have been. And one of the neatest little games to come out in a while is Portal (and more recently Portal 2). It’s a fantastic first-person shooter puzzle game where your goal is to make your way across a test chamber (starting from the entrance and working your way to the exit) using a portal gun.

This gun does not fire harmful projectiles but rather allows you to open portals (i.e. inter-dimensional doors – one orange and one blue) in walls ceilings and floors. Walking through a blue portal allows you to appear wherever the orange portal is (and visa-versa). It’s this simple mechanism that allows for some brilliant and challenging abstract game-play.

One of the cute little obstacles you will encounter are Portal Turrets which stand sentry in various locations happily waiting to shred you to tiny little pieces with their machine guns.

Though deadly, they are cute little buggers and with a little Arduino magic I set out to create one; or more accurately emulate its behavior.

Arduino Portal Turret In Action

Project Description

Replicates the behavior of a Portal Turret using a PIR Sensor to detect infra red motion (to wake up sleeping turret), a PING Sensor and Servo (to locate target within a predefined distance of the turret), a bright red LED (to simulate the laser designator – much safer then using an actual laser). A wave board is used to play the various portal sounds.

Portal turret sound files were obtained from theportalwiki.com. I cherry picked the sounds I wanted and renamed them to something more meaningful in my source code. You will have to do the same.

Parts List

Feel free to source the parts from wherever you like. I am listing the components I used here as a point of reference.

Download the Arduino Sketch

Arduino_Portal_Turret.ino (Version 1.0) – Supports target detection, tracking and acquisition within 180 degrees of the forward position. Portal turret will audibly call out to user and announce state transitions.

Feel free to enhance or change the code as you like. Just make sure you share your adventure with me. I would love to hear of any improvements and uses for your Arduino Portal Turret! With Halloween right around the corner I am tempted to connect mine to my stereo amplifier and hide it near the porch to have it greet unwary trick-or-treaters. Muhahaha!