2-Axis Pan-Tilt Camera Module

From Waveshare Wiki
Jump to: navigation, search
2-Axis Pan-Tilt Camera Module
2-Axis Pan-Tilt Camera Module.jpg

I2C, UART, TTL Buse Servo Control Interface
2-DOF Pan-Tilt Camera





The pan-tilt camera module adopts high-torque 2-DOF bus servos, achieving a wide range of rotation in both the horizontal PAN axis (±180°, total range of 360°) and the vertical TILT axis (-45° to 90°, total range of 135°), significantly broadening the coverage area of the camera.
Based on a universal robot driver board, it seamlessly integrates with Raspberry Pi 4B/5, offering enhanced hardware flexibility. An open-source WEB control demo allows users to effortlessly control the pan-tilt via Google Chrome, enabling adjustments in the pan-tilt's orientation and image capture functionalities. Beyond basic photography and video capabilities, this pan-tilt camera also features facial and motion detection, delivering a more intelligent and precise monitoring experience. Not only are the pan-tilt's slave computer demos open-sourced, but also the demos about Raspberry Pi camera functionalities, empowering users for secondary development based on their specific requirements.

Both joints adopt a high-precision bus servo direct-drive solution, equipped with 360° 12-bit magnetic encoders for angle sensing, capable of relaying joint angles, load and other information, facilitating closed-loop control. Despite utilizing compact bus servos, they achieve a maximum joint torque of 30kg.cm, ensuring seamless integration of the pan-tilt camera module into various projects. Additionally, we provide a Picatinny rail along with 1/4 screws, open-source models, and drawings, enabling users to expand and create further possibilities according to their needs.

Driver Board Specifications

  • JOINT ANGLE SENSOR: 12-bit 360° magnetic encoder
  • SERVO TORQUEZ: 30kg.cm
  • LED POWER: <1.5W
  • WEIGHT: 441g

Assembly & Configuration Guide

Note: This tutorial includes how to install Raspberry Pi and how to configure the SD card, and you need to prepare the Raspberry Pi and SD card by yourself. Please refer to the Package Content for a detailed part list.

  • Product Assembly and Configuration Video:

In the installation process of the video, there is no connection between the horizontal servo and the tilt servo. It is necessary to calibrate the servo according to the following guide before connecting.

Product Firmware Update

  • If "PT CAM Version:0.9" is displayed on the OLED screen when your product is booted, it means that the driver on the product is already a new version, and you do not need to execute this section to update the product.
  • If "PT CAM Version:0.9" is not displayed on the OLED screen when your product is booted, it means that the driver on the product is still the old version, and you need to perform this part of the content to update the product; If you need to restore factory settings, you can also do so through this section.

We offer the ESP32 download tool of pan-tilt, which allows users to quickly update the firmware or restore the product to the factory program.
1. First, use a USB cable to connect the middle USB port of the product driver board to your computer.
2. Download the ESP32 download tool of pan-tilt, decompress it, and double-click "flash_download_tool_3.9.5.exe" to open the program. After opening, two windows will pop up. What we need to operate is the UI interface of the download tool, and the other window is used as a terminal to display the working status of the download tool.
3. In the "DOWNLOAD TOOL MODE" interface, set Chip Type to "ESP32" and WorkMode to "Factory". With "Factory", the relative path is used when binary files are invoked. Therefore, users do not need to manually enter the binary file path. Click OK after selecting.
Download tool mode.png
4. In this software interface, keep the "LockSettings" checked, the right side represents that you can upload the program to 8 pan-tilts at the same time. Click "COM" and select the new COM (the new COM here is COM31); BAUD is the download speed, the higher the value, the faster the speed, and ESP32 can use up to 921600.
5. After the selection, click "START" to upload the program. After the upload is completed, "IDLE" will change to "FINISH", you can disconnect the USB connection between the driver board and the computer, use the matching 12V 5A power supply to power the product, turn on the switch on the driver board, and the robot can be controlled after the power is turned on.

Usage Guide

The slave control unit of this product is driven by ESP32 by default, communicating with the host device (such as a Raspberry Pi) via a GPIO serial or USB connection. The current host control demos provided are Raspberry Pi-based. The pan-tilt functions of the slave device demos (excluding camera-related functions) can operate independently without reliance on the host device. In the assembly and configuration guide, the Raspberry Pi communicates with the slave device via a GPIO serial connection.

Raspberry Pi WEB Usage

In this part, we will introduce how to use the product when the Raspberry Pi communicates with the slave device through GPIO headers.
Connect the configured 12V 5A power cable to the power interface of the pan-tilt, turn on the power, and it boots after powering on. After booting up, you can access the Raspberry Pi's WEB control interface by entering the Raspberry Pi's IP address followed by ":5000". For instance, if the Raspberry Pi's IP address is, you'd access it via It's important to note that the device you're using to access this interface must be in the same Local Area Nerwork(LAN) as the Raspberry Pi to successfully access it.
After accessing successfully, you can see the picture captured by the Raspberry Pi camera, and the following respectively introduces the key functions of the Raspberry Pi WEB control interface.

  • Clicking the 屏幕截图 2024-06-11 152344.png button in the center of the camera view initiates the photo-capturing function. The taken photos will be stored in the Photo Gallery module below.
  • If you click the "Record" button, it activates the video recording function. The videos captured by the camera will be stored in the Video Files module below.
  • Clicking once on the 屏幕截图 2024-06-11 152842.png button enlarges the current camera view by a factor of 1, clicking twice zooms it in by a factor of 2, and clicking a third time restores it to its original size.
  • Dragging the transparent circular button in the bottom right corner of the camera view controls the rotation of the camera pan-tilt. When using a PC with a keyboard, you can control the rotation of the pan-tilt through the classic "WASD" shortcut.
  • The square control panel below the camera view also manages the rotation of the camera pan-tilt in different directions. Clicking the "AHEAD" button restores the camera position to the set midpoint.
  • Simple Detection Type: sets the type of object detection for the camera.
    • None: no object detection is active.
    • Movtion: the detection of moving objects.
    • Faces: detection for human faces.
  • Simple Detection Reaction: sets the automatic response upon detecting an object. If there's no detected object, this function remains inactive.
    • None: no automatic response.
    • Capture: automatic photo capturing upon detection.
    • Record: automatic video recording upon detection.
  • Advance CV Funcs: sets the type of detection.
    • OBJECTS: object recognition.
    • COLOR: color recognition.
    • HAND GS: gesture recognition.
  • Head Light Ctrl: turn the LED above the camera on or off.


Photo Gallery: Stores captured photos. If multiple images are taken, clicking "View Photo Gallery Page" displays all images (the number in parentheses represents the total). Clicking on an image allows zooming in for a closer view while clicking the button in the top right corner of an image deletes it.

Video Files: Stores recorded videos. If multiple videos are recorded, clicking "View Video Files Page" displays all videos (the number in parentheses represents the total). Clicking on a video plays it, and clicking the button that appears to the right of the video deletes it.

Bus Servos Initialization Setup: Servo calibration settings. Since servo calibration is typically performed during product assembly, there might not be a need to configure settings here. However, if adjustments are necessary for servo ID or center position settings, clicking "Setting Page" allows access to the setup page to follow the steps provided.

Arduino IDE development tools


Open-source Demo


STEP Model

Driver Board Schematic


Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)