
How to Build a Pan-Tilt Camera with ESP32-CAM Servos
Build a pan-tilt camera with an ESP32-CAM board and two micro servos. One servo pans the camera left and right, and one tilts it up and down. A PIR sensor wakes the camera when motion crosses its 7m range. The ESP32-S3-CAM board costs $11.97 and carries 16MB of flash and 8MB of PSRAM.
Quick facts
| Fact | Value |
|---|---|
| ESP32-S3-CAM board | $11.97, 16MB flash, 8MB PSRAM |
| ESP32-CAM board | $25.99, OV2640 camera, 4MB PSRAM |
| Pan and tilt servos | SG92R, 2.5 kg/cm at 4.8V, $8.00 |
| PIR sensor | Up to 7m range, 0.3 to 18 sec delay, $7.62 |
| Camera options | OV2640 2MP or OV5640 5MP |
| Servo horn set | $8.37, 4-point aluminum 2-pack |
Which board fits a pan-tilt camera?
The ESP32-S3-CAM suits a new build with more memory. It carries 16MB of flash and 8MB of PSRAM for $11.97 as a board only.
The ESP32-CAM suits a simple build with a fixed camera. It costs $25.99 with an OV2640 camera module and 4MB of PSRAM.
Pick the OV5640 5MP camera for sharper stills. Pick the OV2640 2MP camera for faster video streaming.
Which micro servos move a small camera?
A camera board weighs little, so a micro servo has torque to spare. The SG92R gives 2.5 kg/cm at 4.8V and costs $8.00.
Use one SG92R for pan and one for tilt. Both servos center the same way, so one test routine covers the pair.
Fit a 4-point aluminum horn on each servo spline. The $8.37 set is a 2-pack with a ball link for the camera plate.
How do you wire servos to the ESP32-CAM?
Wire each servo signal lead to a free GPIO pin on the board. The ESP32 LEDC driver gives 16 PWM channels for servo control.
Power the servos from a 5V to 6V supply, not from the board. A camera board cannot feed two servos under load.
Join the grounds of the servo supply and the board. A missing common ground makes servos jitter and ignore commands.
How does the PIR sensor trigger the camera?
The HC-SR501 PIR sensor watches for body heat in its cone. It sees motion up to 7m away inside a cone under 120 degrees.
It runs on 5V to 20V and holds its output for 0.3 to 18 sec. Set a short delay for stills and a long delay for video.
Wire its output to a GPIO pin and wake the camera on a rising edge. The 2-pack costs $7.62, so keep one spare in the parts box.
How do you test pan and tilt travel?
Center both servos before you fit the camera plate. A servo that starts off center loses travel on one side.
Move the pan servo through its full range and watch the camera. It should sweep smooth with no binding at either end.
Set software limits just inside the hard stops. A servo that pushes against a stop will draw stall current and heat up.
How the options compare
| Part | Role | Key spec | Price |
|---|---|---|---|
| ESP32-S3-CAM board | Camera controller | 16MB flash, 8MB PSRAM | $11.97 |
| ESP32-CAM board | Camera controller | OV2640 camera, 4MB PSRAM | $25.99 |
| SG92R servo | Pan and tilt | 2.5 kg/cm at 4.8V | $8.00 |
| PIR sensor | Motion trigger | Up to 7m range | $7.62 |
| 4-point horn set | Camera plate link | Aluminum 2-pack | $8.37 |
How do you build the pan-tilt camera?
- Center both SG92R servos and fit their horns at 90 degrees.
- Mount the pan servo to the base and the tilt servo to the plate.
- Wire the servo signals to free GPIO pins on the board.
- Connect the servos to a 5V to 6V supply with a common ground.
- Wire the PIR sensor output to a GPIO pin.
- Load the camera sketch and test pan, tilt, and motion trigger.
Parts that fit this guide
In-stock parts ship from the New York, USA warehouse in 1-2 business days. Prices below are the live store prices we verified on November 10, 2026.
ESP32-S3-CAM Development Board N16R8 – Board, OV2640 or OV5640 Camera, 1/5/10-Pack ($11.97)
ESP32-S3-CAM board at $11.97 for the board only. It carries 16MB of flash and 8MB of PSRAM.
ESP32-CAM Development Board with OV2640 Camera Module, 4MB PSRAM ($25.99)
ESP32-CAM board at $25.99. It ships with an OV2640 camera module and 4MB of PSRAM.
SG92R Analog Plastic Composite Gear Micro Servo ($8.00)
Micro servo at $8.00. It gives 2.5 kg/cm of torque at 4.8V for pan and tilt.
HC-SR501 PIR Motion Sensor Module, 2-Pack ($7.62)
PIR sensor at $7.62. It is a 2-pack that sees motion up to 7m away.
4-Point Aluminum Servo Arm Horn Set with Rudder Angle Ball Link, RC Aircraft, 2-Pack ($8.37)
Aluminum horn set at $8.37. It is a 2-pack with a ball link for the camera plate.
Shop the full range: ESP32 and ESP8266 at Quality RC Parts. See also: Related guide.
Frequently asked questions
Do I need two servos for a pan-tilt camera?
Yes. One servo pans the camera left and right, and one tilts it up and down.
Which ESP32-CAM board should I pick?
Pick the ESP32-S3-CAM for more memory at $11.97. Pick the ESP32-CAM for a simple build at $25.99 with camera included.
How far does the PIR sensor see?
Up to 7m inside a cone under 120 degrees. Mount it where the subject crosses the cone, not where it walks straight at it.
Can I power the servos from the ESP32-CAM board?
No. Power them from a separate 5V to 6V supply with a common ground, or the servos will brown out the board.
Sources
Last updated: November 10, 2026.
