Arduino Guitar pedal

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
aberrant
 
Posts: 4
Joined: Sun Apr 07, 2013 7:46 pm

Arduino Guitar pedal

Post by aberrant »

Hi,

I'd like to build a trinket/arduino based guitar pedal. To do that I know I need to do make the -1v to +1v output from the guitar into 0-5v (or 0 to 3.3) to be read by a micro controller. When I look on the web I see resistor ladders, and some op-amp solutions but all that seems to be a little more then what I can handle. Is there an easier way to do this? I see the "Electret Microphone Amplifier - MAX4466 with Adjustable Gain" (http://www.adafruit.com/products/1063) and this looks like what I want, but I want a 1/4 inch jack on the end instead of the microphone. Can I just desolder the mic and wire in my own jack? Is there an even easier way to do this?

Thanks,

Collin

User avatar
gerattricjoe
 
Posts: 8
Joined: Fri Aug 22, 2014 11:10 pm

Re: Arduino Guitar pedal

Post by gerattricjoe »

G'day Colin, from one newcomer to the Forum to another. I know little about guitar pedals or guitars (and not much about Arduinos yet either). Having said that I have spent a lifetime in electronics and audio but need clarification to help you with this.

You say the output you which to convert is -1v to +1v. I suspect you are speaking about an audio voltage (signal) from a guitar and not a DC voltage as comes from a battery - correct? You want the micro to read the guitar's audio signal for processing?

If this is the case we would say it is a 1v audio signal or 1v PP (peak to peak) signal**. Saying +/- 1v leads to confusion. Please, I am not being critical of your explaination here just explaining for the future the normal way of expressing these things.

If this is what you want please respond and I will try to explain how to go about solving your problem. Oh, by the way, please also tell me basically what you want to do with the signal when you get it into the micro. I don't think using the "Electret Microphone Amplifier" as you envisage is your answer. Cheers, joe

** 1v PP could also be expressed as 0.7v RMS (root mean square) but for a guitar probably the former is a better way of saying it!

User avatar
aberrant
 
Posts: 4
Joined: Sun Apr 07, 2013 7:46 pm

Re: Arduino Guitar pedal

Post by aberrant »

Here are some examples of what I want to do conceptually.

http://www.instructables.com/id/Lo-fi-A ... tar-Pedal/

http://www.instructables.com/id/Arduino-Guitar-Pedal/

http://interface.khm.de/index.php/lab/e ... rocessing/

http://www.amandaghassaei.com/projects/arduinodsp

There just seems to be a lot of components just to get a signal into the Arduino.
I really just want to get to the point where I can start writing code that goes like this:

Code: Select all

// read input from guitar
audioValue = analogRead(INPUT_PIN);
// math to mess with audio value
analogWrite(audioValue);
My plan is to use a trinket because it can do direct audio out:
https://learn.adafruit.com/trinket-audi ... d-playback

Here is some info on guitar pickups if you are interested.
http://en.wikipedia.org/wiki/Pickup_(music_technology)

Collin

User avatar
gerattricjoe
 
Posts: 8
Joined: Fri Aug 22, 2014 11:10 pm

Re: Arduino Guitar pedal

Post by gerattricjoe »

Ok where do I start, I'm sorry its is going to be long. Thank you for the references, most helpful.

Your problem and others in your references is that you are dealing with a AC (alternating current) signal out of your guitar pickup. Unfortunately the Arduino only accepts DC (direct current) input. You therefore need some kind of conversion.

The easiest way to do this is to superimpose the guitar output (an AC signal) on to half of the reference voltage of the Arduino’s ADC (analogue to digital converter). So if you set the Reference in the Arduino to 5v (a default value**) and have a signal from the guitar that goes between +1v to -1v the input signal seen by the Arduino will vary between 2.5v + 1v = 3.5v and 2.5v - 1v = 2.5v. It is no longer an AC voltage but an continuously varying DC voltage and because it is now a DC voltage the Arduino will accept it.

** http://arduino.cc/en/Reference/AnalogReference

(Your third reference is a good example of what I have been writing about. He/She uses two 100k ohm and one 10k ohm resistors in series across the 5v supply voltage. The 10K resistor is a variable resistor enabling the operator to vary the voltage about which AC signal input swings between about 2.4v and 2.6v.)

So how is it done? It’s very simple just use three resistors (R1, R2 and R3 with the latter two being about 10k ohm each) and a capacitor (C1) as shown by kylemcdonald in his circuit in your first reference. The resistor values he has chosen however will give him 0.53v (not 2.5 volts as I have calculated above) about which his alternating voltages will swing. This will limit the peak to peak voltage signal as he can only apply to the input about +0.5v to -0.5v. If this is exceeded then terrible distortion will occur. But then I guess that is the whole idea of the device!

One of the things that concerns me about kylemcdonald’s circuit is the loading it place on the guitar pickup circuit. Randofo in your second reference overcomes this problem by using an opamp (operational amplifier) to buffer the relatively low impedance of the 3 resistor and 1 capacitor circuit. What do I mean by loading? I suspect (and I may be wrong) that a guitar pickup expects to ‘see’ a circuit with a relatively high input impedance (resistance). If this is not so the output signal from the pickup will be reduced and its tonal response altered - maybe even markedly.

So Collin, where does this leave you. There is no easy way out, you must get the hardware sorted before you can sit in front of your computer and hash out the code. You will have to do this this with resistors etc. and an opamp as randofo has done. Depending on the complexity you want you probably do not need to use the whole setup of resistors that kylemcdonald has done because, for starters he has a stereo system. But you are just going to have to get your hands dirty with a soldering iron.

I sincerely hope you can follow the above and that I have not been too technical. I think you have a bit of research ahead of you. Study what I have written and get back with any problems you have. Perhaps also others can help with relation to the Arduino itself. Cheers, joe

Just had another thought. If your pickup output is +/-1v you would be better using perhaps the 2.56v reference that can be set in the Arduino. That way you will be able to use more of the 'bits' for processing.

User avatar
aberrant
 
Posts: 4
Joined: Sun Apr 07, 2013 7:46 pm

Re: Arduino Guitar pedal

Post by aberrant »

Thanks Joe for the analysis. I think adafruit should sell a board to do this for me LOL.

Collin

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”