Simon Says Game With LED Decoration
by 909804 in Circuits > Arduino
571 Views, 2 Favorites, 0 Comments
Simon Says Game With LED Decoration
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
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)
Steps
- Set up the 555 timer, 4017 decade counter, and the white LEDs in position
- Connect the double A batteries to the positive and negative power rail
- Connect the 555 timer and 4017 decade counter to power and ground
- 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
- Connect the threshold(555 timer) to the trigger(555 timer)
- Connect rest(555 timer) to power
- Connect the 1uF capacitor from ground(555 timer) to trigger(555 timer)
- Connect the clock enable(4017) to ground
- Connect the out(555 timer) to the clock(4017)
- 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)
- Connect the cathode of the LEDs to ground
Setup(Part 2)
Steps
-
Set the colored LEDs, pushbuttons, and piezo buzzer in position
- Connect the terminal 1 of the first pushbutton to Arduino pin 2 with a 1k ohms resistor
- Connect the red LED to Arduino pin 3 with a 560 ohms resistor
- Connect the terminal 1 of the second pushbutton to Arduino pin 4 with a 1k ohms resistor
- Connect the yellow LED to Arduino pin 5 with a 560 ohms resistor
- Connect the terminal 1 of the third pushbutton to Arduino pin 6 with a 1k ohms resistor
- Connect the green LED to Arduino pin 7 with a 560 ohms resistor
- Connect the terminal 1 of the last pushbutton to Arduino pin 8 with a 1k ohms resistor
- Connect the blue LED to Arduino pin 9 with a 560 ohms resistor
- Connect Arduino pin 10 to the piezo positive terminal
- Connect terminal 2 of all the pushbuttons to ground(Arduino)
- Connect the cathode of all colored LEDS to ground(Arduino)
- Connect the piezo negative terminal to ground(Arduino)
Write the Code
Here is the full code:
Run the Simulation
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