Skip to main content
Version: FILS English

Guitar Tuner

Used to tune your guitar

info

Author: Magureanu Alin
GitHub Project Link : https://github.com/UPB-PMRust-Students/project-Alin1502

Description

The project consists of a guitar tuner that helps the user to accurately tune each guitar string without the need for external devices or application. Firstly, the sound is captured by the MAX9814 microphone and is sent to the microcontroller. The Raspberry Pi Pico analyzes the signal using Fast Fourier Transform in order to determine the dominant frequency. The obtained frequency is compared to the standard tuning values and identifies the closest musical note. After all the computations, the obtained note is shown on the OLED Display and the buzzer replicates the sound of the chord. For simplicity of the user interface, the user can select which string he is currently tuning using a push button.

Motivation

As someone who started to play guitar recently, I found it frustrating that my guitar was getting out of tune frequently. While there are mobile apps available for tuning, I disliked the idea of always depending on a phone and internet access to perform this. By researching how to detect sound frequencies, process them and display them in real time, I was able to create my own, fully functional device for tuning the guitar.

Architecture

  1. Raspberry Pi Pico: used for handling the logic of the project. It receives analog audio input from the microphone, makes it digital using ADC and performs signal processing to detect the frequency
  2. Microphone Module: captures the sound of the guitar being plucked, which is then sent to the microcontroller
  3. OLED Display: displays when the chord is in tune and the current string selected
  4. Push Button: prompts the user to select between the 6 chords ( E, A, D, G, B, E) to select what to tune.
  5. LED: blinks red when guitar is out of tune, green when it is in tune
  6. Buzzer: replicates the sound of the respective chord after it gets in tune

Guitar_Tuner

Log

Week 28 April - 4 May

I started working on the documentation for the project. I bought every necessary component and i started to connect them on the breadboard, in order to be able to make the schematics and understand how they interact with eachother.

Week 5-11 May

This week I started looking into how to use the Fast Fourier Transform (FFT) to detect the frequencies from the microphone. I needed this to figure out which string is being played on the guitar.I learned how to take audio samples, remove the DC offset, and apply the FFT using the microfft crate.

Week 12-18 May

I implemented the other components : the push button to select between strings, and the two led's to display the tuning status. I still have issues with computing the correct frequency of each string, as there is a lot of background noise detected. The display is working aswell, displaying if we should tune upwards, downwards or if it's in tune.

Week 19-25 May

I succesfully completed the software part of the project. The tuner is now capable to detect accurately the frequency of each guitar string. I also improved the user interface part, providing clear feedback on the display.

Hardware

  1. Raspberry Pi Pico 2
    Main control unit. Coordinates all used components - the microphone, the buzzer, the led's and the display. It performs signal processing to analyze the audio input and determine the string's frequency.
  2. MAX9814 Microphone
    Captures audio. Detects the sound and sends the analog signal to the pico's analog-digital converter.
  3. Push Button
    User interaction. Allows the user to cycle through guitar strings for tuning and is used to move to the next chord after a string gets tuned.
  4. LED's
    Visual tuning indicators. When the correct frequency is detected, it means the guitar is in tune and the green led turns on. Otherwise, the red led is constantly turned on during the process.
  5. Active Buzzer
    Audio feedback. Sounds a confirmation tone when a string is tuned correctly, providing audible confirmation alongside the green LED. The tone of the buzzer coresponds the sounds of the respective string.
  6. OLED Display
    Display status. Shows messages such as the current string tuned or whether we need to tune up or down.
  7. Step Down Power Supply
    Using a battery and the LM2596s, we will power the whole circuit such that it is portable and we can use it anytime

Hardware_Photo1

Hardware_Photo2

Hardware_Photo3

Schematics

KiCad_Schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller40 RON
Raspberry Pi Pico WHThe Debugger39 RON
MAX9814Microphone Module60 RON
9V BatteryPower the circuit20 RON
LM2596s Step DownPower the circuit13 RON
Push ButtonSelect Button0.36 RON
OLED DisplayThe Display30 RON
LEDBlink LED0.4 RON
BuzzerReplicates Sound1.4 RON

Software

LibraryDescriptionUsage
defmt, defmtrttEfficient LoggingUsed for detailed logging and debugging
ssd1306Display LibraryUsed for I2C OLED Display
embassy-rpPico PeripheralsUsed for accessing the peripherals
num-complexComplex Numbers LibraryUsed to compute complex part of fourier
microfftFourier Transform LibraryUsed to compute frequency with fourier
embassy-timeTime management libraryUsed for time-based operations such as delays
embassy-executorAsync/Await executorUsed for asynchronous programming and timers
embedded-graphicsText libraryUsed for text and shapes
heaplessMemory allocationUsed for String
libmMath LibraryUsed for math functions
  1. Clap Switch
  2. Fundamentals and Harmonics
  3. Video Demo for Tuner