Servos are small motors that can rotate 180 degrees and whose position can be controlled. Some types of Servos can also rotate continuously. However, normal servos can be hacked to rotate 360 degrees.

They are built with a small DC motor, a potentiometer and some control circuitry. The rotation of the motor changes the position of the potentiometer which acts as feedback for the control board to know the exact position of the servo. This behavior is very useful for some applications, but not so much for others where we don’t care about the current position of the servo but want to perform full rotations (like rotating the wheels of a robot).

In this tutorial we’re going to hack a Futaba s3003 servo, connect it to an Arduino and write some code to move it forward, backwards and stop it.

Modifications

There are two modifications we need to perform on the servo:

  • Substitution of the potentiometer with two equal fixed resistances.
  • Removal of the physical stop in one of the plastic gears.

By substituting the potentiometer with fixed resistances, we make the servo think it is always in the same position (somewhere between 0 and 180 degrees).

For example, if your potentiometer was 5kΩ, two 2.5kΩ resistances would make the servo think it is in the middle position (90 degrees). Don’t worry too much about the resistance as it can be somewhere between 2kΩ and 3kΩ. We will later figure out the position at which it is fixed.

Steps

1 – Open the bottom lid by removing the 4 long screws.

Opening the servo

2 – Remove the top lid. You will see some plastic gears.

The gears

3 – Gently push out the circuit board.

The board

4 – Find two resistances of around 2.2kΩ and join two of the ends together.

Photo of the resistances joined

5 – Using a soldering iron, remove the potentiometer from the board. Insert the resistances in the holes, inserting the joint ends where the middle leg of the potentiometer was.

Photo soldering the resistance

6 – Remove the physical stop from the plastic gear using a knive.

Removing the stop from the gear

7 – Put it all back together.

Arduino

Time to write some Arduino code, it has great support for controlling servos. Open the Arduino IDE and upload the following snippet to your Arduino board.

#include <Servo.h>

Servo myservo;

void setup()
{
  myservo.attach(9);
}


void loop()
{
  myservo.write(180);
  delay(3000);
  myservo.write(0);
  delay(3000);
}

Wire the servo to your Arduino following this table, and power it up.

Servo Arduino
Black GND
Red 5v
White Pin 9

If the servo modification was successful, it should rotate 3 seconds in one direction and 3 seconds in the opposite direction.

Finally, we have to find which value will make the servo stop. For this, we have to try passing values to myservo.write() and waching the direction of the servo. The value will be somewhere between 80 and 100.

Depending if your value is bigger or smaller than the “stop value”, the servo will rotate in one direction or the other.

Happy hacking!