Project Name: Automatic Guitar Tuner 🎸


Project Functional Description:


Design Overview:

  • A properly tuned instrument is crucial for producing accurate and harmonious notes, making this necessary for all instrumentalists. The process of tuning a chordophone, a string instrument, can be more challenging as rotating the pegs requires force, making it less accessible for some individuals and time-consuming for all individuals. Our project, the Automatic Guitar Tuner, aims to make this task accessible and more streamlined. It is a tool musicians can use to tune a chordophone, with a focus on guitars, by simply selecting the desired note on a OLED screen with buttons, holding the tool against the desired peg, and plucking the string. Using a microphone and digital signal processing, then, the device will analyze the frequency and make the proper adjustments by rotating the pluck using a stepper motor clockwise or counterclockwise as necessary. The OLED will display when the adjustments are completed. The other notable user interface includes a start/pause push button, two push buttons for right/left to select the note and the instrument, and a select button to choose the note or the instrument. The device will also have different modes for different instruments as well as a free spin mode to assist the user in rotating the motor manually for the restringing of the instrument.

Electrical Setup:

  • Compute and Operation System: In the core of our project lies a 32-bit STM32F407 microcontroller with a floating-point unit (FPU) as we are doing digital signal processing (DSP) including Fast Fourier Transform (FFT) to single out the frequency of a note. The MCU also does the PID control algorithm using sound feedback for stepper motor rotation control, utilizes I2S to read from a MEMS microphone, generates PWM signals for the stepper motor driver, controls the OLED display through SPI, reads input buttons via GPIO, and monitors battery through I2C with the battery management IC.
  • Motor Control System: This subsystem involves a stepper motor and its driver to provide the required torque to rotate the peg. A stepper motor connected to the microcontroller that rotates based on feedback from the microphone.
  • Sound Analysis System: A digital MEMS microphone with built-in amplification and filtering captures without a codec encoder will be used to record the sound and communicate with the MCU through the I2S protocol. The selected mic provides an 18-bit resolution audio. DSP is performed so that the microcontroller knows what frequency is being played.
  • User Interface System: The user interface comprises an OLED display module communicating via SPI protocol and a set of push buttons connected through GPIO to help with selection, the manual rotation mode, and interrupting the procedure. The display provides the tuning status, battery level, and menu navigation options such as string selection and instrument selection. A power button to turn the device on and off and buttons to control the screen display and select certain options.
  • Power Delivery System: Power delivery is handled through a Li-Po battery, a battery management IC, a Buck/boost converter, and a USB-C connector. The system provides two main voltage rails: 5V for the motor system and 3.3V for the MCU and other digital components. A BQ27441 Fuel Gauge IC to measure the state-of-charge (%), and the current/power being outputted from the battery. A BQ25185 Battery Charger IC to charge the battery via micro USB. The device is shut off if the power is too low.
  • Initial Hardware Setup Diagram

    Overview of the electrical hardware setup

Mechanical Setup:

Software Setup:

Primary Project Specific Design Requirements (PSDRs):

  1. (Hardware) An ability to have the microcontroller interact with an OLED via SPI.
  2. (Hardware) An ability for a microcontroller to read data from a digital microphone using I2S.
  3. (Hardware) An ability to interact and control a stepper motor driver from a microcontroller using bit-banging.
  4. (Hardware) An ability to interact between a microcontroller and a battery management IC using I2C.
  5. (Software) An ability to utilize embedded DSP methods to determine the guitar strings frequency.

Secondary "Stretch" Project Specific Design Requirements (PSDRs):

(to be implemented after the primary goals if the time allows)
  1. (Software) An ability to display graphics on the OLED showing the frequency of the string being tuned.
  2. (Software) An ability to have a free spin mode to assist in restringing the guitar.