Skip to main content
Version: FILS English

Automatic Guitar Tuner

Automatically tunes your guitar after plucking a string.

info

Author: Niss Francisc-Cristian
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-Niss-Francisc-Cristian.git

Description​

The β€œAutomatic Guitar Tuner” is a device designed to assist guitarist in tuning their instruments accurately and fast. It works by detecting the frequency of a played string and adjusting the tuning peg automatically using a motor.

Motivation​

Tuning a guitar can be considered a frustrating process for a lot of guitar players, especially beginners. The motivation behind this project is to simplify that experience using a compact and portable device. This project combines my two main passions those being Music and IT.

Architecture​

The Raspberry Pi Pico 2W acts as the central control unit, managing the input and output of the system.

The Max9814 Microphone Module captures the sound of a vibrating guitar string and sends the analog signal to the Pico for processing.

The Voltage Regulator provides a stable 5V power supply to the entire system, including the Pico, motor driver, and microphone.

The L298N receives control signals from the Pico and adjusts the direction of the connected motor accordingly.

The DC Motor is connected to a 3D printed tuning peg gripper and rotates to tune the guitar string automatically.

Arhitecture

Log​

Week 5 - 11 May​

I finished purchasing all the components necessary for the project and now I am starting to connect and understand each component

Week 12 - 18 May​

I completed assembling the circuit and ensuring that each component is properly wired and powered. With the hardware setup in place. I also finished making the blueprint for the 3D component that I will be attaching to the motor.

Week 19 - 25 May​

I’ve completed the hardware and motor torque testing to ensure the system can turn a guitar peg reliably. With testing finalized, I’ve now started coding and have implemented the key functions I planned.

Hardware​

Raspberry Pi Pico 2W – acts as the central controller, running the logic to read audio input, process frequency, and control the motor.

Max9814 Electret Microphone Amplifier Module – captures the sound of the vibrating guitar string and outputs an amplified analog signal.

GA12-N20 DC Motor (6V, 30RPM) – rotates the guitar tuning peg to adjust string tension.

Dual Motor Driver Module – allows the Pico to control the motor direction using two GPIO pins.

LM2596S DC-DC Step-Down Converter – steps down the 8.4V from the battery to a stable 5V used by the entire system.

2S LiPo Battery (7.4V, 1300mAh) – provides portable power for the motor and control circuitry.

Generic Electronics Kit – includes breadboard, jumper wires, resistors, and connectors needed for prototyping.

3D Printed Tuning Peg Handle – a custom attachment mounted to the motor shaft to grip and turn the tuning peg of the guitar.

The system is powered by a 2S LiPo battery which supplies approximately 7.4V. This is stepped down using the LM2596S module to a regulated 5V that powers the Raspberry Pi Pico 2W, motor driver, microphone, and the motor itself via the L298N.

Hardware

Hardware

Schematics​

KiCad

Bill of Materials​

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller39,66 RON
MAX9814 Microphone ModuleThe microphone24,90 RON
GA12-N20 DC MotorThe motor26,18 RON
LM2596S DC-DC Step Down ModuleVoltage regulator12,99 RON
Dual Motor Driver Module L298NThe motor driver module10,99 RON
2S LiPo 8V BatteryThe battery95 RON
General Electronics KitBreadboard,wires,capacitors,resistors,etc.60,38 RON

Software​

LibraryDescriptionUsage
rp-halHAL implementation for the Raspberry Pi PicoGPIO, ADC, and hardware setup
embedded-halEmbedded hardware abstraction layerGeneral embedded hardware interface
microfftFast Fourier Transform library for microcontrollersConverts time-domain audio samples into frequency domain
defmtLogging crate optimized for embedded systemsDebugging values during development
cortex-mLow-level Cortex-M functionalityOptional: interrupt and timing control
embassy-rpAsync HAL for Raspberry Pi PicoAsync GPIO, ADC, PWM, and peripheral control
embassy-executorAsync runtime for embedded systemsRuns #[embassy_executor::main] async function
embassy-timeAsync timer/delay library for EmbassyUsed for non-blocking delays like Timer::after()
panic-probeMinimal panic handler for embedded RustCaptures and prints panics via RTT
micromathLightweight math functions for no_std environmentsUsed for computing Hann window and FFT magnitude
  1. Rust on Raspberry Pi Pico
  2. embedded-hal Documentation
  3. microfft Crate for Frequency Analysis
  4. Max9814 Microphone Datasheet (Analog)
  5. Raspberry Pi Pico 2W Docs
  6. Guitar Strings Frequency