Audio input with Arduino Uno

Hi,

I am relatively new to Arduino and I am trying to build a guitar tuner. The first part of my project involves getting an audio input. I have a 3.5mm jack to send a signal through and I wish to amplify it using an Op Amp configured into a non-inverting amplifier circuit. I also need to create a DC offset so the incoming signal can oscillate around 2.5v with an amplitude of 2.5v so it can be detected by the entire 0-5v band of Arduino, as it cannot detect negative voltages. I understand a lot of the physics and basic electronic principles behind this but I need a bit of help understanding how I would configure the circuit and how I can test it out to understand what is being sent through, as there are gaps in my knowledge. Is anybody able to help? I may need it explained to me simply. Thanks.

Have you measured the voltage out of your guitar?

Guitar pickups can sometimes put-out about 1V, so before you go too far, connect your guitar to A1 and run the [u]Analog Read Serial Example[/u] to see how much signal you're getting. You might not need an amplifier, and if you do that will give you an idea of how much gain you need.

for this experiment, the negative half-cycle won't hurt the Arduino because a passive guitar pick-up doesn't put-out enough current to damage it. It won't read the negative half, so half your readings should be zero and if the signal goes over ~0.5V the Arduino's protection diodes will clip/distort the negative half, but it will give you an idea of how much signal you're getting.

If you are getting enough signal, [u]this page[/u] shows an input-bias circuit. The two equal-value resistors form a 1:2 [u]voltage divider[/u] and the 10uF capacitor "isolates" the 2.5V DC bias from the audio source. Since the guitar is high impedance, increase the resistor values to around 1M. (You can ignore the other components.)

If you need an amplifier, [u]here[/u] is a schematic for a microphone board with a biased-output for the Arduino. That should get you started. It's an inverting amplifier but that doesn't matter for audio.*

That circuit is also too-low impedance for a guitar, so you can either increase the resistor values proportionally or add a [u]buffer amplifier[/u] in front of the main amplifier. (A standard, non-biased, buffer amplifier will need a bi-polar power supply so the output can swing negative.)

  • It can be a problem if you invert one side of a stereo signal, or something like that... But for example, if you switch the + & - connections on your guitar speaker, or on both of your stereo speakers, you won't hear a difference.