Arduino Airsoft Game Controller

Arduino Airsoft/Paintball game management system

Mid summer 2017, some of the guys at my weekend airsoft group asked me to help them out with a little project. They wanted to build a control system for game play that had lights and a siren to help let people know when a game starts or ends and more. I figured it would be a quick little project, and I was looking for something to build with a couple Arduino Uno’s that I had lying around, so I took them up on it. This is the first project I have done on an Arduino, however I used to use the ATMEL AVR chip to do this kind of thing so I am very familiar with this stuff.

The basic functionality they asked for was a game timer and lights to represent 2 teams for capture the flag (my favourite game). When we play outdoors one of the big problems we have is letting both teams know exactly when the game starts (pretty big field). We have tried whistles (usually lose them), yelling (usually resulting in sore throats and a headache), and Radios (usually forget them , dead batteries, or wrong channel). This is really annoying, so I figured I would add functionality for a 30 second countdown for game starts.

I ended up needing 5 buttons.

  • Start Game
  • Stop Game / Reset
  • Choose Game Duration (10,20,30,50, unlimited minutes)
  • Team 1 (Red)
  • Team 2 (Yellow)

I needed 5 bright LED’s to show the current game duration, I used some LEDs from amazon designed to run on 12V. Also three 12V trailer LED’s to show Team 1, Team 2, or Uncaptured/System Status. Finally I needed a 12V Siren, which I found in my junk pile, an old car alarm siren from 1990! ha , I knew I would use it eventually, I am not a pack rat or anything like that 😉

I programmed it originally on an Arduino Uno, but when I was done I decided that I would deploy it on an Ardinuo Nano ($5, vs $15 for the Uno) so I could keep the Uno for other development projects because it has nice headers for jumpers but the Nano needs to be soldered.

I really did not want to jump through a lot of hoops to get a development environment working on my PC, so I used for editing and uploading the binary to my Arduino over USB. It worked really well, but not as good as a real development environment. It can be frustrating having such a limited code editor without context sensitive help. But good enough, so on we go….

I began by figuring out what pins I should use for each function and looking up how to initialise them.

I used the following Constants for the Digital Pins

const int BTN_START = 2;
const int BTN_STOP = 3;
const int BTN_GAME_LENGTH = 4;
const int BTN_TEAM1 = 5;
const int BTN_TEAM2 = 6;

const int LIGHT_TEAM1 = 9;
const int LIGHT_TEAM2 = 10;
const int SIREN = 11;
const int LIGHT_MIDDLE = 8; // was 12, but I fried pin 12 being lazy, Note to self: Stop being lazy…

// Used pins Analog 0 to 5 for the game duration lights
const int LIGHT_10 = A0;
const int LIGHT_20 = A1;
const int LIGHT_30 = A2;
const int LIGHT_50 = A3;
const int LIGHT_UNLIMITED = A4;

The Pins must be initialized BEFORE you use them or the magic smoke comes out, this is usally done during the initialization of the program before the main loop begins. Take a look at the setup() function in the code link.

I tried to break the program up as much as possible and comment a bunch as well. It may be useful for someone looking to learn the very basics of Arduino.

Here is a poorly lit Prototype Pic!

Early stages of connecting the Relay board to the Arduino Uno.

I gave the first (completely soldered) version to the guys to put into an enclosure, and forgot to take a picture, so here is a pic of the second version using a solid state relay.

Version 2

The entire project source code can be found here Arduino Airsoft Game System Code. It is free for anyone to use, any way they want! Have fun!

I have found the arduino to be a fantastic platform for moderate complexity projects. I had so much fun building this that I want to build another project A.S.A.P.

Coming soon, the next project idea:

Airsoft/paintball picatinny mounted live Chrono with OLED display.

I met a guy with a crazy cool chrono as part of his gun. It had sensors built into a fake suppressor and an LED display on a small brick mounted on his top rail. It could measure fps and rpm and even count the number of shots. This seems like a great project to try to build for myself. (And save a pile of money over buying the commercial unit). I plan on 3D printing a barrel suppressor or parts to fit within a commercial one, also 3D printing the brick for mounting on the picatinny and holding an OLED display.

I figure the cost will be:
$5 Nano
$5 for 10 pair IR transmit receiver
$3 1 inch OLED display
$2 misc wire and PLA

Figure I can do this for under $15!