How I built my Arduino-powered automatic pan-tilt head for shooting stitched panoramic landscapes

Tips & Techniques

Shooting multi-frame panorama photographs can be fun, and the resulting images can be striking. But once you get past a panorama that is, say, four or five frames wide, it becomes difficult to do without a tripod. And if you want a panorama that is more than one frame in height, then hand-held is nigh impossible.

There are manual panorama heads you can mount on your tripod, but using one can become a bit tedious, especially shooting a dozen or so frames. They become more onerous when you want a pano that is several rows high.

I like to shoot panos with a longer lens – an 85 or 100mm – rather than the 28 or 35mm wide-angle lens most folks use. But since the field of view is much smaller on a longer lens – a 28mm lens has approximately 3 times the field of view of an 85mm lens – the number of frames for a given pano will be many more.

So I decided to build my own automatic, motorized pano head that would do the work for me and give me repeatable frames. I had previously built an automatic focus-stacking rail for macros using an Arduino micro-controller. So I decided to also use an Arduino to control the movements of the panorama head.

The actual pano head consists of an “L” shaped bracket or arm, two servo motors, an Arduino Nano microcontroller and some software. How much it will cost to build depends solely on what parts you buy and what find in your junk drawer or on your workbench. Since I have no facilities for doing metalwork or anything other than some light wood-cutting or drilling, the design, for me, had to consist of off-the-shelf parts. This automatic panorama head can be made right at the kitchen table with nothing more than some hand tools, an electric drill, and a soldering iron.

Keep in mind that just about any part of this project can be altered or changed to your liking with the exception of the electronics. If the electronics are changed, then the program code will have to be changed.

The Pano Bracket

The bracket for the pano head is a simple L-shape with a 6.75” vertical arm and a 7.75” horizontal arm. Most any material can be used – wood, aluminum, Lucite, etc – as long as it is rigid enough for the two servos and your camera and lens. The dimensions are not critical as long as you can mount your servos and your camera fits comfortably and has room to vertically pivot.

Because I wanted this to be a “kitchen table” project, I chose to use aluminum channel and hardware from GoBilda, an engineered system of building components. The constituent pieces all have standardized dimensions and standardized hole patterns that make it easy to fit pieces together with no cutting or drilling.

I chose GoBilda’s 1120 Series U-Channel for the pano frame. Their U-channel looks somewhat like Swiss cheese with lots of holes. But the standardized hole patterns meant that drilling metal was eliminated from my task. All GoBilda components fit and bolt together. Using two corner brackets, the U-channels bolted together to form a strong L-shaped structure with a perfect 90° corner.

Servo Motors

For drive motors, I chose the GoBilda 3206 Series Servo Gearbox which uses a Hitec HS-788HB servo motor. This unit has an aluminum framework that is both the servo mount and a pillow block for the drive all in one. The servo and the U-channel have dimensions and matching bolt holes that make for an easy fit.

This servo is available with six different gear ratios. I chose the 9:1 ratio which gives me plenty of torque and a nice rotational speed. The HS-788HB is an eight turn servo so even with the gear reduction it can complete approximately 320° of a circle. The clamping hub on the output gear has threaded holes that are perfect for mounting brackets.

You can definitely use a smaller, less expensive servo than the model I chose. The one I chose is both overkill and expensive. You might even consider a servo such as the GoBilda 2000 Series Dual Mode Servo. Just know the weight of the camera and lens you plan to use and compare that to the servo’s torque rating.

Tripod & Camera Attachments

There will be no panorama until the servos can be attached to the tripod and camera.

An Arca-Swiss quick-release plate is used to connect the pano head to your tripod and an Arca-Swiss quick-release clamp is used to connect a nodal rail that mounts the camera. I used GoBilda Surface mounts which bolt directly to the servo’s output gear to connect the Arco-Swiss hardware.

Fortunately, most Arca-type QR plates are slotted and will match up with and bolt directly to the GoBilda surface mount. Bolt the surface-mount to the output gear of the servo on the horizontal arm of the pano head. The QR plate is then bolted to the surface mount.

Mounting an Arca-type quick-release clamp to the surface mount requires a bit more effort. The surface mount has a number of holes, including 2 slotted holes along the centerline, but none of these work with Arca clamps which typically mount with a centered ¼-20 screw. One way to handle this is to carefully lay out two points on the clamp that align with the slots on the surface mount. Drill and countersink these holes. Now you can attach the clamp with flathead screws and nuts.

Another method is to use the GoBilda hole-reducer. Choose the reducer with a 4mm i.d.; epoxy the reducer to the underside of the surface mount. Drill out the hole in the reducer to accept a ¼” screw. Use a ¼-20 x ⅝” screw and bring it from underneath the surface mount. Fix it in place with a nut (see photos). The Arca clamp can screw onto the surface-mount just as it would on a tripod.

Preparing and Testing the Electronics

The electronics center around an Arduino Nano which does all the necessary calculations and controls the servomotors. You can use the Arduino Uno or other Arduino models as well. I chose the Nano solely for its small size.

Wire your Nano and other electronics according to the circuit diagram. Pay careful attention to match the pin numbers on the Nano as they are referenced in the program code.

I seriously suggest you first connect everything on a solderless breadboard so you can test your circuit and adjust your servos before putting it all together in a case. Use a breadboard that has a power rail (or bus) down each side and two banks of connection points separated by a groove or gap. Mount the Nano so that it spans the gap and the pins on one side of the Nano can use one bank of connectors and the pins on the other side can use the other bank of connectors. Viewing a YouTube video or two will make it clear how to use a Nano with a solderless breadboard and jumper wires.

Once all the electronics are wired on the breadboard, you are ready to download the program and test everything.

Installing the Program Code and Testing

First, you must download the Arduino IDE, the program that is used for programming Arduino microcontrollers. You can find the IDE on the Arduino website. Open the IDE and copy the code following the steps below.

The code linked here is complete. I have tried to fully comment everything so you can follow through and understand what the code is doing. There are several comments that include “NOTE.” Each time you see this there is a value e that may be changed for your particular situation. Please review these carefully.

Note: If you are an experienced Arduino or C coder, you may well laugh at what I have created. Feel free. I am sure it lacks in efficiency and elegance.

Copy the program code into the Arduino IDE and uncomment all the debugging “Serial.print” statements by deleting the double slashes (“//“) that precede them. This will allow you to follow the program in the IDE serial monitor to make sure everything is working properly. Once you are satisfied that everything is working properly, you can either comment out the statements again or erase them completely.

Once the debugging print statements are active, load the code into the nano. After loading you should see the display light up with the message, “PANO-XY 4-BUTTON” If you see this on the display, the code loaded correctly and you should be able to go through the prompts and have the system run the panorama sequence.

Here is the step-by-step:

  1. Copy the software code and paste it in the Arduino IDE, completely erasing everything in the empty sketch.
  2. Save the new Arduino IDE sketch to your computer.
  3. Comment out the “Serial.print” statements. Once this is done, save again.
  4. Make sure no external power (AC or battery) is connected to the Nano.
  5. Connect the Nano to your computer with a USB cable.
  6. Check under the Tools menu of the IDE to be sure you have selected “Arduino Nano” as your board and you have a serial driver as your port. Click on the “Upload” button in the IDE.
  7. Once the uploading is complete the Nano is running the code.
  8. You should now be able to run the system on your breadboard with the USB cable supplying power.
  9. If you need power for your servos while testing, be sure your external power source (AC or battery) is attached only to the servos while the Nano is attached to your computer. Do not attach both the USB and external power to the Nano at the same time!

You can view the complete Arduino code here.

Installing the Electronics in a Case

When you are ready to put everything in a case, I strongly recommend making a “subfloor” for your case and mounting all your components on the subfloor. This way everything can be mounted and wired outside the case where you have good visibility and easy access. Once everything is completed, the complete assembly can be secured in the case with just a couple of bolts. I used a solderable breadboard with power rails for my subfloor.

Another tip is to make buses for the positive and negative legs of the power source. Everything requires power, and the easiest way to wire it is to use buses. Attach your power source leads – one to each bus – and then attach your components to the two buses. I added screw terminals to the power rails of my breadboard subfloor to create my positive and negative buses.

I strongly recommend you use a screw terminal shield on the Nano when you are ready to do the permanent wiring. You will have safe, secure connections that can be changed if necessary and no soldering!

Camera Shutter

The easy way to interface the pano head control with your camera is to buy a remote shutter cable for your particular camera. Open the switch end of the cable and you should see three wires – common; autofocus; and shutter. Determine which wire is for the shutter. The common and shutter wires will be wired to the relay. The autofocus wire be trimmed off – you don’t want autofocus with a panorama. The shutter will fire every time the relay engages. You might want to add a connector to the control box so you disconnect the cable if you wish.

DC Power Supply

The power required will be determined by the servos you use. With the large servos I chose, I needed 7.5 volts. I used a case that holds 6 AAA batteries (9 volts). I jumpered one of the battery bays (soldered a wire from the positive end to the negative end) so that I could use just 5 batteries for my needed 7.5 volts (see photo). I used a barrel connector to connect the battery case to the control box. Velcro was used to attach the battery case to the control box.

Servo Adjustment

If you look near the beginning of the code, you will see a section titled “Servo
Variables.” Servos vary, and the default settings (1000, 1500, & 2000
microseconds) in the servo library that the code uses are, at best, guidelines. You
can see in the code that the settings for my two servos are different from both the
default and from each other. You will have to do a bit of trial-and-error work to
find the 0° and 180° positions for each of your servos.

Parts List

My parts list pretty much assumes you have absolutely nothing in your junk drawer or on your workbench. It also assumes the building of a pano head exactly like mine. Using bits and pieces you might have around is perfectly okay. The requisite electronics are starred; all the other items are suggestions.

You can download the complete parts list here.

The Controls

The first iteration of the pano head used a 4 x 4 keypad and a 4-line display to input information. Although this worked well, it was way too big and ungainly, requiring a control box that was 6.5” x 6.5” x 4.5”. I redesigned the system to use a 2-line display and 4 buttons. The new control box is just 4.5” x 2.5’ x 2”.

When you are ready to take a pano you will go through a series of prompts on the display to input the information needed. Simply follow the prompts on the display using the buttons as arrow keys and just scroll to the input values you desire.

First, will be the focal length of the lens you are using. Second, will be the desired width of the pano in degrees. Third, is the number of rows you wish for the image. Finally will be whether the camera is in portrait or landscape orientation. The micro-controller will calculate the frame size and the number of frames needed to complete the panorama. It will then move the camera through the sequence taking a picture at every frame.

Taking a Panorama

To make a panorama, follow the prompts and enter the lens focal length, the width of the pano in degrees, how many rows are wanted, and whether the camera is in landscape or portrait mode. The electronics then calculate how much the camera will move between images, how many images are required, the aspect ratio of the final pano, & the approximate time to complete. Then it will go about taking the photos while you enjoy a refreshing beverage.

Step-by-Step

  1. Power up the pano head so the camera arm moves into position, then mount your camera.
  2. Aim your camera at the center of the desired panorama. Put your camera into manual mode, including focus. Since you will be taking a series of images, you want them all to be same. In manual mode everything will stay the same from image to image. Adjust the camera settings and focus for your image.
  3. To make a panorama, follow the prompts on the display and enter the lens focal length, the width of the pano in degrees, how many rows high you want it, and whether the camera is in landscape of portrait mode.
  4. The microcontroller calculates how many images are required, the aspect ratio of the final pano, and the approximate time to complete. The pano head will then go about taking the photos while you relax with a refreshing beverage.

Finally…

I hope you find this project fun to complete, and you enjoy taking panorama photos with your new automatic pano head.

About the Author

Don Simmons is a Texas-based retired mathematics teacher who pursues photography as a hobby. His tastes are eclectic, but he enjoys taking pictures of all sorts of things, but particularly in black and white. You can find out more about Don and see his work on his website.

Products You May Like

Articles You May Like

Rode’s New VideoMicro II is Totally Redesigned for Better Performance
Sony Will Supply Apple with ‘Advanced’ Image Sensor for the Next iPhone
Fujifilm Warns Its 35mm Films in Short Supply ‘for the Time Being’
Lomography Leather Wraps Three LC-A Film Cameras for a Limited Run
AstrHori releases pictures and specs of upcoming 105mm f/2.8 tilt-shift macro lens

Leave a Reply

Your email address will not be published. Required fields are marked *