Servo Run From Same Power Source As Speakers?

I'm designing a project that plays sounds and moves a servo at the same time. I'm using an adafruit FX sound-mini to trigger the sounds. Instead of creating my own speakers with an amplifier board, I just bought a cheap USB-powered speaker. It has a 5V USB-cable and an audio jack which I plugged into the sound board.

Everything works great if I'm not powering the servo and the speakers from the same power source. However, when I try to run the speakers and the servo motor off the same 5V power source, I get some pretty terrible static out of the speakers every time the servos start running. I've diagrammed out my set-up below.

Any ideas? Someone mentioned isolating my servo motor with a diode but didn't explain how.

Thank you so much in advance.

heropants:
However, when I try to run the speakers and the servo motor off the same 5V power source, I get some pretty terrible static out of the speakers every time the servos start running.

If you will forgive the pun it sounds like you have answered your own question.

Give the servo its own power supply.

...R

That can be a problem... Motors tend to put noise on the power supply and audio amplifiers tend to be sensitive to power supply noise. And, amplifiers that don't use bipolar (positive and negative) power supplies tend to be more noise-sensitive. Digital is SO much easier than (analog) audio!!! :stuck_out_tongue:

The best/easiest thing would be separate power supplies. If you were building your own power supply you could use separate regulators and maybe some separate filtering.

Or, here's something you can try -

Add a diode in series with the speaker power (not the motor). A Schottky diode would be best because of the lower voltage drop*, but if you have any diode rated for 1A or more, go-ahead and try it. (If it works you can replace it with a Schottky later.)

Then add a "big" capacitor (1000uF or more) between the speaker-power and ground.

The capacitor will "hold" the voltage and the diode prevents the capacitor from discharging into the motor. That will do a pretty-good job of filtering negative-spikes/noise on the 5V line. But, positive spikes will get through the diode and the capacitor filtering won't be as effective, so it depends on the nature of the noise.

  • You'll get about a 0.7V drop across a regular silicon diode and when you lower the power supply voltage you lower the amount of audio power you can get. And, 5V is pretty low for a power amplifier to begin with.

There's a few things you can do to reduce the interference.

First, you've drawn the power lines as branching off to each device. Give them each their own wire all the way back to the power supply. This is called "star" wiring because it all radiates out from a central point.

You can add capacitors across the pins of each device. Big capacitors absorb low frequencies and small capacitors absorb high frequencies. Sometimes you will need one of each size. Buy a capacitor assortment that has values between 100uF and 0.1uF. Experiment with putting those different values on either the motor, speaker or both.

You can add inductors too. Simple clamp-on ferrites like you see on USB power cables can do the trick. You can get all sorts of different inductors. The neatest ones are integrated into the socket but I'm guessing that desoldering the speaker PCB and putting a new socket on is going to be more expensive and time-consuming than getting a new 5V supply.

Robin2:
If you will forgive the pun it sounds like you have answered your own question.

Give the servo its own power supply.

...R

Thanks! With past projects, this is what I've done (although I usually give the speakers their own power supply since the servo and Arduino can run off the same one without a problem. I was hoping, however, that there was a way to do it without monopolizing 2 plugs.

DVDdoug:
That can be a problem... Motors tend to put noise on the power supply and audio amplifiers tend to be sensitive to power supply noise. And, amplifiers that don't use bipolar (positive and negative) power supplies tend to be more noise-sensitive. Digital is SO much easier than (analog) audio!!! :stuck_out_tongue:

The best/easiest thing would be separate power supplies. If you were building your own power supply you could use separate regulators and maybe some separate filtering.

Or, here's something you can try -

Add a diode in series with the speaker power (not the motor). A Schottky diode would be best because of the lower voltage drop*, but if you have any diode rated for 1A or more, go-ahead and try it. (If it works you can replace it with a Schottky later.)

Then add a "big" capacitor (1000uF or more) between the speaker-power and ground.

The capacitor will "hold" the voltage and the diode prevents the capacitor from discharging into the motor. That will do a pretty-good job of filtering negative-spikes/noise on the 5V line. But, positive spikes will get through the diode and the capacitor filtering won't be as effective, so it depends on the nature of the noise.

  • You'll get about a 0.7V drop across a regular silicon diode and when you lower the power supply voltage you lower the amount of audio power you can get. And, 5V is pretty low for a power amplifier to begin with.

Thanks for the feedback! I'll give this a try. I didn't think about the voltage drop across the diode. I've got some 1A diodes and 1000 uF capacitors I'll try it with.

Sounds like the "easiest" option is to keep running the speakers and everything else off of separate power sources, but I'd only like to use one plug so I'll give this a try.

Thanks!