The OV7670-mini camera module
is the name I've given it.
The circuit is based on the official manual, and this module works correctly.
The image below shows a photo taken using this module.


The image below shows the module's test circuit (taken with a mobile phone).


The main controller of the test circuit is an RP2040,
which uses PWM to generate a 24MHz clock signal to supply the OV7670.
The I2C pull-up resistor used in the test is 10kΩ, which cannot achieve 100kHz I2C communication; the I2C communication clock frequency used in the test is 10kHz.
Using PIO combined with DMA to read data from the OV7670, 30fps data reading can be achieved.
(RGB565-QVGA format, one frame of image data is 320*240*2 bytes. The DMA of the rp2040 can achieve single-cycle transmission with extremely high throughput. The transmission rate reaches 120M*8bit with 8-bit width. Data transmission can be completed instantly when the OV7670 outputs data.)
The image data is sent to the PC through the ch340e chip using serial communication. The serial port baud rate is 1.5Mbps.
Using a Python host computer to receive serial port data, convert the raw RGB565 format data to RGB888 format and store it as an image file (jpg, png, bmp, etc.) that can be viewed on a PC.
The wiring is as follows
: | Raspberry Pi Pico | OV7670 |
| ----------------- | ----------------- |
| GND | GND |
| 3V3(OUT) | VCC (3.3) |
| GP3 | XCLK |
| GP4 (I2C0 SDA) | SDA[^i2c_pullups] |
|
GP6 | D0 | | GP7 | D1
| | GP8 | D2
| | GP9 |
D3 | | GP10
| D4 | |
GP11 | D5 | | GP12 | D6 |
| GP13 | D7 |
| GP14 | PCLK |
| GP15 | HREF |
| GP16 | VSYNC |
| GP17 | RST |
| GP21 (I2C0 SCL) | SCL[^i2c_pullups] |
The Python script demonstrates the operation

on the host computer. Use the following command in the command line, passing the serial port number, to run the script:
`python rgb565_show1.py COM7`.
Use the following command to specify the image storage name and format to start a photo capture. (The Python script automatically sends instructions to the RP2040 to capture a frame of image data.)
`capture("h1.jpg")`.
Use the following command to set the image mirroring; the parameter is 0 or 1, where `v` represents vertical flipping and `h` represents horizontal flipping.
`set_vflip(0)
` `set_hflip(0)`
. The source code, compiled firmware, and Python script are all attached.
Important reference links during the author's development process
: https://github.com/the6p4c/rp2040_ov2640
https://blog.csdn.net/zdzh1/article/details/21739589
Related links:
USB camera developed using this module:
https://www.bilibili.com/video/BV123e5ehEis/?spm_id_from=333.999.0.0&vd_source=6e817c3943bff9f1749caaa76f60e5dc