Introduction: StopIt! LED Game (powered by Arduino)

Picture of StopIt! LED Game (powered by Arduino)

This project was inspired by this video from YouTube and the Pendulum Challenge Kit from 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

Picture of 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
-USB A-B cable (Sometimes called a printer cable.) -Should come with your arduino.
-Solderless breadboard (half sized)-Can be purchased from
-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
-A small amount of thin cardboard. I used empty cereal box.

-Soldering Iron
-Electrical solder

Step 2: Solder Jumper Wires to the Button

Picture of 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

Picture of 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.

Step 4: Build the Circuit

Picture of 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.

-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.

-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

Picture of 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!

Picture of 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!


Ploopy (author)2013-10-30


I just made one

juggleboy (author)Ploopy2013-10-31

Looks good! Glad you enjoyed my instructable.

lyn625 (author)2012-07-23

is it just ok to use arduino Diecimila than Uno?
will be the coding different?

juggleboy (author)lyn6252012-07-23

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.

vandygirl2013 (author)2012-04-11

i am not familiar with the move command... how can i make the lights go up and back and not just one direction

juggleboy (author)vandygirl20132012-04-12

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.

LoopBack127 (author)2011-12-06

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

vbbbbeee (author)2017-08-30

hey! I can't download the code.Can anybody help me? i would like to try it.

vbbbbeee (author)2017-08-30

hello! i can't download the to download? I would like to try it.


JosefineH2 (author)2017-03-22

Hey! We used your idea for a class in school! So much fun!!

jmert1 (author)2016-12-06

how can I change the code so that when you make 5 successful stops, it will activate a servo?

juggleboy (author)jmert12016-12-07

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.

jmert1 (author)juggleboy2016-12-13

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.

jmert1 (author)2016-12-09

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...

srusnock (author)2016-11-23

Thanks for the simple directions

Imoviemaker3! (author)2016-08-08

awesome project

UndercoverChicken (author)2016-06-01

I made it. The lights go too slow for the first few rounds. How do I speed them up?

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.

Also. For me the button doesn't work all the time. I've tried multiple buttons. It's weird. Maybe it's with the code

Buttons can be tricky to get right sometimes. Did you remember to include the resistor between the button and ground on Step 4? Make sure that it runs from the side of the button closest to the Arduino's input pin to the ground rail of the breadboard. That will ensure that the input pin reads a digital LOW when the button is not being pressed.

If that doesn't fix the problem, you could try to implement a way of "debouncing" the button. Debouncing is described on the Arduino website here:

Basically, mechanical buttons tend to oscillate back and forth very quickly between being open and being closed in the short time that it takes to press or release the button. Although this oscillation is imperceptible to us humans, the Arduino picks up on it, which can cause unpredictable behavior.

Okay; thank you.

ForeprimeSeo (author)2016-04-04

High school simple. Thanks

ForeprimeSeo (author)2016-04-04

High school simple. Thanks

ForeprimeSeo (author)2016-04-04

High school simple. Thanks

ForeprimeSeo (author)2016-04-04

High school simple. Thanks

KendallC3 made it! (author)2015-12-29


KendallC3 (author)KendallC32015-12-29

I used two arduino's

Hacked old printer into a ticket dispenser

1st arduino reads the coin op (led and photo cell) and send 5v to the 2nd arduino. And also run count down timer be4 it cuts off its 5v.

2nd arduino runs the game,buzzer and outputs to the transistor running the ticket dispenser.


MianM1 made it! (author)2015-06-03


i made it.

LEDs blinks randomly and shows the score on lcd.. On wrong input buzer beeps 5 times.. :)

Thanks all of you.. Specily juggleboy.

Aellyssa MaeM1 (author)MianM12015-09-28

hi , may i know the codes that you input ? thankyouuu :)

OG22 (author)2015-05-26

I'm having trouble with the code. How did everyone else do it? I clicked on the attachment, and a webpage opened with all of the lines of code together, not separated (as you can see in the photo). I copied this to the Arduino program, and, unsurprisingly, it didn't upload. How can I get the correct code file?

OG22 (author)2015-05-26

Arduino Tech (author)2014-11-14

I made one, its so cool and easy!! thanks for this instructable

lavadarkshadow (author)2014-04-12

I tried making it, but I don't think the leds were getting enough power. They didn't light up all the way. Also I din't have the pushbutton so I just used a normal button. I seemed to work I got an output from the serial monitor.

I tried again, and this time I guess I wired everything okay because it works :D

moimoipalamoi made it! (author)2014-02-18

Thank you for the code! I'm new in arduino world. I recently bought 1 to play with and I'm in love with it. I've learned new codes in this game project thanks to you!

greystripe3 (author)2012-12-28

were do u get the code

juggleboy (author)greystripe32012-12-29

The Arduino sketch is attached to step three. You can download it from there.

lyn625 (author)2012-07-24

i have one more question, have u try to incorporate the game with sound?
i think it will be more fun.

lyn625 (author)2012-07-23

is it just ok to use arduino Diecimila than Uno?
will be the coding different?

lyn625 (author)lyn6252012-07-24

i was planning that too....
but still thanks for your reply, i appreciate it :)

ok i will post it here if it works in Diecimila

bakedicecream (author)2011-11-17


About This Instructable




More by juggleboy:Upgrade Your Space Launch with a Physical Staging Button for Kerbal Space ProgramComputer Controlled RGB LedStopIt! LED Game (powered by arduino)
Add instructable to: