555 Timer Roulette
This project uses a 555 timer to create a circuit that simulates a spinning roulette wheel. The circuit involves a 555 timer and a 4017 IC decade counter. It simulates a gambling game called roulette. The user will touch their fingers to a touch wire which will results in a moving pattern of lights and when the user takes their finger off the touch wire, the LEDs will slow down until their is one LED lit up and eventually none.
Supplies
- 555 timer IC
- 4017 IC
- PNP Transistor (BC 557)
- Resistors (330 Ohms, 10 k Ohms, 2 x 3.3M Ohms, 10 M Ohms)
- Capacitors (1uF, 100n)
- LEDs (White)
- 9V battery or power supply
- Breadboard
- Jumper wires
Data Sheets
555 Timer Texas Instruments Datasheet: https://www.ti.com/lit/ds/symlink/lm555.pdf?ts=1712679384480&ref_url=https%253A%252F%252Fwww.google.com%252F
4017 IC Texas Instruments Datasheet: https://www.ti.com/lit/ds/symlink/cd4017b.pdf?ts=1712668207757&ref_url=https%253A%252F%252Fwww.google.com%252F
Testing Components
Components of the circuit should be tested in before constructing as good practice. This can help to mitigate troubleshooting errors later in the building stage. Many times circuits can be perfectly correct in terms of connections, orientation of LEDs, capacitors, transistors, etc. However, components of circuits break often, and the reason a circuit can be wrong can be as simple as a broken or ineffective wire, LED, or Capacitor.
Separate components such as the resistors, batteries, and capacitor values can be checked using a digital multimeter. For example, a 9 V battery is needed for this circuit to run properly. The DMM can be turned to its voltage setting, and the positive and negative terminals of the battery are to be connected. Then the voltage value can be checked. This process can be repeated to check the resistance value (Ohms) and Capacitance (Farads).
Setup
Construct the circuit to the directions of the schematic and video above. These videos will help to aid in the building of the circuit correctly.
Suggestions:
- The setup of LEDs in a circle pattern is rather difficult. It might be easier to set up the LEDs in a straight line connected by jumper wires to the correct connections, or setup the LEDs to connect directly to the 4017 IC.
- The cathodes of all of the LEDs are connected inside the circle. The cathode, or negatively charged terminal of the LED is the longer leg of the LED.
- Ensure that the capacitor is connected in the right orientation. This can be checked by reviewing that the positive end of the capacitor is connected to the end of the 3.3 M Ohm resistor, and the negative end is connected to the 10 M Ohm resistor.
4017 IC Explanation
The CD4017 IC has 10 decoded outputs (Q0-Q9). These outputs go high sequentially as the counter progresses. In the roulette circuit, these outputs are connected to LEDs. Each time the 4017 advances its count, a different LED is illuminated, simulating the movement of the roulette wheel. The 555 timer oscillates between high and low states at a certain frequency determined by the values of resistors and capacitors connected to it. The output of the 555 timer, which is the clock signal, is connected to the clock input (CLK) of the CD4017 IC. Each rising edge of the clock signal causes the 4017 to advance its count by one step. Looking at the 555 Timer data sheet, there are two comparators. One is located by the trigger and one on the threshold of the 555 timer. The threshold and trigger each hold a fraction of the VCC. The threshold is 2/3 VCC and the trigger is 1/3 VCC. Each of the outputs of these comparators lead to an SR flip flop. The 555 timer works when the voltage of the trigger falls below its 1/3 VCC value. This sets the SR flip flop via the comparator, which in turn shuts the discharge off. The SR flip flop can be reset when the threshold voltage rises above 2/3 of the VCC. This operating process can be seen in the square wave pulses that the 555 timer produces.
The 555 Timer for this Roulette circuit will produce a square wave. This is what is demonstrated on the above picture of the oscilloscope. Since the 555 timer is set up in astable mode for this circuit, the square wave is indicative of the clock pulses to the clock input of the 4017 IC. In astable mode, the output of the 555 timer cycles on and off. This is why we see a square wave produced on the oscilloscope. In astable mode, the threshold and trigger have the same voltage. This means that whenever the trigger pin voltage is low, discharge is off, and output is on. It is the square wave frequency generated by the 555 timer that causes the decade counter of the 4017 IC send a specific frequency into the LEDs. The wave function causes the frequency to slowly decrease, which results in the appearing slowing of the spinning lights, and thus eventually leaving one light lit up.
The desired frequency of the circuit can be set to adjust the output signal. This will determine the speed of the perceived spinning of the LEDs in the Roulette Wheel. This can be calculated using the following formula:
Frequency = 1.44 / ((R1 + 2 * R2) * C)
Values of R1, R2, and C can be adjusted to reach desired frequency.
Next Steps and Real Life Applications
Next Steps: In my Roulette circuit, I disregarded the circular motion of LEDs to make it easier to construct the circuit. I would like to connect the LEDs in a circular pattern next.
- If the speed of the "wheel" is too fast or too slow, adjust the values of the resistors and capacitors to achieve the desired speed.
- If the LEDs do not light up or behave unexpectedly, double-check the connections and component values.
A Raspberry Pi or Arduino can be used as a controller to log user results of the roulette wheel. This means scores can be tracked of each individual user potentially.
Real Life Applications: This circuit although simple, is much like the very complicated circuits used inside of Casinos for their electronic gambling games. Electronic roulette wheels with LEDs likely use very similar structures to this one.