Arduino guitar pedal help

Thread Starter

Rezex124

Joined Jan 31, 2021
11
Hi!

I've been working on a school project, that is a guitar pedal (effects) using an arduino board. I've been using the EasyEDA site for designing the schematic. I would like to ask a more skilled/experienced person to go over my design and look for any flaws or mistakes. Any tips about it would be greatly appreciated.

I would also like to ask, if I can use the SAME ground pin on the arduino for all different parts of the circuit? Or will it result in frying it (the pin itself)/ be some other problems with the circuit?


(note that instead of using the actual Arduino Mega2560 footprint, I created pin headers, because I'm not using most of the digital pins. This decreases useless space and later on gives me more space to work with - on the PCB itself)Guitar pedal effects-arduino.jpg
 

wayneh

Joined Sep 9, 2010
17,496
I would also like to ask, if I can use the SAME ground pin on the arduino for all different parts of the circuit? Or will it result in frying it (the pin itself)/ be some other problems with the circuit?
A common ground is generally fine as long as all power sources are isolated (like battery-powered). You need to be very concerned when connecting the "grounds" of two line-powered power supplies. They may not both be referenced to earth ground, or to the same voltage, and current could then flow from one to the other through their "ground" wires. Not good.
 
Last edited:

Thread Starter

Rezex124

Joined Jan 31, 2021
11
I think you mean the ''2V5'' net label? This actually links up to the box marked ''power supply'' where the second ''2V5'' net label is. It's suppose to be a virtual ground, but I'm not sure as this is my first time actually using them...

I was thinking, if I leave everything as is, and then when designing the PCB I surround the whole board with a copper area (net-ground), it should do the trick?
 

Thread Starter

Rezex124

Joined Jan 31, 2021
11
Your capacitors C2, C4, C5, C6 and C7 will cut all high audio frequencies making the output sound muffled like an old AM radio.
Yes I agree, the cut off frequency is at 5kHz. I don't know if I can make it any higher than that.

As far as my theoretical knowledge goes, the C2 and C5 are used as an anti-aliasing filters, which are used at the input of analog to digital converters. C4 is suppose to eliminate oscillations or any noise in the line.

The C7 is opposite of that - a reconstruction filter (at the output of AD converter), that will prevent imaging.
I know it seems there are a lot of these low pass RC filters, but I didn't want to risk clipping, so that's why I put so many.


If I'm mistaken, please don't hold back to correct me lol
 

Audioguru again

Joined Oct 21, 2019
6,672
Yes I agree, the cut off frequency is at 5kHz.
But since each RC has a 5kHz cutoff then the system produces -15dB (1/32) of the power at 5kHz and cuts frequencies higher than about 750Hz.

Clipping occurs when a voltage level is higher than the opamps can produce, not the frequency.

I guess you are using an Arduino to do digital effects but its PWM frequency is too low for ordinary audio.
 

Thread Starter

Rezex124

Joined Jan 31, 2021
11
Yes I'm using an Arduino, and I know its not meant to be used for audio. I just thought of giving it a go...testing and what not.

I don't really understand how you got to the cut off frequency of 750Hz... will do some research on my own.
What would you suggest I do instead? Do I remove the filters or change the values or something like that?
 

Audioguru again

Joined Oct 21, 2019
6,672
At the cutoff frequency of one RC, the level level is cut -3db and produces 1/2 of the output power.
If a second RC is added then the output power at the cutoff frequency is reduced to 1/4 of the power.
You have 5 RCs so the cutoff frequency is reduced to 1/32 of the power. But a cutoff is a curve that affects frequencies as low as 0.15 of the cutoff frequency.

If you remove or increase the cutoff frequency of the filters then you know that the low PWM frequency will beat with ordinary audio frequencies and cause "image" sounds. Maybe you could use the image sounds as an effect.
 

Thread Starter

Rezex124

Joined Jan 31, 2021
11
Oh I get what you're saying now. But even if the output will be 1/32 of the inputs power, the circuit is then connected to a normal (store bought) guitar amp, so it will amplify the signal. That should work right?
 

Audioguru again

Joined Oct 21, 2019
6,672
An audio amplifier has a flat frequency response so that all audio frequencies have the same output power.
With your RC filters cutting the high frequencies then the low frequencies into and out of the amplifier will be at a loud level you set but 5kHz will be 1/32 of the low frequency power and lower frequencies will be much less. Very muffled sounds.
 

Thread Starter

Rezex124

Joined Jan 31, 2021
11
I don't know man. It doesn't make much sense to me that having multiple filters with same cut off frequency results in a new lower frequency. Like in my case the cut off is 5kHz, so when signal goes through first filter only signals in range of 5kHz get through. And the second filter is also 5kHz so it just lets it all through, no?
My guess would be that it just 'improves' how fast it cuts the higher ones. Sharper roll off so to speak.
 

Sensacell

Joined Jun 19, 2012
3,432
I don't know man. It doesn't make much sense to me that having multiple filters with same cut off frequency results in a new lower frequency. Like in my case the cut off is 5kHz, so when signal goes through first filter only signals in range of 5kHz get through. And the second filter is also 5kHz so it just lets it all through, no?
My guess would be that it just 'improves' how fast it cuts the higher ones. Sharper roll off so to speak.
Nope, RC filters do not produce a "brick wall" cutoff, they produce a very soft sloping response, cascading them compounds the attenuation.
 

Audioguru again

Joined Oct 21, 2019
6,672
Your filters are passive and produce a droopy and sagging response. One RC= -3dB at cutoff frequency, two RCs= -6dB, three RCs= -9dB, four RCs= -12dB etc. Lower frequencies are also reduced a little.
An active filter (with an opamp or two) produces a very sharp cutoff response. One RC= -3dB at cutoff frequency, two RCs= -3dB, three RCs = -3dB, four RCs= -3dB etc. lower frequencies are not reduced.

Your filters are lowpass, each RC reduces 5kHz by -3dB (half the power) and very low frequencies are passed without the filter affecting their levels. A lowpass filter rolls off the high frequencies. An active filter does not add the -3dB for each RC.
 

Thread Starter

Rezex124

Joined Jan 31, 2021
11
Oh, so if I understand correctly, if I have higher order filters - with active filters, the cut-off frequency stays the same (almost), but roll off gets steeper.
With passive ones, the roll-off gets steeper too, but because of this, it also ''takes the edge off'' from the curve, resulting in having smaller fc, as shown in picture.
1612384069070.png
So how do I find the fc for my order of filter, because I can't seem to find an equation for it.
 

Thread Starter

Rezex124

Joined Jan 31, 2021
11
All the ADC (as far as I'm aware) is done in the arduino. The default set up is 110us per conversion, so using f=1/t, the frequency is 9090Hz.
 

Audioguru again

Joined Oct 21, 2019
6,672
An AM radio cuts the 10kHz adjacent station's interference and sounds muffled like an "AM radio".
Your guitar pedal will sound the same.
Most audio ADCs switch at 44kHz and higher to sound good.
 
Top