Professional Documents
Culture Documents
Download Favorite
https://www.instructables.com/id/Guitar-Tuner-With-an-Arduino/ 1/15
27/02/2019 Guitar Tuner With an Arduino: 8 Steps (with Pictures)
Guitar Tuner With an Arduino by EE421ACDC (/member/EE421ACDC/) Follow Download Favorite
Pitch is everywhere, but what exactly is it? This website will document the steps to create
your very own Arduino guitar tuner.
Pitch, which is often thought of as how high or low a sound is, can be de ned as the
human perception of frequency. It is clear that humans can not detect frequency with the
naked ear, however, our natural idea of pitch can get us most of the way there. Pitches are
denoted by the seven letters A,B,C,D,E,F,G and A which is one octave above the initial A
with a frequency of 2A. If we look at the keys of a piano we see a repetition of those same
https://www.instructables.com/id/Guitar-Tuner-With-an-Arduino/ 2/15
27/02/2019 musical notes. Each set of eight notes is known
Guitar Tuner asArduino:
With an
Guitar Tuner With an Arduino by EE421ACDC (/member/EE421ACDC/)
Follow
an octave and(with
8 Steps each note Download
Pictures) can be at Favorite
(lower) or sharp (higher) than the ideal pitch frequency. Lets take a look at rather small
frequencies between 50 and 0.
We were not given this natural ability to perfectly detect pitch or frequency, but with
technology and our understanding of signals, this can be done. This demonstration will
outline how AC/DC achieved a means to detect the pitch of a guitar string through
frequency analysis.
This image indicates the frequency layout for any note the guitar signal might produce.
These ranges allow the user to tell if the note being played is sharp or at, and this is
displayed in a later video.
How exactly do we get frequency from a raw input sine wave? We'll get into how the
Arduino handles the conversion later, for now, lets build the input circuit. The input is taken
directly from the audio jack which intern receives the signal through the audio cable from
the inductive pickups located on the guitar. We need to collect the signal and then amplify
it, after that the raw voltage value is inputted into the board as an analog input to be
processed.
1) Lets begin by building the op-amp circuit. Take the time to gather all the components
listed below.
https://www.instructables.com/id/Guitar-Tuner-With-an-Arduino/ 4/15
27/02/2019 (x1) bread board/ prototyping board
Guitar Tuner With an Arduino: 8 Steps (with Pictures)
Guitar Tuner With an Arduino by EE421ACDC (/member/EE421ACDC/)
Follow Download Favorite
NOTE: The Op Amp circuit takes the sound waves and increases the amplitude, so that the
Arduino can read it easily. The waveform without it would not be in the detectable range of
the Arduino of 0 to 5V. It then sends the signal into the Arduino to be sampled, which then
samples the frequency of the sound waves, and records it on the serial port so the user can
see.
(https://cdn instructables com/FPA/FTIL/J20PGRZE/FPAFTILJ20PGRZE LARGE jpg) (https://cdn instructables com/FSF/UL2C/J20PGS0P/FSFUL2CJ20PGS0P LARGE jpg)
We need some way to out put the processed data from the arduino, for this Guide we will
be using the following schematic to output with the 16x2 LCD display. For this you will use
the same arduino connected to the op-amp circuit as well as;
(x1) large value resistor (for power to the LCD) we used 22 kOhm.
more wires...
and that's it. This is pretty simple, just connect the wires in the same way that they are
shown in the schematic.
NOTE: We used a 10 kOhm potentiometer as a variable resistor to adjust the gain of the op
amp. The gain is the amplitude of the output voltage divided by the amplitude of the input
voltage.
This video shows the full circuit put together, walks through the schematic and parts list,
and goes over important parts of the code.
int len = sizeof(rawData); int i,k; long sum, sum_old; int thresh = 0; oat freq_per = 0; byte
pd_state = 0;
//Base 0 octave frequencies // oat freq = 415; // dont neet this oat Ffreq; oat Note;
char testput; String out = “b—-[[ ]]—-#”; int octave_counter; oat C = 16.35; oat D =
18.35; oat E = 20.60; oat F = 21.83; oat G = 24.50; oat A = 27.50; oat B = 30.87;
// initialize the library with the numbers of the interface pins //Pin 12 = RS //Pin 11 = E //Pin
5 = DB4 //Pin 4 = DB5 //Pin 3 = DB6 //Pin 2 = DB7 LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
//string output = 0; // set up the LCD’s number of columns and rows: lcd.begin(16, 2);
lcd.setCursor(0,0); lcd.print(” EE421: Signals”); lcd.setCursor(0,1); lcd.print(” Guitar Tuner”);
delay(3000); lcd.clear(); lcd.setCursor(2,0); lcd.print(“[“); lcd.setCursor(13,0); lcd.print(“]”); //
Print a message to the LCD.
count = 0; } oat freq; void loop() { if (count < LENGTH) { count++; rawData[count] =
analogRead(A0)>>2; } else { sum = 0; pd_state = 0; int period = 0; for(i=0; i < len; i++) { //
Autocorrelation sum_old = sum; sum = 0; for(k=0; k < len-i; k++) sum += (rawData[k]-128)*
(rawData[k+i]-128)/256; // Serial.println(sum);
//Filter out frequencies that are too high to matter if(freq_per < 400) { freq = freq_per; } else
{ freq = -1; }
https://www.instructables.com/id/Guitar-Tuner-With-an-Arduino/ 7/15
27/02/2019 = “b—–< >>>>–#”; else if(cl1==-4) outTuner
Guitar = “b-<<<<< >—–#”;
With an Arduino:
Guitar Tuner With an Arduino by EE421ACDC (/member/EE421ACDC/)
Follow
else(with
8 Steps if(cl1==4)
Pictures)out = “b—–<
Download Favorite
>>>>>-#”; else if(cl1==-5) out = “b<<<<<< >—–#”; else if(cl1==5) out = “b—–< >>>>>>#”;
} else{ Ffreq = -1; } // -1 one for too low // count++;
oat getFfreq( oat freq){ octave_counter++; if(freq > B){ return getFfreq(freq/2);} else return
freq; }
https://www.instructables.com/id/Guitar-Tuner-With-an-Arduino/ 8/15
27/02/2019
Add Tip V Ask Question
Guitar Tuner With an Arduino by EE421ACDC (/member/EE421ACDC/) Follow |
Guitar Tuner With an Arduino:
Comment
8 Steps (with Pictures)
Download Download Favorite
Step 8: References
The construction of the LCD circuit was setup and designed from an online tutorial from the
following linked web page. This link also includes the circuit schematics for the LCD circuit.
https://www.arduino.cc/en/Tutorial/HelloWorld
(https://www.arduino.cc/en/Tutorial/HelloWorld)
The electric guitar signal amplifying circuit was developed with aid of another Instructable.
The link contains the corresponding circuit diagrams.
https://www.instructables.com/id/Arduino-Guitar-Tuner/
(https://www.instructables.com/id/Arduino-Guitar-Tuner/)
http://www.akellyirl.com/arduino-guitar-tuner/
(http://www.akellyirl.com/arduino-guitar-tuner/)
http://www.akellyirl.com/reliable-frequency-detection-using-dsp-techniques/
(http://www.akellyirl.com/reliable-frequency-detection-using-dsp-techniques/)
https://github.com/akellyirl/Arduino-Guitar-Tuner (https://github.com/akellyirl/Arduino-
Guitar-Tuner)
Share
Did you make this project? Share it with us!
I Made It!
Recommendations
https://www.instructables.com/id/Guitar-Tuner-With-an-Arduino/ 9/15
27/02/2019 Guitar Tuner With an Arduino: 8 Steps (with Pictures)
Guitar Tuner With an Arduino by EE421ACDC (/member/EE421ACDC/) Follow Download Favorite
(/id/Vintage-Look-Media-PC/)
https://www.instructables.com/id/Guitar-Tuner-With-an-Arduino/ 10/15
27/02/2019 Guitar Tuner With an Arduino: 8 Steps (with Pictures)
Guitar Tuner With an Arduino by EE421ACDC (/member/EE421ACDC/) Follow Download Favorite
(/id/Ever-Blooming-Mechanical-Tulip/)
https://www.instructables.com/id/Guitar-Tuner-With-an-Arduino/ 11/15
27/02/2019 Guitar Tuner With an Arduino: 8 Steps (with Pictures)
Guitar Tuner With an Arduino by EE421ACDC (/member/EE421ACDC/) Follow Download Favorite
(/id/Crazy-Circuits-an-Open-Source-Electronics-Learning/)
https://www.instructables.com/id/Guitar-Tuner-With-an-Arduino/ 12/15
27/02/2019 Guitar Tuner With an Arduino: 8 Steps (with Pictures)
Guitar Tuner With an Arduino by EE421ACDC (/member/EE421ACDC/) Follow Download Favorite
(/class/Arduino-Class/)
(/contest/organize19/)
https://www.instructables.com/id/Guitar-Tuner-With-an-Arduino/ 13/15
27/02/2019 Guitar Tuner With an Arduino: 8 Steps (with Pictures)
Guitar Tuner With an Arduino by EE421ACDC (/member/EE421ACDC/) Follow Download Favorite
(/contest/epilog10/)
(/contest/remix2019/)
Add Tip
V Ask Question
| Post Comment
5 Discussions
ВалерийЛ
(/member/%25D0%2592%25D0%25B0%25D0%25BB%25D0%25B5%25D1%2580%25D0%25B8%25D0%25B9%25D0%259B3/) (/member/
Question
Answer / Upvote
Good afternoon. Why is not the code you wrote written compiled? A lot of mistakes. Do you need any
additional libraries?
1 answer F
https://www.instructables.com/id/Guitar-Tuner-With-an-Arduino/ 14/15
27/02/2019
Guitar Tuner With an Arduino(/member/Swansong/)
Guitar
Swansong
by EE421ACDC (/member/EE421ACDC/)
Tuner With an Arduino:
(/member/Swansong/)
Follow
1 year 8 Steps (with Pictures) Reply
ago
Download / Upvote
Favorite
Post Comment
(http://www.twitter.com/ins
https://www.instructables.com/id/Guitar-Tuner-With-an-Arduino/ 15/15