Automatic Guitar Tuner - Arduino

by karina_melgar in Circuits > Arduino

1694 Views, 2 Favorites, 0 Comments

Automatic Guitar Tuner - Arduino

Screenshot 2021-11-28 224203.png

The automatic guitar tuner is a device that will tune a guitar string based on sound inputs. It consists of a 3D-printed handheld box with a mounted servo motor used to rotate a 3D-printed clamp that fits around a guitar tuning peg. There are 6 red LEDs and 1 green LED used to indicate the status of the tuner; each red LED corresponds to one guitar string, and the green LED indicates if the string is in tune. The user will press a select button that cycles through the red LEDs (only one is on at a time) until the red LED for the desired string is lit. After the user selects a string, attaches the device to the corresponding peg, and strums that string once, a microphone sensor module will detect the intensity of this sound and send signals to the Arduino if it is above a certain intensity threshold. Then the Arduino will process the signal to determine the frequency (pitch) of the sound using FFT (Fast Fourier Transform) calculations. If this frequency does not match the desired tuning frequency of the string (with some tolerance), then the servo will be activated to rotate the clamp and turn the peg. The servo will rotate clockwise to lower the frequency and counterclockwise to increase the frequency. Once in tune, the green LED will turn on to indicate it is done tuning. This LED will turn off if the user selects another string. The user can then repeat the process with another string.

I made this project as part of an assignment for my mechatronics course. Below you can find additional design considerations, instructions for assembly and operation, a bill of materials, a circuit diagram, and downloadable CAD files and Arduino code.

Supplies

  • Arduino Uno
  • Sound sensor
  • 100, 220, and 1000 ohm resistors
  • Red and green LEDs
  • Tactile switch push button
  • Breadboard and wires
  • Continuous-rotation micro servo and mounting hardware
  • 3D-printed enclosure and clamp

Design Considerations

For someone making this project, the main issue to consider is finding a motor that has enough torque to turn the tuning peg on your guitar. The servo that I used was not strong enough to do this, so unfortunately the device did not function as intended. If I were to redo this project, I would either try to find a different motor that would work better or redesign the clamp and its attachment to the servo so that it will turn the tuning peg as expected.

One other thing to consider is to design the clamp around your guitar’s tuning peg shape. Make sure the spacing of the grips is not too large or too small so that it fits around the tuning peg. It also would be beneficial to build the circuit with the microphone on the sound sensor positioned well so it can pick up the sounds from the guitar easily. It might be a good idea to have the sensor connect to wires that plug into the breadboard instead of directly inserting it into the breadboard so that you can position the microphone closer to the sound source. Lastly, I would advise to keep the red LEDs in the same order as their corresponding Arduino pins so that it is visually organized and matches the order of the guitar strings by tuning frequency.

If I were to redo this project with the same design constraints and budget, I would invest in a higher quality sound sensor. I only used $13.96 of my $20 budget (see Appendix A), so I could afford to purchase a better, though more expensive, sound sensor. This would allow for more accurate sensing and could improve the calculation of the frequencies of the sounds being played, thereby making the tuning more accurate. And as mentioned before, I would see if purchasing a different kind of motor would work better for my tuning device.

Assembly

  1. Build the circuit based on the diagram below. Ignore the connections for the servo for now.
  2. Insert the servo into the opening in the enclosure, lining up the circular holes of the enclosure with the mounting holes on the servo. Insert the servo mounting bolts through these holes from the inside of the enclosure and fasten nuts from the outside of the enclosure.
  3. Cut and strip three solid-core hookup wires approximately 3 feet long (length may vary depending on how long or short you want the connection to be from the handheld device to your breadboard). You may want to tape or braid the wires so they remain in a bundle. Insert one end of each wire into the connector for the servo. Connect the other end of these wires to the appropriate locations in the breadboard based on the diagram in Appendix B.
  4. Insert the rotating part of the servo into the hole on the flat side of the clamp and push the clamp down so it is pressed against the servo.

Operation

Once the device is assembled, fit the clamp over the guitar peg corresponding to the desired string to tune and hold it in place. Connect the Arduino to the computer and upload the code. Press the select button on the breadboard until the red LED corresponding to the desired string to tune is on. Move the breadboard so the microphone is near the guitar and strum the string while continuing to hold the handheld device over the peg. Until the green LED is lit, wait a few seconds before strumming the string again. When the green LED turns on, either select another string to be tuned and repeat the process or disconnect the device from the computer if you have finished tuning all strings.

Bill of Materials (BOM)

Screenshot 2021-11-28 225333.png

A note about the BOM: in my course, we were given kits that contained a collection of basic circuit components, such as resistors or LEDs, as well as the Arduino. There is a subtotal cost for items that were purchased separately from this kit and a full cost for all items used in this project.

Circuit Diagram

Screenshot 2021-11-28 225625.png

CAD Files and Arduino Code