Hardware: ESP32 Cam
Author: DJ Sures
This firmware converts a ESP32 Cam into an EZB for ARC to connect to it.
This firmware turns an ESP32-CAM into a Wi-Fi EZB-compatible controller that can run Synthiam ARC peripheral control and drive up to 16 PWM/servo channels through an attached PCA9685 breakout board - while still supporting live camera streaming from the onboard OV2640.
It’s designed for robots that need vision + 16 servo outputs without upgrading to a larger controller board.
What the Firmware Provides
- EZB Compatibility (Peripheral Controller) The ESP32 accepts ARC control commands and behaves like an EZB-compatible controller for common robotics tasks such as:
- servo position commands
- PWM output control
- digital on/off ports
- UART expansion passthrough (Serial2)
ARC can connect and send commands exactly like it would to an EZB style controller.
Integrated Camera Streaming The firmware initializes the ESP32 camera driver and streams JPEG frames to ARC over a dedicated TCP connection. This provides live video feedback in ARC while the controller side remains responsive.
PCA9685 Expansion for 16 Channels Instead of using ESP32 GPIO for servo timing, this firmware uses an Adafruit PCA9685 PWM servo Driver over I2C. That means:
- ARC ports D0 to D15 map directly to PCA channels 0 to 15
- servo timing stays stable even while Wi-Fi and camera streaming are active
- you get more usable servo outputs than most ESP32-CAM boards can provide natively
- Simultaneous Operation Camera streaming and EZB command handling run side-by-side. The ESP32 can:
- stream video continuously
- accept and execute servo/digital/PWM commands
- keep TCP connections alive for both ARC control + camera streaming
Required Hardware
To use the expanded servo/digital output capability, you’ll need:
- an ESP32 camera module supported by the firmware
- a PCA9685 board (commonly the Adafruit-compatible 16-channel PWM driver)
The PCA9685’s servo power rail is not intended to be powered by the ESP32-CAM. Use a dedicated servo supply and share ground.
Supported ESP32 Camera Boards
This firmware includes camera model pin maps for many ESP32 camera variants, including:
- CAMERA_MODEL_AI_THINKER
- CAMERA_MODEL_WROVER_KIT
- CAMERA_MODEL_ESP_EYE
- CAMERA_MODEL_M5STACK_PSRAM
- CAMERA_MODEL_M5STACK_V2_PSRAM
- CAMERA_MODEL_M5STACK_WIDE
- CAMERA_MODEL_M5STACK_ESP32CAM
- CAMERA_MODEL_M5STACK_UNITCAM
- CAMERA_MODEL_M5STACK_CAMS3_UNIT
- CAMERA_MODEL_TTGO_T_JOURNAL
- CAMERA_MODEL_XIAO_ESP32S3
- CAMERA_MODEL_ESP32_CAM_BOARD
- CAMERA_MODEL_ESP32S3_CAM_LCD
- CAMERA_MODEL_ESP32S2_CAM_BOARD
- CAMERA_MODEL_ESP32S3_EYE
- CAMERA_MODEL_DFRobot_FireBeetle2_ESP32S3
- CAMERA_MODEL_DFRobot_Romeo_ESP32S3
Only enable one camera model at a time. A mismatched model typically causes camera init failures or empty frames.
How ARC Port Mapping Works in This Firmware
This firmware’s "mapping" is intentionally simple and consistent:
PCA Channels
ARC ports D0 to D15 map to PCA9685 channels 0 to 15
these channels can be treated as:
- servos (position 0 - 180)
- PWM percent (0 - 100)
- digital on/off (full off / full on)
digital ports are write only. The read option will simply read the cached value of the last state. This is a limitation of the PCA9685.
Because PCA9685 is external hardware, you don’t need to fight ESP32-CAM GPIO limitations to get stable outputs.
ADC Inputs
ADC reads are currently stubbed (returns 0) in the shown firmware due to the PCA9685 not having ADC input pins. It is a write-only PWM module.
Network Behavior
The firmware runs two TCP servers:
- Port 23: EZB compatible command/control channel
- Port 24: camera JPEG streaming channel
It also supports two Wi-Fi modes:
Access Point Mode (default in the sample)
- ESP32 creates its own Wi-Fi AP (ex:
GetOffMyLawn) - default IP is
192.168.1.1 - easiest for direct robot setup with no router required
Client Mode
- ESP32 connects to an existing Wi-Fi network
- the device IP is shown in Serial output
- useful for robots on a larger LAN
Camera Compression Auto-Management
The ESP32-CAM has limited buffer space for image payloads. This firmware includes optional dynamic JPEG compression tuning:
- checks frame sizes over a window of frames
- adjusts JPEG quality to keep frames within a target range
- reduces stalls and helps keep streaming smooth
This is especially useful when lighting changes cause frame size spikes.
Benefits of This Firmware
More servo Outputs PCA9685 provides 16 stable PWM/servo channels without relying on ESP32 PWM timers.
Stable Timing While Streaming Servo timing is offloaded to PCA hardware, so video streaming doesn’t wreck servo pulses.
All-in-One Robot Board You get camera, control, and servo expansion in one compact setup.
Simple ARC Port Model ARC sees consistent channels (0-15) that don’t change per the ESP32-CAM board layout.
Great Fit for Servo-Heavy Robots Robotic heads, arms, animatronics, pan/tilt rigs, hexapods, and any build where ESP32 pins alone aren’t enough.
Typical Use Cases
Perfect for robotics projects that need both vision and many outputs:
- humanoid heads with multiple facial servos
- pan/tilt + arm systems
- animatronic creatures
- camera rovers with extra actuators
- inspection bots with a camera + servo tools
Summary
This firmware converts an ESP32 camera module into a Synthiam ARC compatible EZB style controller with:
- live OV2640 camera streaming over TCP
- EZB compatible control channel for ARC commands
- 16-channel PCA9685 servo/PWM expansion
- AP or Client Wi-Fi operation
- optional auto JPEG compression adjustment for stable streaming
To deploy successfully:
- Select the correct
CAMERA_MODEL_*define - Set your Wi-Fi mode (AP or Client)
- Wire the PCA9685 to the configured SDA/SCL pins and confirm the address
- Flash the firmware and connect from ARC (camera + controller)
