Casino Roulette Mini Game
A mini game that brings the casino right to your tabletop. Spin, bet, and win big!
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:
- 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:
Hardware
- Raspberry Pi Pico W: Microcontroller board for running the game logic.
- LEDs: Visual indicators representing current number selected on the spinning roulette.
- LCD 1602 module: Display for showing current odds and game information.
- Buzzer: Emmits a sound when the leds are spinning.
- Push-button switch: Trigger for starting the game.
- Potentiometer: Control for selecting the winning color.
- Potentiometer 2: Control for selecting the value of the bet.
- Breadboard: Platform for prototyping and connecting components.
- Jumper wires: Connectors for establishing electrical connections on the breadboard.
- 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:
Schematics
Bill of Materials
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico W | Microcontroller Core | 35 Lei |
LCD 1602 Display (I2C Interface) | Display Output | 25 Lei |
Breadboard 830 Tie Points MB-102 | Prototype Platform | 10 Lei |
Set of 200 LEDs (3mm & 5mm) | Visual Indicators | 16 Lei |
Tactile Push Button | User Input | 6.5 Lei (for 10) |
Red Button Cases | Visual Enhancement | 2.70 Lei(for 5) |
Shift Registers | Reduce Wire No. | 32 Lei(for 7) |
10K ohm Potentiometer | Adjustable Input | 12.85 Lei (for 5) |
Knobs for Potentiometers | Knob for Adjustment | 10.65 Lei (for 5) |
Buzzer | Sound Feedback | 10 Lei(for 2) |
Dupont Wires M-F, 20cm | Wire Connection | 6 Lei |
Dupont Wires M-F, 30cm | Wire Connection | 7 Lei |
Dupont Wires F-F, 30cm | Wire Connection | 6 Lei |
Dupont Wires F-F, 20cm | Wire Connection | 6 Lei |
Dupont Wires M-M, 30cm | Wire Connection | 7 Lei |
Dupont Wires M-M, 20cm | Wire Connection | 7 Lei |
220Ω Resistors | Current Limiting | 9 Lei (for 30) |
330Ω Resistors | Current Limiting | 9 Lei (for 30) |
Software
Library | Description | Usage |
---|---|---|
micro-rand | A tiny, no STD library for generating (pseudo) random numbers. | Used to generate the winning number |
LCD1602 | A 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.