S18: Spark - MP3 Music Player with Audio Spectrum
Contents
Spark - MP3 Music Player with Audio Spectrum
Abstract
The project aims to build an embedded system based music system using SJOne (LPC1758) board. The system will play music through a speaker interfaced with the board. A mobile application will be used to remotely control the system using Bluetooth. The app will be able to send the start and stop signal to play music as well as switch the song and modify volume. The playlist for music will be stored on an SD card mounted on the SJOne board. An audio decoder is required as a mediator between speaker and SJone board. It will read data from SD card using SPI interface, convert this data into audio data and send to the speaker. RGB Spectrum of Audio will be shown on the LED.
Objectives & Introduction
Show list of your objectives. This section includes the high level details of your project. You can write about the various sensors or peripherals you used to get your project completed.
Team Members & Responsibilities
- Sucheta Iyer
- Interfacing the SJONE board with speakers via the audio decoder
- Sneha Sharma
- Interfacing the SJONE board with speakers via the audio decoder
- Android application
- Krishna Sai Anirudh Katamreddy
- PCB design
- Ashwini Bhargava
- Interfacing the SJONE board with RGB Display
- Doyal Patel
- Interfacing the SJONE board with RGB Display
- Android application
Schedule
Show a simple table or figures that show your scheduled as planned before you started working on the project. Then in another table column, write down the actual schedule so that readers can see the planned vs. actual goals. The point of the schedule is for readers to assess how to pace themselves if they are doing a similar project.
Week# | Date | Task | Actual |
---|---|---|---|
1 | 4/3/2018 | Project Abstract | Completed |
2 | 4/17//2018 | Order Components (MP3 Decoder,16*32 LED Display) | Completed |
3 | 4/24//2018 | Initialize LED screen with different colors.
Read music data from SD card through SPI. |
Completed |
4 | 5/1/2018 | Initializing single LED and testing it with sample algorithm with different colors(completed)
Initialize the Audio Decoder through SPI communication and read manufacturer ID - (completed) Read from Sjone board and play sample song - (completed) Read from Memory card(SJone) and play sample song - (in progress) Designed a PCB which can hold MP3 player shield and two SJOne boards. Connected circuits between MP3 player shield and one SJOne, LED matrix and second SJOne board. Communicating SJOne with android application using bluetooth. |
Completed |
5 | 5/8/2018 | Get audio spectrum values and display on LED.
Pass the song data received through SD card to the audio decoder Listen to sample music on headphone/speaker. Added Audio Analyzer to the PCB design. Reviewed all the circuit connections and dimensions between components pins. Ordered the PCB. Developing user interface on android application. |
Completed |
6 | 5/15/2018 | Testing and Bug Fixing
Soldering the PCB. Final Report |
In Progress |
Parts List & Cost
Sr. No. | Component | Cost |
---|---|---|
1 | SJONE board | $80 |
2 | Audio Decoder | $24.95 |
3 | 16*32 RGB Screen | $32.42 |
4 | PCB | $ |
Design & Implementation
The design section can go over your hardware and software design. Organize this section using sub-sections that go over your design and implementation.
Hardware Design
Discuss your hardware design here. Show detailed schematics, and the interface here.
Audio Decoder
The Sparkfun MP3 Player Shield was used in this project. This includes the VS1053B MP3 audio decoder IC which decodes the supplied audio files. The audio decoder is capable of decoding audio data of various formats such as WAV, MP3, MIDI and AAC. Audio data in MP3 format is chosen for this project.
Input: MP3 audio file transmitted through SPI
Output: Audio to headphone jack and header pins.
Bluetooth Module and Android App
The Bluetooth Module connects with the SJOne Board via UART and the data received is transmitted via Bluetooth to the SparkMusicPlayer Android App. Similarly data sent via Bluetooth by the App is communicated via UART to the SJOne board. The entire flow is displayed below.
Bluetooth Module
The HC-05 Bluetooth module is used in this project. It is interfaced with the UART2 pins of the SJOne board as follows:
HC-05 RX pin - SJOne UART2 TX pin
HC-05 TX pin - SJOne UART2 RX pin
VCC pin - SJOne 3.3V pin
GND pin - SJOne GND Pin
SparkMusicPlayer Android App
Native Android app that connects with HC-05 module (and thereby to the SJOne Board) via Bluetooth.
Data Received by the App: A list of songs available on the SD Card mounted on the SJOne board.
Data Transmitted by the App: Control signals - Play, Pause, Stop, Volume Up/Down and Song Selection from the received list of songs.
The screen of the Android app is as shown below.
Frequency Decoder
Text
LED Matrix
To display frequency spectrum of music input adafruit’s 16 x 32 LED Matrix is used. It is interfacing with LPC1758 using multiple GPIO pins. The LED matrix is connected to LPC1758 board by connecting three select pins to select rows (A, B and C), selection of colors using (R1,B1,R2,B2,G1,G2), Clock (clk), OE (Output enable), and Latency (LAT) of the LED matrix to GPIO pins of LPC1758 board shown as bellow:
LED matrix R1 pin -> SJOne P0.29 pin
LED matrix B1 pin -> SJOne P0.30 pin
LED matrix G1 pin -> SJOne P2.7 pin
LED matrix R2 pin -> SJOne P1.19 pin
LED matrix B2 pin -> SJOne P1.20 pin
LED matrix G2 pin -> SJOne P2.6 pin
LED matrix A pin -> SJOne P1.22 pin
LED matrix B pin -> SJOne P2.5 pin
LED matrix C pin -> SJOne P1.23 pin
LED matrix Clk pin -> SJOne P1.28 pin
LED matrix OE pin -> SJOne P1.29 pin
LED matrix LAT pin -> SJOne P2.4 pin
PCB Design
PCB is being used to connect Sparkfun MP3 player shield, LED Matrix and Audio Analyzer with two SJOne boards.
Hardware Interface
In this section, you can describe how your hardware communicates, such as which BUSes used. You can discuss your driver implementation here, such that the Software Design section is isolated to talk about high level workings rather than inner working of your project.
Audio Decoder
Text
Bluetooth and Android App
Text
Frequency Decoder
Text
LED Matrix
Text
PCB Design
PCB is designed to connect SparkFun MP3 Player Shield, LED Matrix, Audio Analyzer between two SJOne boards.
Software Design
Show your software design. For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level. Do not show the details of the code. For example, do not show exact code, but you may show psuedocode and fragments of code. Keep in mind that you are showing DESIGN of your software, not the inner workings of it.
Audio Decoder
Text
Bluetooth and Android App
Text
Frequency Decoder
Text
LED Matrix
The software design to update LED matrix is as follow:
1. Disable output.
2. Enable latch.
3. Select the row using A,B and C pins.
4. Reset all the LED’s in selected row. Light up colored row depending on value of frequency band and it’s value.
5. Enable output.
6. Disable latch.
Implementation
This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation.
Audio Decoder
Text
Bluetooth and Android App
Text
Frequency Analyzer
The implementation of Frequency analyzer is as follow:
1. Init LED matrix.
2. Start task to get audio frequency data and send it to LED Matrix.
2.1. Get audio frequency data for all band at once.
2.2. For each data in ith band.
2.2.1. Apply filter and divide result by 128 to get proper data between 0 to 32.
2.2.2. Send row, color and frequency information to update matrix.
Testing & Technical Challenges
1. Understanding the speed of communication between SJOne-memory card and SJOne-MP3 decoder. It was a producer-consumer problem that we were facing which was playing the song is a distorted way. We had a hard time figuring out which communication had the timing issue.
Suggestions:
1. If someone would want to use this particular decoder, then we would recommend converting the sample Arduino code that comes as part of the software package to C code. It would give a good head-start to how the decoder operates on default parameters.
<Bug/issue name>
1. Late arrival of PCB.
Conclusion
Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?
Project Video
Upload a video of your project and post the link here.
Project Source Code
References
Acknowledgement
Any acknowledgement that you may wish to provide can be included here.
References Used
List any references used in project.
Appendix
You can list the references you used.