Thursday, May 14, 2015

OpenPanTilt electronics

It has been a while since I made the OpenPanTilt prototype. It is now available on Thingiverse:655790 and I am quite surprised about the feedback and attention it has gotten. Billions of people have now downloaded the design files (at least 430) and millions have asked me about the electronics (at least three individuals). It is about time that I provide some details. (I also plan to publish a few more time lapse videos to show this magnificent piece of equipment in action.)

The electronics consist of an Atmel ATMega328P-PU a.k.a barebones Arduino. The AVR is run on 16MHz and driven by 5V from a 7805 regulator. It can be bootloaded using something like this. Two optocouplers drives the camera (shutter and focus). I guess any optocoupler will do, but I used 4N35. Besides from a reset switch and some filtering caps here and there, thats it.

The stepper motors are driven by easydriver stepper motor drivers. I made room for three of these on the board, so it can drive a camera dolly in addition to pan and tilt.

The schematics was created in Kicad. This was my first project in Kicad, and since I was impatient, I used the autorouter in Kicad according to the instructions at Wayne and Layne.  I think the autorouter performed well for this small project.

When the board seemed fine, I created the gerber files using this guide at Toymaker Television. Notice the "mirror X-axis" when creating the drill file. Finally, I submitted the gerbers to OSH-park. The project can be found at OSH-park if you are interested.

The PCBs have excellent quality and the soldering goes like a blast.

Two Easydriver stepper motor drivers are fitted on the PCB (room for one more).

The user interface is simply a TM1638-based 8x7segment display with control buttons. It was ordered from China and can be found everywhere on the interweb. I soldered some wires going from the TM1638 PCB to my own panel mounted control buttons.

In the above picture you can see the extremely simple user interface. It works as follows:
  1. Use the buttons to pan and tilt the head to the desired start position.
  2. Press P1 (programs the start position).
  3. Use the buttons to pan and tilt the head to the desired end position.
  4. Press P2 (programs the end position).
  5. Press Start. The Pan/Tilt head will now return to the start position and will start shooting.
You can optionally press the Menu button before programming to set the interval between each step and each picture.
This is extremely easy, but it works. The display shows the number of pictures shoot and the current pan/tilt position. I choose to use a 7-segment display just because I like the old school looks of it. A 20x04 LCD with a rotary encoder would, of course, be more sensible.  

The box has connectors for 12V DC, camera (shutter and focus), Pan stepper motor, Tilt stepper motor and an auxiliary stepper motor.

Some mistakes 

I did some mistakes while building the control unit. If you want to build something similar, you should try to avoid these.

First of all, the 12V power header for the stepper drivers was was reversed on my PCB layout, meaning that the driver did not initially get any power.

Hence, I had to modify the mounting of the easydrivers a bit (notice the white wire on the above picture). No big deal, but it means that you should not order these boards from OSH-park, even if the board was selected amongst the staff picks of the week. :-)

A second error on the board is that there is no protection whatsoever on the 12V DC. No diode, no polyfuse, no fuse. Nothing. At least a diode should be placed in there, somewhere.

A third thing that I was not aware of is that the easydriver board must be connected to a load. Without a load (i.e., a stepper motor), the driver IC will burn up. Totally stupid, but I burned up two boards this way, and had to wait forever to get some new boards from Shenzhen, China. Thankfully, they are easy to replace.


Ok. Thats it. I learned a lot while building OpenPanTilt. And, best of it all, it works. If you want to build something similar, or have comments, please let me know. I know Josh Sheldon was inspired by OpenPanTilt and has developed some of the ideas further, and I must say, with impressive results.


  1. Replies
    1. I could, but there are some problems with my design (as mentioned in the article). I rather recommend you buy a kit meant for controlling a 3D-printer. You can get an arduino, LCD, stepper drivers etc for about $40. Although you only need two stepper drivers for the pan/tilt, the extra drives in such a kit can be handy. Example:

  2. Hello can you share the Arduino code?
    Im Brazilian and here this type of information is much difficult to obtain.


    1. I would not recommend this design for others. As mentioned above, I recommend buying a RAMPS-kit, and start out with arduino-code for that. Look at this:

  3. There are actually a lot of particulars like that to take into consideration. That could be a nice level to deliver up. I supply the thoughts above as general inspiration but clearly there are questions just like the one you bring up the place a very powerful factor will likely be working in honest good faith. I don?t know if best practices have emerged round issues like that, however I am sure that your job is clearly identified as a fair game. Each girls and boys really feel the impact of just a moment’s pleasure, for the rest of their lives. electronics quality control

  4. hi, i need the stl gears and worm gear for make one. do you have it somewhere?

  5. how i install the rotating part of the bottom box?