Introduction: StopIt! LED Game (powered by Arduino)
This project was inspired by this video from YouTube and the Pendulum Challenge Kit (Broken link. Try this one.) from Makershed.com. Its a simple game consisting of five LED lights and one pushbutton switch. The LEDs flash in a sequence and the player must press the button when the middle LED light is lit. The speed at which the lights flash increases until the player presses the button at the wrong time.
Don't forget to rate this 'ible!
Ok, lets go!
Step 1: Materials and Tools
These are the parts you'll need to build your own StopIt! game.
-Arduino Uno (This controls the LEDs and detects when the button is pressed.) -Can be purchased form makershed.com
-USB A-B cable (Sometimes called a printer cable.) -Should come with your arduino.
-Solderless breadboard (half sized)-Can be purchased from makershed.com
-5 Leds (Four of one color, and one of another.)
-Pushbutton switch -I bought mine at Radioshack
-small resistor (more if you are worried about burning your LEDs.)
-At least 15 or so breadboard jumper wires -Can be purchased from makershed.com
-A small amount of thin cardboard. I used empty cereal box.
Tools:
-Soldering Iron
-Electrical solder
-Computer
Step 2: Solder Jumper Wires to the Button
Use your soldering iron to attach jumper wires to the button. Make sure you have strong connections that are not touching.
Step 3: Program the Arduino Board
if you have not set up and configured the Arduino software on your computer, you need to do that first. This is a good guide.
Download the attached Arduino Sketch file.
Plugin you Arduino to your computer.
Open the sketch in the Arduino software.
Upload the sketch to your Arduino.
Attachments
Step 4: Build the Circuit
Now it's time to build the circuit. Make sure to unplug your Arduino board before wiring it up.
Power and ground:
-Run a jumper wire from arduino "5V" pin to breadboard "+" rail.
-Run a jumper wire from arduino "GND" pin to breadboard "-" rail.
LEDs:
-Insert the LEDs into your breadboard as shown, with the longer leads farthest to the left. The red LED goes in the middle.
-Run wires from the each breadboard row with a short LED lead in it to the "-" breadboard rail.
-Run wires from the each breadboard row with a long LED lead to arduino pins 2 through 6.
Button:
-Run one of the buttons wires to the breadboard's "+" rail.
-Run the second wire from the button to an empty breadboard row.
-Run a wire from the same row on the breadboard to arduino pin 8.
-Run a resistor from that row to the breadboard's "-" rail.
Make sure your setup matches the pictures.
Step 5: Hide the Wires
Now, lets make something to hide those ugly wires! I cut out a small rectangle out of cardboard and slid it between the LEDs and the wires. It worked, but it still didn't look great, so I printed "Stop it!" on a piece of paper and glued it to the cardboard. Now it looks like something! You can do what I did or use your imagination and be creative! If you choose to go the route I did, you can get download and print the picture.
Step 6: Test It Out!
Okay, now comes the fun part! Using it!
Connect you Arduino to your computer. The LEDs should begin flashing. If not, you may have them inserted wrong. Try putting them in the opposite way. The long leads need to be on the left. Once they are flashing, you need to watch for when the middle (red) LED comes on, that is when you press the button. If you were successful, the middle light should blink on and off quickly. Now the game speeds up and the LEDs blink faster. Keep playing until you accidentally press the button when a LED other than the one in the middle is lit. The game stops. Watch and count how many LEDs light up to see your how well you did. With 5 being the best and 1 being the worst. Congratulations! You just made an Arduino game!
If you open a serial monitor from the Arduino software, you will be able to see more detailed information about your score.
Thanks for reading this Instructable all the way through! And don't forget to leave a comment if you have any questions or ideas!

Participated in the
Make It Glow Challenge
38 Comments
9 years ago
Cool!
I just made one
Reply 9 years ago on Introduction
Looks good! Glad you enjoyed my instructable.
10 years ago on Introduction
is it just ok to use arduino Diecimila than Uno?
will be the coding different?
Reply 10 years ago on Introduction
I have never used a Diecimila but I would say just try it and see what happens! I don't know of any major differences between arduinos, so I imagine it would work. If you do try it out, please let me know how it goes. I'm curious.
11 years ago on Introduction
i am not familiar with the move command... how can i make the lights go up and back and not just one direction
Reply 11 years ago on Introduction
This is what the move function does: First, it turns of all of the LEDs, then it lights up the next one in the sequence. It knows which LED to light because it checks the "LightPosition" variable.
To have the lights flash to the right, then back the left, you need to change the code at the beginning of the loop, underneath "//Move the light", so that it does not jump back to the first LED when it reaches the side, but instead reverses the direction they blink in. If you can change the way the "LightPosition" variable gets set, you can make the light travel back and forth. You probably need another variable to keep track of which direction the light is traveling.
This is where you should look to make your changes in the code:
//Move the light.
if(millis() - lastMove >= pause)
{
lastMove = millis(); //Remember when we switched LED
LightPosition++; //increment the Light position.
if(LightPosition >= 6) LightPosition = 1;
move(LightPosition);//Update the light position.
}
Hope this helps.
11 years ago on Introduction
Very neat idea!
I Built it with my 7 year old and he loved it (my little geek in training). It was our first Arduino game and this motivated him to keep building more and more! Please see photo for our improvised solder-less "remote" button
Thanks for posting this!
Happy Holidays
4 years ago
will the button that came with the starter kit work?(its 4 pin)
Reply 4 years ago
Any momentary switch should work, so I would expect that your button would work fine.
5 years ago
hey! I can't download the code.Can anybody help me? i would like to try it.
5 years ago
hello! i can't download the codes.how to download? I would like to try it.
thanks!
6 years ago
Hey! We used your idea for a class in school! So much fun!!
6 years ago
how can I change the code so that when you make 5 successful stops, it will activate a servo?
Reply 6 years ago
Neat idea!
You could declare another integer variable at the top of the code and use that to keep track of how many correct stops have been made. Then, somewhere in the main loop portion, add an 'if' statement that checks if that variable is 5. Then you could put in the body of the 'if' statement your code to move the servo. Depending on your goal, you might also want to reset that variable to zero after successfully reaching 5 stops so that you can activate the servo again.
Reply 6 years ago
Juggleboy, thanks for the reply. I have some idea what you are talking about, but I don't have any idea how to do this. I've been doing some studying on how to code, but for me it would be like learning a new language. I keep plugging away at it though.
6 years ago
I made this and it is really kind of cool and simple. Now I want to complicate matters.... I know nothing of coding really, but if someone can help me out here. I would like to add a couple of more LEDs, and have more than one that is the target, RED one, and I would like them to light randomly is possible. I want to make the game more challenging. Thanks...
6 years ago
Thanks for the simple directions
6 years ago
awesome project
7 years ago
I made it. The lights go too slow for the first few rounds. How do I speed them up?
Reply 7 years ago
Look for the line that initializes the "pause" variable in the Arduino sketch and replace the 1000 with a smaller number. The number you choose will be the initial length of time (in milliseconds) that the light will stay on a single LED before moving to the next one.
You might also want to tweak the portion of the code that decides how many LEDs to light up once the game is over, since the level of difficulty will have changed a little.