Assembling the Pan-Tilt HAT

Christopher J Caldarella
9 min readJun 12, 2021

Assembly steps of this Pimoroni device for use with the Raspberry Pi

Pimoroni Pan-Tilt-HAT assembled

I ordered the Pimoroni Pan-Tilt-HAT (from Amazon.com) and had to assemble it before attaching it to my Raspberry Pi. Continue reading for the process I followed — with pictures!

This post is loosely adapted from the Pimoroni instructions found here. I created these instructions because I wanted a guide with more pictures, but I could not find one.

The Tools:

The tools I needed for this process:

  • 1x pair wire snips (to trim the nylon M2 bolts)
  • 1x Flat-head precision screwdriver (the type for PC repairs, etc.)

The Parts:

The box of parts for this device included:

  • 1x PCB board
  • 1x Pan-Tilt Mechanism (pre-assembled with 2 servos, pan and tilt)
  • 4x Plastic (nylon M2) bolts, black
  • 4x Plastic (nylon M2) nuts, black
  • 4x Plastic (nylon M2) bolts, white/clear
  • 6x Plastic (nylon M2) nuts, white/clear
  • 1x Plastic mount for LED lights, white/clear
Pan-Tilt-HAT parts
Pimoroni Pan-Tilt-HAT parts

More Parts

  • 1x Raspberry Pi
  • 1x Camera for the Raspberry Pi (I used the Module V2)
  • 12" Flex Cable for Raspberry Pi Camera or Display (OPTIONAL)
  • Any other parts you may need for your Raspberry Pi
CanaKit Raspberry Pi 4 8GB with the Pan-Tilt-HAT

Please note that this guide will not cover affixing the light attachment since it did not come in the box with this package.

Also note that not all Raspberry Pi Cameras are compatible with all Raspberry Pis. Please do your research and make sure that what you have will work together.

Alright! Find a comfortable, well-lit, clean surface to begin and let’s go!

Step 1: Affix the Pan-Tilt mechanism to the PCB board

What you will need:

  • 1x PCB board
  • 1x Pan-Tilt Mechanism
  • 4x Plastic (nylon M2) bolts, black
  • 4x Plastic (nylon M2) nuts, black
  • 1x pair wire snips (Optional)
  • 1x Flat-head precision screwdriver

Using the set of black bolts and nuts, we want to bolt this piece:

Figure 1.1

Onto this piece:

Figure 1.2

We want to place the Pan-Tilt mechanism, as shown above, onto the PCB Board, also as shown above.

You can see the base of the mechanism is not centered and sits a bit to the right in the picture above. We want that part to be close the holes labeled “SERVO CABLES” on the PCB board, since that is exactly where they will be going eventually. Like so:

Figure 1.3

You can thread the bolts from the top, but I found it easier to push the bolts up through the bottom. Note that if you push the bolts down from the top you will need to trim the bolts at some point so it can sit properly on your Raspberry Pi.

Figure1.4

Once that is done, now would be a good time to thread the servos cables through the aptly named gap in the board that says “SERVO CABLES” (as seen in Figure 1.2 and also in Figure 1.3). Your Pan-Tilt-HAT should look like the below picture (Figure 1.5).

Figure 1.5

Note that there are preferences of where to put the top servo cable. I like to tuck mine underneath the servo, but it seems others like to put it off to the side. Use one of these ways, or find your own way to do this!

Step 2: Connect the Servos cables to the PCB board

What you will need:

  • 1x PCB board
  • 1x Pan-Tilt Mechanism (pre-assembled with 2 servos, pan and tilt)

If you have not already, thread the servos cables through the PCB board so we can connect them as shown in the previous step. Take care to keep track of which cable goes to which servo.

Here is a picture of the bottom of the PCB again. Notice the three sets of three pins each, and two of them are labeled SERVO1 and SERVO2:

Figure 2.1

We will want to connect the Pan-servo cable to the “SERVO1” pins, and the Tilt-servo cable to the “SERVO2” pins. Here is a picture of the Pan-servo connected:

Figure 2.2

Before going on, now may be a good time to explicitly identify each servo.

  • The servo at the base moves the Pan-Tilt mechanism from side to side or in a horizontal motion; that is the Pan-servo, or SERVO 1.
  • The servo above the Pan servo moves the Pan-Tilt mechanism in an up or down or vertical motion; that is the-Tilt servo, or SERVO 2.
Figure 2.3

Once the servos cables are connected to the PCB, it should look like this:

Figure 2.4

Step 3: OPTIONAL: Swap the Camera cable

What you will need:

  • 12" Flex Cable for Raspberry Pi Camera or Display

If you have the flex cable for the Pi Camera or just want to swap it out, continue on. Otherwise, go onto Step 4.

I thought this piece of equipment was a good idea to implement since the camera will be moving, I wanted something that could hold up to more wear and tear.

On the back of your camera is a ribbon wire going into a metal part with a black piece of plastic on the outer edge. This part makes contact between the ribbon wire and the pins inside that metal piece.

Figure 3.1

Gently grasp the two ends of the plastic piece and pull it away from the camera module to open the clasp. It may need some force, and that is ok, just as long as it is gentle — we do not want to damage the cable or camera module. This is what it looks like when it is open:

Figure 3.2

Before removing the cable, carefully note which side the exposed wire is on. Generally, the exposed wires will face the PCB. Pull the cable out, and place the new cable in its place. Make sure to the exposed wire is facing the right way.

Figure 3.3

And gently close the clasp.

Figure 3.4

Step 4: Affix the Camera to the Mounting Plate

What you will need:

  • 1x PCB board with Pan-Tilt Mechanism attached
  • 2x Plastic (nylon M2) bolts, white
  • 2x Plastic (nylon M2) nuts, white
  • 1x pair wire snips
  • 1x Camera for the Raspberry Pi

There are two very similar black acrylic mounting plates. Both sit on top of the camera module; However one sits directly on the camera module while the other sits on top of both. They are not labelled so I will do so in this picture.

Figure 4.1

Note that if your camera has a protective film on the lens, now would be a good time to remove it. After this step it will be difficult to reach in and pull off that protective film.

Figure 4.2

Place the plate with the “T”-shape cutout directly on top of the front of the camera module. Note that the ribbon is protruding from the side with the rounded corners.

Figure 4.3

Now place the top mount over the bottom mount. That is, the two mounting plates are stacked on top of each other, with the camera module at the bottom.

Figure 4.4

Thread the two nylon bolts through the two middle-holes from the front.

Figure 4.5

On the back, affix the nuts to the bolts like so.

Figure 4.6

Using the wire-snips trim off the excess nylon bolt from the back to ensure proper fitting when attaching to the Pan-Tilt-Hat mechanism.

Figure 4.7

Step 5: Affix the Camera to the Pan-Tilt mechanism

What you will need:

  • 1x PCB board with Pan-Tilt Mechanism attached
  • 1x Camera for the Raspberry Pi with ribbon cable

Pass the camera ribbon cable through the slot on the Pan-Tilt-HAT PCB labeled “CAM CABLE”.

Figure 5.1
Figure 5.2

Find the tabs on the “Tilt” part of the mechanism. The camera mounting plates will fit snugly between these two tabs.

Figure 5.3

Gently push the camera in place until the tabs snap shut around the mounting plate. Per Pimoroni, the camera ribbon should be coming from the top of the module.

Figure 5.4

Note that the orientation of the camera will likely require flipping your image. If you plan on using Pimoroni’s python applications to move your camera, they already account for this, and it is typically one line of code to account for this.

If you find that you need it orient your camera the other way, you can gently push the tabs apart and pull the camera module out, rotate it, and snap it back in (right-side-up). I was able to do so very easily with just my hands. It is doubtful this will be necessary, but I wanted to mention this.

This is as far as the Pimoroni instructions go, so this is where I will leave off.

Perhaps in the future I will add a part about attaching the PCB to the Raspberry Pi. However, I will show my pictures of the process. Good luck!

Step 6: Getting your Raspberry Pi ready with Heatsinks

What you will need:

  • 1x Raspberry Pi
Figure 6.1
Figure 6.2
Figure 6.3
Figure 6.4
Figure 6.5
Figure 6.6

NOTE: I think I actually had to remove one of the Heatsinks to fit the Pan-Tilt-HAT properly (I think it was the middle one). Please keep that in mind for this section.

Step 7: Attaching your Camera

What you will need:

  • 1x Raspberry Pi
  • 1x Assembled Pan-Tilt-Hat with attached Camera Module

Similar to Step 3.

Figure 7.1
Figure 7.2
Figure 7.3
Figure 7.4

Step 8: Attaching your Pan-Tilt-HAT mechanism

What you will need:

  • 1x Raspberry Pi
  • 1x Assembled Pan-Tilt-Hat with attached Camera Module
Figure 8.1
Figure 8.2

Note that the Heatsink in this picture was the one I removed earlier. I am only using it here for a better angle to take these pictures.

Conclusion

I hope this was helpful. I plan to go back and write instructions for Steps 7 and 8 at a later time, but for now the pictures should be helpful enough.

Please check out my GitHub for some code that I wrote to help maneuver the Pan-Tilt-Hat. It is integrated with my Face-Tracker project at the moment, but I hope to make a separate project and blog post about using Pimoroni’s pantilthat software and/or Pimoroni’s PanTiltFacetracker.

--

--

Christopher J Caldarella

My name is Chris and I have just started my journey with Data Science with a Bootcamp through General Assembly. I will briefly be writing about that.