# How can I limit current to my servos?

Hey guys,

You may recall that recently I was having an issue with my circuit where my leds would dim when my servos activated, and occasioanlly my atmega would reset because my batteries were unable to supply enough current.

One of the solutions I'd briefly considered was using a resistor to limit the current. But at the time, I didn't explore this option further. Well, I recently revisited it, and determined that at 4.8v, I was gonna need pretty large resistors if I was planning to feed 1A to my two servos, and resistors that can hande that much current seem hard to find on Mouser, and space is really limited with this project. So I wondered is maybe there wasn't some other way to limit the current to the servos.

So I've been doing some research in that area, and it seems like it's possible to limit current using a diode or two, a resitor, and a transistor. But I haven't been able to find a source which explains how to choose the right transistor, resistor, and diodes. Because of this, I'm not even sure if this is a viable solution.

I really think I need to solve this problem by limiting the current to the servos rather than by using two voltage regulators and two batteries, because I need to fit like four chips, 8 dip switches, two trimpots, a bunch of molex connecotrs, and whatever resistors and capacitors I need on a board which is like 2"x4", and an extra voltage regulator and another ser of batteries is just gonna make things even tigther. Plus I'm hoping to integrate a dac and an amp onto the board as well and I don't know if I'm gonna need a seperate power source for those, so I'm hoping I can at least power the rest of the board and servos with the one power source.

Maybe I don't even need a transistor though. It might be that I have done my calculations on how much power my resistor needs to dissipate incorrectly. It seems a bit odd to me that the lower the value in ohms I have for my resistor the bigger the resistor I need. I mean I don't need a huge wire to conduct 1 amp, so why would I need a super large resistor?

Yet when I use the ohms law calculator: http://www.the12volt.com/ohm/page2.asp

...and input 4.8v and 1 amp, I get 4.8ohms for my resistor value. And if I then put in 1 amp and 4.8 ohms I get 4.8 watts. Does that mean I need a resistor that can handle 4.8 watts? Or is that simply the watts flowing through it, and I need to do some other calculation to determine how much of that power it's actually dissipating as heat? And how do I calculate that?

They're a little bigger than I'd like, but maybe I could fit a 1/2" resistor or two in there.

Probably the simplest way of limiting current to servos is to just move them more slowly

I really think I need to solve this problem by...

That is the problem. Your thinking appears to be off target to fix an inadequate power supply issue. Not starting movement of both servos at the sametime may help. In a similar instance I used a large capacitor to help maintain power to a servo controller when two servos were starting at the same time, but probably wouldn't work for you. Also the circuit internal to the servo probably needs a certain minimum voltage supplied to function properly. Maybe you should look at using smaller servos that better match the power supply you have limited yourself to.

You may recall that recently I was having an issue with my circuit

Alas, I don't. And it doesn't show up in your "recent posts" display. So some additional info on what your power supply is would be helpful.

I mean I don't need a huge wire to conduct 1 amp, so why would I need a super large resistor?

The wire is trying to pass the current while losing as little power as possible. The resistor, otoh, is trying to waste some power by turning it into heat. So it needs surface area to radiate that heat and conduct it to passing air molecules.

You may find that adding the resistor doesn't help that much: lowering the voltage may just push the motor closer to stalling, increasing the current drain to the point where you're still getting dropouts.

My power supply at the moment is either a 9v battery, or 6 AAA's.

I am building a replica of this prop:

Or rather, the circuitry that goes inside it. As you can see, the space inside is very limited. The circuit itself will need to be around 2"x4" to fit in there. And the servos I'm using as much smaller than those there, but even so, I'm having trouble powering them and my board, and things are only likely to get worse because I want to try adding a dac, an amp, and a small speaker so I can play back more than simple beeps.

As I am building these props for other people, I can't simply solder together rechargable batteires as they've done here. Rechargables are too expensive and require a charger, and the batteries would eventually need to be replaced even if I found a way to recharge them in place. So, I need to use battery snaps or holders.

I've been considering sticking one 9v in the handle and another under the circuit board, though a 9v won't last very long with the servos drawing as much current as they do. I think my last test indicated the battery would drop by about a volt after activating the servos 100 times. I don't want folks to have to change the battery every day, so if I can fit 6 AAA's in there I will, but I'm still waiting on the shell to determine exactly how much space I have. I think I might be able to fit six AAA's in there if I put them in a 3x2 configuration across the bottom.

The thing is, even 6 AAA's couldn't prevent the leds from dimming for a moment when the servos activated. And if I include a 9v in the handle to power the Atmega and the leds (assuming one will even fit), then I'll have to have two TO-220 style voltage regulators on the board. An LM317 to provide 4.8v to the servos, and a 7805 to provide 5v to the Arduino. And having already laid the chips out on a board that is roughly the size I'll need, I know that I could really use the space that second regulator would take up for something else. The chips are packed in like sardines as it is.

So if there is some simple method I could use which wouldn't take up much space on the board and would let me limit the servo's current, that's definitely something to consider. It may not take up less space than the second voltage regulator, but I'm just hedging my bets in case I can't fit those extra batteries in there.

And besides, I'm just curious if it can be done. Maybe I won't need the solution now, but in a later circuit, who knows?

So if there is some simple method I could use which wouldn't take up much space on the board and would let me limit the servos current, that's definitely something to consider.

It's ohms law you are trying to fight with. Current = voltage / resistance. In your case the servos are the resistance and it's the servos that determines what current will be drawn at any given time, and that is determined by mechanical load, travel duration, etc. The only thing you can do external to the servos to effect the current is to change the voltage supplied to the servos, and as the servos have a specific voltage input requirement, normally 4.5-6vdc, this is not a effective way to solve your root problem, not enough source current capacity.

I think your looking for a magic bullet to solve your basic problem, inadequate battery current capacity. Standard 9vdc batteries will never solve a current draw problem, they are just too wimpy (and expensive). While adding expense, rechargeable cells of higher current capacity is most likely the best solution. Nicads and nihm (as well as li-po) can be had in many different package sizes and can supply higher peak current then most non-rechargeable batteries.

So you are dealing with two battery constrains, higher enough current capacity to run the total static (baseline Arduino draw + support components) and peak (when the servos have to move) current and a desired battery duration time. There is no magic here just fundamental engineering calculations and trade-off decisions.

It's not unlike major project decision making, quality-speed-costs, you only get to choose two of them.

Lefty

Ah, the old startrek phazer/tricorder stage prop from post some time back! Waaaaaaay over done. The only thing it needs electronic is one of the below LED chase lits for the converging LEDs. To make the little arm things on the sides move, just make a simple thumb slide to make them flip around to the front, with a rubberband to pull the slide back when released. Lot simpler ways to get it done.

Do the side-arm things need to be able to move at different rates/times? That is, could you get by with a single servo moving both arms? If so, that might reduce your power requirements, and free up some space for more batteries or other things...

:)

Ah, the old startrek phazer/tricorder stage prop from post some time back! Waaaaaaay over done. The only thing it needs electronic is one of the below LED chase lits for the converging LEDs. To make the little arm things on the sides move, just make a simple thumb slide to make them flip around to the front, with a rubberband to pull the slide back when released. Lot simpler ways to get it done.

What? Star Trek?! BITE YOUR TONGUE MAN!

What I'm trying to do here is create the most accurate PKE meter available to date. And it's hardly overdone, there's only one other fellow who makes the circuits and his aren't quite movie accurate.

The original prop used resistive touch switches and servos, so that's what I'm using. To do otherwise would miss the point.

I wish I could save the trouble of having trimpots on the board for the servos to make sure the wings line up, and reduce my current needs by half by using a single servo, but the folks who make the plastic shells made them to be used with two servos and it would be hard to gear the wings together.

Rubber bands ain't gonna cut it. :-)

Do the side-arm things need to be able to move at different rates/times? That is, could you get by with a single servo moving both arms? If so, that might reduce your power requirements, and free up some space for more batteries or other things...

I wish I could. If I was making the plastic shells I'd go that route. But the shells are made by other people, and they're not all the same, so the cheapest and most obvious solution wouldn't necessarily work for everyone. The safest route to go is to use two servos because that can be made to work with most setups. Most setups expect the wings to be mounted directly onto the servo horns for ease of installation.

I think your looking for a magic bullet to solve your basic problem, inadequate battery current capacity. Standard 9vdc batteries will never solve a current draw problem, they are just too wimpy (and expensive). While adding expense, rechargeable cells of higher current capacity is most likely the best solution. Nicads and nihm (as well as li-po) can be had in many different package sizes and can supply higher peak current then most non-rechargeable batteries.

So you are dealing with two battery constrains, higher enough current capacity to run the total static (baseline Arduino draw + support components) and peak (when the servos have to move) current and a desired battery duration time. There is no magic here just fundamental engineering calculations and trade-off decisions.

I'm not looking for a magic bullet, I understand there are tradeoffs which need to be made. For example, if I stuck a resistor on there that would probably slow the servos down. But in this case the servos don't need to move fast, so I could live with that tradeoff. I can also live with short battery life if I have to. But I can't ask people to pay \$20 for a battery charger, and I don't want to add \$10-\$20 to the cost of the meters by having to ship rechargables with them. I also don't want to do anything funky like solder the batteries together which would make it impossible for the end user to change them.

At this point I've already got a working prototype. You can see that here: http://www.youtube.com/watch?v=E1ye8AsXK8U&

And if I need to, I can go the two battery route. The prototype there is running off 9v for the servos and USB power for the atmega.

I just want to make sure there's not another solution I've overlooked. I mean maybe a coil would help. Or maybe instead of sticking big capacitors on the servos I could stick smaller ones across the leds. I dunno. There's so many things I still don't know about designing circuits.

I guess the extra battery route would be the least likely to have problems with different brands of servos though.

While I'm on the subject of a seperate battery again... anyone know of a through-hole voltage regulator which would be smaller than a TO-220 package would be when laid flat on the board, but could handle say 200mA of current? I looked at tranistor shaped ones and those didn't seem to be able to handle that much current. And I think the metal can ones weren't much better and were much more expensive to boot. Are there any others I've missed?

I've tried 47uf and 100uf caps. And I asked folks here about how big of caps I'd need and they indicated they'd need to be positively enormous. Due to space limitations I probably couldn't afford more than one cap about a half inch across and a half inch tall. I dunno how much power such a cap would have but I don't think even it would be enough to smooth out the power spikes.

Even if I could find a supercapacitor small enough for my needs, I suspect one capable of supplying so much current would be expensive. Might even be dangerous.

What's this about a seperate feed using a diode though? Would said srotage capacitor be connected in parallel like a decoupling cap? I think someone posted a schematic in my other thread which had a diode and a cap. I think the diode was placed such that the capacitor was wired in parrallel and the diode was placed such that the cap could only feed one side of the circuit when it discharged. They needed a zener diode or something with a low votlage drop. Are you talking something like that?

Such a setup might work with the leds. Don't think it could supply enough power to the audio and microcontroller though. Not with the small caps I'd have to use.

Would add a million more ways I could screw the circuit up too. I try to keep these things as simple as possible cause I hardly know what I'm doing. :-)

Hm...I think I'm probably going to have to make the two battery solution work. I mean I can't add 50 capacitors to the circuit just to make the leds not dim when the servos move. That would take more space than the voltage regulator. I'm fairly certain there's room for enough batteries.

Forget the caps stuff, just wire everything to a 12vdc car battery with a strap to carry it like a back pack. Paint it weird colors and tell them it's a nuclear reactor power supply.

Lefty

No, no, and no. They are small They are cheap (<\$2) and they are not dangerous.

Huh. I’d looked for some on Mouser and Digikey I think, but I was only able to find really large expensive ones.

Those are definitely interesting. I don’t have a clue how to translate farads into how many mA I’ll get out for how many seconds at what voltage, but I’l try to figure it out to see where I might best make use of those.

You would feed it through a diode from the battery so that the servo motors couldn’t draw any power from it.

I think I understand. Would it need to be a special diode with a low voltage drop, or any old diode?

Dunno what the “50 capacitors” thing is about?

Oh I was just thinking if I needed a capacitor on every led or something. Space on this board is so tight I gotta keep the number of caps and resistors as low as possible. I’ve gone so far as to find 2mm headers and receptacles for the 8 conductor cables I need to run to each wing, and have even been considering SIP switches instead of DIP switches just to get that little extra bit of room.

Think I may eventually need to learn how to solder surface mount components, but that’s for another project. (I did price out how much it would cost to have the PCB house do it. Like \$1500 for only 30 components on 10 boards! Ouch!)

Forget the caps stuff, just wire everything to a 12vdc car battery with a strap to carry it like a back pack. Paint it weird colors and tell them it's a nuclear reactor power supply.

Haha! I live in an apartment building any my neighbor sees me building all this GB stuff all the time. About two weeks ago, he says "I gotta ask... what's the car battery for?" I'd left my car's battery charging in the hall cause it was dead and he thought I had it hooked up to some electronics project in my apartment.

I had a good laugh cause it was a reasonable question. I would do something like that. :-)

So all the current for everything in the circuit besides the servos would need to pass through this one diode then and as a result there would be a voltage drop? And the capacitor is behind this diode with everything else?

It's kinda hard to search for axial diodes on Mouser when all they list are a hundred different packages many of which are SMT and I have no idea which is which, so I just searched the DO packages which I knew were axial and I found this one which they've got like 52K of:

http://www.mouser.com/ProductDetail/Vishay-Semiconductors/1N5817-E3-54/?qs=sGAEpiMZZMuIUjt4yeP9c6hNWXQ8g7Hm2CncK17V3Yo%3d

Does that look like the right sort of diode to use? It's a schottky, which I think the fellow in the other thread reccomended. The voltage drop is only .47v. It says it can handle 1A continuous, which I think should be plenty for my needs on the microcontroller side.

Overall it looks perfect to me. A little expensive, but I only need one. What do you think?

What I'm trying to do here is create the most accurate PKE meter available to date. And it's hardly overdone, there's only one other fellow who makes the circuits and his aren't quite movie accurate.

Where/what are the specifications for being "movie accurate"? If this gizmo is from ghostbusters, did they have arduinos or pic servo controllers back then? Where are the electrical schematics for the gizmo pictured? How do you not know that the gizmo is not just an R/C setup controlled by a prop man off camera? How do you know that you are not trying to real world duplicate "movie magic" (is your gizmo also going to detect ghost and such like in the movie?). I looked at the film clip and I saw the wings move and the LEDs blink, but that is simple to duplicate without servos and such. Where is the technical basis for your duplication efforts?

Where/what are the specifications for being "movie accurate"?

Movie accurate simply means the the prop looks and behaves very closely to the way it did in the film. There's no precise definition of what that means.

If this gizmo is from ghostbusters, did they have arduinos or pic servo controllers back then?

Did they have microcontrollers in 1984? No, I don't think so. :-)

They didn't need them though. The way this prop behaved was when you touched the left resistive touch switch, the wings would extend fully, and then you touched the right one, the wings would extend halfway. This could possibly have been accomplished with a single 555 timer that could be set to two different speeds. A second 555 timer paired with a 4017 decade counter would then provide the animation for the wings and screen. That timer's speed was adjusted with the knob on the back.

Why aren't I doing things that way? Well, they don't exactly play up that the speed of the lights is controlled by the knob on the back in the film. Nor do they make it obvious the wings can only go to two different heights and these are controlled by the touch switches. So what I'm making is an "idealized" meter. One which behaves like the one in the film, but also behaves like you might imagine the device would behave if it were real.

A real PKE wouldn't detect only two levels of activity. And the wing height and speed of the lights would likely be tied together. So I want to offer the user the option of using the PKE that way, because it'll be more fun to use. The user can however change some dip switches to set the meter to prop-accurate mode where it would behave just like the original prop did.

Where are the electrical schematics for the gizmo pictured? How do you not know that the gizmo is not just an R/C setup controlled by a prop man off camera? How do you know that you are not trying to real world duplicate "movie magic" (is your gizmo also going to detect ghost and such like in the movie?). I looked at the film clip and I saw the wings move and the LEDs blink, but that is simple to duplicate without servos and such. Where is the technical basis for your duplication efforts?

The real prop was a rental prop, and if you go to the page that image is from: http://www.cylandprops.com/PKEmeterp1.html

You will see that a fan rented it and then took detailed notes on how it worked. Unfortunately (or fotunately) he did not dismantle the circuit board, so nobody knows exactly how it functioned, but if I were a betting man, I'd say that it functions exactly as I described above with the 555 timer and 4017 chip. Because that is the simplest and most likely setup and that is how the Proton Pack lights functioned. (We do have schematics for those.)

So as far as movie magic goes, there is none in how the meter looks and functions visually. It actually does everything you see in the film and is operated by the actor using the touch switches and knob on the back. The only bit of movie magic with it is the sound. But I kinda gotta try to replicate that. :-)

The way this prop behaved was when you touched the left resistive touch switch, the wings would extend fully, and then you touched the right one, the wings would extend halfway.

So where is the retract button? It would be simple to have a left button for extend and a right button for retract, with the wings moving while button is depressed and stopping when released, with the servos just being used as gear motors. Using a single servo on its side one could also drive the LED pot off of the servo horn. A \$7 servo tester might provide some cost saving. The long handle looks like 8 AAA batterys might fit, or even AA batterys.