Author Options:

Getting the Arduino to Convert analog signal from guitar into correct frequency Answered

Hello Everyone,

I was wondering if anyone can help me with a simple solution to my problem,

I was to be able to get the sounds from my guitar into my ardunio and have the correct frequency be stored.

I can get the guitar connected to the arduino and numbers come out of the serial monitor but they don't make sense,

i need to have the correct frequency come up for each note i play, I have looked at a few solutions but being a beginner to this some go over my head or they just didn't work.

Can anyone help me or point me in the right direction to be able to do this?





8 months ago

I think you need better resolution for A to Do convertion.

After doin this calibrate input value for not between higher & lower note that you can play with your guitar.

Play some define note in low speed & check the results. Hope you can do it well

Oh yes...After that, how about getting your hardware to identify a chord? Maybe G major, G minor, and G7#5...That would be very cool.

I play the guitar :) I wonder if you have to compensate for overtones, sympathetic vibration with other strings, and such. Have you tried making a recording of pure tones using, let's say, Audacity, then playing that into your board to see if they display correctly? I would sure that you match the output impedance of your guitar to the input impedance of your board.

If the frquency is stored then you should be able as a first step to show it on a display.
Can be any simple LCD for the Arduino.
Have the frequency read and the display updated every 50-100ms.
Using a display is really helpful as you eliminate the problem with coding the right stuff for a serial connection - get the basics right first before you add more ;)
Once you can show the frequency of the tone you play the same values can be used to update the display AND the data for the serial connection.
You basically send the frequency as a number value or encoded as a string and the serial monitor will produce a very long list that scrolls through.
From there and with a bit of BASIC of VB scripting you create a little program that uses this serial data to update the info for your computer to show it as a changing value on the screen instead of scrolling down.

Thanks for posting, I think my problem is it is not reading the frequency right. I am getting something on the serial monitor but maybe not enough power is going to the arduino. do i need to increase the power with an opt amp? is there an easy way to do this and a good code to calculate the frequency. Does you know anything about FFT or FHT ? is this something i should be looking into?

I suggest you check what you know first and go from there.
You say you have no problem getting the right frequency - how do you know that without confirming it?
No display means no info and a garbled serial result does not mean the data is correct.
You get in the serial monitor what is transfered, check by adding some lines to your code to send "Hello world" along with it.
If you don't see hello world in the serial monitor as intended it means you have a problem.
This can be the way you provide or send the data but I doubt a power problem.
To me it sounds you don't really understand what you are doing and how to check your code and data input/output.
As said, start by showing your data on a LCD and go from there.