Memory Game on Arduino

by Reya Jindal in Circuits > Arduino

48 Views, 1 Favorites, 0 Comments

Memory Game on Arduino

Screenshot 2026-06-15 at 5.58.29 PM.png

Do you think you have what it takes to beat a machine? This Arduino Memory Game is designed to test how strong your memory actually is!


The game progresses through five different levels, each 10 seconds long, with increasing difficulty as you go. These levels are tracked live on a 7-segment display, so you can easily keep track of your progress. Within each level, you will be forced to recall a randomized sequence, which you must then play back.


If you mess up the sequence or run out of time, the system will enter "Lost" mode; a losing tone will play from the buzzer, all the LEDs will flash, and a sad face will appear on the 7-segment display, informing you that you have failed.


On the other hand, if you successfully finish all five levels, a victory tone will play to let you know you have won, and the game will reset on its own!


This following instructable will guide you step-by-step on how to create your very own Memory Game from scratch.

Gathering Supplies

Screenshot 2026-06-15 at 6.15.14 PM.png

For this project, you will be needing the following materials:

  1. Arduino UNO
  2. Breadboard
  3. LEDs (4)
  4. Pushbuttons (4)
  5. 330 Ω resistors (6)
  6. 10 kΩ resistors (4)
  7. 7-segment display
  8. buzzer


If you want to enhance your game, and give an effect of border lights on your board, feel free to make a multivibrator circuit. This step is completely optional, but I have included it, in order to try and give my game more of an arcade feeling. For the multivibrator, you will need the following materials:

  1. 100µF polarized capacitors (2)
  2. 330 Ω resistors (2)
  3. 10 kΩ resistors (2)
  4. NPN transistors (2)
  5. LEDs (2)


External tools you might need in order to help you assist with this game:

  1. Stripper
  2. Pliers

Wiring Your Breadboard

Screenshot 2026-06-15 at 6.30.57 PM.png
Screenshot 2026-06-15 at 7.10.15 PM.png

The wiring on the breadboard for the game is fairly simple. You may use the picture attached as a reference when wiring it by yourself.


For the multivibrator circuit, if you wish to include it, I have attached a schematic, in order to make the wiring easier to do.

Connecting Your Breadboard to Your Arduino

Screenshot 2026-06-15 at 6.31.34 PM.png
Screenshot 2026-06-15 at 7.34.05 PM.png

Now, it is time to connect your breadboard to your Arduino. If the picture is hard to follow, you may follow along with the writing I am going to provide below. You can also see what pins associate with what equipment in the code file (may be found in later steps).


LEDs,

  1. First Red LED - #4
  2. Yellow LED - #5
  3. Green LED - #6
  4. Second Red LED - #7


Pushbuttons,

  1. First Red Button - #8
  2. Yellow Button - #9
  3. Green Button - #10
  4. Second Red Button - #11


Buzzer,

  1. Buzzer - #13


7-Segment Display (the diagram attached above may help you with the pins as well),

  1. a - A0
  2. b - A1
  3. c - A2
  4. d - A3
  5. e - A4
  6. f - A5
  7. g - #12


Make sure that all your wires are connected properly, otherwise there can be issues further on.

Uploading the Code Onto the Arduino

arduino.png

Finally, it is time to upload the code onto the Arduino. For this game particular, the code portion is much more complex than the actual hardware wiring. This is because, this game is very conditional in the sense that for every action the player takes, there is an action item that needs to occur.


I have tried my best to keep the code very simple. There are comments on almost every line, so you can follow along very easily.


I have written this code all by myself from scratch. Although, if I was ever stuck, I did use some assistance from this instructable; https://www.instructables.com/ARDUINO-MEMORY-GAME-2/.

Game Time!

Arduino Memory Game Explanation

It is time to play your game!!


I have attached a video of me explaining how the game works. Feel free to check it out!


Have fun!!

My Own Personal Reflection

I really enjoyed this entire process. This is partially because this was my first time creating any proper project using the Arduino, and the fact that I was able to do this by myself, without any external sources, make me really proud.


I am not going to lie, there were many times where I got stuck, and sometimes it would take hours just to figure out what the problem was. The hardware portion was definitely much easier than the software portion in the sense that there was a lot less room for you to mess up. There were times where I short circuited my LED, and ended up burning a few by accident, but I learned from my mistakes, and was able to finish the hardware part fairly quickly.


As for the software portion, this part took a few days. The first part was writing all of the code. After, I had to continuously test it, and if there was any part that wouldn't work, I had to double check both the wiring and the code, in order to see where the problem was at.


Some specific problems that I ran into was the random sequence not working properly, the pushbuttons being pressed without me actually touching them (the ghost effect), the 7-segment display not matching with the game, and the LEDs not matching with their associated pushbutton. There were definitely other minor ones, but I do not remember what they were on the top of my head.


Overall, I had a lot of fun!