How to Hack a Servo for Continuous Rotation - TowerPro MG995

by meanpc in Circuits > Robots

129795 Views, 91 Favorites, 0 Comments

How to Hack a Servo for Continuous Rotation - TowerPro MG995

Digital-Metal-Gear-Servo-48g-MG995.jpg
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.

Parts and Tools

How to hack the mg995 servo-35.jpg
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

Remove 4 Screws

How to hack the mg995 servo-01.jpg
Use your phillips screwdrive to remove the four captive screws on the servo.

Remove Cover

How to hack the mg995 servo-02.jpg
Remove the cover that has the 4 screws, exposing the motor and PCB.

Examine the PCB

How to hack the mg995 servo-03.jpg
These 3 white wires are currently connected to the potentiometer.  By the end of this instructable these wires will be gone.

Remove Servo Horn

How to hack the mg995 servo-04.jpg
If there is a horn attached to your servo - remove it.

Remove Backside Cover From Servo

How to hack the mg995 servo-05.jpg
Carefully remove the cover from the back of the servo.  This will expose the gears.

Take a Picture

How to hack the mg995 servo-06.jpg
Take a picture of your gears, to be sure you remember how they go in when you are done.

Remove Top Gear

How to hack the mg995 servo-08.jpg
Remove the upper most gear and set it somewhere clean and safe.  Try not to get the gear dirty.

Remove Gear With Spindle

How to hack the mg995 servo-09.jpg
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.

The Pin

How to hack the mg995 servo-07.jpg
If you look at the gear you just removed, you will see a small shiny pin.  Look at your gear and identify it.

Pull the Pin!

How to hack the mg995 servo-10.jpg
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.

Before Photo of the Bottom of the Gear

How to hack the mg995 servo-11.jpg
Now that you have the pin out, look at the bottom of the gear.  You will see a plastic insert.

Pry Plastic Insert Out

How to hack the mg995 servo-12.jpg
How to hack the mg995 servo-13.jpg
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.

After Photo of Gear

How to hack the mg995 servo-14.jpg
This is what your gear should look like after you take the plastic out.

Put the Gears Back Together

How to hack the mg995 servo-15.jpg
Put the gears back together just like you found them.

Close the Cover on the Gears

How to hack the mg995 servo-16.jpg
Snap the cover back over the gears.  We're done with this side of the servo now.  

Cut the Wires!

How to hack the mg995 servo-17.jpg
Pull the PCB out and cut the 3 wires that connect it to the potentiometer.

Remove Wires From Potentiometer

How to hack the mg995 servo-18.jpg
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.

Bend the Potentiometer Pins Down

How to hack the mg995 servo-19.jpg
We don't want the potentiometer pins getting in the way, so just bend them down so they are flat.

Twist the Resistors Together

How to hack the mg995 servo-20.jpg
Twist the resistors together, then bend one of the leads down like this.

Solder the Resistors Together

How to hack the mg995 servo-21.jpg
Solder the resistors together at the twist.

Trim the Resistor

How to hack the mg995 servo-22.jpg
Trim the excess wire above the solder joint you just made.

Trim the Other Two Resistor Leads

How to hack the mg995 servo-23.jpg
Trim the other two leads so they are the same length as the one in the middle.

The Completed Resistors

How to hack the mg995 servo-24.jpg
They should look something like the picture when you are done.

Desolder Wires From the PCB

How to hack the mg995 servo-25.jpg
Carefully desolder the wires from the PCB.  Gently pull the wire while heating up the solder joint and it will come right off.

Solder Resistors to PCB

How to hack the mg995 servo-26.jpg
Solder the resistors to the PCB.  

Wrap PCB in Electrical Tape

How to hack the mg995 servo-27.jpg
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.

Replace Motor

How to hack the mg995 servo-28.jpg
Stick the motor back in.  Make sure it is all the way in and meshing with the gears in the case.

Position PCB

How to hack the mg995 servo-29.jpg
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.

Replace Lid

How to hack the mg995 servo-30.jpg
Attach cover over the motor and PCB.

Fasten Screws

How to hack the mg995 servo-31.jpg
Fasten the 4 screws and you are done!

The Code

How to hack the mg995 servo-32.jpg
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.

Hook the Servo Up to Your Microcontroller

How to hack the mg995 servo-33.jpg
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.

Test Your Servo

How to hack the mg995 servo-34.jpg
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.