Simple Simon Says Arduino Circuit

by 802480 in Circuits > Arduino

14 Views, 1 Favorites, 0 Comments

Simple Simon Says Arduino Circuit

Funky Densor.png
0.jpg
Screen Shot 2026-01-21 at 11.59.43 AM.png

In this instructable I will explain how to make and code a simple simon says game onto an arduino circuit.


This is a easy, basic circuit design built with the help of an arduino code. In the end you will have a fun memory game you can show off to your friends, or play with yourself.

Supplies

unnamed.jpg

Building the Circuit PT1

0.jpg
0.jpg
0.jpg

1.First take your breadboard and place all the buttons in a sequence, two pins on one side of the breadboard, and 2 legs on the other side of the breadboard. Then connect one of the buttons legs to the ground rail, for each button.


2.Then place the cathode of your LED's on the fourth leg of the buttons. The cathode LED's and 4th leg of the buttons will be in the same row leading to the ground line. The push buttons will be connected to pins 2,3,4,5.


3.Take your 330/560 ohm resistors, and place them inline with the anode of the LED's that are connected to the buttons. These will later be connected to pins 11,10,9,8.

Building the Circuit PT2

0.jpg
0.jpg

1.Take the buzzer and connect to male/female wires to its legs. Take the postive leg and connect it to pin 12 on the arduino, and take the negative leg and either connect it to the ground pin on the arduino, or the ground rail on the breadboard.


2.Lets start the button and LED connections to the arduino. From the first push button inline with the LED cathode, connect the leg of the push button to pin number 5. Continue this for the rest of the push buttons, connecting them to pin 4,3,2.


3.From the resistors coming from the anode of the LED's, connect them in sequence to pins 11,10,9,8.


4.Finish by connecting a wire from the ground rail to a gnd pin on the arduino.

Writing the Code

arduino_logo_1200x630-01.png

COPY AND PASTE CODE INTO ARDUINO CODING SOFTWARE


const int buttonPins[4] = {2, 3, 4, 5};

const int ledPins[4] = {8, 9, 10, 11};

const int buzzerPin = 12;

int sequence[50];

int level = 0;

int tones[4] = {262, 330, 392, 523};

void setup() {

Serial.begin(9600);

for (int i = 0; i < 4; i++) {

pinMode(ledPins[i], OUTPUT);

pinMode(buttonPins[i], INPUT_PULLUP);

}

pinMode(buzzerPin, OUTPUT);

randomSeed(analogRead(A0));

startGame();

}

void loop() {

playSequence();

if (!getPlayerInput()) {

gameOver();

} else {

level++;

delay(500);

}

}



void startGame() {

level = 0;

for (int i = 0; i < 50; i++) {

sequence[i] = random(0, 4);

}

for (int i = 0; i < 4; i++) {

digitalWrite(ledPins[i], HIGH);

}

tone(buzzerPin, 440, 300);

delay(300);

for (int i = 0; i < 4; i++) {

digitalWrite(ledPins[i], LOW);

}

delay(500);

}

void playSequence() {

for (int i = 0; i <= level; i++) {

int led = sequence[i];

digitalWrite(ledPins[led], HIGH);

tone(buzzerPin, tones[led], 300);

delay(300);

digitalWrite(ledPins[led], LOW);

delay(200);

}

}

bool getPlayerInput() {

for (int i = 0; i <= level; i++) {

int pressed = waitForButton();

digitalWrite(ledPins[pressed], HIGH);

tone(buzzerPin, tones[pressed], 200);

delay(200);

digitalWrite(ledPins[pressed], LOW);

if (pressed != sequence[i]) {

return false;

}

}

return true;

}

int waitForButton() {

while (true) {

for (int i = 0; i < 4; i++) {

if (digitalRead(buttonPins[i]) == LOW) {

while (digitalRead(buttonPins[i]) == LOW);

delay(50);

return i;

}

}

}

}

void gameOver() {

for (int i = 0; i < 3; i++) {

for (int j = 0; j < 4; j++) {

digitalWrite(ledPins[j], HIGH);

}

tone(buzzerPin, 200, 300);

delay(300);

for (int j = 0; j < 4; j++) {

digitalWrite(ledPins[j], LOW);

}

delay(300);

}

delay(1000);

startGame();

}

____________________________________

This is written with the use of more complex code. If you wish I have linked multiple websites below of people demonstrating how to use the unique line of code, such as arrays, for loops, etc.


https://www.youtube.com/watch?v=W5AApP9P-b0 -changing tone of buzzer

https://www.programmingelectronics.com/tutorial-13-how-to-use-arrays-with-arduino/? utm -Arrays tutorial

https://docs.sunfounder.com/projects/esp-cam-kit/en/latest/arduino_video_course/video_7_array.html?utm -Arrays tutorial

https://opentools.ai/youtube-summary/for-loops-arduino-arduino-uno-programming-for-beginners?utm -For loops tutorial

https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-experiment-guide---v41/circuit-2c-simon-says-game?utm-Basic guide on the circuits compnents and code(Original version of the game)

End

Thank you for taking the time to look at or build this simon says game circuit. I had a lot of fun designing this circuit and writing the code, and I hope that inspiration reaches someone else. Once again thank you, and stay curious.