Skip to content

Commit 835cc2e

Browse files
Final documentation (#1359)
* Added documentation for the project * Final documentation
1 parent 5ef7cfc commit 835cc2e

5 files changed

Lines changed: 36 additions & 25 deletions

File tree

website/versioned_docs/version-acs_cc/project/2026/radu.vasilescu0510/arhitectura_proiect.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.
11.3 KB
Loading
45.4 KB
Loading

website/versioned_docs/version-acs_cc/project/2026/radu.vasilescu0510/index.md

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Randomness-audited Wheel-of-Fortune
22
A motorized wheel that randomly chooses its output and also proves how fair it is.
33

4-
:::info
4+
:::info 
55

66
**Author**: Radu-Alexandru Vasilescu \
77
**GitHub Project Link**: https://github.com/UPB-PMRust-Students/acs-project-2026-vasilescuradu
@@ -11,10 +11,9 @@ A motorized wheel that randomly chooses its output and also proves how fair it i
1111
## Description
1212

1313
The Randomness-audited Wheel-of-Fortune is an arcade-like
14-
product, designed to be fun and interesting. The user chooses the wheel speed,
15-
presses the “start game” button and the wheel begins to rotate, while specific
16-
visual and sound effects are running. The result is displayed on the LCD screen,
17-
along with statistics. The project uses an entropy source - the jitter from an
14+
product, designed to be fun and interesting. The user chooses the number of full rotations,
15+
presses the “start game” button and the wheel begins to rotate. When it stops, the result is displayed on the LCD screen,
16+
along with fairness statistics. The project uses an entropy source - the jitter from an
1817
unconnected analog pin – to create a carnival experience. At the same time,
1918
fairness is guaranteed by the chi-square test and the distribution of the results is
2019
logged on an SD card for external audit.
@@ -29,49 +28,66 @@ ways to show that mathematics is not only about theory, but also about
2928
real-life situations.
3029

3130
## Architecture
32-
![Arhitectura Proiectului](arhitectura_proiect.svg)
31+
![Project architecture](final_architecture_schematic.webp)
3332

3433
## Log
3534

3635
### Week 27 April - 3 May
3736

3837
I created the documentation, containing a lot of details about the
3938
project.
40-
### Week 12 - 18 May
39+
### Week 10 - 17 May
40+
41+
I created the motorized wheel and presented a spin demo
42+
for the hardware milestone. Also, I wired the pot and the button.
43+
44+
### Week 18 - 24 May
45+
46+
I wired the SD card reader, the EEPROM and the LEDs.
47+
I implemented most of the required software and presented a demo for the software milestone.
48+
49+
### Week 25 - 31 May
50+
51+
I replaced the DC gear motor and VNH2SP30 driver with a 28BYJ-48 stepper motor and ULN2003 driver, which lets the wheel land exactly on the target slot without speed/brake calibration. I added a 16x2 LCD (4-bit mode) that shows the result and the chi-square fairness verdict after each spin, moved the start button to an analog input, and repurposed the potentiometer to select the number of full rotations.
4152

42-
### Week 19 - 25 May
4353

4454
## Hardware
4555

46-
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.
56+
The hardware architecture revolves around the STM32 microcontroller. The physical rotation of the wheel is powered by a 28BYJ-48 stepper motor controlled via a ULN2003 driver, which gives exact, repeatable positioning on the target slot without any speed or brake calibration. The system is powered via a 5V USB connection. User inputs are handled by a 50k potentiometer to configure the number of full rotations and a physical push button (read as an analog voltage level) to start the game. A 16x2 LCD displays the resulting slot and the fairness verdict after each spin. The AT24C256 I2C EEPROM is used for stats logging. The MicroSDHC 8GB card and the SD card reader nano module are used for external audit. All components are prototyped and connected using a standard 830-point breadboard and a dedicated jumper wire set.
4757

4858
### Schematics
4959

50-
![KiCAD Schematic](schema_1.svg)
60+
![KiCAD Schematic](final_kicad_schematic.webp)
5161

5262
### Bill of Materials
5363

5464
| Device | Usage | Price |
5565
|--------|--------|-------|
5666
| [STM32 Nucleo Board](https://www.st.com/en/evaluation-tools/stm32-nucleo-boards.html) | The main microcontroller running the logic | ~ 100.00 RON |
57-
| [6V 96 RPM Plastic Geared Motor](https://www.optimusdigital.ro/ro/motoare-altele/5833-motor-cu-reductor-din-plastic-i-ax-cu-diametrul-de-4-mm-6-v-96-rpm.html?srsltid=AfmBOop9PXG0G7C-zHNTAhXIJz2r2rfr9kBAst5gFgeA-74S_rmirAKH) | Physically rotates the wheel | 11.99 RON |
58-
| [2A DC-DC Boost Module](https://www.optimusdigital.ro/ro/surse-ridicatoare-reglabile/169-modul-dc-dc-boost-de-2a.html?srsltid=AfmBOoox6WjCYDuuwY0qRSkYvsngnhVKMo9N3AZCa5qBWSvFPmQlqV2-) | Steps up the 5V USB voltage to power the DC motor | 9.99 RON |
59-
| [VNH2SP30 Motor Driver Module](https://www.optimusdigital.ro/ro/drivere-de-motoare-cu-perii/477-modul-driver-pentru-motoare-vnh2sp30.html?srsltid=AfmBOorCpeoK8NdSGiNEunGo-vjNDS64Qik-48tXZOUHw1bAlmUx0eQT) | Controls the speed (via PWM) and direction of the DC motor | 29.94 RON |
60-
| [50k Mono Potentiometer](https://www.optimusdigital.ro/ro/componente-electronice-potentiometre/1885-potentiometru-mono-50k.html?srsltid=AfmBOopsy_OdVFuYxkBoo1D9JZx9zzn1B3piJ1i7kABN3P_O6AsyTs_w) | Analog input to adjust the rotation speed | 1.49 RON |
61-
| [White Round Cap Push Button](https://www.optimusdigital.ro/ro/butoane-i-comutatoare/1115-buton-cu-capac-rotund-alb.html?srsltid=AfmBOorTSdiSNy5lCZLD_elUSRuKveDm7G4lwfxWsktSIJ8Z76j-wwe5) | Digital input to trigger the spin event | 1.99 RON |
67+
| [28BYJ-48 5V Stepper Motor and Blue ULN2003 Driver Set](https://www.optimusdigital.ro/ro/motoare-motoare-pas-cu-pas/101-driver-uln2003-motor-pas-cu-pas-de-5-v-.html?srsltid=AfmBOoo7z2oDRYsy1MbzxaFBLjm9ummjQTLPcTV45-iWbfMgyH3tTVms) | Physically rotates the wheel | 16.97 RON |
68+
| [50k Mono Potentiometer](https://www.optimusdigital.ro/ro/componente-electronice-potentiometre/1885-potentiometru-mono-50k.html?srsltid=AfmBOopsy_OdVFuYxkBoo1D9JZx9zzn1B3piJ1i7kABN3P_O6AsyTs_w) | Analog input to select the number of rotations | 1.49 RON |
69+
| [White Round Cap Push Button](https://www.optimusdigital.ro/ro/butoane-i-comutatoare/1115-buton-cu-capac-rotund-alb.html?srsltid=AfmBOorTSdiSNy5lCZLD_elUSRuKveDm7G4lwfxWsktSIJ8Z76j-wwe5) | Analog input to trigger the spin event | 1.99 RON |
6270
| [830 Tie-Point Breadboard and Jumper Wire Kit](https://sogest.ro/accesorii-multimetre/set-placa-test-breadboard-830-165x55x085cm-set-cabluri-breadboard-si-alimentat) | Prototyping and interconnecting all electronic modules | 39.00 RON |
71+
| [SD card reader nano module](https://sogest.ro/module-diverse/modul-nano-cititor-de-card-sd) | Interfaces with the SD card for data logging | 16.00 RON |
72+
| [AT24C256 I2C EEPROM Module](https://www.optimusdigital.ro/en/memories/632-modul-eeprom-at24c256.html?search_query=EEPROM&results=64) | Persistent storage for statistics across reboots | 9 RON |
73+
| [MicroSDHC 8GB card](https://sogest.ro/carduri-microsd/card-microsdhc-8gb-clasa10-maxell-cu-adaptor-sd-x-series-micro-sdhc-8gb-ad-class10) | Physical storage medium for the external audit logs | 38 RON |
74+
| [Display LCD1602 HD44780](https://www.bitmi.ro/display-lcd1602-hd44780-albastru-iluminat-10486.html?gad_source=1&gad_campaignid=21312430054&gbraid=0AAAAADLag-l9Mrse7Pa8BnYa5ZS0HyDMY&gclid=CjwKCAjwrNrQBhBjEiwAoR4VO28wxRhXikjyxuW3njLUfpud9TIIGEJrlRJMqJKEM_28ANK_kKp9whoCWFsQAvD_BwE) | Used for displaying results and statistics | 14 RON |
6375

6476
## Software
6577

66-
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.
78+
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 driving the stepper motor, managing user inputs, and logging data to the SD card—without blocking the CPU.
6779

6880
| Library | Description | Usage |
6981
|---------|-------------|-------|
70-
| [embassy-stm32](https://github.com/embassy-rs/embassy) | Async HAL & Execution framework | Hardware abstraction and async scheduling. |
71-
| [embedded-hal](https://github.com/rust-embedded/embedded-hal) | Standard hardware traits | Traits for external peripherals (I2C, SPI). |
82+
| [embassy-stm32](https://github.com/embassy-rs/embassy) | Async HAL | Hardware abstraction (GPIO, ADC, I2C, SPI). The EEPROM (raw I2C) and the 16x2 LCD (4-bit GPIO bit-banging) are driven directly through this HAL, without a dedicated driver crate. |
83+
| [embassy-executor](https://github.com/embassy-rs/embassy) | Async task executor | Runs the main loop and the SD logger as concurrent async tasks. |
84+
| [embassy-sync](https://github.com/embassy-rs/embassy) | Async synchronization primitives | Signal that passes the latest stats snapshot to the SD logger task. |
85+
| [embassy-time](https://github.com/embassy-rs/embassy) | Timekeeping, delays and timeouts | Stepper step timing, button debounce, LCD timing. |
86+
| [embedded-hal](https://github.com/rust-embedded/embedded-hal) | Standard hardware traits | SPI/GPIO traits for the SD card interface. |
87+
| [embedded-hal-bus](https://github.com/rust-embedded/embedded-hal) | SPI/I2C bus-sharing helpers | ExclusiveDevice wrapper for the SD card on the SPI bus. |
7288
| [embedded-sdmmc](https://github.com/rust-embedded-community/embedded-sdmmc-rs) | FAT filesystem & SD card driver | Writing CSV audit logs to the SD card. |
73-
| [eeprom24x](https://github.com/eldruin/eeprom24x-rs) | AT24C* series EEPROM driver | Saving stats persistently across reboots. |
74-
| [hd44780-driver](https://github.com/JohnDoneth/hd44780-driver) | HD44780 LCD controller driver | Displaying results and stats on the LCD. |
89+
| [defmt](https://github.com/knurling-rs/defmt) | Efficient logging framework | Debug/info logging over RTT during development. |
90+
| [cortex-m](https://github.com/rust-embedded/cortex-m) | Cortex-M core access | Cycle-accurate short delays (asm::delay) for the LCD enable pulse. |
7591

7692
## Links
7793

website/versioned_docs/version-acs_cc/project/2026/radu.vasilescu0510/schema_1.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)