Help needed with animatronic jaw project

Hi all,

I have a project I'm working on where I want to play pre-recorded mp3s and make jaw movements along with them. I'll say up front I don't know much about electronics. What I have:

  • Arduino Uno (I also have a Mega if it's really needed)
  • AC/DC adapter for the Uno
  • adafruit mp3 shield
  • hobby servo
  • Some cheap computer speakers which plug into the mains, with a 3.5mm jack into the shield

The issue I'm having is that when it's all connected up, the servo is jittery and the arduino keeps resetting. I should note, the jittering doesn't happen when the servo is run on the arduino by itself, and everything works fine when it's just the mp3 shield. So it seems it's the combo.

From what I've read online, that's probably to be expected because of the power required for the servo when it's in action.

adafruit and some other places recommended using a 470uF capacitor for servo instability. Tried that, didn't work and then I read some more posts saying of course that wouldn't work, I would need a Schottky diode to make it work. All a bit over my head.

So I assume the easy thing to do is power the servo separately, which is fine - I already have 2 AC converters, one for the arduino and one for the speakers so what's a third, I'll put them all on a mains power board and hide it in the base of the project. I don't want to use batteries for this project, just to plug it in.

So: if a separate power supply is the right answer, how would I power the servo separately? Seems like a simple question but I just haven't come up with anything.

qvm2: So: if a separate power supply is the right answer, how would I power the servo separately? Seems like a simple question but I just haven't come up with anything.

By rights you should always power std servos from a separate power supply.

You want a 5V supply, ideally with 1A current capability. Then you connect the power supply +5V to the servo red wire, power supply 0V to the servo brown, (or black), wire and connect the power supply 0V to the Arduino 0V, then connect the servo signal wire to the pin on the Arduino that you plan to use to drive it.

Thanks steve, that's about what I was expecting it's good to hear. Can you give me an example of what a power supply like that would look like?

When I look around, I see adapters like this, but they terminate in a typical circular end, i.e. not separated power/ground (I assume by 0V you mean the Gnd pin).

qvm2: Thanks steve, that's about what I was expecting it's good to hear. Can you give me an example of what a power supply like that would look like?

When I look around, I see adapters like this, but they terminate in a typical circular end, i.e. not separated power/ground (I assume by 0V you mean the Gnd pin).

If you're powering from the mains, that plugpack looks fine. If the plug on it's lead is 2.1mm or 2.6mm, you could buy a socket to go with it, but otherwise just chop the plug off and solder on a connector that suits your purpose. If you're using veroboard or similar, you can even solder the bared wire ends directly to that. Alternatively, if the plug isn't a standard size, you could buy a 2.1mm power plug and matching socket, solder the plug in place of the current one and fit the socket to your project.

You shouldn't really need 3 separate power supplies though. If you had one, with a capacitor or two between 5V and ground near the Arduino and the MP3 shield to remove any spikes created by the servo, you'd be fine. You could connect the 5V directly to the Arduino's 5V socket, rather than to the Vin. It's just a matter of making sure that the supply can provide enough current, and that it's filtered by caps to remove spikes.

A little electronics knowledge can go a long way. A bit of reading would help you heaps ;)

I assume by 0V you mean the Gnd pin

Yep.

You're the man Steve, thank you. I'm obviously floundering, a lot of the info out there just seems aimed at batteries and I didn't want to buy even more stuff without being sure. I appreciate you took the time to help me out with the simple stuff.

One power supply would be great, I'll give it a go as I'm sure there's some tutorials on the subject out there.

qvm2: You're the man Steve, thank you. I'm obviously floundering, a lot of the info out there just seems aimed at batteries and I didn't want to buy even more stuff without being sure. I appreciate you took the time to help me out with the simple stuff. One power supply would be great, I'll give it a go as I'm sure there's some tutorials on the subject out there.

No worries. I have to do other things right now, then hit the sack, but I'll keep a reminder and draw you up a diagram in the morning if you like.

Wow that'd be above and beyond, if you get too busy it's ok but I'll be sure to check back and in any case, spread the good word about Arduino projects. It's been a lot of fun for me just getting this far.

Here's a diagram of the connections for your circuit. (Barely worthy of a schematic. Pretty simple.) It's possibly overkill with the 3 caps, but it should stop any servo spikes on your supply from affecting the Arduino. Small 5V or adjustable 5A switching DC-DC converter modules are pretty cheap. I get them from eBay for about $5 each. A 12V 2A plugpack would be ideal to plug into the mains and power the circuit, but a 1A or 1.5A should just do the job. You'd still need to power the speakers separately. I have no idea what voltage/current they need.

And if you do still have problems, increase the value of the cap across the servo power connections to about 470uF.