Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Printing
    • Multicolor FDM
    • FDM
    • SLA Resin
    • MJF Nylon
    • SLS Nylon
    • SLM Metal
    • Binder Jetting
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Printing
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Printing
    • Multicolor FDM
    • FDM
    • SLA Resin
    • MJF Nylon
    • SLS Nylon
    • SLM Metal
    • Binder Jetting
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Arduino & Microcontrollers

Arduino Simon Says Game: Build with LEDs and Buttons

Arduino Simon Says Game: Build with LEDs and Buttons

April 1, 2026 /Posted by / 0

Table of Contents

  • Introduction
  • Components and Hardware Setup
  • Wiring Diagram and Connections
  • Complete Code with Explanation
  • Customization and Improvements
  • Troubleshooting Common Issues
  • Advanced Features and Extensions
  • Frequently Asked Questions
  • Conclusion

Introduction

The Arduino Simon Says game is one of the best beginner projects for learning Arduino programming. It teaches arrays, random numbers, loops, input handling, timing, and state machines — all wrapped in a fun, interactive game. You will build the classic memory game where the Arduino plays a sequence of LED flashes and the player must repeat the sequence by pressing the corresponding buttons.

This project requires only 4 LEDs, 4 buttons, a piezo buzzer, and an Arduino — components typically included in starter kits. The total cost is under ₹100 if you already have an Arduino board.

🛒 Recommended: Arduino Uno R3 Beginners Kit — Includes all components needed for the Simon Says game.

Components and Hardware Setup

  • Arduino Uno or Nano
  • 4 LEDs (red, green, blue, yellow)
  • 4 push buttons
  • 4x 220 ohm resistors (for LEDs)
  • 1 piezo buzzer
  • Breadboard and jumper wires

Wiring Diagram and Connections

// LED pins: 8 (red), 9 (green), 10 (blue), 11 (yellow)
// Button pins: 2, 3, 4, 5 (with INPUT_PULLUP)
// Buzzer: pin 7
const int ledPins[] = {8, 9, 10, 11};
const int btnPins[] = {2, 3, 4, 5};
const int tones[] = {262, 330, 392, 523}; // C4, E4, G4, C5
const int BUZZER = 7;

Complete Code with Explanation

#define MAX_LEVEL 100
int sequence[MAX_LEVEL];
int level = 0;

void setup() {
  for (int i=0; i<4; i++) { pinMode(ledPins[i], OUTPUT); pinMode(btnPins[i], INPUT_PULLUP); }
  pinMode(BUZZER, OUTPUT);
  randomSeed(analogRead(A0));
  startAnimation();
}

void loop() {
  // Add new step to sequence
  sequence[level] = random(4);
  level++;

  // Play sequence
  for (int i=0; i<level; i++) {
    flashLED(sequence[i], 400);
    delay(200);
  }

  // Get player input
  for (int i=0; i<level; i++) {
    int btn = waitForButton();
    if (btn != sequence[i]) { gameOver(); return; }
    flashLED(btn, 200);
  }

  // Success - brief pause before next round
  delay(500);
}

void flashLED(int idx, int duration) {
  digitalWrite(ledPins[idx], HIGH);
  tone(BUZZER, tones[idx], duration);
  delay(duration);
  digitalWrite(ledPins[idx], LOW);
}

int waitForButton() {
  while (true) {
    for (int i=0; i<4; i++) {
      if (digitalRead(btnPins[i]) == LOW) {
        delay(50); // Debounce
        while (digitalRead(btnPins[i]) == LOW); // Wait release
        return i;
      }
    }
  }
}

void gameOver() {
  // Flash all LEDs and play sad tone
  for (int j=0; j<3; j++) {
    for (int i=0; i<4; i++) digitalWrite(ledPins[i], HIGH);
    tone(BUZZER, 100, 300); delay(300);
    for (int i=0; i<4; i++) digitalWrite(ledPins[i], LOW);
    delay(300);
  }
  level = 0; delay(1000);
}

void startAnimation() {
  for (int i=0; i<4; i++) { flashLED(i, 150); }
}

Customization and Improvements

  • Add speed increase: reduce delay as levels increase for more challenge
  • Add score display with 7-segment LED or OLED screen
  • Store high score in EEPROM
  • Add two-player mode where players take turns
  • Add a timeout — if the player takes too long, game over

Troubleshooting Common Issues

  • Buttons register multiple presses: Add debounce delay (50ms) and wait for button release
  • LEDs do not light up: Check resistor values (220 ohm) and LED polarity (long leg = anode = positive)
  • Sequence always the same: Use randomSeed(analogRead(A0)) to seed the random number generator with noise from a floating analog pin

Advanced Features and Extensions

Replace LEDs with WS2812 NeoPixels for RGB colour effects. Add an accelerometer — instead of pressing buttons, tilt the device in the correct direction. This creates a physical, motion-controlled version of Simon Says.

Frequently Asked Questions

What is the maximum level?

With a 100-element array, the game supports 100 levels. Each level adds one step, so level 100 requires memorising and repeating a 100-step sequence. Most humans struggle beyond level 15-20.

Can I use RGB LEDs instead of single-colour LEDs?

Yes, use common-cathode RGB LEDs and assign different colours to each button. You will need 3 pins per LED (12 total) or use a WS2812 strip with just 1 data pin.

Conclusion

The Arduino Simon Says game is a perfect starter project that teaches essential programming concepts while creating something genuinely fun to play. Build it for your college electronics lab, makerspace, or as a gift for younger family members learning electronics.

🛒 Recommended: Arduino Uno R3 Beginners Kit — Everything you need for this project. Browse all Arduino kits at Zbotic.in
Tags: Arduino, beginner, Game, LED
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Compost Temperature Monitor: A...
blog compost temperature monitor active pile management 614493
blog dairy milk chiller temperature controller build 614499
Dairy Milk Chiller: Temperatur...

Related posts

Svg%3E
Read more

Arduino Batch Programming: Flash Multiple Boards Quickly

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Based Radar System with Ultrasonic Sensor

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Automatic Plant Monitor: Sunlight, Moisture, Temperature

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Lie Detector: GSR Sensor Polygraph Project

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Metal Detector: Build a Treasure Finder

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Customer Support Email: [email protected]
WhatsApp: 020 6913 4444

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now
Chat with us