Introduction: Arduino - Simple Simon Says Game

Picture of Arduino - Simple Simon Says Game
In this instructable, I will show you how to make a simple Simon Says Game using an Arduino. it's not just simple but we can get a psychological benefit. I have a bad memory to remember something fast or a new things. So this project really suitable for someone like me. hahaha

We're gonna using some basic electronics built on top of an Arduino. When the project is finished you will have a working simple circuit that fun to play.


This is the video of my Arduino - Simple Simon Says Game
(change the quality for a better view)



 

Step 1: Parts and Tools

Picture of Parts and Tools

Here is all you will need:
(1) Arduino UNO R3
(4) LEDs (Red, Green, Blue, Yellow)
(4) Push Button (small)
(1) PCB Matriks / Perfboard
(1) Speaker 8 ohm (0,5 watt)
(4) 100 / 330 ohm resistors
(1) 9V battery
(1) 9V battery box with on-off switch
(4) Spacer 0,5 cm
(1) Project enclosure (I'm using "Kitchen Ware" box)
- Breadboard
- Shrink tubing
- Jumper wire
- Rainbow wire (optional)
- Male header extended
- Blackhousing / female 1x1 header (optional)

Tools:
- Soldering iron
- Solder
- Hot glue
- Mini drill
- Pliers
- Cutter
- Helping hands (if you don't have it, you can build it from my helping hands instructable )

Step 2: Making the Circuit on Breadboard

Picture of Making the Circuit on Breadboard

Let's build it on breadboard first. First, lets put the components on a breadboard so we could see how it worked and how to fit it onto the perfboard. The circuit diagram was made with Fritzing.

Step 1
Put the buttons on breadboard.  We're gonna tie one lead of the buttons directly to ground. The other lead will be wired to the Arduino's Digital pins 2, 3, 4, and 5. 

Step 2
Put the LEDs above the buttons. Plug the LEDs in with the switches so the Cathode is on the same strip as the side of the button that is tied to ground. And arrange it so the Anode plugs in off to the side of the button.

Step 3
Add 330 Ohm resistor and put it inline with the Anode to the top section of the breadboard. Now we can connect a wire from the resistor to the Arduino.

Test everything out and make sure that you're circuit is going to work before you start soldering.

Step 3: Write the Code

Picture of Write the Code

The sketch was originally made by Robert Spann back in 2009. I just a beginner of Arduino so I got the sketch from mpilchfamily's instructables . To give the game sound it using the Tone.h Library. You will get an error if you dont install the Tone library, downlod the tone.zip and put it in the adruino library folder. A file of the sketch and Tone Library is also attached.

You can go to How to Install a Library to learn it.

Step 4: Move to Perfboard

Picture of Move to Perfboard

Step 1
Cut the perfboard about 7 cm x 5,5 cm.

Step 2
Arrange the component, I usually place all components in before starting to solder. But if you want to do soldering one by one,  you can mark on the perfboard which legs of your component will be placed.

Step 3
Arrange the push buttons. (see image 1)

Step 4
Put LED, the cathode connect to the push button, the anode connect to the resistor. I'm using 330 Ohm resistor, because I want my LED no so bright. For the resistor, I put it backward on purposed for efficiency with the enclosure. (see image 2 and 3)

Step 5: Complete the Circuit on Perfboard

Picture of Complete the Circuit on Perfboard

Step 1
Add a jumper wire for connect the push button with LED (cathode). (See image 1)

Step 2
Using a rainbow cable to connect the circuit with the Arduino. (we're gonna make 2 packets cable, each packet consist of 4 cables)
- We need 4 cables, and 4 male header
- Strip the end of the cable, about 0,5 cm (see image 2)
- Put the wire / bend it around the male header (see image 3)
- Solder it together (see image 3)
- Make 2 packet of these. (see image 4)

Step 3
Solder the first packet cable with resistor. And solder the second packet cable with the push button. (See image 4)

Step 4
Add a ground leads, I made it from a quite long wire. and put the wire for connect to the ground of Arduino. (see image 5)

Step 5
Check the components once again before soldering.

Step 6: The Enclosure

Picture of The Enclosure

Step 1
Drawing the pattern on "Kitchen Ware" Box with marker for placing the spacer for Arduino. It's really helps for drilling. (See image 1 and 2)

Step 2
Be careful when you drilling the "Kitchen Ware" Box, because it made of plastic. It easy to melt if the drill get hot, but it's okay you can tidy it up by using a small cutter knife.

Step 3
Put the Arduino to fit with the box, and draw a pattern for jack power and USB socket. (see image 3)

Step 4
Drawing the pattern on the top of the box with marker for placing the push buttons and LEDs. It's really helps for drilling. (See image 4)

Step 5
Don't forget to make a hole for the speaker. I put my speaker on the other side of the box.

Step 6
There will be some scratch and some little cracks on the box, you can covering it with the colour paper or paint it.

Step 7: Put the Circuit Into Enclosure

Picture of Put the Circuit Into Enclosure

Step 1
Put an Arduino into the enclosure. And put the Speaker on the other side. I attached the speaker with Transparent Tape instead of using hot glue. The Positive leads connect to Pin 12 of Arduino, and the negative leads connect to the ground of Arduino. (see image 1)

Step 2
I attached the perfboard with 'Foam Double Sided Tape' instead of using hot glue, just in case I want to modify the circuit later. But if you want to make the circuit steady and permanent I recommend for using some hot glue. (see image 2)

Step 3
- Connect the "ground wire" directly to ground of Arduino.
- The second packet cable (from push buttons), will connect to the Arduino's Digital pins 2, 3, 4, and 5. 
- The first packet cable (from LEDs & resistors) will be using Digital pins 8, 9, 10, and 11.
So make sure the buttons and LED are lined up as follows:
* Button on pin 2 with LED on pin 8
* Button on pin 3 with LED on pin 9
* Button on pin 4 with LED on pin 10
* Button on pin 5 with LED on pin 11

Step 4
We are done!!

Step 8: Finish !!

Picture of Finish !!

You can let the box being transparent or you can paint it, but for me I covered it with Batik pattern for looking better and because Batik is a National Culture and Identity of Indonesia :)


Don't forget to give me a feed back or advice because I'm just a beginner.

Have fun :D


Greetings from Indonesia!!

Comments

JaylordV1 (author)2017-08-06

Sir can you help me to reset that memory test game using a tilt switch

DonaldJ1 made it! (author)2014-10-18

I made this today, but with modifications for using LED Tactile switches which light up as you press them.

However, I did have some issues getting the code to work. The file does not compile with the tone library. However as the tone functionality is now available within the latest version of Arduino (1.0.6), I modified your code to make use of this. It does however require the user to pick up the pitches.h file as used in the toneKeyboard example

faziefazie (author)DonaldJ12015-05-26

Sorry for my late reply, I've been hiatus for awhile from this web for some reason.

That was awesome work, you did a good job.

Yeah, I think the tone library already update, so it doesn't compatible with my version anymore. Can you share the link, the modified code or the steps to make it works with the latest version Arduino IDE? it would be very helpful for the other who have the same problem, since I don't have so much time now to do it :(

But anyway, keep up the good work ;)

DonaldJ1 (author)faziefazie2016-04-08

Sorry for the very late reply.

I'd lost the original code (old laptop dying), however I have taken your original code base and made it work again with the tone library.

The project is available on github at:

https://github.com/dojones1/Arduino-Simon-Says

I plan to recreate the project with the touch LEDs, and will try and get a working repository with the codebase for that.

MarkC360 (author)DonaldJ12017-07-24

Thank you for doing this work. Code worked perfectly for me.

fakhroul.rmc (author)DonaldJ12015-08-10

hello DonaldJ1... can i ask for the coding of the tone that your modified... i got the same problem...

DonaldJ1 (author)fakhroul.rmc2016-04-08

https://github.com/dojones1/Arduino-Simon-Says

Noob_Boy_XXX (author)2017-07-16

Where is the power supply? newbee here. please teach me how to connect power supply on this project.

nimati1999 (author)2016-03-16

it keeps swending me this error..

Arduino: 1.6.3 (Windows 7), Board: "Arduino Uno"

C:\Users\User\Documents\Arduino\libraries\Tone\Tone.cpp:26:20: fatal error: wiring.h: No such file or directory

#include <wiring.h>

^

compilation terminated.

Error compiling.

A library named Tone already exists

This report would have more information with

"Show verbose output during compilation"

enabled in File > Preferences.

uuemad (author)2016-01-10

how to fix this problem I couldn't find the wiring library anywhere.

Arduino: 1.6.5 (Windows 8.1), Board: "Arduino/Genuino Uno"

Using library Tone in folder: C:\Users\Youssef\Documents\Arduino\libraries\Tone (legacy)

-IC:\Users\Youssef\Documents\Arduino\libraries\Tone -IC:\Users\Youssef\Documents\Arduino\libraries\Tone\utility C:\Users\Youssef\Documents\Arduino\libraries\Tone\Tone.cpp -o C:\Users\Youssef\AppData\Local\Temp\build9214209217883788605.tmp\Tone\Tone.cpp.o

C:\Users\Youssef\Documents\Arduino\libraries\Tone\Tone.cpp:26:20: fatal error: wiring.h: No such file or directory
#include <wiring.h>
^
compilation terminated.
Error compiling.

faziefazie (author)uuemad2016-01-11

it usually happened because the tone library is not compatible with your arduino IDE, I'm back using Arduino 1.0.4 to make it work. Maybe you can search/googling the tone library that already modified and compatible with your IDE version.

Regards

uuemad (author)faziefazie2016-01-12

I installed the 1.0.4 ide and it didn't work again

faziefazie (author)uuemad2016-01-13

Someone has created it based on my project and it's working, maybe you can check his instructables https://www.instructables.com/id/ER18X9IIBGCF50S/

Famagroup made it! (author)2015-08-03

Very fun! I make some improvements like a score board using a 16x2 lcd. And a hot swap cables using a speaker stereo connector. Good project!

MihkelG (author)Famagroup2015-12-23

Hei, Can you share the counter code?

faziefazie (author)Famagroup2015-11-13

WOW, that's awesome!!

Keep up the good work :)

faziefazie (author)Famagroup2015-11-13

WOW, that's awesome!!

Keep up the good work :)

FreddieC1 (author)2015-12-04

Do you think its possible to build this on a larger scale? I would like to build something you can kick a ball at.

faziefazie (author)FreddieC12015-12-16

yes of course it possible, I guess you can do anything with arduino or any micro controller.

Dark Master (author)2015-11-29

Great instructable... But I was not able to get it working. The game would function as normal except for the buttons. When I pressed a button to answer it would light up a random led and it would think that was the led you pressed.

faziefazie (author)Dark Master2015-11-30

are you sure the pin connections and the code already matched?

I guess it's not so hard to wiring it up, you can try it first on the project board and test it. Someone has created it based on my project and it's working, maybe you can check his instructables https://www.instructables.com/id/ER18X9IIBGCF50S/

best regards.

Dark Master (author)faziefazie2015-11-30

Thank you I'll try that

KristersK (author)2015-11-15

It's not working , i have sound but leds arent turning on . Maybe its because i am using arduino nano ?

faziefazie (author)KristersK2015-11-30

I'm sorry, but I never use arduino nano, so I don't know the difference between nano and arduino uno's pins. you can check the data sheet/schematic for arduino nano, maybe the voltage for drive the leds isn't enough. Other case, are you sure the wiring already set up properly?

RonM9 made it! (author)2015-07-10

For a beginner this is a great project and code.
As you asked for advice, I noticed some coding issues and hard to follow sections. The biggest issue was that if someone changed pin assignments for their own setup, the buttons and LEDs would not work. So I created an improved version here:

https://www.instructables.com/id/ER18X9IIBGCF50S/

I hope you and others, who have had problems with differing hardware, find it very helpful.

faziefazie (author)RonM92015-11-13

Thanks for that, that would be really helpful for other and also for me :)

JonathanM107 made it! (author)2015-11-12

My son and I made this, great fun and still being played with !

faziefazie (author)JonathanM1072015-11-13

Awesome!!

Keep up the good work :)

AlonsoN1 made it! (author)2015-11-03

It really works!!!

faziefazie (author)AlonsoN12015-11-13

Wow, that's awesome. congratulations :)

RonM9 (author)2015-08-14

Here is new coding for this project, using tone library, which works with the latest IDE; and has several improvements and fixes.

https://www.instructables.com/id/ER18X9IIBGCF50S/

Tyck (author)RonM92015-10-11

Hello,

So I have this together and working fine,

But when the sequence is entered to quickly it results in a wrong answer even though the serial moniter registers that the sequeance was entered correctly. Is there a way to fix this, I tried playing with the delays but to no avail. I'm just still just learning and would like to be able to get this operating with the quick button taps that help to make it really feel like classic SIMON

RonM9 (author)Tyck2015-10-16

Good observation. I apparently did not truly play that much with it. This differently reduces the fun. I found that there was a delay(250) being used to allow time for the button to be released. This barred new inputs during that time. I replaced it with a new function call to wait_BtnRelease(), in my project (see link above).

You may also be interested in another version of this game referred to as Simon_Sings. Check out: https://www.instructables.com/id/Fast-Easy-Simon/

PabloW2 (author)RonM92015-09-14

Hi! the link is broken somehow. Can you correct it please? Thanks!

RonM9 (author)PabloW22015-09-16

The link was to an un-published instructable. I now see that even with the link, others can't get to it. So I have made it public by 'publishing' it.

https://www.instructables.com/id/Improved-Simon-Say...

KrishY1 (author)2015-08-23

I've tried to this but the LED's are not working, after uploading the program, only the speaker is working,,need help thanks

fakhroul.rmc (author)2015-08-10

Hello... i got some problem with your coding.. its would not works and my led not light up.. would your help me....

YasserR1 (author)2015-06-20

Saludos. Quisiera saber si podría ayudarme con este problema.
Estoy usando Arduino Nano.
He seguido todos los pasos, uno por uno, pero al momento de la verdad solo funciona el sonido. No se prende ni un solo LED y los botones no funcionan. ¿Existe algún problema con usar Arduino Nano y no UNO?
----------------------------------------------------
Greetings. I wonder if you could help me with this problem.

I'm using Arduino Nano.

I followed all the steps, one by one, but the moment of truth only sound works. It does not turn a single LED and buttons does not work. Is there a problem with using Arduino Nano and not Arduino UNO?

Famagroup (author)YasserR12015-06-29

In the code, change boolean to int and it works! Nice!

RonM9 (author)2015-06-28

The original logic used hard coded values for comparing button and LED pin numbers, along with some other issues. So I created an updated version, for everyone (see https://www.instructables.com/id/ER18X9IIBGCF50S )

It will work with a Nano or a Mega 2560.

RobertA18 (author)2015-06-18

I do not speak English, so I'm sorry for the mistakes .

RobertA18 (author)2015-06-18

I did otherwise and it worked.
I will provide the schema and the code I used.

source: https://learn.sparkfun.com/

Download link: https://mega.nz/#!7p1xQbZI!SZdeipBP7YiEeAO4abhK4Q-cLkzrvVz9QwAJ0Rgo27k

thelearingnoob (author)2015-06-08

faziefazie I tried to upload your code and got this error(s)

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Windows NT (unknown)), Board: "Arduino Uno"
In member function 'void Tone::begin(uint8_t)':
121: error: 'bitWrite' was not declared in this scope
error: 'digitalPinToPort' was not declared in this scope
error: 'portOutputRegister' was not declared in this scope
error: 'digitalPinToBitMask' was not declared in this scope
In member function 'void Tone::play(uint16_t, uint32_t)':
198: error: 'OUTPUT' was not declared in this scope
error: 'pinMode' was not declared in this scope
294: error: 'bitWrite' was not declared in this scope
In member function 'void Tone::stop()':
:361: error: 'digitalWrite' was not declared in this scope

please help.

JonoJ (author)2015-03-17

hey, nice project.

i am following your instructions step by step.

code loaded fine, but when i switch it on, i have no LEDs turning on. but the opening tune works fine, just dont see any lights or hear the sound of the first led light going on?

Any help?

What are the jump wires at the top for? (running along + and -)

davecoxhome (author)JonoJ2015-05-29

Yeah, I had the same problem. It turns out that two arrays of type boolean (boolean button and boolean ledpin) need to be changed to type int instead of boolean.

So just changing those two boolean to int solved the problem.

Apparently in an older compiler, type boolean was interpreted as integer, and now it is properly interpreted as binary. The array is stuffed with integers, so calling it a boolean made it truncate them to just 1 or 0, and lost it's mind...

faziefazie (author)JonoJ2015-05-26

Maybe you put the wrong pin of LED, if you take a look at the picture of my breadboard on step 2 , the cathode (-) was connected with the 4th pin of push button, the anode (+) connected to resistor.

the jump wires? you mean the black wire? it's connect to the ground (on arduino) and also ground from power/ battery.

davecoxhome (author)2015-05-29

Yeah, I had the same problem. It turns out that two arrays of type boolean (boolean button and boolean ledpin) need to be changed to type int instead of boolean.

So just changing those two boolean to int solved the problem.

Apparently in an older compiler, type boolean was interpreted as integer, and now it is properly interpreted as binary. The array is stuffed with integers, so calling it a boolean made it truncate them to just 1 or 0, and lost it's mind...

davecoxhome (author)2015-05-29

davecoxhome (author)2015-05-29

ahmedabutahoun2003 (author)2015-05-26

I have found some people saying that it doesn't work on the lastest version of IDE, so is that true? And how to fix it?

About This Instructable

94,159views

170favorites

License:

Bio: Bachelor of Wireless Telecommunication Engineering from Bandung State Polytechnic, Indonesia | Software QA - Junior Engineer at Oberthur Technologies | A Rhesus(+) | Aries | Photography | Computer Geek | Chiliphobia | Art ... More »
Add instructable to: