Instructables

Arduino Guitar Tuner

Featured
Picture of Arduino Guitar Tuner


Build your own electric guitar tuner using the Arduino! I decided to make this because I wanted to experiment with audio input and frequency detection. I used Amanda Ghassaei's method for Arduino Frequency Detection in order to get frequency readings using the Arduino. I used LEDs that light up according to the frequency of the audio input, indicating whether the string being played is sharp, flat, or in tune. This works like any other guitar tuner, but you can make it yourself!
 
Remove these adsRemove these ads by Signing Up

Step 1: What you need

Picture of What you need
(x1) Arduino Uno (RadioShack #276-128)
(x1) TL082 Dual JFET Input Op Amp (RadioShack #276-1715)
(x1) 6x4x2" project enclosure (RadioShack #270-1806)
(x6) 5mm Yellow LED (RadioShack #276-021)
(x6) 5mm Red LED (RadioShack #276-041)
(x1) 5mm Green LED (RadioShack #276-022)
(x13) 150 Ohm Resistor (RadioShack #271-1109)
(x2) 9V Battery (RadioShack #23-1134)
(x2) 9V Snap Connector (RadioShack #270-324)
(x1) M-type power plug (RadioShack #274-1569)
(x1) SPST Rocker Switch (RadioShack #275-693)
(x1) 1/4" Mono Audio Jack (RadioShack #274-255)
(x1) Matching Printed Circuit Board (RadioShack #276-170)
(x1) Grid-Style Printed Circuit Board (RadioShack #276-149)
(x3) 100kOhm Resistor (RadioShack #271-1347)
(x1) 22kOhm Resistor (RadioShack #271-1339)
(x1) 10uF Capacitor (RadioShack #272-1025)
(x1) 100nF Capacitor
(x1) 6x4x.125" Acrylic Sheet





Step 2: Drill

Picture of Drill
guitarspade.jpg
guitardrill1.jpg
Drill a starter hole on the side of your enclosure using a 1/8" drill bit. Drill into the starter hole using a 13/16" spade bit to create a larger hole for the SPST rocker switch. The rocker switch will serve as an on/off switch for the tuner.

Drill a hole beneath the on/off switch hole using a 23/64" bit. This hole is for your audio jack.

Step 3: On/Off Switch

Picture of On/Off Switch
guitarswitch4.jpg
guitarswitch5.jpg
guitarswitch6.jpg
guitarswitch7.jpg
Solder the red end of one of your battery snaps to one of the lugs on the switch and solder a red wire to the other lug of the switch.

Feed the snap and wire through the 13/16" hole in your enclosure and fasten it in place with its mounting nut.

Hey there, I finished all the soldering and even started the LED's but am having trouble getting the frequency to read out. I'm getting the same issue as a previous comment about the "inf hz" being displayed hundreds of times in the serial monitor. I've quadruple checked all my connections, placemets, and soldering and everything goes with the schematic and your photos it seems. Any idea? Is this a short circuit or is my soldering wrong? (See images below - I know it's poor, I'm a beginner). Please help! This project rocks but I'm bummed if it doesn't ever come together.

20140411_182932.jpg20140411_182904.jpg20140411_183001.jpg
nikoala3 (author)  rickybobbymills5 days ago

Oh no! Hmm, It's honestly pretty hard to tell from the photos. Obviously It's kind of late in the game now, but did you try bread-boarding the circuit first? If you did, did you have the same problem? Is your guitar turned all the way up? Are you sure your batteries are good? Sorry if these are stupid questions.. Just gotta cover all the basics first.

I did but didn't get a readout, I'm new with breadboards and electronics in general so I figured I probably hooked it up wrong. I felt more comfortable following your schematic and pictures, but ended up with the 3 rd lights on the right. Would it help if I took closer pictures? I also used a 104 M ceramic capacitor, you seemed to use a 473M capacitor, does this matter?

I built this project but the LEDs seem working wrong. They don't refrhes themselves. They stay the same when I kill the sound. I built for an acoustic guitar

nikoala3 (author)  feuchtigkeit5 days ago

The way I coded it, the LEDs only respond to new audio input, so they will stay lit up until you strum the guitar again. You can definitely change the code so that they turn off when there is no new input.

I know the circuit I built is correct but i just get inf hz and clipping if I strum the guitar... so now what...

nikoala3 (author)  evan.stoddard29 days ago

Hmm darn. I recall having a similar problem when I made mine. I'm sure we can figure it out. Are you confident that the signal coming from the guitar is about 5V peak to peak? I think I had that problem when the amplitude of the signal coming in wasn't quite right or if there was no signal at all. Have you played with the volume on your guitar?

Not entirely sure... I don't have a scope and my Mac doesn't have a line in so not quite sure what to do in that case... I think my problem is VCC+ voltage because I'm trying to not use 9v since I use them up like mad so I'm hacking up power supplies and not getting 18v... Either too high or too low and at one point I was getting some frequencies but really had to dig in because of the low voltage supply. I'll try using 9v batteries to test and build and worry about external supplies after it works lol. I'll let you know when the magic smoke comes out :P

We tried this tonight. There's something wrong with the power section. The Ardunio wouldn't power up, until we powered externally and disconnected from the battery power.

Powering externally is a bit more difficult because you need both positive and negative voltage. She splits the power in the middle to get a ground reference and 9v for the arduino. If you want to power external then I would loop up schematics for a positive and negative supply but for testing I would go with two 9 volts just until you get it working.

nikoala3 (author)  evan.stoddard28 days ago

Yeah I feel ya about the 9v batteries, but I think that could be the problem. Let me know how it goes!

arimika11 days ago

i can't read schematic of amplifier and DC offset,
can you make a picture little bit closer than picture in step 9 ?

Thankz b4

aaa.jpg
geckomafia19 days ago

Just curious, why the 2 9V batteries? is it possible to do this with only 1 9V?

You don't happen to have a gerber file to make a pcd for this circuit do you ;)

I just made a quick Schematic, board, and generated gerber files in EagleCAD. You're welcome to the files if i attached my zip file correctly

nikoala3 (author)  evan.stoddard28 days ago

Haha sorry no xD

technovative7 months ago
Neat project, excellently presented Ible. While it would most certainly be more cost effective to buy a chromatic tuner, you'd miss out on the satisfaction of doing it yourself and learning.

If someone came to this project with the intention of building a tuner pedal then this would actually be more cost effective. A good tuning pedal costs $100 and you can't reprogram it ;). If people came to this project with the intention of just building a chromatic tuner then this wouldn't be cost effective just as you stated. But for a guitar pedal tuner, this is probably the most cost effective option (as long as expertise and willingness to give up time is there) due to its cost and ability to be customized.

Can you please include a schematic with this project? I would also like to know all the pin numbers instead of just some of them.

nikoala3 (author)  evan.stoddard1 month ago

Hey! I have included a schematic for the amplify/offset part in step 6. The rest of the soldering/connections should be in steps 9 and 13. Are you referring to pin numbers on the TL082 or the Arduino? Is there a specific part you are confused about?

I'm sorry, should've been a bit more specific. I was referring to the TL082 and actually right after I asked the question I took a better look at the schematic and figured it out. I was just being a bit lazy ;)

nikoala3 (author)  evan.stoddard29 days ago

No worries! Glad you figured it out.

akellyirl5 months ago
Thanks. Nice Project.
If you'd like another idea to get around the problem of reliability of the frequency identification see my post:
http://www.instructables.com/id/Reliable-Frequency-Detection-Using-DSP-Techniques/

Thanks for pointing this out. I haven't taken a good look at the source for your method and the source for this project very much but how easily will it be to integrate your method with her source? I have a decent knowledge in C and can figure it out I was just wondering approx. how much work would need to be put in

samtechpro1 month ago

Its a kids DIY project. There is no circuit diagram to build the circuit. That's a prepared kit. Nothing is created. You're just telling to assemble the parts purchased from market. It may be an advertisement of your guitar tuner company.

KOTSOS52 months ago

Hello, very nice project! an "electronic" question why c1 in the schematic is polarized backwards?

ir_One3 months ago

hi,
you have any sample video? i use other amplifier, its work. but if this tuner to use guitar accoustic. can't run normally, why? maybe you have another source code

ir_One3 months ago

i following this code program, but can,t work, please help me

nikoala3 (author)  ir_One3 months ago

Hi! Hopefully I can help out. What part of the code are you having issues with? Or what specifically is going wrong?

ir_One nikoala33 months ago

yeahh..
this is work.. thank your tutorial,

oea, i have anyquestion,
PORTB &= B11101111;//set pin 12 low << what function..?

ir_One nikoala33 months ago

sketch_jan12a.ino: In function 'void stringCheck()':

sketch_jan12a.ino:189: warning: suggest parentheses around comparison in operand of &

or send me your code file *.ino

zfmiii5 months ago
This project looks excellent. As a noob on this type of stuff though, I'm thinking of replacing the EADGBE setup with a 5x3 LED note readout, and then adding a 1/4" output jack. Any comments in terms of parts and programming?
agadelha5 months ago
hi i will use part of your project for build another one. i wanna make te arduino recoguinaze the notes from a guitar and play some flash game. so i will need serial port e i dont need two batteries can i use the same amplifer?
Mangustiano7 months ago
Yes, if it worked, it would be awesome...
I spent last two days to build this project but at least it doesn't work.
When I switch it on, and after the test led, only three red leds on the right remains turned on.
And nothing else seems to work.

I tried others arduino and also to remove the arduino and letting it work alone with only one led linked to the Analogic Pin 1...
And that led still remains on after the light test.

nikoala3 (author)  Mangustiano7 months ago
Hmm... Maybe we can figure out what's wrong. Did you run the first frequency detection code to make sure the Arduino is receiving the signal from the guitar and correctly calculating the frequency?
I tried to run the first detection code and I've got only the word "clipping" on the serial monitor.
Many times at the speed of light and some time the word "inf hz" appers between hundreds of "clipping".

I tried also to turn on the switch while the usb connector is linked but nothing's changed.

Same result with the guitar 's jack linked to the tuner or not.
And also playing or not playing the guitar.
nikoala3 (author)  Mangustiano7 months ago
It looks like for some reason the audio input is not reaching the Arduino. Are you sure that your audio jack is connected properly and the volume on your guitar is turned all the way up?
Do you have any access to an oscilloscope? That would be an easy way to see if you are getting a signal from the jack and/or from the amplifier and DC offset.
I tried two guitars with the volume turned up and two cables but without differences.
I also tried to change every single component with new ones.
I still have those three leds on the right turned on.

I don't have an oscilloscope so I can think that this project ends here for me.
jamescarlson7 months ago
That's way cool, great job!!
wow. I had planned to do the same using amanda's code but had to put the project on hold due to harmonics and other priorities I had at the time. Great to see someone did make it. :-)
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!