Step 5: Connect Remaining Components

Once your input and output circuits are made on your perf board, place it inside and start attaching all the wires that have yet to be attached.

  • The audio input goes into the input circuit, then into the Arduino's analog inputs
  • The pot taps go to the Arduino's analog inputs
  • Two LEDs go to PWM outputs, one goes to a digital output
  • Four PWM outputs go into the 8/2-bit weighted DAC circuit
  • The output of the weighted DAC circuit goes to the audio output
<p>How would I create this with 1/4 audio jacks?</p>
<p>I played guitar and I think a great invention</p>
<p>I'm having trouble getting sound from this build. I wanted to test the voltage on the input circuit to make sure I was getting values that looked righht, so I wrote a little dummy test to output my value of A0 in the serial console after going through the input circuit (I couldn't find my voltmeter!)</p><p>Oddly enough, when no audio signal is coming in, I keep getting values between 405 and 409. Even stranger, when I connect the input to ground, I still get the same values. When I have a strong audio signal coming in, I get values between 405 and 620. </p><p>The only thing I can think of is that I had to use a lower value cap (.1uF instead of 2.2uF) because it's all I had, but I thought that would just affect filtering. Otherwise I'm not sure what's going on. I've double checked the build of the circuit and resistor values. Any help would be appreciated!</p>
<p>Nevermind, I realized I was a fool and forgot how voltage dividers worked! When I replaced the cap with the proper value 2.2uF I got a ground value of 495, which I realized is close to 512, which is where it's supposed to be since it's a DC offset audio signal, so it's going to oscillate around the middle of the voltage range. When I turned my volume all the way up, I got values between 13 and 1020, just as I should!</p><p>Still no sound out of the other end though, but I haven't tested everything yet.</p>
The folder I downloaded is named &quot;Arduino_Guitar_Pedal&quot; including five files. There is not any GlitchPedal file. May you send me the link to the Glitchpedal code? I am doing something wrong.. <br>
<p>Did you ever get the proper code? I'd also like to see it!</p>
@CyrilHaumont, could not get reply working, so here are the answer: <br> <br>To make it work on newer IDE (&gt;= 1.0) you need to replace all &quot;Wprogram.h&quot; and &quot;Wconstants.h&quot; with &quot;Arduino.h&quot;
Hi, <br>I'm doing a new version of your guitar pedal. But i have just one problem, I can't find any Wprogram.h or Wconstants.h... <br>And i read all comments (randolfo's too), it seems nobody has this kind of problem ? <br>can it be from my version of arduino ide ?
Hi there, <br>I am about to start building this specific project but I would like to know how I am going to upload the code to my Arduino and make it run. Where can I find the GlitchPedal code and do I have to load more code (libraries) to run it? I am noobie as you understood.. Thanks a lot!!
there are no other libraries to run, just the GlitchPedal code. but i recommend you follow this new tutorial by randy http://www.instructables.com/id/Arduino-Guitar-Pedal/
could someone tell me why the compiler tells me that analogWrite is not defined within scope?
I'm a total arduino/electronics noob, but I think that some of the function libraries got migrated to a new location in some core revision to the arduino libraries. <br><br>Basically, in dsp.cpp, replace <br><br> #include &quot;WProgram.h&quot;<br><br>with <br><br> #include <br><br>And then make the same swap in timers.cpp with <br><br> #include &quot;WConstants.h&quot; <br><br><br>The code at least compiled for me. Of course I am still having problems with the actual build. All I'm getting is a very faint square wave buzz that modulates with knobc. <br><br>Why did I think this was going to be simple? <br>
hey man! this looks truly awesome. any chance of a video or mp3? also, how would keyboards/synthesizers/drum machines work through this? sweet project!<br> -stefan1138
check out the video on vimeo <div class="media_embed"> <iframe frameborder="0" height="282" src="http://player.vimeo.com/video/1460684?title=0&byline=0&portrait=0" width="500"></iframe></div>
I got the asynchronous analog read you discussed working, though not using interrupts but a standard loop. Vastly increases my sample rate. Ported the chorus/flanger to it. <br>code: http://pastebin.com/thP70QFj
Wrote a chorus! <br>Pot 1 is chorus speed. Define LINEARITY for experimental sine wave LFO using pot 2 to blend between linear or sine (it has problems) and pin 13 which has a LED on most devices will display the rate visually. <br>http://pastebin.com/nCNyXSsR <br>Works really nicely on low values, with a subtle flange on high values. Can also do many silly noises with the chorus set really fast. <br>Sample: http://soundcloud.com/nexekho/arduino-lo-fi-chorus
Site note: buffers take up quite a bit of memory, might need to go mono for a Mega 168.
Sounds MUCH BETTER in mono due to higher sample rate. <br>http://pastebin.com/2ed16VD0 <br>http://soundcloud.com/nexekho/much-much-smoother
Added a depth control that changes how far it sweeps. Very useful for getting good flange effects. <br>Code: http://pastebin.com/cRmNHCdk <br>Sample: http://soundcloud.com/nexekho/flange-this
Is there a way to add an on/off switch to the circuit (like the one on the picture), making a stomp box out of this?
You can make a bypass with a SPDT which will select either the Arduino output or the guitar input, but it will likely &quot;suck tone&quot; and as such you will need a DPDT to isolate the Arduino input as well.
Yes it would be possible, in tonepad.com you can see a wiring diagram for these switches. It would have to be a DPDT or 3PDT.
Hope this helps: <br>http://www.muzique.com/lab/truebypass.htm
I don't usually make guitar pedals so I'm not familiar with the way that switch is wired. If it actually toggles between two sources, you just need to wire the &quot;clean&quot; input directly to one side of the switch, and the distorted output to the other.<br><br>On the other hand, if it is a momentary switch you'll need to wire it to an interrupt pin on the Arduino and modify the code to watch for that interrupt, not applying any effects when the toggle is on.<br><br>I'm sure there are also plenty of schematics out there for making toggle boxes with these switches, in which case you would just wire your clean signal to one input and the distorted signal to the other.
Hey, I just built one of these on perfboard, made a mistake on the inputs (biasing with A7 rather than 5V, will correct in the morning) and while almost everything works (the dials work, etc.) I can't get a sound wave out. If I just take a standard flashing light example script and tell it to whack a PWM to pin 3, it outputs a very loud square wave. Using your code, nothing is output. This is my first Arduino project. I'm using a Nano but it's a Mega328P Nano which should work right?
I've fixed it now. It was an issue with the timer registers. Thanks for the design.<br> <br> I've attached some photos of my custom build. &nbsp;Small size was a priority here so I built the output filters under the Arduino itself which was a fun challenge.
wow! awesome, and congratulations on your first arduino project. glad everything worked out. your design is super compact, it looks great :)
Made some code changes and got it as good as it'll ever be in terms of sound cleanliness. Using 10-bit in, 16-bit out, and a prescale of 8. <br>Sample: http://soundcloud.com/nexekho/almost-perfect <br>(note: I'm using a POD as a preamp and distortion, the Arduino is just clean passthrough at the moment and then a Valvecaster post-amp before going into my PC's line in) <br>Code: http://pastebin.com/9zphwpvA <br>I'm finding that using a tone dial to roll off the highs makes a far cleaner sound. <br>
(also note: I'm not being silly, I'm trying to output a 100Hz triangle wave using your code instead of passthroughing the input ;])
Also, the schematic describes a high-pass-filter for the output. Is that right? It feels like it should be low pass.
I'm new the the arduino scene, is Diecimila the same as Duemilanove ?
How crucial is the ratio between resistors R and 256R, the guy in the shop couldn't tell the difference between orange and brown so I have R = 1.5k and 256R = 190k...<br><br>Could I use my 190k and two 330R in series (R=660, 256R should equal (ish) 170R (but would be 190R)? Or is that not a close enough match?<br><br>I've checked all of my wiring and joints, guitar was on, amp was on, audio leads functional, used a chorus pedal to boost the input (you used a tuner).<br><br>Thanks in advance :-)
using the two 190k resistors in series against the 1.5k gives a ratio of 253 which is totally acceptable. the resistor manufacturing tolerance will probably be the bigger error. good luck!
This looks great! I was wondering if this can be used with a synth or laptop audio. And if not, if it can be modified to do so..
anything you can plug into a guitar pedal should work fine. and definitely laptop output, i primarily used my laptop for testing this while i developed it.
I see you used ceramic and electrolytic caps. Which one works better?&nbsp;<br /> Also, what would be the polarity if you used the electrolytics in your schematic?<br />
I&nbsp;didn't evaluate ceramic vs electrolytic for their &quot;sound&quot; really, so I&nbsp;can't say which one is &quot;better&quot;. You'll have to try both out and let me know if you hear a difference!<br /> <br /> I&nbsp;vaguely remember, on the outputs, the electrolytic caps facing the output. But again, you should try it both ways -- this was two years ago now and I&nbsp;have been writing a lot more code that making circuits since then :)<br />
&nbsp;Any chance you could post a picture with the other side of the perfboard circuit for the DAC? I'd like to have a go at this project but am having a little trouble with this stage.<br /> <br /> Someone should make an audio input/output sheild for the Duemilanove with all the DAC on board for projects like this!<br />
Sorry, I don't have this pedal any more, I&nbsp;made it for a friend!<br /> <br /> If I remember correctly, the perf board wasn't connected on the back and everything was manually soldered. So hopefully the diagrams/schematics on this page will explain anything missing from the pictures. The pictures were meant more as a layout guide for fitting the components in a smaller space.<br />
I was wondering what kind of preamp is necessary. I don't own a tuner that acts as a preamp (more like a filter). Is it possible to build a preamp that's not too difficult?<br />
A preamp can be as simple as an opamp. But there are a ton of DIY&nbsp;guitar preamp designs, <a href="http://www.diyguitarist.com/GuitarStuff.htm" rel="nofollow">here's one of the first links that popped up on Google.</a><br />
Hi there, <br /> <br /> love your work, I have one question about this though, the r1 on the in-part, what is it good for, why do you need it?<br />
Hi Larsby,<br /> <br /> The r1 acts to &quot;scale&quot;&nbsp;the incoming signal. I&nbsp;generally think in terms of software rather than hardware, so you can imagine the chain on the input acting like this:<br /> <br /> - r1 divides the signal (scales it down slightly)<br /> - c1 centers the signal around zero (removes the DC&nbsp;component)<br /> - r2 and r3 add a constant DC&nbsp;component back in -- shifting the signal up<br />
Hi guys, great work!<br /> <br /> I'm trying to get the basic code working, but I can't seem to get all the PWM pins going! inputs are working fine, as far as I can tell, but only pin 3 is PWM'ing. 5/6/11 do nothing! I'm just using the basic aduino dsp code right out of the box.<br /> <br /> When I edit setupIO() in DSP.cpp to say:<br /> <br /> &nbsp; waveformGenerationMode(11, fastPWM);<br /> &nbsp; timerPrescale(11, 1);<br /> &nbsp; analogWrite(11, 0);<br /> <br /> 11 seems to work fine. (though it's just noise, because i'm not using accurate resistors...)<br /> <br /> I can't get 5/6 to work at all. <br /> <br /> Any ideas? <br /> <br />
I had the same problem, I&nbsp;got around it by removing the &quot;analogWrite&quot;s from:<br /> <br /> void setupIO() {<br /> &nbsp; // prepare left<br /> &nbsp; waveformGenerationMode(3, phaseCorrect);<br /> &nbsp; timerPrescale(3, 1);<br /> //&nbsp; analogWrite(3, 0);<br /> &nbsp; <br /> &nbsp; // prepare right<br /> &nbsp; waveformGenerationMode(5, phaseCorrect);<br /> &nbsp; timerPrescale(5, 1);<br /> //&nbsp; analogWrite(5, 0);<br /> //&nbsp; analogWrite(6, 0);<br /> &nbsp; <br /> &nbsp; // faster input<br /> &nbsp; analogReference(INTERNAL);<br /> &nbsp; analogPrescale(analogPrescale32);<br /> }<br /> <br /> And also fiddling around with the timer registers:<br /> <br /> void waveformGenerationMode(int pin, int type) {<br /> &nbsp; int timer = getTimer(pin);<br /> &nbsp; int wgm = type == phaseCorrect ? B001 : B011;<br /> &nbsp; if(timer == 0) {<br /> &nbsp;&nbsp;&nbsp; TCCR0B &amp;= ~(B1 &lt;&lt; 3); // clear WGM02<br /> &nbsp;&nbsp;&nbsp; TCCR0A &amp;= ~B11; // clear WGM01 and WGM00<br /> &nbsp;&nbsp;&nbsp; TCCR0A |= wgm | B11110000; // set WGM01 and WGM00, Compare on Match<br /> &nbsp; } else if(timer == 2) {<br /> &nbsp;&nbsp;&nbsp; TCCR2B &amp;= ~(B1 &lt;&lt; 3); // clear WGM23<br /> &nbsp;&nbsp;&nbsp; TCCR2A &amp;= ~B11; // clear WGM21 and WGM20<br /> &nbsp;&nbsp;&nbsp; TCCR2A |= wgm | B11110000; // set WGM21 and WGM20, Compare on Match<br /> &nbsp; } <br /> &nbsp; <br />
Thanks man!<br /> <br /> I'll try that and let you know how it goes.<br />
I&nbsp;recommend trying an earlier version of the Arduino IDE (maybe revision 15). I&nbsp;haven't tested this with the most recent versions, and this has some pretty low level stuff that might have been affected by changes.<br />
Thanks man, I tried versions 13 - 15, but no go. <br /> <br /> Anyone else had this problem? I'm just using a standard Arduino Duemianove with an ATmega328P-PU. <br /> I've tried both mac/windows. I'm just using the example code. (the Arduino DSP one, not the Glitch Pedal. Though, that has the same problems...)&nbsp;<br /> <br /> Thanks a million for all the help!<br /> &nbsp;- Loren

About This Instructable


279 favorites


More by kylemcdonald: Structured Light 3D Scanning Nandhopper 1-Bit Noise Synth Lo-fi Arduino Guitar Pedal
Add instructable to: