ESP32 Cam

ESP32 Cam EZB

ESP32 Cam

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

  1. 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.

  2. Integrated Camera Streaming The onboard OV2640 camera streams JPEG video to ARC, providing live visual feedback alongside actuator control.

  3. 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:

  1. Select the correct CAMERA_MODEL_* define.
  2. Edit the mapping tables to match your ESP32 board’s GPIO.
  3. 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.

Firmware Versions

Download
  • Added a verification in the Setup() to check if there's a conflict between any camera pins and ARC_ESP32 mapping pins. The Digital, Servo, and ADC pins cannot be the same as those used in the Camera, otherwise there will be a peripheral conflict. The firmware will display a looping error message in the serial monitor if there is a pin conflict.

You have two options to resolve a conflict, but first, make sure you have selected the board settings that match your board.

Here are your options to rectify a pin conflict...

  1. View the datasheet/schematic or pinouts of the PCB and look for PINs that do not conflict with those listed for your module in camera_pins.h. Replace the conflicting PINs with the PINs you would like to use instead. For example, if pin #4 conflicts with servo or DIGITAL pin mapping, change it to a pin that is not already in use and available on the PCB.

  2. Remove the entry entirely by moving every pin value up and adding a 0xff at the end. There must always be 24 entries.

  3. If you don't care about organizing anything, replace the value with 0xff, and that ARC Dx pin will not do anything. But,  you'll end up with a value in the middle of your port range that doesn't do anything, which might be kinda weird.

Click to show supported capabilities
Supported Capabilities
  • 12 Byte Unique Identifier
    Each controller has a unique identifier that can be referenced. This is to keep track in EZ-Builder projects which controller is being used and user logic specific to the ID.
  • ADC with 12 bit Resolution
    The ADC captures analog voltage at 8 bit resolution. This means the native value will be an 8 bit (0-4095) from the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.
  • Transmit Uart TX on all digital ports
    All digital ports support the ability to transmit (TX) serial/uart data at various pre-determined baud rates.
Download

Compiling Instructions:

  • This was designed with.... Board: ESP32 by Espressif Systems Version 3.3.5 Library: ESP32Servo by Kevin Harrington Version 3.1.3

Camera & Image Pipeline

  • Switched to using the official esp_camera.h API alongside the OV2640 wrapper for improved compatibility with newer ESP32 camera cores.
  • Added configurable camera XCLK frequency via XCLOCK_FREQUENCY (#define), allowing selection between 20 MHz (default) and 10 MHz for long/poor-quality ribbon cables or noisy environments.
  • Zeroed the camera_config_t structure with memset() before use to ensure all new fields introduced by the ESP32 camera library start from a known state.
  • Added a robust check for esp_camera_sensor_get() returning nullptr and a descriptive error message to the Serial console, with a safe halt loop if the camera fails to initialize.
  • Added a confirmation log message when the camera initializes successfully.
  • Improved the auto-compression (ACOMP) logic:
    • Uses safer accumulation and division with guards for zero-frame conditions.
    • Casts image size and average size more defensively.
    • Keeps compression changes within a defined 5-60 range with an explicit target window around 7-8 KB per frame.
  • Ensured the camera’s LEDC timer (timer 3 / channel 7) is reserved exclusively for XCLK so servo PWM cannot accidentally reconfigure the camera clock.

WiFi & Network Behavior

  • Expanded WiFi event handling to cover the full WiFiEvent_t enum, including RSSI low, beacon timeout, remain-on-channel, WPS PBC overlap, and more, with detailed Serial logging.
  • Added a separate Arduino-layer IPEvent() handler for arduino_event_t, covering WiFi and Ethernet events (IPv4/IPv6 acquisition, connect/disconnect, AP events) with verbose Serial diagnostics.
  • Kept WiFi.setSleep(false) to prioritize low-latency streaming while documenting the trade-off with power consumption.
  • In AP mode, changed the default softAP IP from 192.168.50.1 to 192.168.1.1 for a more standard local network layout.
  • Preserved the ESP.restart() safety behavior in client mode when WiFi connectivity is lost, ensuring the device self-recovers.

ARC / ESP32 Pin Mapping

  • Introduced explicit mapping tables to decouple ARC logical ports from ESP32 GPIO numbers:
    • ARC_TO_ESP_DIGITAL_PIN_MAPPING[24]
    • ARC_TO_ESP_SERVO_PIN_MAPPING[24]
    • ARC_TO_ESP_ADC_PIN_MAPPING[8]
  • Documented that ARC has 24 digital/servo Dx ports and 8 ADC ports, with unmapped entries set to 0xff.
  • Reworked all digital, servo, PWM, ultrasonic, and ADC commands to use these mapping tables instead of assuming ARC port index == ESP32 GPIO number.
  • Added isArcPortValid() and isGpioValid() helpers to safely validate indices before touching arrays or GPIO, avoiding out-of-range access.

Servo / PWM Handling

  • Increased the _Servos array size to 24 and tied it to the mapped GPIO indices for more consistent ARC-to-ESP mapping.
  • Added a pin-mode cache (_PIN_MODES[24]) initialized to -1 at startup, so pin configuration is only applied when needed.
  • Added servo as a dedicated pin-mode value to distinguish servo-controlled pins from normal INPUT/OUTPUT.
  • Introduced guarding logic so that:
    • Setting digital outputs or PWM on a pin will detach any servo mapped to the same ARC port first.
    • Servo and digital usage no longer conflict silently on shared pins.
  • Limited ESP32Servo/ESP32PWM to use only LEDC timers 0, 1, and 2 so that timer 3 remains permanently reserved for the camera XCLK.

EZB Protocol & Command Handling

  • Kept the core EZB command set (ping, firmware ID, digital, servo, PWM, ultrasonic, ADC, UART expansion, etc.) but refactored the implementation to use the new ARC/ESP mapping tables.
  • CmdReleaseAllServos now iterates the ARC_TO_ESP_SERVO_PIN_MAPPING table and only detaches servos on mapped pins, avoiding touching unknown or invalid GPIOs.
  • Servo positioning (CmdSetServoPosition) now:
    • Validates ARC port range.
    • Looks up the mapped servo GPIO.
    • Uses servo pin mode and attach/detach behavior based on position, with bounds checking via isGpioValid().
  • PWM speed (CmdSetPWMSpeed) now:
    • Uses the servo mapping to find the GPIO used for PWM.
    • Detaches any servo on that GPIO before running analogWrite().
  • Digital on/off and digital read commands now:
    • Validate ARC ports.
    • Map through ARC_TO_ESP_DIGITAL_PIN_MAPPING and detach servos only if they share the same GPIO.
    • Enforce correct pin mode (INPUT/OUTPUT) via the pin-mode cache.
  • Ultrasonic (CmdHC_SR04) now:
    • Validates ARC ports.
    • Uses digital mapping for both trigger and echo.
    • Detaches any servos that share those GPIOs before triggering.
    • Works only on mapped, valid pins and still returns distance in cm as uint8_t.
  • ADC read (CmdGetADCValue) now:
    • Uses ARC_TO_ESP_ADC_PIN_MAPPING instead of a fixed switch statement.
    • Returns 0 for unmapped ADC ports or invalid mappings, with pin-mode setup only when a valid GPIO is configured.
  • Added an error(const char*) helper that prints a descriptive message in a tight loop when an invalid ARC port is detected for critical commands, making configuration issues very visible during development.

UART / Serial Enhancements

  • Switched to Serial2.setRxBufferSize(8000) for ESP32 core compatibility (replacing setRxBuffer()).
  • Kept readSerial2Byte() as a blocking helper that reads directly from Serial2, matching the previous behavior while simplifying the code.
  • Maintained the UART expansion commands for CmdEZBv4 (UARTExpansion0/1/2) but ensured they work cleanly with the new buffer configuration and mapping safety checks.

Internal Structure & Safety

  • Added explicit forward declaration of doEZProtocol() near the top of the file for clarity.
  • Converted several short utility functions (IsAvail, Avail, validity checks) to inline for performance in the tight main loop and protocol handler.
  • Replaced the EZ header globals with macros:
    • EZHEADER and EZHEADER_LEN
    • Simplifies use when writing the image prefix to the camera client.
  • When accepting new CAM and EZB clients, now use a temporary WiFiClient variable before assigning to the global to avoid partial or invalid states.
  • Improved comments and documentation throughout the file, especially around:
    • Camera configuration and troubleshooting.
    • ARC-to-ESP pin mapping behavior.
    • WiFi and Arduino event handling.
    • Expected behavior when port mappings are incorrect.

Behavioral Changes You May Notice

  • Default AP IP is now 192.168.1.1 instead of 192.168.50.1.
  • If the wrong CAMERA_MODEL_x is selected or the camera fails to initialize, the firmware now prints a clear error and halts instead of failing silently with zero-length frames.
  • Digital, servo, PWM, ultrasonic, and ADC operations are now mediated through explicit ARC mappings, making it easier to port this firmware to other ESP32-based boards by adjusting only the mapping tables.
  • Auto-compression of camera images should be more stable with fewer visible jumps in JPEG quality due to the guarded averaging logic.
Click to show supported capabilities
Supported Capabilities
  • 12 Byte Unique Identifier
    Each controller has a unique identifier that can be referenced. This is to keep track in EZ-Builder projects which controller is being used and user logic specific to the ID.
  • ADC with 12 bit Resolution
    The ADC captures analog voltage at 8 bit resolution. This means the native value will be an 8 bit (0-4095) from the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.
  • Transmit Uart TX on all digital ports
    All digital ports support the ability to transmit (TX) serial/uart data at various pre-determined baud rates.
Download
  • Removed firmware-level Serial2 RX ring buffer and switched to ESP32 UART hardware buffer (setRxBuffer(8000)).
  • Updated UART expansion commands to read/write directly from Serial2.
  • Removed unused Serial2 buffer code and related helper functions.
  • Minor code cleanup and simplification around UART handling.
  • Digital read fix: CmdGetDigitalPort previously returned the port index instead of the actual digital pin state - now correctly returns digitalRead(port).
  • Camera/EZB client IP logging fix: Printed _CLIENT.remoteIP() before assigning the client object - corrected to log after available().
  • HSR04 bounds check fix: Port range check used <= _PortCnt (off-by-one) - corrected to < _PortCnt since _PortCnt is a count, not last index.
Click to show supported capabilities
Supported Capabilities
  • 12 Byte Unique Identifier
    Each controller has a unique identifier that can be referenced. This is to keep track in EZ-Builder projects which controller is being used and user logic specific to the ID.
  • ADC with 12 bit Resolution
    The ADC captures analog voltage at 8 bit resolution. This means the native value will be an 8 bit (0-4095) from the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.
  • Transmit Uart TX on all digital ports
    All digital ports support the ability to transmit (TX) serial/uart data at various pre-determined baud rates.
Download
  1. Install libraries into arduino ide: https://dl.espressif.com/dl/package_esp32_index.json

  2. Board manager install ESP32 by Espressif Systems

This project builds using...

  • Espressif Systems esp32 library version 3.0.7
  • ESP32Servo by Kevin Harrington version 3.0.6
Click to show supported capabilities
Supported Capabilities
  • 12 Byte Unique Identifier
    Each controller has a unique identifier that can be referenced. This is to keep track in EZ-Builder projects which controller is being used and user logic specific to the ID.
  • ADC with 12 bit Resolution
    The ADC captures analog voltage at 8 bit resolution. This means the native value will be an 8 bit (0-4095) from the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.
  • Transmit Uart TX on all digital ports
    All digital ports support the ability to transmit (TX) serial/uart data at various pre-determined baud rates.
Download

Version Information

  • Added editable definitions at the top of the ino source file for enabling/disabling features
Click to show supported capabilities
Supported Capabilities
  • 12 Byte Unique Identifier
    Each controller has a unique identifier that can be referenced. This is to keep track in EZ-Builder projects which controller is being used and user logic specific to the ID.
  • ADC with 12 bit Resolution
    The ADC captures analog voltage at 8 bit resolution. This means the native value will be an 8 bit (0-4095) from the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.
  • Transmit Uart TX on all digital ports
    All digital ports support the ability to transmit (TX) serial/uart data at various pre-determined baud rates.
Download

Version Information

  • Increase the auto compression adjustment jump from 1 to 5 so it responds quicker.
Click to show supported capabilities
Supported Capabilities
  • 12 Byte Unique Identifier
    Each controller has a unique identifier that can be referenced. This is to keep track in EZ-Builder projects which controller is being used and user logic specific to the ID.
  • ADC with 12 bit Resolution
    The ADC captures analog voltage at 8 bit resolution. This means the native value will be an 8 bit (0-4095) from the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.
  • Transmit Uart TX on all digital ports
    All digital ports support the ability to transmit (TX) serial/uart data at various pre-determined baud rates.
Download

Version Information

  • Works with servo & Camera at the same time
  • Added a note that the default IP address in AP Mode is (192.168.50.1)
Click to show supported capabilities
Supported Capabilities
  • 12 Byte Unique Identifier
    Each controller has a unique identifier that can be referenced. This is to keep track in EZ-Builder projects which controller is being used and user logic specific to the ID.
  • ADC with 12 bit Resolution
    The ADC captures analog voltage at 8 bit resolution. This means the native value will be an 8 bit (0-4095) from the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.
  • Transmit Uart TX on all digital ports
    All digital ports support the ability to transmit (TX) serial/uart data at various pre-determined baud rates.
Download

Version Information

  • Works with servos & camera at the same time
Click to show supported capabilities
Supported Capabilities
  • 12 Byte Unique Identifier
    Each controller has a unique identifier that can be referenced. This is to keep track in EZ-Builder projects which controller is being used and user logic specific to the ID.
  • ADC with 12 bit Resolution
    The ADC captures analog voltage at 8 bit resolution. This means the native value will be an 8 bit (0-4095) from the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.
  • Transmit Uart TX on all digital ports
    All digital ports support the ability to transmit (TX) serial/uart data at various pre-determined baud rates.
Download

Version Information

  • added dynamic camera compression

  • mapped Dx to GPIOx (i.e. ARC D4 = GPIO4, which is the FLASH LED)

Click to show supported capabilities
Supported Capabilities
  • 12 Byte Unique Identifier
    Each controller has a unique identifier that can be referenced. This is to keep track in EZ-Builder projects which controller is being used and user logic specific to the ID.
  • ADC with 12 bit Resolution
    The ADC captures analog voltage at 8 bit resolution. This means the native value will be an 8 bit (0-4095) from the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.
  • Transmit Uart TX on all digital ports
    All digital ports support the ability to transmit (TX) serial/uart data at various pre-determined baud rates.
Download

Version Information

  • First check-in of the ESP32 Cam firmware

*Note: For servo use with EZ-Cam, only pins 2,4,12-19,21-23,25-27,32-33 are recommended.

Click to show supported capabilities
Supported Capabilities
  • 12 Byte Unique Identifier
    Each controller has a unique identifier that can be referenced. This is to keep track in EZ-Builder projects which controller is being used and user logic specific to the ID.
  • ADC with 12 bit Resolution
    The ADC captures analog voltage at 8 bit resolution. This means the native value will be an 8 bit (0-4095) from the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.
  • Transmit Uart TX on all digital ports
    All digital ports support the ability to transmit (TX) serial/uart data at various pre-determined baud rates.

ARC Pro

Upgrade to ARC Pro

Stay on the cutting edge of robotics with ARC Pro, guaranteeing that your robot is always ahead of the game.

Author Avatar
PRO
Canada
#33  

Timing is always fun. My first computer was a zx80 and the only way you could get code to run without the screen flickering was to time the execution of the code exactly between the update of the screen frames so the screen wouldn't flicker.  Several people on the interwebs are using ESP32-Cam for servos and cameras at same time so I am sure it is possible.

Author Avatar
PRO
USA
#34   — Edited

It was long time ago but I got two servos (pan & tilt) working with the ESP32-CAM.

https://github.com/madhephaestus/ESP32Servo recommended pins: pins 2,4,12-19,21-23,25-27,32-33

ESP32-CAM SD Card:

User-inserted image

Safe pins: DATA2 = 12 (DJ implementation = 4) CLK= 14 (DJ implementation = 3) DATA0 = 2 (Not mapped in DJ Implementation)

Please try:

Servos: EZB Port 3 = Board HS2_CLK (Gpio 14) EZB Port 4 = Board HS2_DATA2 (Gpio 12)

Author Avatar
PRO
USA
#35  

can you point me to a website?

Author Avatar
PRO
USA
#36   — Edited

Quote:

can you point me to a website?
@EzAng can you be more specific ?

Regarding ARC->ESP32CAM everything you need is in this thread. EZB port mapping to ESP32 GPIO  ESP32-CAM pinout.

Schematic is here: (ESP32_CAM_V1.6.pdf) https://github.com/SeeedDocument/forum_doc/tree/master/reg#ESP32_CAM_V1.6

Recommend pins for ESP32 servo Library used in DJ's implementation: https://github.com/madhephaestus/ESP32Servo

ESP32 Documentation about SDCARD/SDIO implementation: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sdio_slave.html I picked the Gpio 14, Gpio 12 because they are safe, for example GPIO13 is a SPI/CS So will activate the SDCARD when low so not safe.

Author Avatar
PRO
USA
#37   — Edited

sorry I was talking to Nink he said Several people on the interwebs are using ESP32-Cam for servos and cameras at same time so I am sure it is possible.

However I will try what you proposed

still think my best solution for me is:

an IoTiny on connection 1 for many servos

esp32 cam on connection 0 - camera

that works for me

Author Avatar
PRO
Canada
#38  

If you install the standard ESP32 code on the ESP32 CAM all works fine with Servo's

Author Avatar
PRO
Synthiam
#39  

Maybe the boards differ between what I have and you.. There's a portion of the code that translates arduino pin index to gpio. You can edit it here...

User-inserted image

Author Avatar
PRO
Canada
#40  

I am probably doing something wrong but this is what I had on the ESP32-CAM  ARC  ESP32-CAM D16 -GPIO 0 - Nothing D5  - GPIO 13 - Crashes D3  - GPIO 14 - Move servo wait 1 minute it moves sometimes just vibrates D4  - GPIO 12 - servo just gets hot but release actually works :-)