4 color memory game
There are 4 LEDs conencted to pins 8 - 11 that pulse in a different order you have to remember
There are 4 buttons connected to pins 4 - 7 that you use to replicate the right sequence
One of the buttons is the start button, and another starts it silently
When you get the sequence right a happy beep will play
When a wrong sequence is inserted a sad tone will play
Easy to fit compactly with an Arduino nano on a small breadboard
Project Overview
This project is a compact version of the classic "Simon Says" memory electronic game, optimized for the Arduino Nano. It challenges the player to remember and replicate a growing sequence of colorful light flashes and sounds. The design is specifically made to be portable and space-efficient on a small breadboard.
Hardware Configuration
- Arduino Nano: The brain of the project, chosen for its small form factor and breadboard compatibility.
- LEDs (Red, Green, Blue, Yellow): Connected to digital pins 8 through 11. Each LED corresponds to a part of the sequence.
- Push Buttons: Four buttons connected to digital pins 4 through 7. These serve as the player's interface for inputting the sequence.
- Piezo Buzzer: Provides audio feedback, playing specific tones for correct and incorrect moves, as well as distinct notes for each LED flash.
- 1k Ohm Resistors: Used to limit the current flowing through each LED to protect them from burning out.
Game Logic and Workflow
- Startup: The game starts in an idle state. Pressing a specific button initializes the game with sound, while another button can start it in silent mode.
- Pattern Generation: The Arduino generates a random sequence of colors. In each round, it flashes the sequence to the player.
- Player Input: The player must press the corresponding buttons in the exact same order.
- Validation:
- If the input is correct, the Arduino plays a "happy beep" and adds one more step to the sequence for the next round.
- If the input is incorrect, a "sad tone" plays, the sequence is cleared, and the game resets.
- Difficulty Scaling: As the player progresses, the sequence becomes longer and faster, testing the limits of their memory.
Compact Design
By using the Arduino Nano and a mini breadboard, the entire circuit fits into a palm-sized area. This makes it an excellent project for learning about arrays, random number generation, and switch/button debouncing in Arduino programming.