Add OV3660 camera support for AI Thinker ESP32-CAM

The esp32-camera library already includes a full OV3660 driver, so no
library changes are needed. This commit wires in the sensor-specific
initialization the OV3660 requires:

- Increase XCLK from 15 MHz to 20 MHz in InitCameraModule(); the OV3660
  requires 20 MHz and the OV2640 is compatible with both frequencies
- Apply OV3660-specific settings in ApplyCameraCfg() when the detected
  sensor PID matches OV3660_PID: enable vflip (sensor image is natively
  inverted), reduce initial saturation, and clamp frame size to SXGA
  (1280x1024) if a larger size was stored in EEPROM, since UXGA exceeds
  the OV3660's maximum resolution
- Update CAMERA_MODEL EXIF string from "OV2640" to "OV3660"
- Add OV3660 to the supported camera modules table in the AI Thinker
  README
- Add build/ to .gitignore to exclude Arduino IDE compiled output
pull/140/head
Jeff Evans 2026-04-14 22:31:09 -07:00
parent db0112e9c2
commit 423550d2c4
4 changed files with 27 additions and 10 deletions

6
.gitignore vendored
View File

@ -41,7 +41,8 @@
.LSOverride
# Icon must end with two \r
Icon
Icon
# Thumbnails
._*
@ -68,3 +69,6 @@ Temporary Items
# End of https://www.toptal.com/developers/gitignore/api/c++,macos
# Arduino IDE build output
build/

View File

@ -107,7 +107,7 @@ void Camera::InitCameraModule() {
CameraConfig.pin_sccb_scl = SIOC_GPIO_NUM;
CameraConfig.pin_pwdn = PWDN_GPIO_NUM;
CameraConfig.pin_reset = RESET_GPIO_NUM;
CameraConfig.xclk_freq_hz = 15000000; // or 3000000; 16500000; 20000000
CameraConfig.xclk_freq_hz = 20000000; // or 3000000; 15000000; 16500000
CameraConfig.pixel_format = PIXFORMAT_JPEG; /* YUV422,GRAYSCALE,RGB565,JPEG */
/* OV2640
@ -322,6 +322,18 @@ void Camera::ApplyCameraCfg() {
sensor->set_vflip(sensor, vflip); // vertical flip 0 = disable , 1 = enable
sensor->set_dcw(sensor, 1); // 0 = disable , 1 = enable
sensor->set_colorbar(sensor, 0); // external collor lines, 0 = disable , 1 = enable
/* OV3660-specific initialization */
if (sensor->id.PID == OV3660_PID) {
sensor->set_vflip(sensor, 1); // OV3660 image is natively inverted
sensor->set_saturation(sensor, -2); // reduce initial oversaturation
/* OV3660 max resolution is SXGA (1280x1024); clamp if a larger size was stored */
if (TFrameSize > FRAMESIZE_SXGA) {
log->AddEvent(LogLevel_Warning, F("OV3660: frame size exceeds SXGA, clamping"));
TFrameSize = FRAMESIZE_SXGA;
sensor->set_framesize(sensor, FRAMESIZE_SXGA);
}
}
}
/**

View File

@ -13,13 +13,13 @@
#define _MCU_CFG_H_
/* ----------------- CAMERA TYPE ---------------*/
#define AI_THINKER_ESP32_CAM true
#define ESP32_WROVER_DEV false
#define CAMERA_MODEL_ESP32_S3_DEV_CAM false
#define CAMERA_MODEL_ESP32_S3_EYE_2_2 false
#define CAMERA_MODEL_XIAO_ESP32_S3_CAM false
#define CAMERA_MODEL_ESP32_S3_CAM false
#define ESP32_S3_WROOM_FREENOVE false
#define AI_THINKER_ESP32_CAM true
#define ESP32_WROVER_DEV false
#define CAMERA_MODEL_ESP32_S3_DEV_CAM false
#define CAMERA_MODEL_ESP32_S3_EYE_2_2 false
#define CAMERA_MODEL_XIAO_ESP32_S3_CAM false
#define CAMERA_MODEL_ESP32_S3_CAM false
#define ESP32_S3_WROOM_FREENOVE false
/* ---------------- BASIC MCU CFG --------------*/
#define SW_VERSION "1.1.2" ///< SW version
@ -100,7 +100,7 @@
/* ------------------ EXIF CFG ------------------*/
#define CAMERA_MAKE "OmniVision" ///< Camera make string
#define CAMERA_MODEL "OV2640" ///< Camera model string
#define CAMERA_MODEL "OV3660" ///< Camera model string
#define CAMERA_SOFTWARE "Prusa ESP32-cam" ///< Camera software string
#define CAMERA_EXIF_ROTATION_STREAM false ///< enable camera exif rotation for stream

View File

@ -56,6 +56,7 @@ These are currently known or tested camera modules:
| OV2640IR | 160° | 2MP | Yes | Yes | |
| OV8225N | 66° | 2MP | Yes | Yes | |
| OV3360 | 66° | 3MP | Yes | Yes | |
| OV3660 | 66° | 3MP | Yes | Yes | Max resolution SXGA (1280x1024) |
| OV5640-AF | 72° | 5MP | Yes | Yes | Overheating, slow photo loading |
<a name="different_mcu"></a>