Tune up. (2012)


A self-tuning guitar system, implemented entirely in assembly code on an Intel 8051 microprocessor. Includes audio processing front-end, electromagnetic string excitation, and stepper motor circuitry.

This project was a final project for 6.115, Microcomputer Project Laboratory. The goal was to make a guitar that can tune itself automatically, based upon the Intel 8051 microprocessor and supporting circuitry. The entire project was coded in 8051 assembly.


Here’s how it works: On each string are two coils, a sensing coil and a driving coil. The two are connected through an op amp, which provides a gain of ~200. There is a positive feedback between the coils, with the loop of the system being closed by the string itself. Each coil is a magnetized iron pole, wrapped with wire, much like a guitar pickup but for a single string. It translates motion of the metal guitar strings into a voltage signal and vice-versa. The coils were made by modifying buzzers to remove the diaphragm. The microcontroller opens the feedback path between the sensing and driving coils, and natural noise in the string causes oscillation to start, resulting in the string resonating indefinitely at it’s natural frequency. This is analogous to the startup of a crystal oscillator. The voltage signal of the string’s motion is also fed to a low pass filter, which produces a sine wave of frequency equal to the fundamental frequency of the string’s vibration. This is fed into a comparator, which produces a square-wave of frequency equal to the string’s fundamental. This drives an interrupt pin on the 8051, which counts clock cycles to determine period and therefore frequency. A stepper motor drives the tuning pegs in the proper direction until the string converges on the proper frequency.


The most difficult part of the project was the tradeoff between convergence time on the proper tuning and tolerance from the nominal frequency. I was able to strike a balance where it converges in a reasonable amount of time, but the tolerance is tighter than the human ear’s ability to discern pitch!


Project code (8051 assembly)