Zum Inhalt springen

WSAL16138 – Pan-Tilt HAT/en

Aus JW Tech Wiki

Documentation notice: This technical documentation was independently rewritten from an archived supplier source. Check technical details and commands against the product version and manufacturer documentation before use.

Summary

The 2-DOF Pan-Tilt HAT by Waveshare is a Raspberry Pi add-on board that controls two servos over I2C. It is suited for basic camera panning and tilting applications and ships with examples for both Raspberry Pi and Jetson Nano.

Related products at JW Tech

Technical overview

  • Operating voltage: 3.3 V / 5 V; logic level: 3.3 V
  • Controller chip: PCA9685, 12-bit resolution, 16 channels, I2C interface
  • Ambient light sensor: TSL2581FN (older revisions) or TSL25911FN (Rev2.1); I2C address 0x39
  • PCA9685 default I2C address: 0x40 (address pins tied to 0)
  • Product dimensions: approx. 56.6 x 65 mm
  • Two servo ports: S0 (tilt) and S1 (pan)
  • I2C communication uses start, stop, and acknowledge signals
  • Example code provided for Raspberry Pi and Jetson Nano

Commands and examples – verify before use: 

sudo raspi-config
sudo reboot
git clone https://github.com/WiringPi/WiringPi.git
./build debian
sudo apt-get install python3-smbus -y
wget https://files.waveshare.com/wiki/Pan-Tilt_HAT/Pan-Tilt_HAT_code.zip
unzip Pan-Tilt_HAT_code.zip
cd Pan-Tilt_HAT_code/RaspberryPi/
cd test && make clean && make && sudo ./main
cd Light_Sensor/
cd Servo_Driver/
cd bcm2835 && make clean && make && sudo ./main
cd wiringpi && make clean && make && sudo ./main
cd python && sudo python main.py
sudo apt-get install python3-bottle -y
cd web_Python/ && sudo python main.py
sudo apt-get install python3-pip
sudo pip3 install Jetson.GPIO
sudo groupadd -f -r gpio
sudo usermod -a -G gpio your_user_name

Notes and version constraints

  • Version-sensitive: the light sensor change from TSL2581FN to TSL25911FN (Rev2.1) may require software updates.
  • Test each servo's full rotation range separately before assembly to avoid jamming or overheating.
  • Jitter occurs when the target angle is below the servo's minimum physical step angle.
  • Seeing three I2C addresses during scan is expected: 0x40 (PCA9685), 0x70 (ALLCALLADR register), and 0x39 (light sensor).
  • Precise angular control is not achievable on this entry-level product.
  • bcm2835 demos are no longer recommended; prefer WiringPi and Python examples.
  • Bottle-based remote control supports Python 2 only.

Source and revision record

  • Pan-Tilt HAT - Waveshare Wiki
  • Source revision: 109694
  • Captured: 2026-08-31T03:18:30+00:00
  • SHA-256: 9415e0ad3a6f3ff5e280d3439a787934904a1e572c8aac02c5dd184c59a8aa75