Background of the Project -
Pretty much all of my life, I've had a huge passion for music. I've played piano from a pretty young age and I have recently begun learning how to play guitar, so when I was tasked with creating an embedded system in my engineering class, it was only natural that I made it about music.
The project I chose to create was a simple guitar tuner. It uses a mini USB microphone to record a small audio clip of a string being played. It then converts the audio file to a frequency value using an FFT. Lastly, the frequency value of the converted audio clip is compared to the 'target' frequency of the corresponding string and feedback is given based on whether the string is in tune or the note is flat/sharp. This feedback is in the form of text on an LCD screen.
Build Instructions -1. Collecting Parts / Soldering
After collecting all the needed hardware components, the first step should be unpack the LCD screen and solder on the pins provided with the packaging. If there aren't enough pins to fill both sides of the board completely, make sure to prioritize the 8 SPI pins the device requires: GND, Vin, CLK, MISO, MOSI, CS, D/C, and RST. After completing this, the assembly begins (for which the fritzing diagram included below will be needed).
2. PocketBeagle & Breadboard
The two breadboards that have been gathered should be snapped together to form a single large breadboard. This is not necessary, but it makes for a much more stable device. After doing this, you can place the PocketBeagle as shown on the fritzing diagram, with "P1_1" lining up with pin a1 on the breadboard.
3. Buttons
The buttons, represented by yellow jumper wires, should be installed exactly as seen on the fritzing diagram.
4. Mini USB Microphone
The mini USB Microphone is represented by the blue jumper wires in the fritzing diagram. Included below is a picture of how the 5 jumper wires are connected to the mini USB breakout board, which is connected to the USB microphone.
5. LCD Screen
The LCD screen is represented by the green jumper wires in the fritzing diagram. Included below is a picture of how the 8 jumper wires should be connected to the LCD screen.
6. Getting Code
The code is available at the Github repository referenced below.
7. Using the Guitar Tuner
After completing the build and downloading the code from Github, you are finally able to use the guitar tuner! The process of using the device is simple -
- Press one of the six buttons, which each correspond to a guitar string (top blue button is low E string, bottom red button is high E string, the four in between are arranged as you would expect)
- Play the string you wish to tune in the 3 second period after pressing the button.
- Check the screen to see if the string is flat, sharp, or in tune.
- Repeat as necessary.
Below you will see three videos of the device being used, which show the three possible outcomes of running a test for one of the strings. In each of the videos, the top button (which corresponds to the low E string) is used to commence the recording of the sound.
Additional Help & Resources Used -
A huge thanks goes to my professor Erik Welsh who guided me throughout the process of creating this device and who also provided the display code used in this project. Listed below are additional sources that were used in the creation of this guitar tuner -
- PyAudio Recording Code Inspiration - youtube.com /watch?v=jbKJaHw0yo8
- FFT Conversion Code Inspiration - https://stackoverflow.com/questions/3694918/how-to-extract-frequency-associated-with-fft-values-in-python
Comments
Please log in or sign up to comment.