Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Arduino Guitar Effects Pedal Project

Status
Not open for further replies.
The cause of the Noise would be the 5V supply.
I guess, when put in a filter to the supply of the analouge stage, or put in there an seperat power supply and buffer the PWM Signal with a schmitt trigger the noise should dissapear.
So You have not a must to configure the low pass filter to lower frequencies.
 
Can you elaborate on wideband noise?



I don't think so. The code in this case is very predictable. There is no "effect" in play here. The code is just reading the input and outputting the same value. The code is running from a 31KHz interrupt which is triggered from the ADC complete interrupt. The interrupt first reads the ADC and then configures the PWM outputs. Because of this order it is unlikely the ADC is picking up the spike created by the PWM since it is read before the PWM is triggered.

I am beginning to doubt that any type of typical RC or RLC filter can block this noise (voltage spike). The reason being the speed at which the spike happens (and trying many different filter combinations). Given that I have a 4KHz low-pass filter on the output, how could a 86Mhz signal make it through? I think the answer is that a filter can only attenuate (not eliminate) a signal and given the magnitude of the signal spike I'm dealing with, a typical filter isn't going to work. Well, a 90% reduction would indicate that the filter is working but I'm not sure the additional 10% is achievable.

Hello,

Wideband noise is noise that is spread across a wide spectrum. That means that if you use a low pass filter with cutoff of 10kHz then you still have noise frequencies of 1Hz to 9.999kHz, and if you use a low pass filter with cutoff of 5kHz, then you still have nose 1Hz to 4.999kHz, and if you use a low pass filter of 1kHz then you still have 1Hz to 999Hz frequencies getting though (somewhat).
If you use a high pass filter of 1kHz then you still have noise 1.001kHz to the max frequency, and etc., etc.
So you never get rid of it entirely. It's like the noise you get out of a hall effect sensor.
The only way to get rid of this kind of noise is to use DSP techniques. They use this in some advanced sound systems.

You dont seem to be willing to try anything that might help though based on some guesses about where the noise might actually be coming from. Because your output is a digital signal you might be able to isolate it using the single transistor idea where the input the transistor stage does not react to the noise itself but only to the main digital signal, and so the output can be isolated more easily. It may work and it's easy to try yet you dont seem to be willing to try this. That is very puzzling. With some noise problems all you can do is try and if it doesnt work, try something else.

Code variability does not mean that the code changes grossly, it is normal code running that causes current flows to change from instruction to instruction which generates some random noise. The only code that probably does not generate some random noise is code that repeats the same instruction over and over again, like a train of nop's, but even that can depending on what the peripherals are doing at the time too.
 
You dont seem to be willing to try anything that might help though based on some guesses about where the noise might actually be coming from.
I'm not sure from where you got this idea. I have tried and implemented several things to reduce the noise (that's why it sounds as good as it does now ;))

I've added additional smoothing capacitors to the 5V and 2.5V, an RC filter on the audio output, an RL filter on 5V, and an aluminum shield between the main board and daughter board.
There may be additional noise coming from something other than the 5V spikes but it is insignificant in comparison to the magnitude of this particular noise source.

The perf board the shield is made from is literally full and has no more room for additional circuitry. If this was on a breadboard trying different designs might be an option but as it is now everything is soldered in place. I put too much faith in the original schematic I used as a basis.
 
Did you ever try this:-
Try a ceramic directly on the MCU power pins & see if that reduces the spike.

A decent size ceramic cap directly on the MCU power and ground should reduce or eliminate any high frequency noise on the power pins.
Use a 0.1uF or even several, if the chip has multiple power connections.
 
Here is what the board currently looks like:

top_side.jpg


Notice the snazzy 3 LED display with selector switch. I can switch between 8 different effects with the button and the LED's display which effect is in use.
 
A decent size ceramic cap directly on the MCU power and ground should reduce or eliminate any high frequency noise on the power pins.
Use a 0.1uF or even several, if the chip has multiple power connections.

Yes, I've added additional capacitors to the power of the circuit but in this case it does not help. I believe the reason for this is something called Capacitive Reactance. I've measured the frequency of the voltage spikes to be 86.2 MHz and at this high frequency the additional capacitors have little to no effect.
 
I found a really informative video on filtering high frequency noise: https://training.ti.com/capacitor-selection-high-frequency-ripple

The video shows how you can filter high frequency noise by selecting a capacitor with a self resonant frequency that matches the frequency of the noise ripple.
Any given capacitor actually behaves like a Resistor-Inductor-Capacitor series circuit and has a resonant frequency as a result. Unfortunately I don't have the equipment needed to measure the resonant frequency of a capacitor at this high of a frequency. My oscilloscope might be just fast enough at 100MHz but I don't have a frequency generator that will get anywhere close to 86MHz.
It does not seem possible to calculate the resonant frequency of a given capacitor without measuring it because the characteristics very greatly between devices.

I wonder if a cheap ESR meter like this one https://www.taydaelectronics.com/esr-meter-transistor-tester-lcd-diode-multimeter-capacitance.html would be accurate enough to be useful for calculating the resonant frequency of a capacitor.
 
Last edited by a moderator:
Not just to the power circuit but soldered directly to the pins on the MCU itself (or its socket).
The frequency should not be a problem with a small ceramic cap, but any lead length between the CPU pins and the capacitor is.
Use a 1n ceramic as well as a 100n ceramic if very high frequency noise remains a problem with the capacitors you have.

See the photo for a part of a prototype industrial controller I'm working on.

The socket is for a DSPIC33, the ground pins are directly linked to ground plane by through wires and each power pin has a ceramic as close as physically possible - the one inside the socket and two parallel to the right side. A typical IC manufacturers requirement for high frequency devices is no more than 3 - 6 mm between device pin and decoupling cap, shorter if possible.

(The two small reddish ones are the oscillator caps and the other group of four are on analog inputs - it is a mixed signal system with some complex analog functions as well as a lot of digital.)

It also has electrolytics for bulk decoupling in several places, two of the smaller ones are next to the ceramics.

For anything involving even vaguely sensitive analog or for high frequency gear I only ever use ground-plane boards. That minimises ground noise and offsets before they start to cause problems in most cases, as well as vastly reducing general noise.

Decoupling.JPG
 
Another method of reducing noise is to add a series low value resistor, directly against the output pin that is causing the noise problems, to decouple it from the load capacitance it otherwise sees from the rest of the circuit.

That reduces current spikes as well as ringing and noise in the signal itself.

edit - To clarify the above, you do not show the CPU board and that's the source of the noise problem, so where the most critical power pin decoupling and output decoupling should be.
 
Last edited:
Just as an experiment, try disconnecting the resistor from PWm7 pin on the arduino and let me know how it sounds.
 
Just as an experiment, try disconnecting the resistor from PWm7 pin on the arduino and let me know how it sounds.
I've tested the sound by shutting down both PWM's (via software) and the circuit is very quiet when the PWM's are not toggling. Of course there is no sound being output in this case but it does show that there is no noticeable noise being generated by the rest of the circuit.
 
Not just to the power circuit but soldered directly to the pins on the MCU itself (or its socket).
The frequency should not be a problem with a small ceramic cap, but any lead length between the CPU pins and the capacitor is.

Getting them that close would be an issue with this board. (I'm using a MCU board similar to the one shown in the middle of the schematic). The MCU is surface mount with a very tight pin pitch. I might be able to piggy pack a ceremic on top of the MCU power and ground pins. Anything I put on the daughter card is going to be at least 5-6 cm away at a minimum.

For anything involving even vaguely sensitive analog or for high frequency gear I only ever use ground-plane boards. That minimises ground noise and offsets before they start to cause problems in most cases, as well as vastly reducing general noise.

That does seem like a better type of perf board. What is it called? I haven't seen it before.
 
OK, looking at that - I'd try a real arduino board rather than a clone, or at least a better clone.

I've found a through-PCB view of what appears to be that Arduino board, in the official version. It has a large ground plane area under the CPU with a good wide power track through near the top with what looks to be provision for a ceramic cap at the left and an electrolytic just above the right side:
The lower diagonal track is also power, but has no decoupling even on the official board, from what I can see.
brdscreenshot.png

Those capacitors do not appear to exist on your CPU board.

Or, if your board does have any obvious ground and power copper areas below the chip, soldering some ceramics caps (different values, large and small) flat to the board and directly across those may help.

Device data & pinout here: https://www.farnell.com/datasheets/1817551.pdf

Atmel also have their own design notes covering the exact problem you are seeing, among other things.
**broken link removed**

For comparison with those boards, a seriously decoupled and filtered commercial design - no idea what it is, just from google images:
https://upload.wikimedia.org/wikipe...600px-CPU-Beschaltung-mit_MLCC-P1040239-d.jpg


That prototyping board is a ground-plane type, sometimes referred to as having a "colander ground plane" due to the array of clearance holes around the drilled holes.

It's one of these, the top with the normal stripboard pattern on the underside. I use the square pad ones as well for some things (better for RF).
https://docs-emea.rs-online.com/webdocs/138a/0900766b8138a6e6.pdf
You can get similar ground plane board from companies like Octopad.


Edit - just examined that PCB layout a bit closer; it looks like the large copper areas are topside, underneath the CPU. You would have to look for power and ground areas close outside the IC and see if there are any spots you could add caps to. There again, your board may be very different.

Can you post a photo of your board underside? I've found a lot of photos online that appear to be that exact board top view, but none of the back.

I did find a fully filtered version, at only about ten times the cost...
https://static1.squarespace.com/sta...32009cc69/1440849291799/mega8.jpg?format=500w
 
Last edited:
In one oft my last designs I had a Problem with unconnected unused inputs with some open wires on it.
The Controller sometimes resetting, when an output changes.
After activation oft the internal pullups it works fine.

I would suggest You to activate the pullup of all the inputs that have no proper condition.
 
I would suggest You to activate the pullup of all the inputs that have no proper condition.

I actually tried that, I set all unused digital I/O pins to INPUT_PULLUP thinking that maybe the extra current used by all the pullups would make the spike on Vcc diminish. This had no effect on the Vcc spikes. It did have an effect on the sensing of button presses. The one button I'm using is configured as an INPUT_PULLUP and after setting the ~50 or so unused I/O pins the code could hardly detect button presses. I'm not sure if this was a software or hardware issue but I didn't pursue this issue further, I just left the unused pins uninitialized. I suspect that when you define a pin as an input the Arduino software starts polling those pins looking for a state change.
 
OK, looking at that - I'd try a real arduino board rather than a clone, or at least a better clone.

I've found a through-PCB view of what appears to be that Arduino board, in the official version. It has a large ground plane area under the CPU with a good wide power track through near the top with what looks to be provision for a ceramic cap at the left and an electrolytic just above the right side:

Those capacitors do not appear to exist on your CPU board. Or, if your board does have any obvious ground and power copper areas below the chip, soldering some ceramics caps (different values, large and small) flat to the board and directly across those may help.

From this picture I found of an Genuine Arduino Mega board I can see 4 capacitors that are near the MCU. My board has none of these.

Genuine_Arduino_Mega_Closeup.jpg



Also, my board does not have a large pad under the MCU either, on the bottom layer the Analog Input traces are running right under the MCU. I guess the board designers wanted you to be able to read all of the MCU noise on the analog inputs.

I've had good luck with some Arduino clone boards but these particular Mega clones are pretty marginal. They also have a problem resetting without a power cycle which means you have to disconnect them from USB and quickly upload them before the bootloader jumps to the main code. Reset switch doesn't work either. The ICSP port does work well but I had to trim off the pins to keep them from shorting something on my daughter board.

I guess I should have suspected something when the only brand name on these boards is "MADE IN CHINA". You would think even a Chinese company would want their company logo on the boards but not in this case, they likely wanted to not be identified.

Thanks for all the great supplementary information you provided in the last post!
 
Sorry - crossposted; I added an update to my previous one.. probably a bad idea..
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top