Main Content

Capturing Camera Images with CircuitPython

CircuitPython 7 adds support for capturing images from “parallel cameras” on select boards, and libraries are available to configure the popular OV7670 and OV2640 cameras.

While not up to standards we’re used to from a current smartphone or laptop, it’s nicely balanced to the capabilities of recent 32-bit microcontrollers.

The Arduino library for OV7670 cameras on the Grand Central M4 has its own dedicated guide.

Parts
Items needed
- Compatible microcontroller board: any ESP32-S2 including Kaluga supported by CircuitPython with enough pins exposed, any RP2040 supported by CircuitPython including Pico and other boards with enough pins, or Grand Central M4
- SPI TFT module
- OV7670 or OV2640 camera module — the board pinout must match exactly
- Two 2.2k resistors, if pull-up resistors are necessary
- Soldering iron and supplies
- Appropriate USB data + power cable
- Prototyping supplies such as breadboards and jumper wires

The Espressif Kaluga v1.3 development kit has all you need (including an OV2640 camera module and 320x240 LCD), and no soldering is required, so it’s probably the best way to get started! Be aware that you must use the USB Breakout Cable with this board.

OV7670 and OV2640 camera modules with the 18 pin, 2-row header can be found on Amazon, eBay, etc. Make sure the pinout matches the camera shown above, as occasionally there are incompatible variants. The cameras are sometimes sold in sets which is a good idea, as they’re easily damaged with the wrong voltage or rough handling, especially if you need to modify it for use with the Grand Central M4.

Other sensor models (such as OV3660 and OV5640) exist, but they require different initialization code and cannot currently be used.”

Link to article