LED Spinner Game

by Prabjyot Singh in Circuits > Arduino

18 Views, 0 Favorites, 0 Comments

LED Spinner Game

imga.jpg

This is a circuit made from a 555 timer, a decade counter, and an Arduino. The circuit causes the LEDs to fire rapidly when the button is pressed, and this is the game. When the button is released, the LED that you land on determines the score. Landing on a red LED is -20 points, yellow is +10 points, and green is +40 points.

This circuit uses a 555 timer to flash an led over and over again. This cycle is synced with the decade counter to keep changing the led that is flashed. Once power is no longer supplied to the 555, the last led that was flashed remains on. This LED is read by the Arduino and appropriate score is added and displayed on the LCD.

Supplies

TOTAL PRICE: $81 for all of the components + many extras for future projects.

Ideate and Research

I started by looking back through the previous projects that I had done and thought of a way to combine 2 of them. I had made a 555 circuit before and a circuit using an Arduino. I took inspiration from other projects using the 555 such as the random generating dice. I used the schematic for this RNG Dice project and saw how this could be turned into a game. I thought I could integrate an Arduino with this to keep track of score and even to display it to an LCD monitor.

I researched online for schematics of the dice circuit and found one.

Building: Breadboard

Definitely my schematic.PNG
circuit.PNG

Start by placing the 555 Chip and the Decade Counter chip a few pins apart and pacing a button in. Place the LEDs in too in the order of 3 reds, 2 yellows, and 1 green. Connect the 555 Timer's power pin (8) to the Arduino's pin 2, and its ground pin (1) into ground on the breadboard. Connect the button to power, ground its output with the 10k resistor, and take the output to pin 3 on the Arduino. Connect the 555 timer's pin 1 to ground, place a jumper between pins 2 and 6 of the 555. Connect the 555's pins 2 and 3 together with a 1k ohm resistor. Connect pin 5 of the 555 with the capacitor with it's ground side in the ground terminal and its positive side connected to pin 5. Connect the decade counter's power pin (16) into power and its ground pin into ground (1). Also connect pin 13 of decade counter into ground. Connect pins 5 and 15 of the decade counter together. Connect pin 14 of the decade counter to pin 3 of the 555. At this point ground all of the LEDs by placing jumper wires between each LED's cathode all leading to a single 330 ohm resistor into the ground terminal of the breadboard. Wire each LED's anode to the decade counter's pins 1, 2, 3, 4, 7, and 10. Also wire the anodes to pins 8-13 on the Arduino with the red LEDs on 8, 9, and 10, yellow LEDs on 11 and 12, and the green LED on 13. Also now connect the ground and power rails on the breadboard to the Arduino's 5V power output and ground pins. For the final component, the LCD. Plug the GND pin into ground and the VCC pin into power. Connect the SDA pin into A4 on the Arduino, and SCL into A5.

Arduino

project].PNG

At this point the breadboard is fully completed, so the code is the only part remaining. The code is attached below. How it works is: It takes input from the button, and outputs to the 555. When the button is pressed it passes the power straight to the 555 and that lets the LEDs flash. As soon as the button is released, the program tracks that and reads which LED is on. From this it calculates score and displays that out to the LCD. It goes back to the cycling state when the button is pressed again.