Hi everyone, today I am going to show you how I made a "Digital Roulette Wheel" by combining ESP32-C3 Super Mini Microcontroller with the classic CD4017 CMOS decade counters. When the button is pressed, the ESP32 sends "clock pulses" to the CD4017 IC, causing the LEDs to cycle. Releasing the button triggers a realistic slowing down effect until it stops on a random result and reports the final position using the Serial Monitor or via Wi-Fi.
Trust me, there's a lot going on with this project hardware design, Arduino coding, PHP, databases, 3D design and printing, and more. Video: https://youtu.be/5jVFR7KSNmg Full Blog Post: https://diyfactory007.blogspot.com/2026/05/Roulette.html
Components Required
For this project we need:
🔗 1 x ESP32-C3 Super Mini Plus Microcontroller: https://s.click.aliexpress.com/e/_c2zUTvyj
🔗 2 x CD4017 CMOS Decade Counters: https://s.click.aliexpress.com/e/_c33qzzRt
🔗 2 x 2N2222 NPN Transistors: https://s.click.aliexpress.com/e/_c4OwNvnZ
🔗 3 x 220Ω Resistors: https://s.click.aliexpress.com/e/_c41SucJd
🔗 1 x 10kΩ Resistor: https://s.click.aliexpress.com/e/_c41SucJd
🔗 1 x Push Button Switch: https://s.click.aliexpress.com/e/_c3cfuN6J
🔗 1 x SPDT Switch: https://s.click.aliexpress.com/e/_c4FRHRaX
🔗 18 x 5mm Red LEDs: https://s.click.aliexpress.com/e/_c2RpNzh9
🔗 2 x 5mm Green LEDs: https://s.click.aliexpress.com/e/_c2RpNzh9
🔗 1 x 3mm Blue LED: https://s.click.aliexpress.com/e/_c306Pzbh
🔗 1 x 10mfd Capacitor (optional)
🔗 1 x LiPo Battery: https://s.click.aliexpress.com/e/_c4okFfef
🔗 1 x Battery Charging Module (optional): https://s.click.aliexpress.com/e/_c3EJLcZh
🔗 1 x Battery Level Indicator: https://s.click.aliexpress.com/e/_c4KGEDh5
And a 3D Printer to print the enclosure
Circuit Diagram
The wiring of this project is really simple!
* Connect Pin-8 of the ESP32 to the Reset pin (Pin 15) of IC#1.
* Connect Pin-10 of the ESP32 to the Clock pin (Pin 14) of IC#1.
* Connect Pin-9 of the ESP32 to the push-button switch with a pull-up resistor.
* Connect Pin-0 of the ESP32 to the Wi-Fi Indicator LED with a current limiting resistor.
For the rest of the wiring, check out the circuit diagram on screen.
To make things even easier, I’ve designed a custom PCB for you. You can grab the Gerber file from the description below and get the board fabricated from [PCBWay.com](https://PCBWay.com).
Core Functionality
I originally built this LED roulette project using a 555 timer IC and a couple of CD4017 CMOS decade counters. The 555 timer functions as a clock oscillator, generating a signal that drives the 4017 decade counter. The output from PIN-3 of the IC555 is fed into PIN-14 of the IC4017. Each time the IC4017 receives a pulse, it increments the count and activates the next output pin (Q0 to Q9), creating a shifting LED effect.
To know more about the ICs please check out my tutorial no. 26 "555 Pulse Generator Module, How it Works", the link is in the description below.
The main drawback of this initial design is that I had to handle the counting manually. I wanted a system where the numbers are added automatically and the winner is determined by the system itself. My goal isn't to build a gambling wheel, but rather a simple roulette game that I can enjoy playing with my son.
To achieve that, the ESP32-C3 Super Mini turned out to be the perfect choice. It is compact and comes with built-in Wi-Fi capability.
So, instead of using the 555 timer IC, I switched to the ESP32-C3 board to generate "clock pulses" for one of the CD4017 ICs. When the button is pressed, the pulses become faster and faster. The light races around the circle, creating the sensation of a "spin." When the button is released, the spin doesn't stop immediately. Instead, it gradually increases the time between the pulses, making the lights slow down progressively - just like a real wheel coasting to...
Read more »
Hulk



