esphome / esphome/feature-requests
Allow for higher resolution, clock speed and framerate in ESP32 Camera
- Dominant language
- No language data
- Stars
- 450
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the problem you have/What new integration you would like**
Current configuration variables does not support newer camera modules like OV5640.
1. ESPHome lacks support for the following resolutions:
- 1280x720 (720p)
- 1280 x 960
- 1920x1080 (1080p)
- 2592 x 1944 (QSXGA)
2. ESPHome lacks support for 40 Mhz master clock speed. ESPHome only supports 10 Mhz and 20 Mhz. (From reading the electronic diagrams, I THINK this board runs at 40Mhz, however, i am not sure! Please enlighten me!)
3. max_framerate parameter is limited to 60 hz. OV5640 supports up to 120 hz.
**Please describe your use case for this integration and alternatives you've tried:**
I am using [this](https://www.aliexpress.com/item/1005004521039608.html?spm=a2g0o.order_list.order_list_main.66.58e21802R2RHnA) board.
I am able to flash the board with ESPHome, no issues. However i am not able to get a really good picture.
- If i set `external_clock: frequency:` to `10 Mhz`, the image brightness is OK, but i am not able to get a good framerate.
- If i set `external_clock: frequency:` to `20 Mhz`, the image brightness is really dark, but the framerate is slightly better.
Playing around with exposure parameters have little effect.
I am not able to utilize the camera capabilities. Camera should support 1080p @ 45 hz or 2592x1944 @ 15 hz.
When reading the documentation it SEEMS to me that this board runs at a master clock rate of 40 Mhz, which ESPHome does not support.
**Additional context**
- Datasheet for OV5640: https://www.1stvision.com/cameras/sensor_specs/OV5640_PB_3-4-11.pdf
- Electrical diagrams: https://www.aliexpress.com/item/1005004521039608.html?spm=a2g0o.order_list.order_list_main.66.58e21802R2RHnA
OV5640 maximum image transfer rate:
- QSXGA (2592x1944): 15 fps
- 1080p: 30 fps
- 1280 x 960: 45 fps
- 720p: 60 fps
- VGA (640x480): 90 fps
- QVGA (320x240): 120 fp
My current configuration:
```
esp32_camera:
name: My Camera
external_clock:
pin: GPIO15
frequency: 20MHz #Should be 40 Mhz?
i2c_pins:
sda: GPIO22
scl: GPIO23
data_pins: [GPIO2, GPIO14, GPIO35, GPIO12, GPIO27, GPIO33, GPIO34, GPIO39]
vsync_pin: GPIO18
href_pin: GPIO36
pixel_clock_pin: GPIO26
reset_pin: GPIO5
resolution: 1024x768
jpeg_quality: 10
max_framerate: 30fps
agc_gain_ceiling: 64x
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the esp32_camera configuration shown in the issue and read the linked OV5640 datasheet alongside the currently supported values. Check the limits for resolution, external_clock frequency, and max_framerate. Done means the requested OV5640 resolutions, 40 MHz clock option, and higher framerates are supported where the hardware allows.
Written by the indexing model from the issue text.
Assessment
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100