Skip to main content

Casino Roulette Mini Game

A mini game that brings the casino right to your tabletop. Spin, bet, and win big!

info

Author: DUMITRU Vlad Andrei

GitHub Project Link: https://github.com/UPB-FILS-MA/project-kevinvlad03

Description

This project aims to recreate the captivating experience of Casino Roulette, encapsulating the thrill and randomness of betting games, through the integration of modern computing with traditional casino elements. By leveraging the compact yet powerful Raspberry Pi Pico W and the efficiency and safety of the Rust programming language, we embark on creating a digital version of the classic Roulette game.

Motivation

The motivation behind this project is to blend the excitement and allure of casino gaming with the educational and technical challenges of building a digital game. It serves as a practical application to explore electronics and programming, while also offering an engaging and interactive way to understand the probabilities and mechanics of roulette. This project aims to inspire creativity, foster problem-solving skills, and provide a fun platform for learning and experimentation.

Architecture

In it's final stage, my project will look more or less like the following diagram: Roulette Mini Game Schematic

  • The round roulette shape will be made of LEDs of the indicated colors.
  • The central LCD screen will display information about game status.
  • By pressing the button, you will initiate a new game by selecting to bet either on a number, or a color.
  • With the potentiometer, you will select your lucky number or color.

Log

Week 6 - 12 May

Worked mostly on hardware components and connections, testing the best way of connection and the best way to make the roulette spin. I also started working on the software part, trying to make the LEDs spin and stop on a random number.

Week 7 - 19 May

Managed to fully integrate the spinning roulette with the LEDs, and also managed to make the LEDs stop on a random number. I also completed the LCD display software and hardware, which will display the current odds and game information. Moreover, the push-button switch was integrated to trigger the game, and the potentiometer was connected to select the desired number. The buzzer was also added to emit a sound when the LEDs are spinning.

Week 20 - 26 May

On this week, I spent most of the time focusing on hardware, as my software and logic were already done. The only software addon was that I implemented a system of betting. I built a box for the project and gave everything I had to make it look okay. I finished the project on the 26th. Here are some pictures of the final project: Final1 Final2

Hardware

  1. Raspberry Pi Pico W: Microcontroller board for running the game logic.
  2. LEDs: Visual indicators representing current number selected on the spinning roulette.
  3. LCD 1602 module: Display for showing current odds and game information.
  4. Buzzer: Emmits a sound when the leds are spinning.
  5. Push-button switch: Trigger for starting the game.
  6. Potentiometer: Control for selecting the winning color.
  7. Potentiometer 2: Control for selecting the value of the bet.
  8. Breadboard: Platform for prototyping and connecting components.
  9. Jumper wires: Connectors for establishing electrical connections on the breadboard.
  10. Shift Registers: Reduce the number of wires needed to connect the LEDs.

In the project, the Raspberry Pi Pico W runs the game logic, while LEDs visualize the spinning motion of the roulette values, the LCD 1602 module displays game information, the push-button switch triggers the game, and 1 potentiometer selects the winning color, anothr the value of your desired bet. These components are connected using a breadboard and jumper wires for prototyping and experimentation.

Here are some pictures of the current state of the project`s hardware: Hardware1 Hardware2 Hardware3 Hardware4 Hardware5

Schematics

KiCad Schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico WMicrocontroller Core35 Lei
LCD 1602 Display (I2C Interface)Display Output25 Lei
Breadboard 830 Tie Points MB-102Prototype Platform10 Lei
Set of 200 LEDs (3mm & 5mm)Visual Indicators16 Lei
Tactile Push ButtonUser Input6.5 Lei (for 10)
Red Button CasesVisual Enhancement2.70 Lei(for 5)
Shift RegistersReduce Wire No.32 Lei(for 7)
10K ohm PotentiometerAdjustable Input12.85 Lei (for 5)
Knobs for PotentiometersKnob for Adjustment10.65 Lei (for 5)
BuzzerSound Feedback10 Lei(for 2)
Dupont Wires M-F, 20cmWire Connection6 Lei
Dupont Wires M-F, 30cmWire Connection7 Lei
Dupont Wires F-F, 30cmWire Connection6 Lei
Dupont Wires F-F, 20cmWire Connection6 Lei
Dupont Wires M-M, 30cmWire Connection7 Lei
Dupont Wires M-M, 20cmWire Connection7 Lei
220Ω ResistorsCurrent Limiting9 Lei (for 30)
330Ω ResistorsCurrent Limiting9 Lei (for 30)

Software

LibraryDescriptionUsage
micro-randA tiny, no STD library for generating (pseudo) random numbers.Used to generate the winning number
LCD1602A library for interfacing with the LCD1602 module.Used to display game information

For the software part, the only library I used was micro-rand, which is a tiny, no STD library for generating (pseudo) random numbers. This library was used to generate the winning number in the game. Otherwise, the game logic works on basic asynchronous tasks and loops from Embassy.

Inspiration