Skip to main content
Proton AI Core supports both the OV2640 and OV3660 camera modules, making it straightforward to capture images and video frames at the edge. This guide walks you through installing the required library, configuring the camera driver, and capturing JPEG frames in your firmware.

Prerequisites

  • Camera module physically connected to Proton AI Core (see Camera Hardware)
  • esp32-camera library installed (instructions below)
  • Arduino IDE with the ESP32 board package, or a PlatformIO project configured for ESP32-S3

Installing the Camera Library

The esp32-camera driver is bundled with Espressif’s official ESP32 Arduino board package. If you have already installed the esp32 board package via Boards Manager, no additional library installation is needed.To confirm, go to Tools → Board → Boards Manager, search for esp32 by Espressif Systems, and ensure it is installed at version 2.x or later.

Camera Configuration

The esp32-camera driver is configured through the camera_config_t struct before calling esp_camera_init(). You assign GPIO pin numbers, clock frequency, pixel format, and frame buffer settings here. The example below shows a full configuration for the OV2640 sensor.
camera_config.cpp
Pin definitions above are placeholders marked “To be confirmed”. Check the official pinout diagram at /hardware/pinout or the Downloads page before using in production.

Capturing a Frame

Once the camera is initialised, call esp_camera_fb_get() to grab a frame buffer from the driver. Always return the buffer with esp_camera_fb_return() after you are done — failing to do so exhausts the frame buffer pool.
capture.cpp

Frame Sizes

The frame_size field of camera_config_t controls the output resolution. The OV2640 supports resolutions up to 1600×1200; the OV3660 supports higher resolutions. Choose a frame size that balances image quality with your application’s memory and processing requirements.
Use FRAMESIZE_QVGA for AI inference tasks — smaller frames mean faster processing and lower memory usage on the tensor arena.