Interfacing camera module with MCU

Thread Starter

timo_lad

Joined Aug 24, 2020
5
Hello guys, I've got a project I'm working on right now which involves making use of a camera. I'd like to know what microcontroller would be the most suitable to interface a camera module to. I've tried using the ESP32 wifi camera but decided to discard it due to the small frame rate and high latency (in my case).
Also, I would also like to know to send the camera data via USB to a computer (if possible).
I'm new to this (although I have some experience working with PIC16F877 and Arduino) and any help would be highly appreciated. Thank you!!!
 

djsfantasi

Joined Apr 11, 2010
6,792
I don’t know if you can send the camera data in real-time via USB to a computer without writing an application to receive the data.
 

BobaMosfet

Joined Jul 1, 2009
1,207
Most of your questions are determined by what camera you're referring to, as it is your engineering constraint in terms of it's requirements; and then your own requirements performance/connection-wise.
 

cspwcspw

Joined Nov 8, 2016
72
I did two projects with OV7670 cameras on ESP-32.
The ESP-32 (on the standard dev boards, anyway) is tricky: memory is limited to 1MB, fragmented into a number of small pools. So you can't allocate enough for a whole frame buffer for 320x240 times two bytes per pixel (what I set the camera up for). So I needed to deal with each scan line of the image as it arrives, and get rid of it quickly. I was able to put 25fps onto a parallel-bus TFT attached to the ESP-32. (TFT and camera had settings that found common ground for compatible size and pixel formats, so the ESP-32 didn't have to do any format conversions, etc - just grab data, and shunt it over to the TFT.)

But using the standard ESP-32 USB serial interface doesn't have enough bandwidth to upload the data. I implemented a snapshop upload, but the trick was to use the TFT memory as the frame buffer, freeze data going into it, and read it back at leisure while uploading once scan line at a time to the PC.

With good intentions, I bought a high-speed adapter (FT4232HL) with fast SPI (to get the data off the ESP-32), onto a fast USB upload. But I moved onto something else and never got back to that. :-( Projects are at https://github.com/cspwcspw
 

Thread Starter

timo_lad

Joined Aug 24, 2020
5
Most of your questions are determined by what camera you're referring to, as it is your engineering constraint in terms of its requirements; and then your own requirements performance/connection-wise.
Thanks BobaMosfet, well I'm not really sure of what camera module to select but my project involves capturing video and sending it over the internet.
 
Last edited:

Thread Starter

timo_lad

Joined Aug 24, 2020
5
I did two projects with OV7670 cameras on ESP-32.
The ESP-32 (on the standard dev boards, anyway) is tricky: memory is limited to 1MB, fragmented into a number of small pools. So you can't allocate enough for a whole frame buffer for 320x240 times two bytes per pixel (what I set the camera up for). So I needed to deal with each scan line of the image as it arrives, and get rid of it quickly. I was able to put 25fps onto a parallel-bus TFT attached to the ESP-32. (TFT and camera had settings that found common ground for compatible size and pixel formats, so the ESP-32 didn't have to do any format conversions, etc - just grab data, and shunt it over to the TFT.)

But using the standard ESP-32 USB serial interface doesn't have enough bandwidth to upload the data. I implemented a snapshop upload, but the trick was to use the TFT memory as the frame buffer, freeze data going into it, and read it back at leisure while uploading once scan line at a time to the PC.

With good intentions, I bought a high-speed adapter (FT4232HL) with fast SPI (to get the data off the ESP-32), onto a fast USB upload. But I moved onto something else and never got back to that. :-( Projects are at https://github.com/cspwcspw
Thanks cspwcspw, I'm absolutely going to follow this up. Great work!!!
 

ronsimpson

Joined Oct 7, 2019
908
Things to think about: How many pixels are you going to actually use. Some cameras can be set to 320x240 or something small. But most of the small micros do not have enough memory to hold even that small picture.

Any of the Raspberry Pi(s) have large memories. They all have HDMI ports so you can connect a TV or monitor and see what the computer is looking at. I use a Pi-3 as a PC. Using a USB mouse, USB keyboard and a TV I can do development on the very same computer that the software runs on. Think about getting a Pi3 or Pi4 to develop on and then move to the low cost Pi0 for production. (you can develop on the "0" but it is a little slow)

The Pis can talk USB camera, Camera port, or WiFi Camera.
Pi0 does not have WiFi unless it is -W wersion.
 

Thread Starter

timo_lad

Joined Aug 24, 2020
5
Things to think about: How many pixels are you going to actually use. Some cameras can be set to 320x240 or something small. But most of the small micros do not have enough memory to hold even that small picture.

Any of the Raspberry Pi(s) have large memories. They all have HDMI ports so you can connect a TV or monitor and see what the computer is looking at. I use a Pi-3 as a PC. Using a USB mouse, USB keyboard and a TV I can do development on the very same computer that the software runs on. Think about getting a Pi3 or Pi4 to develop on and then move to the low cost Pi0 for production. (you can develop on the "0" but it is a little slow)

The Pis can talk USB camera, Camera port, or WiFi Camera.
Pi0 does not have WiFi unless it is -W wersion.
Thanks, I plan on using 640x480 display and to transmit the camera feed over the internet (maybe using a webrtc protocol). So the Pi 0 -W version is the go-to for the project.
 

cspwcspw

Joined Nov 8, 2016
72
Be aware that video compression makes a big difference, and something like an H.262 stream encoder will normally be done in hardware. So if you look for a camera that already gives you a compressed stream you'll have a better chance of doing the data upload at a reasonable rate.
 
Top