LED "Simon Says" Game

by 789155 in Circuits > Arduino

33 Views, 0 Favorites, 0 Comments

LED "Simon Says" Game

Screenshot 2025-01-22 024451.png

In this project, we'll be creating a fun "Simon Says" game using an Arduino, four buttons, four LEDs, and a speaker. The game will generate a random sequence of button presses, and the player must repeat the sequence correctly to progress. As the player advances, the sequence becomes longer. If the player presses the wrong button, the game resets. This project is great for beginners looking to learn about Arduino input/output, buttons, LEDs, and sound.

Supplies

Screenshot 2025-01-22 024231.png

Arduino Uno (or compatible board)

4 push buttons (or jumper wires for testing)

4 LEDs (any color)

4 220Ω resistors (for LEDs)

1 Piezo Buzzer or small speaker

Breadboard

Jumper wires

USB cable to connect Arduino to your computer

Prepare the Arduino Board

Screenshot 2025-01-22 024741.png

-Insert the Arduino Uno into your breadboard or connect it via a USB cable to your computer.

-Open the Arduino IDE, select the correct board type and port, and upload the code provided above.

Circuit Setup

Screenshot 2025-01-22 024451.png

Follow the TinkerCAD dIagram above


LEDs:

  1. Connect each LED to one of the pins 8, 9, 10, 11. Use 220Ω resistors in series with each LED's cathode (shorter leg) to ground (GND).

Buttons:

  1. Connect one terminal of each button to pins 2, 3, 4, 5.
  2. Connect the other terminal of each button to GND (ground).

Speaker:

  1. Connect the positive terminal of the speaker to pin 12 on the Arduino, and the negative terminal to GND.


Test the Game

Screenshot 2025-01-22 030305.png

Please download or copy the following document for code: https://docs.google.com/document/d/1i8gIL5qlzCDOdpkuWUb3u1JOX7SuBDFyF-1BWSPsrLY/edit?usp=sharing

(NOW DOWNLOAD ARDUINO IDE)

After uploading the code, open the Serial Monitor (Tools > Serial Monitor).

Press the buttons according to the sequence generated by the game.

If you press the wrong button, the game will play a failure sound and restart.

Adjustments and Customization

  1. You can adjust the tone frequencies in the btnNote[] and cheer[] arrays to change the sounds for each button and the success/cheer sound.


  1. The sequence length increases with each round, and the game will continue until you fail. You can adjust the difficulty by modifying the game logic.


YOU'VE FINISHED!

Screenshot 2025-01-22 030354.png

Conclusion

Congratulations, you've built a fun Simon Says game with Arduino! This project helped you learn about input and output, LEDs, buttons, sound, and random number generation in Arduino. You can customize it further by adding more buttons, changing the difficulty, or even adding a display. Feel free to experiment and modify the game as you like.