Make all kinds of game
controllers using an
accelerometer or other
sensors. BY TOM IGOE
Making stuff is more fun when you do it with other people. So is
gaming. So why not combine the two?
Here’s a game you can play against
your friends using game controllers
you build yourselves.
The game is simple. A ball drops from the top
of the screen. Your goal is to keep it from hitting
the ground. Each player has a paddle on-screen
(Figure A, following page). You can move your
paddle left, right, up, and down. You get a point
for each new paddle the ball hits (bouncing it off
your own paddle multiple times doesn’t help).
The more players you have, the easier it is to keep
the ball in the air. You get 5 balls per game.
To move your paddle up, send the command u;
to move down, send d; to move right, send r; and to
move left, send l. That’s it. The fun part is figuring
out what kind of game controller to build, and how
to program a microcontroller to read your actions
to send those commands.
Photography and illustration by Tom Igoe
»MAKE A BALANCE-BOARD GAME CONTROLLER
You can make a balance-board controller using an
accelerometer (Figure B). This board is made from
2 discs of stiff 3-ply cardboard, on a rocker made of
2 semicircles notched to fit perpendicular to each
other. An Arduino and accelerometer are mounted
on the center of the balance board. Balancing and
controlling the paddle is challenging but fun!
1. Attach each axis of the accelerometer to a different analog input of your microcontroller (Figure C).
2. Now you need to find the range of values that the
accelerometer’s 2 sensors return (you’ll need to do
this no matter what sensors you use). Download
the SimpleReader.pde code at
gamecontroller, upload it to your Arduino, and open
the Serial Monitor.
MATERIALS AND TOOLS
You can build your game controller using any
microcontroller that can communicate through
a serial connection to your computer. The code
and hardware examples shown here are done on an
Arduino, but any microcontroller will work, as long
as it can communicate at 9,600 bits per second.
Arduino Uno microcontroller » Maker Shed
3-axis accelerometer, type ADXL335 » Adafruit
Industries #163 (