Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Building an Arduino-based laser game, Part 1: Arduino basics

Jump-start your electronics projects with the open source hardware and software platform Arduino

Duane O'Brien, PHP developer, Freelance
Duane O'Brien has been a technological Swiss army knife since the Oregon Trail was text only. His favorite color is sushi. He has never been to the moon.

Summary:  Arduino is an inexpensive, easy-to-use electronics platform. The entire platform, both the hardware and the software, is completely open source, and the language is loosely based on C/C++. Arduino was built for makers, tinkerers, and artists who want to take the plunge into creating interactive physical objects. This three-part series starts with basic Arduino hardware and uses it to create an interactive laser game called "'Duino tag," where players can play tag using devices built nearly from scratch. Here in Part 1 of this "Building an Arduino-based laser game" series, we craft basic experiments that prepare us for and are a part of 'Duino tag.

View more content in this series

Date:  22 Dec 2008
Level:  Intermediate PDF:  A4 and Letter (183 KB | 23 pages)Get Adobe® Reader®

Activity:  36424 views
Comments:  

Before you start

Whether you're new to Arduino or a seasoned builder, this project has something for you. There's nothing quite as satisfying as creating an interactive physical object, knowing that if it breaks or needs modification, you know where all the parts go and how everything works. The 'Duino tag gun is a great project to work on by yourself or with friends. To complete this project, you should at least have a basic understanding of electronics (you should know what a resistor is, but you don't need to know the science behind one) and have an understanding of programming (you should know what loops and variables are, but you don't need to be able to parse Big O Notation). Don't be afraid to jump right in.

About this series

In this series, we use Arduino technology to create a basic interactive laser game called 'Duino tag:

  • Part 1: Learn some Arduino basics, lay out the project, and do an experiment that will help you understand how Infrared works.
  • Part 2: Build and test the receiver part of the 'Duino Tag gun, including the testing.
  • Part 3: Build the transmitter and complete the 'Duino Tag gun.

About this tutorial

To follow along, you don't need any electronics work experience, although experience working with electronic components can certainly serve you well. The same can be said about working with a microcontroller. If you've worked with microcontrollers, you'll have an edge, but keep in mind that the Arduino platform is well suited for people without that experience. Above all, you should be willing to stretch your skills. Working with electronics and microcontrollers can be a rewarding experience. Most software engineers don't get a chance to write code for devices that interface with the physical world, and Arduino provides a low-cost entry point into working with interactive devices.

This tutorial, Part 1 in a three-part "Building an Arduino-based laser game" series, focuses on Arduino basics. We jump into using Arduino, look at the language basics and API. We prepare for the 'Duino tag project, including design basics and putting together a parts list. We learn about ordering parts online, where to go, and parts we need. Finally, using some stock components and some basic test code, we demonstrate basic principles governing how the gun works.


System requirements

For this tutorial, we need few tools and supplies:

Computer with USB port
While technically not true (many kinds of Arduino hardware interface over old-style serial ports), this series is written assuming you are using a model that communicates over USB. There is Arduino software available for Microsoft® Windows®, Mac OS X, and Linux® (32-bit and AMD-64 bit).
Arduino Diecimila
This is the specific model of Arduino hardware used in this tutorial. You may substitute an Arduino Duemilanove. Order one from a reputable online dealer. Check the Resources for links.
USB A-B cable
This is like the one you probably have attached to a printer.
Basic 5mm red Light-Emitting Diode (LED)
You might have one already, or you can find one at Radio Shack or an online dealer.
Flashlight
The brighter the better.
Arudino software
See Resources to download Arduino software.
Installation and setup guides for Arduino
See Resources to download the Arduino installation guide.

1 of 9 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Open source
ArticleID=358581
TutorialTitle=Building an Arduino-based laser game, Part 1: Arduino basics
publish-date=12222008
author1-email=d@duaneobrien.com
author1-email-cc=