Pan and Tilt with Dual Controllers

It wasn’t long ago that faced with a controller project, you might shop for something with just the right features and try to minimize the cost. These days, if you are just doing a one-off, it might be just as easy to throw commodity hardware at it. After all, a Raspberry Pi costs less than a nice meal and it is more powerful than a full PC would have been not long ago.

When [Joe Coburn] wanted to make a pan and tilt webcam he didn’t try to find a minimal configuration. He just threw a Raspberry Pi in for interfacing to the Internet and an Arduino in to control two RC servo motors. A zip tie holds the servos together and potentially the web cam, too.

You can see the result in the video below. It is a simple matter to set up the camera with the Pi, send some commands to the Arduino and hook up to the Internet.

The serial protocol for the Arduino is simple: The Pi sends a numeric position followed by a P (for pan) or T (for tilt) at 9600 baud. A web server and some Python handle the interface to the Internet and the human.

We’ve certainly seen our share of similar projects. Some of them have been a bit larger.

14 thoughts on “Pan and Tilt with Dual Controllers

      1. I should probably add that because of the potentiometer inside most servos that they wear out. So depending on the application they may not be the best choice. But then again anything with moving parts will eventually wear out.

    1. By having tried moving servos from a Pi, in the same time you arrive to install all, read docs, manage to find why PWM(10) don’t move the servos not even barely, risking to burn the Pi because two servos may eat too much, making a simple circuit with caps an diodes to avoid any possible harm to the Pi, …. you are already partying with beer because you slapped an arduino micro at it, hacked an example sketch, wired two cables and that’s good enough.

    2. The servos need 5v, so you need a NPN transistor and 2 resistors per servo. (ref: https://projectedneuralactivity.blogspot.com/2012/12/controlling-servo-using-raspberry-pi.html )

      Although 2 transistors and 2 resistors are cheaper it does offer less flexibility. You could an Arduino to level shift to 5 volts in addition to adding an additional 14 digital I/O pins, 6 with PWM pins, and 6 ADC input pins (10 bit). which you can easily use from the RPi using nanpy ( https://github.com/nanpy ). ( ref: MagPi issue 8, page 12 https://raspberrypi.org/magpi-issues/MagPi08.pdf )

  1. Sounds like way too much hardware for moving a couple of servos. The RPI is way more than you need to do everything. This would be an interesting thing to ponder with an 8266 based board. Cut the price down from like $50 for an RPI with a memory card and $10 or so for the arduino to like $5 for an 2866 and some little pieces. Oh, and this would be wireless.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s