Bluetooth and Arduino Electromagnetic interference question

Hello Forum Friends,

I have built a circuit that selects the pickups and controls volume and tone of an electric guitar. I call this the ArduGuitar and you can read about it at : http://www.arduguitar.org/

The circuit uses resistive opto-isolators, called Vactrols, to control the guitar pickups. These are LED-LDR pairs where the Arduino controls the LED intensity via PWM and that changes the resistance on the LDR, which in turns allows the signal from the pickup(s) to flow or not to the jack and onwards to the amplifier.

I control the circuit with a GUI that can run on the PC or on an Android phone.

When the guitar circuit is connected to the GUI via USB everything works PERFECTLY. That is already great because it proves the "concept".

But, when I connect to the arduino via a JY-MCU bluetooth module, I get a whistling noise over the amp that lasts as long as the GUI is transmitting and then another 10 seconds longer. After 10 seconds, it switches off and the sound is clean again.

All I can imagine is that the bluetooth communication is somehow picked up by the guitar pickups, acting as antenna. But I have no evidence of this. Even when guitar volume is set to zero, the noise still comes through the amplifier, so I wonder if that is the real explanation. I am thinking not, but then how does the noise get to the amp?

Can anyone suggest an explanation and/or a way to fix this?

I am communicating over the Serial interface at 9600 baud. Technical details:

  • power supply 9V battery - negative terminal to arduino ground and to guitar ground
  • arduino Micro board
  • JY-MCU bluetooth powered from the Arduion 5V pin, and ground, connected to Tx and RX pins for serial comm
  • guitar hot wires never go through the Arduino, are optically isolated via the Vactrols.

Even crazy ideas are welcome at this point - I'm really at a loss as to how to move forward.

Thanks for all help - this forum is one of the greatest in the open-source world! Ciao, Bob

Best way to fix this is to put small capacitors across the LDRs and the input to your amplifier. The input junctions are acting as rectifiers and feeding these signals into your audio. This is not unusual especially with low cost amplifiers. Or at least poorly designed ones.

Grumpy_Mike: Best way to fix this is to put small capacitors across the LDRs and the input to your amplifier. The input junctions are acting as rectifiers and feeding these signals into your audio. This is not unusual especially with low cost amplifiers. Or at least poorly designed ones.

Hi Grumpy_Mike!

Thanks for taking the time to reply. I really really appreciate it!

Please excuse my ignorance if I ask you for some more details. I am a programmer and electronics is not my specialty, (but I'm studying hard to learn!) :

  • Are you are suggesting that I put a capacitor in parallel with each LDR? or just one capacitor in parallel with the audio out? So one end of the cap on the hot wire from the guitar (which goes to the external amp), and the other end of the cap to ground? Or maybe you mean something completely different? Please excuse my ignorance (believe me it hurst me more than anyone..) ;-)
  • What value of capacitor would you suggest? and what type Ceramic or Electrolytic?
  • What do you mean exactly by "unusual for low cost amplifiers"? Do you mean that my circuit is an "amplifier"? or do you mean that this is a fault of my guitar amp?

Thanks so much for any more time you can spare for my little problem. Ciao, Bob

Well I tired a 0.1µF capicitor between the guitar output and ground and that made no impact o the Bluetooth generated noise...

Any thoughts?

Thanks, Bob

So one end of the cap on the hot wire from the guitar (which goes to the external amp), and the other end of the cap to ground?

Yes.

do you mean that this is a fault of my guitar amp?

Yes your amplifier is picking up radio, it is not designed to do this, therefore it is the fault of the amplifier.

Well I tired a 0.1µF capicitor between the guitar output and ground and that made no impact o the Bluetooth generated noise.

Pity. It needs to be a ceramic with the leads as short as possible. You need to track it down. Do you still get it with the lead disconnected? Try the lead connected but the guitar not. Is it a screened lead? There are many techniques for suppressing radio pickup, this is something many radio hams know about. You might want to look at Radio Ham's sites. One way is to wind a few turns of the lead through a ferrite toroid. Then if it is a screened lead you are using you could try a circuit called a bread breaker.

Pity. It needs to be a ceramic with the leads as short as possible.

That is what I used.

Do you still get it with the lead disconnected?

By "the lead", do you mean the cable from the amp to the guitar jack? If that is unplugged, there is no noise from the amp. That lead is a high-end fully shielded pro-guitar cable.

Try the lead connected but the guitar not.

The circuit is in the guitar, with the arduino micro and the BT module. If I unplug the BT module, all noise stops and the guitar continues to play, but when the BT is connected, during transmission and for 10 seconds after the end of transmission, the noise is there. Even with the guitar pickups turned off.

One way is to wind a few turns of the lead through a ferrite toroid. Then if it is a screened lead you are using you could try a circuit called a bread breaker.

Do you mean the 4 tx,rx,vcc,gnd bundle from the BT module to the circuit board? That is not shielded.

I am sorry to bother you with all these questions, and I understand if it's too hard to cure via forum...

Personally, I am at a loss and really don't know where to look or how to proceed ...

Thanks again, Bob

Do you mean the 4 tx,rx,vcc,gnd bundle from the BT module to the circuit board?

No. I mean disconnect the lead from the Arduino end, so you have a lead into the amplifier not connected to anything at the other end.

I understand if it's too hard to cure via forum

It might be in the end but there are some things we can try first.

The idea of these tests is to find out where the interference is getting into the system. Then there is a chance it can be stopped. One way is pickup on the lead itself. Being screened does not make it immune from interference, like I say you might need a Braid Breaker at the amplifier end. http://en.wikipedia.org/wiki/Braid-breaker It talks about TV but the problem is the same.

Grumpy_Mike:

No. I mean disconnect the lead from the Arduino end, so you have a lead into the amplifier not connected to anything at the other end.

Ok, with the amp cable disconnected, no noise comes out of the amp, even at full volume, which is huge. This is even if I keep the cable around the guitar, or touching the BT module.

However, at full volume, I did detect that the switching of the Arduino pins is picked up by the cable. This noise is really minor, though.

When I connect the cable to the arduino circuit, the BT transmission + 10 seconds noise is still there, strong as ever.

I wonder about the common ground being a good thing or a bad thing? The guitar ground, the arduino ground, the BT ground and the 9V battery negative terminal are all connected together. In the past, I had separated the guitar ground from the Arduino ground, but that seemed to cause really strong hum…

Thanks for not being “Grumpy” at all, Mike :wink:
Ciao,
Bob

OK so the next thing to try is to just connect the ground of your amp lead, no signals. Do you still get the noise then.

Note you need the ground connection eventually but this is to see if it is being induced on the ground alone or the signals.

Grumpy_Mike: OK so the next thing to try is to just connect the ground of your amp lead, no signals. Do you still get the noise then.

No, there isn't noise with only the ground connected to the amp cable.

I tried an experiment and put a long piece of unshielded wire on the amp cable's signal connector and then put that wire next to the arduino and BT module. The result was considerably more Arduino clicking on the pins, but no BT transmission noise.

I don't know what that means, but it seems like we are making progress ?

Thanks again, Mike! Ciao, Bob

Try this: when you make a call with your cellphone, or you get called on your cellphone, do you also hear some strange noise on the amplifier? Probably you will. Try connecting a 1nF and 10nF ceramic capacitor parallel to the input of your amplifier.

muddy:
Try this: when you make a call with your cellphone, or you get called on your cellphone, do you also hear some strange noise on the amplifier? Probably you will. Try connecting a 1nF and 10nF ceramic capacitor parallel to the input of your amplifier.

Read reply #3 we tried that already.

Grumpy_Mike:

muddy: Try this: when you make a call with your cellphone, or you get called on your cellphone, do you also hear some strange noise on the amplifier? Probably you will. Try connecting a 1nF and 10nF ceramic capacitor parallel to the input of your amplifier.

Read reply #3 we tried that already.

But with a 0.1µF capacitor not 1nF or 10nF... Would that make a difference?

But with a 0.1µF capacitor not 1nF or 10nF... Would that make a difference?

No. If it were a ceramic cap then the lower value would interfere slightly less with your audio signal but would be better at suppressing RF than the smaller values. As you reported absolutely no difference then it is highly unlikely that using 10nF would make a difference.

alas, I guess we've reached a dead end...

What do yo think is happening?

The audio part of the circuit itself acting as an antenna picking up the noise from the BT module?

alas, I guess we've reached a dead end... Not quite yet.

No, there isn't noise with only the ground connected to the amp cable.

Sorry missed that. So try the capacitors at the arduino end. The other thing to try is some RF suppressors at the arduino end. This could be an inductor wound on a ferrite core and placed in series with the signal.

The other thing is to look at your schematic and layout. Can you supply a schematic and photograph?

So try the capacitors at the arduino end.

That’s what I did already, with no effect.

The other thing to try is some RF suppressors at the arduino end. This could be an inductor wound on a ferrite core and placed in series with the signal.

Could you send a link to an example of one of these? I see lots of different kinds on ebay … and this one at tayda: http://www.taydaelectronics.com/82uh-inductor.html

The other thing is to look at your schematic and layout. Can you supply a schematic and photograph?

I’ve attached a pdf with the layout and a fritzing export of a partial breadboard layout. Also, the webpage http://www.arduguitar.org/ describes what I made, and has a link to the project log which is big and contains lots of stuff about the “new design” for a future prototype, since I was very optimistic with the early results of this version, thinking the noise would be easy to eliminate… but it still may somehow help you to understand, if you have the courage to read it…

I’m happy to take a picture of the circuit, but it is very small and tight and it will be hard to see anything in detail. I used a prototyping board and it is bolted into the guitar.

I’m sorry to not have a better schematic…

Thanks again for all this help!
Bob

Prototypelayout-06.pdf (203 KB)

Thanks for that.

Quote So try the capacitors at the arduino end. That's what I did already, with no effect.

I did say:-

Best way to fix this is to put small capacitors across the LDRs and the input to your amplifier.

That means at the amplifier end and at the LDR end, two places for the capacitor not one.

I've attached a pdf with the layout and a fritzing export of a partial breadboard layout

The problem is that it is almost impossible to read a fritzing layout for anything but a trivial circuit.

I'm happy to take a picture of the circuit, but it is very small and tight and it will be hard to see anything in detail

That would be good it is just the general layout that might give a clue not the actual wiring.

Interestingly enough the component you call Vactrols is essentially what I experimented with in the DIY sense in the mid 60s with flashlight bulbs and LDRs for isolating mains switching SCRs to get a music to lights system. The problem I found was that the transfer function was not very linear.

Looking at the circuit it looks like you could disconnect the ground between the arduino side of things and the audio side of things, that might be worth trying.

You can try clip on ferrites like this:- http://www.solar-electric.com/nosufefi.html These are the sorts of tings you could use. http://uk.rs-online.com/web/c/passive-components/ferrite-cores/ferrite-beads/

Unfortunately this is some what of an art than a science so it is not possible to definitively give a cure. However the fact that we haven't found anything that reduces it means we haven't found the transfer mechanism yet.

Hi!

I’ve attached 2 photos of the circuit to help you understand!

Let me give you an idea of how the circuit works, first, then I will tell you about the results of some experiments I did today.

First, as I mentioned, there is a single common ground for both the Arduino and the Guitar parts of the circuit. The signal or hot wires from the guitar are optically separated from any voltage coming from the battery via the Arduino.

The guitar has 3 pickups, each with a hot wire and a ground.

Each hot wire connects to the LDR of it’s “selector” LDR. To turn a pickup “on”, I set the LED to “HIGH” thus bringing the LDR’s resistance down from huge to around 80 ohms. This “HIGH” setting is a digital out from the Arduino.

The hot wires coming out of the selector LDR’s are connected in parallel to the input node of a voltage divider which is composed of 2 LDR-LEDs. These LED’s are controlled by PWM pins of the Arduino, at the highest frequency of PWM possible for the Arduino Micro (this was needed to keep the oscillating LED’s frequency from causing the LDRs to oscillate in harmony).

The voltage-divider LDR’s together provide the resistance range of a 500KOhm pot.

The output of the voltage divider goes to the amp lead, but it is also connected to another LDR-LED (500KOhm) which is connected to a 22nF ceramic capacitor to ground. This acts as the “tone” control of the guitar, just like the tone pot, it filters out the hgher frequencies if the resistance is low. This is again PWM controlled.

Finally, I used a little trick to boost the volume of the guitar at maximum vol setting. A LDR is connected in parallel to the voltage divider input, and its output goes to the amp lead. This is a digitally controlled on/off LED.

So to summarize, there are 3 vactrols controlled by PWM in the entire circuit. All the others are controlled by DC voltage.

Now that the stage is set, here are the results of my experiments:

  • first I disconnected all the guitar pickups and the guitar ground from the circuit
  • then I set all the arduino pins to zero
  • under these conditions, there was very little bleutooth noise, it was still audible at the amp, but the volume had to be turned way way up to hear it slightly.
  • Now here’s the first interesting point: no matter which digital pins I activated, there was absolutely no change in the bluetooth noise coming from the amp
  • Here’s the next interesting result: as I increased the PWM of ANY of the PWM pins, the noise became gradually stronger. PWM values superior to 15 (on [0…255]) caused maximum noise. There was no significant difference for values greater than 15.
  • Next, I tried to increase the PWM of the various parts of the simulated pots:
  • Increasing the PWM on the tone pot, i.e. reducing the resistance to ground, turns on the noise strong
  • Increasing the PWM on the second LDR in the voltage divider, i.e. the resistance to ground, turns on the noise strong
  • Increasing the PWM in the first stage LDR of the voltage divider, i.e. the resistance between input and output nodes, causes the noise to come on but much less strong than in either of the other cases!
  • Next, I reprogrammed the Arduino to eliminate the PWM. using only HIGH/LOW and no PWM.
  • Now it was clear: turning on any connection to ground turned on the noise
  • Turning on the 1st stage of the voltage divider, did not cause the noise
  • Once either the tone LDR or the 2nd stage of the voltage divider was on, allowing a low resistance path to ground, then switching on/off the 1st stage of the voltage divider had no effect

There are perhaps several ways of interpreting these results. But it is clear that letting the signal into contact with the common ground lets the noise in. The question is if any ground will cause the noise, or if it has to be the common ground with the Arduino & bluetooth transceiver?

A second question is what would be the noise consequences of separating the 2 gounds? What will happen without the common 0V reference ?

I’m planning on doing a next experiment by separating the ground reference for the 2 sides of the circuit, but previously I had tried this and there was terrible hum… So I am not sure about it. This will require quite some work, so please be patient.

I feel that with your help, I have been able to make some real progress!!! Thanks again, so much!

I will get a ferrite brick tomorrow at a shop to try that.

I would be happy to hear your thoughts.
Ciao,
Bob

The circuit is a bit complex for me to picture it, but from what I can gather there is no need to connect the ground of the audio to the ground of the arduino because it is all opto isolated.

Very neat construction by the way.