Design and Construction of an Automatic Guitar Tuner


Sina Atalay


January 15, 2021


November 20, 2023

This post briefly discusses designing and constructing a microcontroller-based guitar tuner device with DC motors. The project was a term project of 6 mechanical engineering students at Boğaziçi University: Sina Atalay, Abdullah Gedük, Ediz Ferit Kula, Alp Uysal, Elif Hacıhasanoğlu, and Kevser Didar İskender.

1 Overview

The goal was to build a microcontroller-based device to automatically tune a guitar with DC motors. The user plays a string, and the device tunes it. Firstly, we tried to visualize how this device would work. The conclusion was this:

  1. The user selects the tuning they desire.
  2. The user plays a string so that the device can hear the current state of the string.
  3. The device tunes the string until the desired pitch is achieved.

Next, we carefully analyzed each step.

The tuning selection part was the simplest one. With buttons and a microcontroller, we built a circuit that takes inputs from the user. Additionally, we made a visual user interface using an LCD screen. Once the tuning selection was made, each string’s pitch was assigned, and the device knew its goal. For example, if the user selected E standard tuning, the sixth string’s fundamental frequency would be 82.4 Hz.

The second part was more challenging. While we could connect a microphone to the microcontroller for sound input, it wasn’t clear how the microcontroller could determine if the string’s pitch was correct. We eventually discovered that the only characteristic of a string’s sound that could be altered was its fundamental frequency. Therefore, it would be sufficient if the device could calculate the string’s fundamental frequency. We achieved this by sampling the string’s sound and applying a discrete Fourier transform to compute the string’s fundamental frequency. Instead of a microphone, we used an electric guitar to record the sound directly and built an amplifier circuit to ensure the microcontroller could detect the sound.

The next step was tuning the guitar to the assigned pitches. This part was done by programming the microcontroller to control DC motors. By turning the tuning key, the string can be tightened or loosened to adjust its pitch. The device’s objective was to tune the guitar so that each string’s frequency matched its assigned value. We used linear regression analysis to predict the amount of time for the DC motor to turn the tuning key based on the difference between the fundamental frequency and the goal frequency.

Our initial plan was to build a device that could tune all guitar strings simultaneously. We were unable to achieve this goal as it required more advanced algorithms and a circuit. However, we succeeded in constructing a device that can tune each guitar string individually.

2 The Final Product

The schematic of the automatic guitar tuner can be seen in Figure 1. Also, the tuner can be seen in action below (the video is in Turkish, but English subtitles are available).

Figure 1: The schematic of the electronic circuit of the dynamometer.