0

I'm using GPIO12 & GPIO13 for PWM audio output to a set of powered speakers on a Raspberry Pi 3. However the speakers have a continuous high pitched beep to them which seems to be tied to the mouse being plugged into the USB port. As soon as I unplug the mouse, the beep disappears though there is still noise hiss/crackle emanating from the speakers. The speakers and Pi are powered from the same power supply.

I have attached a video that shows the problem - https://streamable.com/qa66q.

I can also seem to modulate the beep by lifting the mouse off the table

Any idea as to why this is happening?

2 Answers 2

3

Welcome to the world of RF. You're experiencing what's called "crosstalk". Basically what this means is that the EMI (electromagnetic interference) generated from one wire can influence other wires and cause similarly shaped signals on them even though they are not connected. This normally happens when the two wires are close together and travelling in parallel.

If you want to get rid of the crosstalk you should do as many of the following as possible:

  • Move the mouse and cabling as far as possible from your PWM circuit.
  • Arrange your cable and circuit so that wires in your PWM circuit have as little as possible wires in parallel with your mouse cable.
  • Shorten the wires in your PWM circuit so that the mouse cable can't influence it as much.
  • Wrap the mouse cable in aluminium foil and connect this to ground. This will effectively turn the cable almost into a coaxial cable, which will minimize EMI escaping to your circuit.
  • Wrap, or place your circuit inside a metal case, and connect this to ground. This will create a Faraday cage, removing all EMI getting to your circuit.
  • Use twisted pair cables or earth shielded (such as coaxial cables) to hook up to your circuit. These types of cables minimize the effect of EMI on the internal cables.

If however, you want to increase its effect you will want to do the opposite of items above :-)

  • Wrap your mouse cable around long sections of your circuit. This will make the wires as close as possible to each other, and in parallel.
  • Increase your circuit wires so that the mouse cable can influence it more greatly.

This is by no means the full list of options you have. If you need more I'd recommend researching more about EMI and crosstalk.

2
  • Thanks! I'm going to try and see if that helps. I also will be adding 3 servos into the circuit. Would similar tips help in reducing the EMI that they are likely to cause as well?
    – shekit
    Commented Jun 12, 2018 at 15:25
  • Yes, the tips I gave for EMI reduction will work for everything.
    – drong0
    Commented Jun 13, 2018 at 3:46
0

Untwisted wire pairs can act as antennae that pick up electromagnetic radiation from things like pulses in your mouse wire. You would get a more detailed analysis on SE Electronics

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.