Simon Says Game With LED Decoration

by 909804 in Circuits > Arduino

571 Views, 2 Favorites, 0 Comments

Simon Says Game With LED Decoration

Full pic 2021-06-22 160033.png

In this instructable, I will be making a Simon Says game with additional LEDs to serve as decoration in Tinkercad. This circuit creates a series of tones and lights and requires a user to repeat the sequence. If the user succeeds, the series becomes progressively longer and more complex. Once the user fails to complete the sequence or the time limit runs out, the game is over.

Components Used/needed

(1) Arduino Uno

(14) LEDs(1 Red,1 Blue, 1 Green, 1 Yellow, 10 White)

(4) push buttons

(1) 47k ohm resistor

(5) 1k ohm resistors

(4) 560 ohm resistors

(1) uF capacitor

(1) 555 timer

(1) 4017 decade counter

(1) Piezo alarm

(2) Double A batteries

(2) Breadboards

Jumper wires

About Project and Schematic Drawing

20210622_170206.jpg
20210622_164621.jpg

For the schematic drawing on the left, it is the LEDs that are circling around the Simon Says game. In the decoration, the LEDs lights one by one for a period of 1second and the cycle repeats. The resistors and the capacitor act as the timing components and the output pulses are available from the out pin in the 555 timer. These pulses are given to the clock pin of the 4017 decade counter. The decade counter connect to the LEDs and making each LED remains on about a second. When one LED turns off, the second one turns on.

For the schematic drawing on the right, the Arduino connect to all the pushbuttons, LEDs and the piezo buzzer. The pushbuttons serve as inputs, while the LEDs and the piezo buzzer serve as outputs. Whenever a pushbutton is pressed, the Arduino would sent a signal to the corresponding LED and the buzzer. When received, the LED would light up and the buzzer would ring a corresponding for that colored LED or pushbutton.

Setup(Part 1)

Part 1 2021-06-22 171158.png

Steps

  1. Set up the 555 timer, 4017 decade counter, and the white LEDs in position
  2. Connect the double A batteries to the positive and negative power rail
  3. Connect the 555 timer and 4017 decade counter to power and ground
  4. Connect the power to the discharge(555 timer) with a 1k ohms resistor and further connect the same power to the threshold(555 timer) with a 47k ohms resistor
  5. Connect the threshold(555 timer) to the trigger(555 timer)
  6. Connect rest(555 timer) to power
  7. Connect the 1uF capacitor from ground(555 timer) to trigger(555 timer)
  8. Connect the clock enable(4017) to ground
  9. Connect the out(555 timer) to the clock(4017)
  10. Connect the outputs(4017) to the anode of the white LEDs (Ex. Output 1 connect to LED 1 and output 2 connect to LED 2)
  11. Connect the cathode of the LEDs to ground

Setup(Part 2)

Full pic 2021-06-22 160033.png

Steps

  1. Set the colored LEDs, pushbuttons, and piezo buzzer in position

  2. Connect the terminal 1 of the first pushbutton to Arduino pin 2 with a 1k ohms resistor
  3. Connect the red LED to Arduino pin 3 with a 560 ohms resistor
  4. Connect the terminal 1 of the second pushbutton to Arduino pin 4 with a 1k ohms resistor
  5. Connect the yellow LED to Arduino pin 5 with a 560 ohms resistor
  6. Connect the terminal 1 of the third pushbutton to Arduino pin 6 with a 1k ohms resistor
  7. Connect the green LED to Arduino pin 7 with a 560 ohms resistor
  8. Connect the terminal 1 of the last pushbutton to Arduino pin 8 with a 1k ohms resistor
  9. Connect the blue LED to Arduino pin 9 with a 560 ohms resistor
  10. Connect Arduino pin 10 to the piezo positive terminal
  11. Connect terminal 2 of all the pushbuttons to ground(Arduino)
  12. Connect the cathode of all colored LEDS to ground(Arduino)
  13. Connect the piezo negative terminal to ground(Arduino)

Write the Code

Code 2021-06-22 155931.png

Run the Simulation

Full Running 2021-06-22 171416.png

When you run the simulation, the white LEDs should take off flashing in a circle and never stops until the simulation stops. While the piezo buzzer should play a small tune and all the colored LEDs flash once, then the game starts. In the game, if you pressed the wrong button or missed the time limit, then the buzzer should play a different tune indicating that you failed. After you failed and the tune played, then press any of the pushbutton to start again. If everything works just like this, then congratulation to you for making it to the end.

Real Life Application

Just little extra for anyone that wants to physically build this Arduino project. Then here is some links for purchasing each component.

(1) Arduino Uno - $23
(14) LEDs(1 Red,1 Blue, 1 Green, 1 Yellow, 10 White) - $12.99 for 300pcs

(4) push buttons - $0.48 each

(1) 47k ohm resistor - $0.14 each

(5) 1k ohm resistors - $0.13 each

(4) 560 ohm resistors - $0.06 each

(1) uF capacitor - $1.05

(1) 555 timer - $0.71

(1) 4017 decade counter - $1.05

(1) Piezo alarm - $2.96

(2) Double A batteries - $4.86

(2) Breadboards - $0.83 - 2.11

Jumper wires - $0.99 for 40pcs