Skip to main content
Version: ACS CC

Mini Slot Machine

A miniature slot machine inspired by early electromechanical casino models.

info

Author: Androne Andrei
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-AndroneAndrei

Description

This demonstrative project functions around a Raspberry Pi Pico 2W. It drives three mechanical reels with stepper motors, plays sounds through a DFPlayer Mini, shows doubling process with leds, and displays live game information on a 1602 LCD. Software is impleneted using Embassy and Rust.

Motivation

Nowadays, gambling has become an unhealthy addiction for many people, so I wanted to build a project that showcases how slot machines work today. Ever since most slot machines became fully electronic, the outcome of each game has been largely determined by the underlying software. Therefore, I created a machine that lets the user choose between several game modes (Fair – completely random; Real – small cumulative losses, similar to modern machines that foster addiction; Unfair – large losses that generally do not create the same addictive behaviour).

Alongside its educational purpose, the project applies several concepts covered in the lab work, such as UART communication for the MP3 player, I2C for the screen, and the Rust code needed to implement the three game modes.

Architecture

Diagram

Raspberry Pi Pico W 2 - RP2350

Role: Central component; controls everything else.

Mini MP3 player

Role: Provides music and sound effects, communicating with the Pico via UART and using its internal DAC to drive the small 2 W speaker.

Small speaker

Role: Effectively propagates the audio output from the sound module.

Step Motor 5V with Driver

Role: Spins the reels; communicates with the Pico through a ULN2003 driver using parallel transmission.

Small LCD screen with I2C adapter for easier communication

Role: Displays live game elements and allows the user to view selectable options.

Buttons

Role: Used for selecting options or for activating the spin and doubling features during gameplay.

Leds

Role: A pair of bi‑colour LEDs (simulating card‑colour betting) used for the gain‑doubling option if the player desires.

Log

Week 5 - 11 May

Week 12 - 18 May

Week 19 - 25 May

Hardware

The electronics are simple and modular, centred on one Raspberry Pi Pico W:

Reels – Three 28BYJ‑48 stepper motors spin the reels through ULN2003 driver boards. The Pico sends signals and stops exactly on the right symbol.

Sound – A DFPlayer Mini holds MP3 files on a micro‑SD card. The Pico tells it what to play over UART (it just sends a number of the respective sound effect index). A small 2W speaker propagates the audio.

Display – A1602 LCD with a PCF8574 I2C backpack shows credits, mode, and symbols.

Controls – Three push‑buttons (Start/Spin, Mode/Bet-Double/Stop, Select-Sum) give input. Two bi‑colour LEDs flash alternatively in fast succesion to allow for betting on colour.

Power – Everything runs from a 5 V USB supply (a battery will be added in later developement). The Pico makes its own 3.3 V for logic; motors and audio stay on 5 V.

Schematics

TO DO (KiCad)

Bill of Materials

DeviceUsagePrice
2x Raspberry Pi Pico 2 WMicrocontroller80 RON
DFPlayer MiniMP3 Mini Player14 RON
50mm Speaker - 2W - 32ohmGeneric Mini Speaker5 RON
1602ALCD display29 RON
IO PCF8574Expansion module for Screen's I2C communication9 RON
3x 28BYJ-48 5V + 3x ULN2003Step Motor + Driver51 RON
2GB MicroSD CardCard for storing sounds effects20 RON
Minor Components (buttons, wires, leds, battery, etc.)Taken from an Arduino Starter Pack-

Software

LibraryDescriptionUsage
embassy‑executorAsync runtimeRuns cooperative tasks on the Pico
embassy-timeTimers within async developementDifferent pauses
embassy-rpRP2350 hardware abstractionGPIO, UART, I2C, etc.
ag-lcdLCD diplsay libraryUsed for my mini screen display
port_expanderLibrary providing a common abstraction for I2C port-expandersUsed for my PCF8574
randUtilities for random number generatorUsed in software part that controls game flow