กลับไปหน้ารวมไฟล์
compact-memory-game-for-arduino-nano-with-buzzer-sound-ce2d43-en.md

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

  1. 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.
  2. Pattern Generation: The Arduino generates a random sequence of colors. In each round, it flashes the sequence to the player.
  3. Player Input: The player must press the corresponding buttons in the exact same order.
  4. 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.
  5. 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.

ข้อมูล Frontmatter ดั้งเดิม

title: "Compact Memory Game for Arduino Nano with Buzzer Sound"
description: "Better code of a previously posted project for the memory \"simon says\" game where you remember what order the 4 different colors blink in and keep adding on to the pattern. \nPressing the last button will start the game with sound. The next button starts it silently."
author: "trent15941"
category: "Gadgets, Games & Toys"
tags:
  - "Games"
  - "Kids"
views: 737
likes: 0
price: 1120
difficulty: "Intermediate"
components:
  - "1x Green LED"
  - "1x Small Breadboard"
  - "1x 10 jumper wires 150mm male"
  - "4x 1K resistor, 1/8w"
  - "1x Arduino Nano"
  - "4x push button"
  - "1x Red LED x 1"
  - "1x Computer with USB ports and Internet Access"
  - "1x Blue LED"
  - "1x Piezo buzzer"
  - "1x 1206 Yellow LED"
tools: []
apps:
  - "1x  Arduino IDE"
downloadableFiles:
  - "https://projects.arduinocontent.cc/7f98e1f1-5573-4b38-90e3-2de630b9c2ca.ino"
documentationLinks: []
passwordHash: "fd4b1a19c0d9b51757bf5519d220be24ca6ed02c775b618046631e164e9a5881"
encryptedPayload: "U2FsdGVkX1+Z/ssnjzHchVY8v8ZwRB/jbU8w3Bc3Dhgs1OVBKkPeCpiq4l/9c71kXIp+pt1QDD1K0y05XaylfNp5EBrIk78OEhp4YI+Jz+Rsho7EvltOi1zEj1rFD47ISjkkE0kNRsaT+qjr9VhavwnretHDeoE4n9uLvkDE9/4="
seoDescription: "Compact Simon Says Memory Game for Arduino Nano with Buzzer sound. Improved code for 4-color pattern memory challenges."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/compact-memory-game-for-arduino-nano-with-buzzer-sound-ce2d43_cover.jpg"
lang: "en"