Introduction: How to Hack a Servo for Continuous Rotation - TowerPro MG995

Why would you want or need to modify your perfectly good servo?  It turns out that servo motors are great little gear motors that can connect directly to a microcontroller without the need for a motor driver circuit.  The problem is that servo motors are made to turn between 90 and 180 degrees, for turning the front wheels of a remote control car, turning a rudder, controlling ailerons, etc.

But we want to use these cheap high-torque motors to turn the wheels on our robot.  This instructable will show you how to make your servo spin 360 degrees.

Why the TowerPro MG995?  It's cheap and powerful.  At 4.8 volts, the MG995 produces 138.9 oz/in of torque and spins 360 degrees in 1.2 seconds.  The MG995's are all over eBay for just under ten dollars apiece.  I might not use these to steer a $1,000 RC plane, but they are terrific for powering the drive wheels on your robot.

I highly recommend watching the YouTube video first so you have an overall view of what you will be doing in this project.

Step 1: Parts and Tools

Parts and tools

MG 995 Servo
Two 2.2k ohm resistors

Soldering iron
solder
sponge
Needle-nose and diagonal pliers
Flat and phillips head screwdrivers
Helping hands
Electrical tape

**Optional - for testing purposes
Arduino or microcontroller of your choice
3 jumper wires

Step 2: Remove 4 Screws

Use your phillips screwdrive to remove the four captive screws on the servo.

Step 3: Remove Cover

Remove the cover that has the 4 screws, exposing the motor and PCB.

Step 4: Examine the PCB

These 3 white wires are currently connected to the potentiometer.  By the end of this instructable these wires will be gone.

Step 5: Remove Servo Horn

If there is a horn attached to your servo - remove it.

Step 6: Remove Backside Cover From Servo

Carefully remove the cover from the back of the servo.  This will expose the gears.

Step 7: Take a Picture

Take a picture of your gears, to be sure you remember how they go in when you are done.

Step 8: Remove Top Gear

Remove the upper most gear and set it somewhere clean and safe.  Try not to get the gear dirty.

Step 9: Remove Gear With Spindle

Remove the gear that has the spindle that pokes outside of the servo.  This is usually pretty tight, so pull it off with your needle-nose pliers if you have to.

Step 10: The Pin

If you look at the gear you just removed, you will see a small shiny pin.  Look at your gear and identify it.

Step 11: Pull the Pin!

Grip the spindle with your needle-nose and pry the pin out with your side-cutter.  It will take a little prying but it will come out.

Step 12: Before Photo of the Bottom of the Gear

Now that you have the pin out, look at the bottom of the gear.  You will see a plastic insert.

Step 13: Pry Plastic Insert Out

Use your flathead screwdrivers to pry the plastic piece out of the bottom of the gear.  Try to get the plastic out of the inside of the gear without leaving too much debris.

Step 14: After Photo of Gear

This is what your gear should look like after you take the plastic out.

Step 15: Put the Gears Back Together

Put the gears back together just like you found them.

Step 16: Close the Cover on the Gears

Snap the cover back over the gears.  We're done with this side of the servo now.  

Step 17: Cut the Wires!

Pull the PCB out and cut the 3 wires that connect it to the potentiometer.

Step 18: Remove Wires From Potentiometer

Remove the three wires from the potentiometer.  You can de-solder them if you like, or you can do it like I did and just pull them off.

Step 19: Bend the Potentiometer Pins Down

We don't want the potentiometer pins getting in the way, so just bend them down so they are flat.

Step 20: Twist the Resistors Together

Twist the resistors together, then bend one of the leads down like this.

Step 21: Solder the Resistors Together

Solder the resistors together at the twist.

Step 22: Trim the Resistor

Trim the excess wire above the solder joint you just made.

Step 23: Trim the Other Two Resistor Leads

Trim the other two leads so they are the same length as the one in the middle.

Step 24: The Completed Resistors

They should look something like the picture when you are done.

Step 25: Desolder Wires From the PCB

Carefully desolder the wires from the PCB.  Gently pull the wire while heating up the solder joint and it will come right off.

Step 26: Solder Resistors to PCB

Solder the resistors to the PCB.  

Step 27: Wrap PCB in Electrical Tape

Just a precaution to make sure the resistors don't short against something.  Also, be sure the leads on your resistors aren't making contact with anything on the PCB.

Step 28: Replace Motor

Stick the motor back in.  Make sure it is all the way in and meshing with the gears in the case.

Step 29: Position PCB

Carefully position the PCB in the case.  It may be a tight fit with the tape on it.  Just make sure you will be able to get all of the screws in.

Step 30: Replace Lid

Attach cover over the motor and PCB.

Step 31: Fasten Screws

Fasten the 4 screws and you are done!

Step 32: The Code

This is the code you can use to test your servo if you are using an Arduino.  The myservo.write(90); line sets a standard servo to it's mid-point.  It will tell our hacked servo to stop.

You will need to find the exact null point of your servo.  The servo in this instructable nulled out at 105.  Anything above that would turn in one direction, and anything below it would turn in the other.  The max speed is 180 in one direction and 0 in the other.  You can control the speed by using values in between.

Step 33: Hook the Servo Up to Your Microcontroller

The servo connector has three wires - Brown, Red and Orange.  Brown connects to the ground of the Arduino.  Red connects to the 5V on the Arduino.  Orange connects to the I/O pin on the arduino, in this case digital pin 9.  Use jumper wires to connect between the female connectors on the servo cable and Arduino headers.

Step 34: Test Your Servo

If you did everything right, you should be done.  Try nulling out the servo, then setting the servo to spin at various speeds in both directions.

Comments

author
DavidA107 made it!(author)2017-07-04

This instructable, work perfect! tested now today 07.04.17, the resistor of 2.2k is best hack for MG995.

author
MartineH1 made it!(author)2017-03-05

Is it possible to just remove the potentiometer, when you have exchanged it with a voltage divider? And if so, can you still decide on location, or get to the start position? I want to use the servo to control my camera in 360 degrees :)

author
%D9%85%D8%B9%D9%8A%D9%86%D8%A71 made it!(author)2016-11-14

Please tell me how do i set its mid point it just never stop ,i used it with arduino mega

author
RogerB81 made it!(author)2016-05-11

I should have added that I'm using the servo to rotate a turret on an RC tank. I'm using a standard RC transmitter to control the servo. I would think it will work and I don't have to reprogram anything for my application.

author
RogerB81 made it!(author)2016-05-11

I have watched this video and many others explaining this process. They all say use the 2.2k ohm resistor. I called my local electronics store and I asked if they had these resistors in stock. The sales person asked me what wattage I needed. So even though its easy to do this hack, if you don't have the correct resistors the servo can easily be damaged.

Could you please let me know the wattage resistor I need?

author
Catracho2305 made it!(author)2016-03-27

Will removing the potentiometer stop you from being able to return the motor to its original position after causing it to spin?

author
gilmegidish made it!(author)2014-08-30

Works great! Thank you so much for this tutorial, I need 6 of these for an upcoming project. It's really simple after the first :)

author
skootles made it!(author)2013-05-01

Note for others: One problem I had came during the re-assembly. The right-most gear in this picture has a pin on top and for some reason mine came loose when putting it all back together, causing the gear to become dislodged and the motor to not work correctly. I had to open it back up and push down on that pin to make sure it was secure.

Other than that, everything went perfect. Great guide!

author
cobourgdave made it!(author)2013-04-04

Just saw this in April 2013, and I liked your approach. Nice tutorial, clear and concise. Would suggest that a video camera on a tripod would have made the images a little more stable, but what the heck, it WAS viewable. Nice job, hope to see more

author
radiogareth made it!(author)2013-04-01

Nice glossy hack, well done :-)
I found there was space inside to just remove the potentiometer from its drive shaft, leave it in the center of its travel, tape it up along with the metal stop pin and fit it all back inside the servo in case I needed to de-hack it later. Only problem is each servo may have slightly different 'middles' (dead zone), but you could re-assemble the gear train, send it middle pulses and adjust the pot until it stops. HTH :-)
Gareth

author
aurbindnair made it!(author)2012-11-17

Din't work. Its still doing pulse rotation.

author
jduffy54 made it!(author)2012-10-16

I would just like to comment that you can have more than one line per step. Mine are a little long, but most of these steps are one sentence. My internet is slow, so this took like 20 minutes to see the whole instructable.

author
meanpc made it!(author)2012-11-01

Dial-up?

author
jduffy54 made it!(author)2012-11-01

No, regular internet. It's not peticularly fast, but its not bad. Main problem was the gazillion steps. Would have helped it there was more than a line of text per step

author
meanpc made it!(author)2012-11-02

Yeh, I can see how that would be annoying. I'll keep that in mind next time.

author
Pandalo made it!(author)2012-11-01

What if i'm not using an arduino? I'm new to servomotors, and i'm about to hack 4 of these pieces. Whats the pulse modulation for these babies when hacked?

author
meanpc made it!(author)2012-11-01

I don't know, but I googled it for you and this was the best I could find:

http://www.societyofrobots.com/robotforum/index.php?topic=5062.5;wap2

author
rc+jedi made it!(author)2012-08-27

the drive on the 995's are very robust, but the driver setup buzzes, so they are a great choice for your project. the 996 have better driver circuit, i have used both for some time. servos are so cool. great pictures, thanks for showing it.

author
meanpc made it!(author)2012-08-28

The motor seems to be strong and the gears are metal, so I think it should be pretty robust. Some of the negatives I have read on the net about the MG995 were more on the build quality - especially the quality of the connections of the wiring.

I think they will make good drive motors for a robot though.

Thanks for taking the time to comment!

author
jwolski1 made it!(author)2012-08-23

Great job! I just did this with a futaba s3003 controlled by my arduino uno. I didn't want to do the soldering, so I instead just set the pot near the middle. I can still use servo.write(180) and servo.write(0) to go in either direction. To stop, I just do a server.detach().

Thanks for the idea!

author
Sandisk1duo made it!(author)2012-08-20

Is there a way to hack the servo in a way that allows you to read the value of the potentiometer?

Thanks!

author
meanpc made it!(author)2012-08-20

I don't see why not. Couldn't you just hack the potentiometer so that it can rotate 360 degrees, send 5v in one lead, then send the other lead to an analog input on an Arduino or whatever microcontroller you are using? You can test the potentiometer before hand and can tell exactly what position the potentiometer, and thus the connected motor are in. Would be relatively simple I think.

The only tripping point might be that the wipers in the potentiometer would get worn out really quickly, depending on the duty cycle of the motor. Remember the contacts on slot cars back in the day? I imagine the wipers would wear out in similar fashion.

A good idea though, you should try it.

author
amandaghassaei made it!(author)2012-08-19

cool, thanks for posting, I'll have to try this sometime.

author
meanpc made it!(author)2012-08-20

Thanks for looking and commenting. Just checked out your instructables - WOW.

author
PeckLauros made it!(author)2012-08-19

Good tutorial and nice pictures.

author
meanpc made it!(author)2012-08-20

Thanks! I have 4 of these servos, and hacked the first one the other day. I decided to make an instructable with the second. The pictures are still captures of the video my daughter took .

About This Instructable

109,774views

82favorites

License:

Bio: Electronics are a newly re-found hobby for me. I'm not an engineer - I'm an ordinary guy who likes to tinker with electronics in ... More »
More by meanpc:How to Negotiate at Garage SalesHow to Plan Your Garage Sale Route Using Google Earth (for EBay Sellers)Potentiometers and AnalogRead - How to Arduino #4
Add instructable to: