Skip to content
This guide is for the legacy ESP32-CAM platform. For the current ESP32-P4 submerged unit, see [Flash the ESP32-P4](/how-to/flash-esp32-p4/).

Flash the ESP32-CAM (Legacy)

This guide walks through flashing the SmartPot firmware onto an ESP32-CAM module for the submerged vision unit.

  • ESP32-CAM (Ai-Thinker) module
  • USB-to-serial adapter (FTDI FT232RL or CP2102)
  • Jumper wires
  • USB cable
  • Computer with Arduino IDE or PlatformIO installed

The ESP32-CAM doesn’t have a built-in USB port. Connect a USB-to-serial adapter:

USB-SerialESP32-CAM
3V33V3
GNDGND
TXU0R (GPIO3)
RXU0T (GPIO1)

For flashing mode: Connect IO0 to GND before powering on. This puts the ESP32 into bootloader mode. Remove the IO0-to-GND connection after flashing and press RESET to boot normally.

flowchart TD
    subgraph ser["USB-Serial Adapter"]
        S_3V3["3V3"]
        S_GND["GND"]
        S_TX["TX"]
        S_RX["RX"]
    end

    subgraph cam["ESP32-CAM (Ai-Thinker)"]
        C_3V3["3V3"]
        C_GND["GND"]
        C_RX["U0R (GPIO3)"]
        C_TX["U0T (GPIO1)"]
        C_IO0["IO0"]
    end

    S_3V3 --- C_3V3
    S_GND --- C_GND
    S_TX --- C_RX
    S_RX --- C_TX
    C_IO0 -. "GND during flash" .-> C_GND

    style ser fill:#e6f3f0,stroke:#2d7d6f
    style cam fill:#f0f4f8,stroke:#4a6785
  1. Open File → Preferences
  2. Add to Additional Board Manager URLs:
    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
  3. Open Tools → Board → Board Manager
  4. Search for “esp32” and install esp32 by Espressif Systems
  5. Select Tools → Board → AI Thinker ESP32-CAM
; platformio.ini
[env:esp32cam]
platform = espressif32
board = esp32cam
framework = arduino
monitor_speed = 115200
upload_speed = 921600
  1. Connect GPIO0 to GND (flash mode jumper)
  2. Connect USB-serial adapter to computer
  3. Power on the ESP32-CAM
  4. Select the correct COM/serial port
  5. Click Upload (Arduino IDE) or run pio run -t upload (PlatformIO)
  6. Wait for upload to complete (progress bar shows percentage)
  7. Remove the GPIO0-to-GND jumper
  8. Press the RESET button on the ESP32-CAM

Open the serial monitor at 115200 baud. You should see:

SmartPot Submerged Unit v0.1
Camera initialized: OV2640
TFLite model loaded: species_v1.tflite
Servo initialized: door UNLOCKED
Waiting for tether connection...
  • Load the species classification model (see Train the Species Model)
  • Connect to the smart buoy via tether cable
  • Configure keeper thresholds for your target species