Project Name: Karaoke Machine


Project Description:

Karaoke is a common pastime activity that is done by many people, wherein they would sing a song based upon their choice and then obtain a score out of 100. Our project will apply pitch detection algorithm for the metric of the score calculation.
The product will be concealed inside a box, which will be the mixer in the Karaoke machine. And also, this will be the main system control for our project. On the top, there will be two 8 ohms speaker drivers act as stereo audio system. At the front, there will be a 7 inch display that will show the song lyrics.

Inside the box, there will be our PCB board and the Raspberry Pi 4. The Raspberry Pi 4 is our main computation system. It will be in charge of the heavy Digital Signal Processing (DSP), and also act as the bridge that connects and controls the other electronic devices. To have a lag-free environment, we have chosen 4GB RAM model (2GB RAM is the basic model). Two speaker drivers will be connected to a speaker amplifier on the PCB. The speaker amplifier we have chosen, TPA3128D2, is capable of both driver outputs. Also, up to 30W per each channel. The display, will be connected to the mini HDMI on the Raspberry Pi 4. In addition, there will be a speaker that will take user's singing input via USB on the Raspberry Pi 4.

To enhance user experience, there will be an app for users to control our system through a Bluetooth module, which is HM-19. The controls from the phone will be carried to our microcontroller through UART, and again through UART on the microcontroller to the Raspberry Pi. More details are outlined below:

  1. Initial Data Processing and Score Calculation: The process begins with the user speaking into a microphone. Once the singing is over, their analog voice signal is converted into an audio file, saved locally on the Raspberry Pi. we are using Python to perform pitch analysis on the user's vocal input and comparing it against a reference audio track to assess pitch accuracy. The scoring mechanism quantifies pitch accuracy by cutting the audio into several intervals and comparing the user's pitch with the reference pitch within each interval. The final score is a percentage calculated by tallying the number of intervals where the user's pitch matches the original song.
  2. Music Selection: Users select music through a GUI on a phone application. The app displays a list of available songs, and once a song is selected, a token associated with the song will be sent to the Bluetooth module and the HM-19 Bluetooth module will send that token to the Raspberry Pi through the STM32 microcontroller. The Raspberry Pi then plays the song by controlling the audio amplifier and the speaker. The song continues until it reaches the end and the progress of the song is displayed using an internal monitor. Concurrently, the computer calculates the user's score using the algorithm described above.
  3. Phone App: After the score is calculated, it is saved by the machine and displayed on the phone app. The app's GUI facilitates easy navigation and selection of songs, enhancing the user's interaction with the system.


Project Specific Design Requirements (PSDRs):

  • PSDR #1 (Hardware): An ability to communicate with the phone application through Bluetooth module to interact with microcontroller via UART.

  • PSDR #2 (Hardware): The ability for the STM32 microcontroller to implement UART communication protocol to facilitate efficient data exchange between the Raspberry Pi. Raspberry Pi being able to control the speaker as instructed by the microcontroller from the user via their phone.

  • PSDR #3 (Hardware): An ability to build a powerful self designed stereo audio amplifier that is able to output a loud sound. The circuit will connects to a 3.5mm jack, which will then connects to the device through 4-pole audio jack on Raspberry Pi.

  • PSDR #4 (Software): An ability to maintain an efficient algorithm - pitch detection, timing - with almost no latency that allow to compute digital signal processing with audio input from the user through the microphone and numericalize the analog data for accurately calculating the user's singing skill.

  • PSDR #5 (Software): An ability to design and maintain an interactive GUI for the phone application that functions as a remote control with the ability to choose songs on the home page and a score display at the end of the song.