Introduction: Arduino UNO Laser Game

Project ITTT - HKU

In this instructable I will show my process on building a laser game with an Arduino UNO.

Step 1: Step 1: Parts Needed

  • arduino UNO
  • 3 green LEDs
  • 4 red LEDs
  • 4 orange LEDs
  • 1 blue LED
  • Light dependent resistor
  • resistor
  • piezo buzzer
  • rotry potentio meter
  • lots of wires

In the next step we will put it all together.

Step 2: Step 2: Setting It Up

LED

green: ports 2,3,4 -> ground

red: ports 8,9,10,11-> ground

blue: port 12 -> ground

OTHERS

Light dependent resitor: port 3.3V & A3 (resistor doens't need to go to the ground)

rotry potentio meter: port A3 -> ground

buzzer: port 6 (put resisitor between buzzer and input) -> ground

Explaination:

The green lights will be your 3 "hearts". You will lose a life when you aren't fast enought with hitting the target.

The red and orange lights indicate the target is hittable. They will turn on at a random time and you can try to hit the target until the lights go out.

The blue LED will turn on when you manage to hit the target.

The buzzer will make a sad sound when you lose a life, and it will make a happy sound as soon as you hit the target.

With the potentio meter you can change the sensitivity of the target (light dependent resistor).

Step 3: Step 3: the Code

Download the arduino app:

https://www.arduino.cc/en/Main/Software

Download the zip file this is all the code to make the laser game work.

Step 4: Step 4: Creating the Stage

I created a little health-box for the green LEDs.

I made a large circle as a target.

TARGET:

Make 8 holes (big enough to put LEDs trough) on the outer ring of the circle. Make one hole in the middle where you can put the light dependent resisor (this is the target).

HEALTH BOX

Put 3 holes in the front of the box (for the green LEDs).

Make a hole on the top of the box (for the blue LED).

And make a larger hole in the back of the box (so the wires can pass trough).

Step 5: Step 5: Finish It!

Now if you hook everything up, get yourself a good laser gun/laser pointer, the game can begin!

Hit the middle of the target within the time (while the LEDs are on). If you miss, you loose a life (and sad sound)! If you hit, you get a blue light (and happy sound)!

Have fun and experiment!