Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pm:prj2026:vlad.radulescu2901:andrei.giurgiu0801 [2026/05/24 12:05]
stefan.dumitrache
pm:prj2026:vlad.radulescu2901:andrei.giurgiu0801 [2026/05/24 20:44] (current)
andrei.giurgiu0801 [Resources]
Line 100: Line 100:
  
 ===== Software Design ===== ===== Software Design =====
- 
-** Under construction. ** 
  
 This project will be developed using the PlatformIO extension in Visual Studio Code. This project will be developed using the PlatformIO extension in Visual Studio Code.
Line 146: Line 144:
   * getAudioCurrentTime only returns the time in seconds and for a nice UX I need millisecond precision. For this specific reason, I keep the moment of time when a full second passed, in the ''​last_sync_tick''​ variable. This is where the ''​now_tick''​ variable comes to play. This variable is the key to have milisecond precision, since it tells me how many milliseconds passed since the last update. This is because it uses the FreeRTOS clock. In order to see how much time has passed since the last full second of the song started, I substract from the ''​now_tick''​ variable the ''​last_sync_tick''​ variable.   * getAudioCurrentTime only returns the time in seconds and for a nice UX I need millisecond precision. For this specific reason, I keep the moment of time when a full second passed, in the ''​last_sync_tick''​ variable. This is where the ''​now_tick''​ variable comes to play. This variable is the key to have milisecond precision, since it tells me how many milliseconds passed since the last update. This is because it uses the FreeRTOS clock. In order to see how much time has passed since the last full second of the song started, I substract from the ''​now_tick''​ variable the ''​last_sync_tick''​ variable.
   * After that, I sequentially iterate through the ''​current_lyrics''​ array to see if I need to update the text on the LCD.   * After that, I sequentially iterate through the ''​current_lyrics''​ array to see if I need to update the text on the LCD.
 +  * When the track is paused, the reference second time is equal to the current time to not lose the synchronization.
   * When the song ends, the lyric state variables are reset to show the menu UI.   * When the song ends, the lyric state variables are reset to show the menu UI.
  
 === Audio Task === === Audio Task ===
   * The audio task, since it is very important, it runs once every 2ms.    * The audio task, since it is very important, it runs once every 2ms. 
 +  * This task reads from the Queues to see if the audio needs to be paused, if the track needs to be changed or if the volume needs to be adjusted.
 +  * When it's not paused, I call the ''​loop()''​ method from the audio object to play the music. This handles behind the curtain mp3 decoding and sending input to the amplifier via I2S.
  
  
-===== Results ​=====+===== Testing ​=====
  
-**To be determined after Software Milestone.** +  ​When the parts came, I assembled the circuit and checked if the audio plays correctly on the speaker. I had to solder the wires so that was a bit stressful, since it was the first time for me doing this. The result can be seen in the first demo in the demos section below. 
-===== Concluzii ​=====+  ​Before the lab for the software milestone, I implemented a demo synchronization between the speaker and the LCD on a single song. The UI was tested only by myself, with the synchronization being validated by the laboratory assisted. ​   
 +  ​I tested the UI, by keeping the buttons pressed for a very long time, pressing them in fast succesion. Also, the pause/​resume button was tested in the same way and the volume regulator played a big role to see if the speaker behaved correctly at both low and high volume. 
 +===== Optimizations and elements of originality ​=====
  
-**To be determined after Software Milestone.**+  ​This project doesn'​t rely on dynamic memory allocations,​ using only stack allocated char arrays instead of String objects for the text processing. This stops fragmentation of the RAM memory and brings stability to the system. 
 +  ​The functionality separation two different cores, means that the main players of this architecture won't fight for resources, eliminating glitches in the music stream. 
 +  ​Using FreeRTOS timers as high-precision synchronization mechanisms. 
 + 
 + 
 + 
 +===== Conclusions ===== 
 + 
 +  ​This project was a really fun experience, where I experimented with many new concepts, like Real Time Operating Systems and audio processing API's for embedding systems. 
 +  * Also learning how to solder is a really valuable skill that I will definitely use in the future.
 ===== Download ===== ===== Download =====
  
Line 170: Line 182:
   * 16.05.2026: Add simple demo.    * 16.05.2026: Add simple demo. 
   * 23.05.2026: 90% of software implementation ready.   * 23.05.2026: 90% of software implementation ready.
- +  * 24.05.2026: Fine tuned the implementation.
  
  
Line 178: Line 189:
 {{ pm:​prj2026:​vlad.radulescu2901:​circuit.jpg?​500 | Physical circuit }} {{ pm:​prj2026:​vlad.radulescu2901:​circuit.jpg?​500 | Physical circuit }}
  
-{{https://​drive.google.com/​file/​d/​1OYpMS8L2arQ9ElOX3gjKkMVgnoy5mhVk/​view?​usp=sharing ​Demo video}}+<​html>​ <a href="https://​drive.google.com/​file/​d/​1OYpMS8L2arQ9ElOX3gjKkMVgnoy5mhVk/​view?​usp=sharing"> ​Demo video </a> </​html>​
  
 I did a small demo, where I just played the audio to see if the ESP32 can read the microSD card and if the speaker works. Also, in the video, you can see that the I2C module is connected and gets the text from the ESP32 that says "SD card mounted successfully"​. I did a small demo, where I just played the audio to see if the ESP32 can read the microSD card and if the speaker works. Also, in the video, you can see that the I2C module is connected and gets the text from the ESP32 that says "SD card mounted successfully"​.
 +
 +Below, you can see the final version of the project demo:
 +
 +<​html>​ <a href="​https://​drive.google.com/​file/​d/​1ybvt2zewgrId33BIKKeVnXzge2cTux3o/​view?​usp=sharing">​ Final demo </a> </​html> ​
 ===== Resources ===== ===== Resources =====
  
Line 194: Line 209:
 | MB102 Power supply module| <​html>​ <a href="​https://​www.handsontec.com/​dataspecs/​mb102-ps.pdf">​ Datasheet MB102 </​a></​html>​ | | MB102 Power supply module| <​html>​ <a href="​https://​www.handsontec.com/​dataspecs/​mb102-ps.pdf">​ Datasheet MB102 </​a></​html>​ |
 | MicroSDHC reader module| <​html>​ <a href="​https://​components101.com/​sites/​default/​files/​component_datasheet/​Micro-SD-Card-Module-Datasheet.pdf">​ Datasheet MicroSDHC </​a></​html>​| | MicroSDHC reader module| <​html>​ <a href="​https://​components101.com/​sites/​default/​files/​component_datasheet/​Micro-SD-Card-Module-Datasheet.pdf">​ Datasheet MicroSDHC </​a></​html>​|
 +
 +FreeRTOS documentation <​html><​a href="​https://​www.freertos.org/​Documentation/​00-Overview">​ (link here) </​a></​html>​.
 +
 +AudioI2S documentation <​html><​a href="​https://​registry.platformio.org/​libraries/​esphome/​ESP32-audioI2S">​ (link here) </​a></​html>​.
 +
  
 <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​ <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​
  
pm/prj2026/vlad.radulescu2901/andrei.giurgiu0801.1779613503.txt.gz · Last modified: 2026/05/24 12:05 by stefan.dumitrache
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0