How I modified servo for analog feedback output

The regular servos are good but you have no feedback from them. Imagine having a robot with arm and executing task: Move arm 90° up. You are sending certain µs to the servo and after few milliseconds you stop. But the arm can stuck somewhere and your final task in not completed. This situation brought me a new point of view. „I need a feedback!“ I wanna know what is my servos real position and if they aren’t stucked so I have to try the movement differently. I had seen servos like that on Adafruit. A standalone wire outcomming from the servo. These big 180°big 360°small 180° are just fine but expensive for me who uses to buy cheap from AliExpress.
I got some metal gear 270° servos RDS3115. I like them cuz of degrees, force 15kg/cm, speed 0.15s/60° and fake dual shaft for better mounting.

  1. I removed an enclosure of the servo. My servo has 4 longer screws.
  2. I found a potentiometer. The regular one with 3 wires going to the driver board.
  3. As the soldering iron was heated up I made a hole thru the enclosure for the feedback wire
  4. I soldered new wire to the middle wire of the potentioneter and put the servo back together

I used following simple Arduino sketch to try it out:


#include <Servo.h>

Servo s;

void setup() {

void loop() {
	for (int us = 550; us < 2450; us+= 25) {
		long r = 0;
		for (int i = 0; i < 50; i++) {
			r += analogRead(0);
		float avg = r / 50.0;
		float deg = (avg - 55.0) / 520.0 * 270.0;
		Serial.println(String(us) + " us\t" + String(avg) + "\t" + String(deg) + "*");

You may change constants.


Pridaj komentár

Vaša e-mailová adresa nebude zverejnená. Vyžadované polia sú označené *