Position sensors - or - hacking cheap servos

A project log for Robot Arm Controller

This project controls an robot arm remotely by moving a similar robot arm. The sensing arm looks like a joystick to the computer.

Tim WilkinsonTim Wilkinson 05/22/2016 at 05:363 Comments

Using a robot chassis to control a remote robot chassis requires position sensors in the controlling chassis. Because the robot frame was designed to accommodate servos, the easiest way to add position sensors is to buy a bunch of cheap servos, and modify them to provide position feedback. It turns out you can buy such things from Adafruit (see but at $15 a piece, these seems a little pricey. All I need is a servo sized box which turns a potentiometer to produce a voltage proportional to its position.

Instead I bought a bunch of cheap servos (such as these which cost me $3.50 each and modified them to provide the position feedback.

Modify these servos is really simple. First unscrew the based the servo unit by removing the four screws.

This exposes the control board and motor.

If you lift the control board you'll find a potentiometer underneath it. This is what we want access to. There are three wires connecting the PCB to the potentiometer. We need to sense the voltage found on the center wire.

As with all servos, these are operated using three wires: power, ground and control. I still need power and ground for the servo (we need a voltage to be divided by the pot) but I no longer need the control wire - so I reused this to provide the position output instead. To do this I unsoldered the control wire from its current position on the pcbs, and re-soldered it to the central lead from the potentiometer.

Below you see the three wires - ground, power and control (white):

Here the white wires has been moved to a pin which is connected to the center of the potentiometer. Fortunately, in this servo at least, the potentiometer is attached to an easy to reach point on the PCB.

Now, when the servo is powered, the control lead will provide a voltage proportional to the position of the servo.

Finally, because we're only using this servo for feedback, I disconnected the motor so it would never be powered. You can do this by simply cutting the wires, or you can unsolder them (which is what I did).

All that remains is to pop the top back on, and we have a position sensing "servo" which can be used in the robot arm controller.


PPA76 wrote 08/19/2019 at 18:09 point

Is this change valid for all control servos? I own a CYS8218 servant. Try different changes but the result is always disappointing. You propose to make these connections. I'll try tomorrow. For the moment, thanks.

  Are you sure? yes | no

Tim Wilkinson wrote 05/23/2016 at 16:12 point

For the moment I wanted to make the smallest possible changes to the servos to get position data from them - so no removing the PCB or motor/gear setup. I've considered stripping them down further in the future.

As for better position solutions - I have no doubt there are, but I just wanted something that would easily fit into the robot arm frame that I'm using. The pots are not the greatest things in the world, and there's some polynomials in the code which calibrates and makes them more linear. Certainly sufficient for my purposes.

  Are you sure? yes | no

deʃhipu wrote 05/23/2016 at 07:47 point

You still have the H-Bridges and comparator powered -- why don't you simply remove the whole control board? You can also remove the motor and all the gears from the gear box -- it will then be lighter and easier to move, and you are not risking stripping the gears.

And you can actually buy servo parts, instead of whole servos.

All in all, cheap servos make very poor position sensors -- of thing the producer saves on to make them cheap is the potentiometer, which is often of very bad quality. I think you would be much better off with a pot bought specially for the occasion (of course then you'd need to modify the design to mount it). For even better results, use encoders based on the Hall effect sensors -- they are amazing.

  Are you sure? yes | no