Should I use a transistor?

I'm working on a little project. I have an arduino Uno (at the moment) controlling two servos that move a big Santa. The Santa moves certain ways as you get closer to him. Kinda creepy, I know...

One of the servos moves his arm, but I noticed that when the arm is in the bottom position and resting against a physical stop, if you bump the arm, the servo starts making noise. I'm assuming that the "encoder" is sensing that the servo arm is a hair off, and is attempting to compensate. It happens with my RC airplanes all the time- it goes away when you bump the control stick or it will just settle out on its own. But in this case, the servo isn't settling out unless you cause the arm to "cycle" by standing in front of the sensor that controls the whole thing. This could be dangerous if I leave it on unattended. I'm worried that the servo will "come on" and burn up, possibly catching fire.

Would it make sense to put a transistor between the voltage regulator and servo wire? Then I could have the arduino turn off the power output to the servo when it should be at rest. I have absolutly zero experience with transistors- I just read about them in my "Getting Started with Arduino" book. Are there transistors that can handle a 400ma 6V servo? Thanks!

Wow, just went to Mouser and did a search for "transistor" and got smacked in the face. I have no idea where to start...

wow you really are into hobby servos. if i am not mistaken you could do that in the software
using detach function

this function as to stop giving the servo pulse to continue holding that position.
then when you want to use that servo again use the attach function again

theres another function of servo that is attached. this is just to varify that the port is not use for servo and not other things.

so you might not need the transistor. Hope someone could verify this but i am certain that this might do the trick

I've been into RC airplanes for a long time and have about 100 of them sitting around. Just out of curiosity, do you have a better solution? The hobby servo just seems so convenient since it's already in a complete assembly and only has three wires, power, gnd, and signal.

I'll try the detach thing and see if it works. Thanks.

I got an error for some reason when I tried it. The line of code is:

myservo.detach(9);

The Error is:

no matching function for call to 'Servo::detach(int)'
Win_program_draft.ino: In function 'void loop()':
Win_program_draft:128: error: no matching function for call to 'Servo::detach(int)'
C:\Users\Dave\Downloads\arduino-1.0.2\libraries\Servo/Servo.h:114: note: candidates are: void Servo::detach()

sorry for my remark. i just saying this cause most of your post is about hobby servo. i have no expereince with hobby servo what so ever.

No need to be sorry. If there's a better way, I'm more than eager to know it. :smiley: Can't figure out the detach thing though. :frowning:

you dont have to specify the pin you want to detach, the name if that pin is enough

myservo.detach();

Awesome! Worked perfectly. Thanks!

Edit: Spoke too soon. When he moves his arm up and the servo shuts off, the arm drops. lol Nothing I can't fix in the code, but I thought it was kind of funny to watch. lol

IMHO, i am more or less leaning toward Dc motor,H bridge and an encoder/ pot if the angle is kinda not need to be continuous.

welcome, just glad i could help

Got it! Works exactly like I hoped. Thanks pal!

could you post all of your code, let me see if i could help you