ESP32 Cam EZB
Hardware: ESP32 Cam
Author: DJ Sures
This firmware converts a ESP32 Cam into an EZB for ARC to connect to it.
This firmware transforms an ESP32-based camera module into a full EZ-B-compatible controller with integrated Synthiam ARC video streaming. It enables the ESP32 to function simultaneously as a real-time camera and as a robotics/IoT peripheral controller - all in one compact board.
What the Firmware Provides
EZ-B Compatibility The ESP32 accepts ARC control commands and behaves like an EZ-B, allowing servo motors, digital outputs, ultrasonic sensors, and other peripherals to be controlled directly from Synthiam ARC.
Integrated Camera Streaming The onboard OV2640 camera streams JPEG video to ARC, providing live visual feedback alongside actuator control.
Simultaneous Operation Camera streaming and peripheral control run together, making the ESP32 ideal for robotics scenarios where vision and control must happen at the same time.
Supported ESP32 Camera Boards
This firmware includes camera model definitions for many common modules, including variants of classic AI-Thinker style boards, M5Stack units, and ESP32-S2/S3 models with cameras.
Supported models include:
- 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 one camera model should be enabled in the firmware at a time. A mismatched model typically results in "frame size = 0" or initialization errors.
Understanding GPIO Mapping (Very Important)
Different ESP32 camera boards have:
- different exposed header pins
- different analog capabilities
- different LEDC PWM support
- pins occupied by the camera bus (XCLK, PCLK, VSYNC, HREF, SDA/SCL, etc.)
- differences between ESP32, ESP32-S2, ESP32-S3 variants
Because of this, ARC’s servo and digital port numbers do NOT directly match ESP32 pin numbers. To solve that, the firmware uses mapping tables that translate between:
ARC Dx -> ESP32 GPIO
ARC ADCx -> ESP32 ADC-capable GPIO
This mapping layer exists so that:
ARC always sees consistent "Dx" ports (0-23) regardless of hardware Camera-critical pins are never accidentally used for servos or digital outputs Different ESP32 board layouts remain compatible by changing only one mapping section Servos and ultrasonic sensors can be placed only on pins capable of PWM or input capture Project code in ARC remains portable across ESP32 models
Editing the Mapping for Your ESP32 Module
You must customize the mapping arrays to reflect the physical pins on the ESP32 camera board you are using. This is the only hardware-specific part of the firmware.
This is how ARC ports and ESP32 parts are mapped. In the example below, ARC D0 is mapped to ESP32 port #2. Example of the concept for WRover with Cam:
const uint8_t ARC_TO_ESP_DIGITAL_PIN_MAPPING[24] = {
2, // ARC port D0
4, // ARC port D1
13, // ARC port D2
14, // ARC port D3
15, // ARC port D4
12, // ARC port D5
0xff, // ARC port D6 (not used)
0xff, // ARC port D7 (not used)
0xff, // ARC port D8 (not used)
0xff, // ARC port D9 (not used)
0xff, // ARC port D10 (not used)
0xff, // ARC port D11 (not used)
0xff, // ARC port D12 (not used)
0xff, // ARC port D13 (not used)
0xff, // ARC port D14 (not used)
0xff, // ARC port D15 (not used)
0xff, // ARC port D16 (not used)
0xff, // ARC port D17 (not used)
0xff, // ARC port D18 (not used)
0xff, // ARC port D19 (not used)
0xff, // ARC port D20 (not used)
0xff, // ARC port D21 (not used)
0xff, // ARC port D22 (not used)
0xff // ARC port D23 (not used)
};
const uint8_t ARC_TO_ESP_SERVO_PIN_MAPPING[24] = {
2, // ARC port D0 (servo)
4, // ARC port D1 (servo)
13, // ARC port D2 (servo)
14, // ARC port D3 (servo)
15, // ARC port D4 (servo)
12, // ARC port D5 (servo)
0xff, // ARC port D6 (not used for servo)
0xff, // ARC port D7 (not used for servo)
0xff, // ARC port D8 (not used for servo)
0xff, // ARC port D9 (not used for servo)
0xff, // ARC port D10 (not used for servo)
0xff, // ARC port D11 (not used for servo)
0xff, // ARC port D12 (not used for servo)
0xff, // ARC port D13 (not used for servo)
0xff, // ARC port D14 (not used for servo)
0xff, // ARC port D15 (not used for servo)
0xff, // ARC port D16 (not used for servo)
0xff, // ARC port D17 (not used for servo)
0xff, // ARC port D18 (not used for servo)
0xff, // ARC port D19 (not used for servo)
0xff, // ARC port D20 (not used for servo)
0xff, // ARC port D21 (not used for servo)
0xff, // ARC port D22 (not used for servo)
0xff // ARC port D23 (not used for servo)
};
const uint8_t ARC_TO_ESP_ADC_PIN_MAPPING[8] = {
0xff, // ARC port ADC0 (not mapped)
0xff, // ARC port ADC1 (not mapped)
0xff, // ARC port ADC2 (not mapped)
0xff, // ARC port ADC3 (not mapped)
0xff, // ARC port ADC4 (not mapped)
0xff, // ARC port ADC5 (not mapped)
0xff, // ARC port ADC6 (not mapped)
0xff // ARC port ADC7 (not mapped)
};
Where:
0xFF= not available- Valid range = 0-23 for digital/servo and 0-7 for ADC
This means ARC’s D0...D23 and ADC0...ADC7 stay consistent in software, even though the underlying ESP hardware changes.
How the Firmware Uses the Mapping
Once configured, ARC can:
Peripheral Control
- Move servos
- Turn digital outputs on/off
- Drive PWM
- Read ultrasonic distance
- Poll analog inputs (if available)
Camera Streaming
- Send JPEG frames via TCP
- Auto-adjust compression based on frame size to prevent buffering issues
Resource Management
- Reserves LEDC timer channels so servo PWM can’t break camera clock timing
- Manages Wi-Fi event handling for both AP and STA modes
Benefits of This System
Portable Projects ARC projects don’t need to change when switching ESP32 boards - only the mapping tables change.
Camera Safety Prevents servos from attaching to camera data lines and causing frame failures.
Better Hardware Compatibility Works with ESP32, ESP32-S2, and ESP32-S3 camera variants.
All-in-One Hardware Eliminates the need for a separate EZ-B and camera module.
Cost Effective Uses low-cost ESP32 hardware for high-level robotics and IoT tasks.
Typical Use Case
Perfect for robots or IoT devices needing combined vision + control, such as:
- FPV robotic rovers
- Robotic arms with camera feedback
- Pan/tilt camera turrets
- Home automation with visual monitoring
- Remote inspection robots
Summary
This firmware turns an ESP32 camera module into an ARC-compatible EZ-B controller with live video, servo outputs, digital I/O, ultrasonic measurement, and optional ADC support.
To deploy successfully you must:
- Select the correct CAMERA_MODEL_* define.
- Edit the mapping tables to match your ESP32 board’s GPIO.
- Flash the firmware and connect through Synthiam ARC.
Once mapped, the ESP32 behaves like a compact, Wi-Fi enabled, vision-equipped EZ-B controller ready for robotics and IoT applications.

The Esp32 cam works well
I purchased these
https://www.amazon.com/Aideepen-ESP32-CAM-Bluetooth-ESP32-CAM-MB-Arduino/dp/B08P2578LV/ref=sr_1_6?dchild=1&keywords=ESP32+Cam&qid=1612713883&sr=8-6
or this one?
https://www.amazon.com/dp/B07T1PG77D/ref=sspa_dk_detail_3?psc=1&pd_rd_i=B07T1PG77D&pd_rd_w=E1WJy&pf_rd_p=b34bfa80-68f6-4e86-a996-32f7afe08deb&pd_rd_wg=YAkSn&pf_rd_r=PGR8XDK65KGFB9GTT6XD&pd_rd_r=5f34e09f-5d40-4ed7-9d3e-7014da233f8f&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExV0pIRDhSTFhXRE4wJmVuY3J5cHRlZElkPUEwNjA2NjI4MjFaTkNNMlczMTZQMCZlbmNyeXB0ZWRBZElkPUEwMDgyOTgwMklWSU9FSjdHUllGSSZ3aWRnZXROYW1lPXNwX2RldGFpbCZhY3Rpb249Y2xpY2tSZWRpcmVjdCZkb05vdExvZ0NsaWNrPXRydWU=
It's not really a good cam at all. Bought one that was a great deal (less then $5.00 from Aliexpress) about 6 months back. Couldn't get it to focus right, thought it was bad so purchased just another camera, less the ESP32, same thing. It's ok if you want to use it for a stationary shot but terrible on anything that moves. I found it to be a great cam to monitor my 3D printer over my phone. If the focus is not good you can cut the small glue mark that's around the lens and then turn the lens to focus on the spot you need. If that makes sense?
Mr. Herr Ball
I got it to work well
look like it works good here https://youtu.be/visj0KE5VtY
I agree not brilliant camera but it is very small, self contained, wireless and all you need to provide is power. Good enough for Computer vision and object tracking (what I need it for). If we can also use the GPIO pins to control servo's or read sensors even better and you connect direct to It just like an EZB.
I plan to have 4 of these on my robot 1 inside each hand (So I can identify objects, orientate to the alignment of that object and position hand to grab that object based on orientation. Also plan to put some on feet to know when am about to trip and fall, align to kick a ball etc.
The ezb mode does use gpio for digital and servos. every esp uses different pins for the camera, making it non-standard across different versions. Like all open source and low cost items like this, there’s no standard for us to implement. You’ll need to check the camera pinout file to see what pins are being used by the camera.
additionally, the gpio numbers relate to ARC Dx ports. So look at the diagram on the hardware page and those "should" work. But again, there’s no standard across esp32 cam versions.
You’d need to...
look at the hardware page and the pinout diagram: https://synthiam.com/Support/Hardware/ESP32-Cam
check in the firmware what type of camera you’re using (the #define statement that’s uncommented that works for you)
use that type of camera to look at the camera pinout file included in the firmware and compare which pins are being used for the camera
For the Ai Thinker it looks like I need to brush up on my soldering skills as they decided to put the pins used by the camera on the header and not the free pins. https://github.com/raphaelbs/esp32-cam-ai-thinker/blob/master/docs/esp32cam-pin-notes.md You can still get access to the pins directly on the main board but this could be a bit of a nightmare. If I can't find 5 free pins I wonder if I can add a small ATTiny using serial connection back to ESP32-CAM https://embedded-lab.com/blog/wp-content/uploads/2015/12/8048281449822227147.jpg
Wow that’s a poor design LOL. In the words of AVGN... "what were they thinking?!"
Reading the forums others have been tackling this problem.
apparently, have not tested yet, GPIO0 is only used for enabling flashing firmware l, So this is free.
You can use TX & RX and this gives you GPIO 1 & 3
Put SD card in 1 bit mode with command SD_MMC.begin("/sdcard", true) This gives access to 12 &13
You can use GPIO 4 but flash still goes off when you use it.
So this should free GPIO0, GPIO1, GPIO3, GPIO12, GPIO13 and GPIO4 flashing camera light when using.
https://www.esp32.com/viewtopic.php?t=13141
https://esp32.com/viewtopic.php?t=11471