diff --git a/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/Nedelcu_Diana.svg b/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/Nedelcu_Diana.svg new file mode 100644 index 00000000000..e079981e66e --- /dev/null +++ b/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/Nedelcu_Diana.svg @@ -0,0 +1 @@ +SVG Image created as Nedelcu_Diana.svg date 2026-08-22T20:27:27 Image generated by Eeschema-SVG123456123456ABCDABCDDate:KiCad E.D.A. 10.0.5Rev:Size: A4Id: 1/1Title:File: Nedelcu_Diana.kicad_schSheet: /GNDD1LEDGNDR1RGNDCPVDD1CAPP2CPGND3CAPM4VNEG5OUTL6OUTR7AVDD8AGND9DEMP10FLT11SCK12BCK13DIN14LRCK15FMT16XSMT17LDOO18DGND19DVDD20U1PCM5102GND+3.3VVBUSVBUSDAT21DAT3/CD2CMD3VDD4CLK5VSS6DAT07DAT18SHIELDSHJ1Micro_SD_CardRSTJ3AudioJack3GND1234J2OLED ScreenGNDSW2SW_PushSW1SW_Push+3.3V+3.3VGP01GP12GND3GP24GP35GP46GP57GND8GP69GP710GP811GP912GND13GP1014GP1115GP1216GP1317GND18GP1419GP1520GP1621GP1722GND23GP1824GP1925GP2026GP2127GND28GP2229RUN30GP2631GP2732AGND33GP2834ADC_VREF353V3_OUT363V3_EN37GND38VSYS39VBUS40A1SC0918Raspberry Pi:MODULE_SC0918Raspberry PiSCKSDAVCCGNDA1SC0918Raspberry Pi:MODULE_SC0918Raspberry PiGP01GP12GND3GP24GP35GP46GP57GND8GP69GP710GP811GP912GND13GP1014GP1115GP1216GP1317GND18GP1419GP1520GP1621GP1722GND23GP1824GP1925GP2026GP2127GND28GP2229RUN30GP2631GP2732AGND33GP2834ADC_VREF353V3_OUT363V3_EN37GND38VSYS39VBUS40VBUSVBUSR1R \ No newline at end of file diff --git a/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/diagram.drawio.svg b/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/diagram.drawio.svg deleted file mode 100644 index 51a124585ed..00000000000 --- a/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/diagram.drawio.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -
Power 5V
Power 5V
PC
PC
Raspberry Pi Pico 2W
Raspberry Pi Pico 2W
External 3.3V/5V   
External 3.3V/5V   
PCM5102A   
PCM5102A   
Buttons
Buttons
MicroSD Card Module
MicroSD Card Module
Audio Jack
Audio Jack
GPIO/EXTI
GPIO/EXTI
SPI0
SPI0
PIO / DMA
PIO / DMA
POWER
POWER
Text is not SVG - cannot display
\ No newline at end of file diff --git a/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/diagram.webp b/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/diagram.webp new file mode 100644 index 00000000000..fafc0f9039f Binary files /dev/null and b/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/diagram.webp differ diff --git a/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/hardware.webp b/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/hardware.webp deleted file mode 100644 index 0682595ad67..00000000000 Binary files a/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/hardware.webp and /dev/null differ diff --git a/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/index.md b/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/index.md index 7c91f34a145..ef9e64ee818 100644 --- a/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/index.md +++ b/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/index.md @@ -10,27 +10,28 @@ An automated audio solution that blends background music with scheduled announce ## Description -The project consists of an automated audio playback system. It plays a continuous playlist of WAV files from a microSD card. At predefined intervals (e.g., every 10–15 minutes), the system finishes the current song, switches to a folder for advertisements/announcements, plays one file, and then returns to the music playlist. +The project consists of an automated audio playback system. It plays a continuous playlist of WAV files from a microSD card. At predefined intervals (e.g., every 20 seconds), the system finishes the current song, switches to a folder for advertisements/announcements, plays one ad, and then returns to the music playlist. It also displays the current music/ad and the volume using an OLED screen. ## Motivation -I chose this project because I wanted to build something practical that you see every day, like the audio systems in **supermarkets or gyms** that play background music and periodically interrupt it for announcements or ads. +I chose this project because I wanted to build something practical that you see every day, like the audio systems in supermarkets or gyms that play background music and periodically interrupt it for announcements or ads. -Usually, these systems are either overpriced proprietary hardware or just a PC that’s overkill for the task. Using the **RP2350** and **Rust** is a great way to try and build a "professional" version that is: -* **Reliable:** It won't crash or stutter like a basic media player might. -* **Automatic:** It handles the timing and switching between folders by itself, which is exactly how these systems work in the real world. +Usually, these systems are either overpriced proprietary hardware or just a PC that’s overkill for the task. Using the RP2350 and Rust is a great way to try and build a "professional" version that is: +* Reliable: It won't crash or stutter like a basic media player might. +* Automatic: It handles the timing and switching between folders by itself, which is exactly how these systems work in the real world. ## Architecture The system follows a producer-consumer architecture managed by the Embassy executor: - - **Main Task (Producer):** Reads raw WAV data from the MicroSD card via SPI. - - **I2S Driver (Consumer):** Uses the Pico's **PIO** to stream the PCM data to the PCM5102A DAC. It uses DMA (Direct Memory Access) to ensure playback doesn't stutter while the CPU is busy reading from the SD card. - - **Timer Task:** Tracks the 10-15 minute intervals and signals the main task to switch directories. - - **User Interface:** Handles GPIO interrupts from push buttons for volume adjustment and track skipping. + - Main Task (Producer): Reads raw WAV data from the MicroSD card via SPI. + - I2S Driver (Consumer): Uses the Pico's PIO to stream the PCM data to the PCM5102A DAC. It uses DMA (Direct Memory Access) to ensure playback doesn't stutter while the CPU is busy reading from the SD card. + - Timer Task: Tracks the 20 second intervals and signals the main task to switch directories. + - User Interface: Handles GPIO interrupts from push buttons for volume adjustment. + - OLED Screen: Displays the current song or ad and the current volume using the I2C protocol and reading the file names from the MicroSD card. -![Design](diagram.drawio.svg) +![Design](diagram.webp) --- @@ -45,22 +46,28 @@ The system follows a producer-consumer architecture managed by the Embassy execu ### Week 19 - 25 May - Ordered components. +### Week 27 July - 02 August +- Ordered the OLED screen and implemented it + +### Weeks 3 - 21 August +- Recreated the software and hardware from scratch --- ## Hardware -The project uses the **Raspberry Pi Pico 2W** (RP2350), which provides more processing power for audio handling. The **PCM5102A** DAC provides high-quality stereo output via an I2S interface. +The project uses the Raspberry Pi Pico 2W (RP2350), which provides more processing power for audio handling. The PCM5102A DAC provides high-quality stereo output via an I2S interface. It also contains a microSD card reader connected to the Pico with an SPI protocol, an OLED screen (0.91 inch) that uses the I2C protocol and 2 buttons for volume up/down and a status LED that use GPIO. ### Physical Setup -![Hardware Setup](hardware.webp) +![Hardware Setup](poza_proiect.webp) ### Schematics -![Kicad Schematic](nedelcu_diana_kicad.svg) +![Kicad Schematic](Nedelcu_Diana.svg) ### Software Data Flow -1. **File System Task:** Reads raw WAV data chunks from the SD card into a shared memory buffer. -2. **Audio Task:** Consumes the buffer and uses **DMA** to stream data to the PIO state machine, ensuring the I2S timing remains perfect. -3. **Manager Task:** An async loop that tracks the 10-15 minute timer for advertisements and handles button interrupts to change the playback state. +1. File System Task: Reads raw WAV data chunks from the SD card into a shared memory buffer. +2. Audio Task: Consumes the buffer and uses DMA to stream data to the PIO state machine, ensuring the I2S timing remains perfect. +3. Manager Task: An async loop that tracks the 20 second timer for advertisements and handles button interrupts to change the playback state. +4. Display Task: In order not to overload the memory and keep the sound quality, I decided to use a boolean variable that decides when the OLED needs to update. ### Bill of Materials @@ -71,22 +78,33 @@ The project uses the **Raspberry Pi Pico 2W** (RP2350), which provides more proc | MicroSD Card Module| Storage Interface | 24.39 lei | | Push Buttons | Volume/Skip Controls | 3.60 lei (10pcs) | | Resistor set | Pull-ups and protection | 7.00 lei | +| OLED | Displaying information | 20 lei | +| LED | Status | 0.1 lei | +| Wires | Connections | 5 lei | +| Lego case | Design | 30 lei | +| Breadboards | Connections | 10 lei | --- - ## Software | Library | Description | Usage | -|---------|-------------|-------| -| [embassy-rp](https://github.com/embassy-rs/embassy) | HAL for RP2350 | Peripheral control and PIO/DMA management | -| [embassy-executor](https://github.com/embassy-rs/embassy) | Async Executor | Managing concurrent audio streaming tasks | -| [embedded-sdmmc](https://github.com/rust-embedded-community/embedded-sdmmc-rs) | FAT File System | Reading WAV files from the SD Card | -| [pio](https://crates.io/crates/pio) | PIO Assembler | Creating the I2S protocol state machine | - +| --- | --- | --- | +| [embassy-rp](https://github.com/embassy-rs/embassy) | HAL for RP2040 / RP2350 | Controls chip pins, SPI, I2C, and I2S audio | +| [embassy-executor](https://github.com/embassy-rs/embassy) | Async Executor | Runs the main async loop | +| [embassy-futures](https://github.com/embassy-rs/embassy) | Async Utilities | Plays audio and reads files at the same time | +| [embassy-time](https://github.com/embassy-rs/embassy) | Time Driver | Handles delays and button debounce timers | +| [embedded-sdmmc](https://github.com/rust-embedded-community/embedded-sdmmc-rs) | FAT File System | Reads music and ad files from the SD card | +| [embedded-hal-bus](https://github.com/rust-embedded/embedded-hal) | SPI Bus Sharing | Connects the SD card to the SPI bus | +| [ssd1306](https://www.google.com/search?q=https://github.com/jamwaffles/ssd1306) | OLED Display Driver | Controls the OLED screen | +| [embedded-graphics](https://github.com/embedded-graphics/embedded-graphics) | 2D Graphics Engine | Draws text and UI on the screen | +| [heapless](https://www.google.com/search?q=https://github.com/japaric/heapless) | Fixed-size Collections | Stores playlist lists and text strings | +| [panic-halt](https://www.google.com/search?q=https://github.com/rust-embedded/panic-halt) | Panic Handler | Stops the chip safely if code crashes | --- ## Links -1. [PCM5102A Datasheet](https://www.ti.com/product/PCM5102A) -2. [Pico PIO I2S Example](https://github.com/raspberrypi/pico-examples/tree/master/pio/i2s) -3. [Embassy-rs PIO Documentation](https://embassy.dev/book/dev/pio.html) + + +1. [Modul OLED Albastru 0.91'' 128x32 I2C (Optimus Digital)](https://www.optimusdigital.ro/ro/optoelectronice-lcd-uri/1310-modul-oled-albastru-de-091-128x32-px.html?search_query=Modul+OLED+Albastru+de+0.91%27%27+%28128x32+px%29+&results=1) +2. [Modul DAC Audio Stereo PCM5102A (Optimus Digital)](https://www.optimusdigital.ro/ro/audio-altele/5658-modul-audio-stereo-dac-pcm5102a-cu-interfaa-pcm-32-bii-384-khz.html?search_query=PCM5102A&results=1) +3. [Raspberry Pi Pico Series Documentation](https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html) diff --git a/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/nedelcu_diana_kicad.svg b/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/nedelcu_diana_kicad.svg deleted file mode 100644 index 9cb6480dbdc..00000000000 --- a/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/nedelcu_diana_kicad.svg +++ /dev/null @@ -1 +0,0 @@ -SVG Image created as Nedelcu_Diana.svg date 2026-05-09T19:44:13 Image generated by Eeschema-SVG123456123456ABCDABCDDate:KiCad E.D.A. 10.0.1Rev:Size: A4Id: 1/1Title:File: Nedelcu_Diana.kicad_schSheet: /+3.3VGNDGNDDAT21DAT3/CD2CMD3VDD4CLK5VSS6DAT07DAT18SHIELDSHJ1Micro_SD_CardGNDCPVDD1CAPP2CPGND3CAPM4VNEG5OUTL6OUTR7AVDD8AGND9DEMP10FLT11SCK12BCK13DIN14LRCK15FMT16XSMT17LDOO18DGND19DVDD20U1PCM5102D1LEDGNDGP01GP12GND3GP24GP35GP46GP57GND8GP69GP710GP811GP912GND13GP1014GP1115GP1216GP1317GND18GP1419GP1520GP1621GP1722GND23GP1824GP1925GP2026GP2127GND28GP2229RUN30GP2631GP2732AGND33GP2834ADC_VREF353V3_OUT363V3_EN37GND38VSYS39VBUS40A1SC0918Raspberry Pi:MODULE_SC0918Raspberry Pi+3.3VRSTJ3AudioJack3VBUSVBUSSW1SW_Push+3.3VSW2SW_PushGNDR1RGNDR1RVBUSVBUSA1SC0918Raspberry Pi:MODULE_SC0918Raspberry PiGP01GP12GND3GP24GP35GP46GP57GND8GP69GP710GP811GP912GND13GP1014GP1115GP1216GP1317GND18GP1419GP1520GP1621GP1722GND23GP1824GP1925GP2026GP2127GND28GP2229RUN30GP2631GP2732AGND33GP2834ADC_VREF353V3_OUT363V3_EN37GND38VSYS39VBUS40 diff --git a/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/poza_proiect.webp b/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/poza_proiect.webp new file mode 100644 index 00000000000..7336d74a87d Binary files /dev/null and b/website/versioned_docs/version-fils_en/project/2026/diana_ioana.nedelcu/poza_proiect.webp differ