This is the only real "trick" when it comes to the hardware for this system. Audio happens as an AC signal from -1 V to +1 V, but the analog inputs on the Arduino run from 0 V (Ground) to some positive voltage called the analog reference
(5 V by default). You can specify this positive voltage in code or with an external reference.
Since -1 V to +1 V is a 2 V range, we'll choose something smaller than 2 V for our analog reference value. It turns out 1.1 V is specified as a built in internal reference, which works out nicely.
From here we have to normalize the -1 V to +1 V as 0 V to 1.1 V. I did this using a resistor in series followed by a voltage divider circuit. A guitar cannot directly drive this circuit, it needs a preamp (like another pedal) to drive it. I'm sure you could add a transistor or op-amp preamp to the perf board so you could plug into the pedal directly.
For the output, we're going to be using PWM. With some low level hacks in software, you can get an 8-bit PWM running at 62kHz = 16 MHz / 28
There are some other methods for audio output on the Arduino. A good overview can be found at uC hobby
. I got some great results from an R2R DAC, but considering it needs around 40 resistors for 10-bit stereo output, I decided against it. Instead I went with the weighted pins
technique, which is kind of like a cross between standard PWM and a resistor ladder.
Building the Circuit
I built two of each circuit on one perf board. I had a ground strip down the center that helped for arranging things as neatly as possible. The first time I built the circuit, it was too tall and didn't fit in the enclosure, so I had to build it again.
When you have capacitors in series like this, they will cut off some of your low frequencies. WIth a 2.2 uF capacitor, it's low enough so it doesn't really affect sounds in our hearing range. The larger the value, the better; but capacitors tend to get physically larger as their value increases.