Teach Servo Positions with Manual Movement

This technique enables you to hijack internal potentiometer movements to read and replay servo positions.

Jeremy Cook
4 years ago

Programming a servo with an Arduino or other dev board isn’t the hardest thing in the world, but if you want one to travel to multiple points at different speeds, things quickly get cumbersome. With this technique by YouTuber “peterbiglab,” however, you can configure a servo by simply allowing the Arduino to record positions that you move it to.

The concept is ingeniously simple. RC-style servo motors sense their positions with a potentiometer, and adjust to a set point automatically, never giving any actual feedback to the overall system as to whether it was able to obtain a position. Peterbiglab simply breaks out this sensor wire and feeds it back into an Uno’s analog input pin, measuring the position when otherwise unpowered.

Potentiometer values here are stored in a large array, which can then be played back as needed. Positions are stored in RAM, so a board like the Mega would save more than an Uno, though the “FPS” value, or how many positions per second are stored and retrieved can be set as needed.

In the video, he demonstrates with 60FPS, which is enough to have his rig obtain different positions with what appear to be extremely smooth movements. Code is available here, and this could be a very useful technique for a variety of projects.

Jeremy Cook
Engineer, maker of random contraptions, love learning about tech. Write for various publications, including Hackster!
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles