English
English
简体中文
日本語

Stamp-AddOn Cam0308 ESPHome Integration

This tutorial explains how to connect Stamp-AddOn Cam0308 to Stamp-S3Bat and integrate it into Home Assistant through ESPHome.

1. Device Overview

Item Information
Product Stamp-AddOn Cam0308
SKU A178
Compatible Controller Stamp-S3Bat
Image Sensor GC0308, 0.3MP
Image Interface SCCB, 8-bit DVP parallel interface
ESPHome Version 2026.3.0 or later

2. Configuration

ESP32 Framework

GC0308 requires the ESP-IDF framework, with the sensor driver enabled through CONFIG_GC0308_SUPPORT:

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf
    sdkconfig_options:
      CONFIG_GC0308_SUPPORT: "y"

Startup Initialization

Before the camera driver initializes, PWDN (GPIO39) must be pulled low, RESET (GPIO41) pulled high, and a 500ms delay applied. The complete example performs this startup sequence through M5Stack's early_init external component:

external_components:
  - source: github://m5stack/esphome-yaml/components@main
    components: [early_init]

early_init:
  id: power_up_barrier
  pins:
    - pin:
        number: GPIO39
        allow_other_uses: true
      level: false
    - pin:
        number: GPIO41
        allow_other_uses: true
      level: true
  delay: 500ms
Startup Sequence
The early_init component, GPIO39/GPIO41 level settings, and 500ms delay ensure that the camera starts correctly. Keep this configuration unchanged.

Camera Configuration

Cam0308 uses GPIO48/GPIO47 for the SCCB data lines, while image data is received through the 8-bit DVP interface. allow_other_uses: true allows the camera component to reuse GPIO39 and GPIO41 from the startup initialization stage:

i2c:
  - id: cam_bus
    sda: GPIO48
    scl: GPIO47
    frequency: 100kHz

esp32_camera:
  name: "Camera"
  id: gc0308_camera
  i2c_id: cam_bus
  data_pins:
    - GPIO21
    - GPIO18
    - GPIO16
    - GPIO15
    - GPIO14
    - GPIO12
    - GPIO38
    - GPIO40
  vsync_pin: GPIO42
  href_pin: GPIO17
  pixel_clock_pin: GPIO13
  external_clock:
    pin:
      number: GPIO46
      ignore_strapping_warning: true
    frequency: 20MHz
  power_down_pin:
    number: GPIO39
    allow_other_uses: true
  reset_pin:
    number: GPIO41
    allow_other_uses: true
  resolution: 320x240
  pixel_format: RGB565
  jpeg_quality: 12
  max_framerate: 10 fps
  frame_buffer_count: 1
  frame_buffer_location: PSRAM
  agc_mode: auto
  agc_value: 10
  aec_mode: auto
  aec_value: 480
  vertical_flip: true
  horizontal_mirror: false
  test_pattern: false

The example uses QVGA (320 x 240) resolution and a maximum frame rate of 10 fps by default. When adjusting the resolution or frame rate, change one setting at a time and confirm that the device remains stable.

3. Example

See stamp-addon-cam0308.yaml for the complete configuration. It includes the device, network, API, OTA, startup initialization, and camera settings.

  1. Import the complete example into ESPHome.
  2. Follow the standard ESPHome process to configure, compile, and flash the firmware.
  3. After the device connects to the network, complete discovery and setup in Home Assistant.
  4. Open the device page and add the Camera entity to the Dashboard to view the camera stream.
Page Tools
PDF
On This Page