Skip to main content
Version: ACS CC

Randomness-audited Wheel-of-Fortune

A motorized wheel that randomly chooses its output and also proves how fair it is.

info

Author: Radu-Alexandru Vasilescu
GitHub Project Link: https://github.com/UPB-PMRust-Students/acs-project-2026-vasilescuradu

Description

The Randomness-audited Wheel-of-Fortune is an arcade-like product, designed to be fun and interesting. The user chooses the wheel speed, presses the “start game” button and the wheel begins to rotate, while specific visual and sound effects are running. The result is displayed on the LCD screen, along with statistics. The project uses an entropy source - the jitter from an unconnected analog pin – to create a carnival experience. At the same time, fairness is guaranteed by the chi-square test and the distribution of the results is logged on an SD card for external audit.

Motivation

I am interested in how mathematics can be used in practical contexts and the wheel-of-fortune shows exactly that. Probabilities and statistics have applications in domains such as economics, physics, gambling, etc. Therefore, they are one of the most straightforward ways to show that mathematics is not only about theory, but also about real-life situations.

Architecture

Arhitectura Proiectului

Log

Week 27 April - 3 May

I created the documentation, containing a lot of details about the project.

Week 12 - 18 May

Week 19 - 25 May

Hardware

The hardware architecture revolves around the STM32 microcontroller. The physical rotation of the wheel is powered by a 6V DC Gear Motor controlled via a VNH2SP30 motor driver using PWM signals. The system is powered via a 5V USB connection, utilizing a DC-DC Boost Converter to step up the voltage for the motor. User inputs are handled by a physical push button to start the game and a 50k potentiometer to configure the spinning speed. All components are prototyped and connected using a standard 830-point breadboard and a dedicated jumper wire set.

Schematics

KiCAD Schematic

Bill of Materials

DeviceUsagePrice
STM32 Nucleo BoardThe main microcontroller running the logic~ 100.00 RON
6V 96 RPM Plastic Geared MotorPhysically rotates the wheel11.99 RON
2A DC-DC Boost ModuleSteps up the 5V USB voltage to power the DC motor9.99 RON
VNH2SP30 Motor Driver ModuleControls the speed (via PWM) and direction of the DC motor29.94 RON
50k Mono PotentiometerAnalog input to adjust the rotation speed1.49 RON
White Round Cap Push ButtonDigital input to trigger the spin event1.99 RON
830 Tie-Point Breadboard and Jumper Wire KitPrototyping and interconnecting all electronic modules39.00 RON

Software

The software architecture is written entirely in Rust, utilizing the Embassy asynchronous execution framework. This allows the microcontroller to handle multiple concurrent tasks—such as generating precise PWM signals, managing user inputs, and logging data—without blocking the CPU.

LibraryDescriptionUsage
embassy-stm32Async HAL & Execution frameworkHardware abstraction and async scheduling.
embedded-halStandard hardware traitsTraits for external peripherals (I2C, SPI).
embedded-sdmmcFAT filesystem & SD card driverWriting CSV audit logs to the SD card.
eeprom24xAT24C* series EEPROM driverSaving stats persistently across reboots.
hd44780-driverHD44780 LCD controller driverDisplaying results and stats on the LCD.
  1. Embassy Book - Official documentation for the Embassy async Rust framework.
  2. STM32 Rust Ecosystem - Repositories and Hardware Abstraction Layers for STM32 microcontrollers.