0
\$\begingroup\$

I have an Arduino Uno an OV5640 camera module with 18 pins

3.3V, GND, SIOC, SIOD, VSYNC, HREF, PCLK, XCLK, D9..D2, RST, PWDN

Looking at the example source code at https://github.com/ArduCAM/Arduino/blob/master/ArduCAM/examples/mini/ArduCAM_Mini_5MP_OV5640_AutoFocus/ArduCAM_Mini_5MP_OV5640_AutoFocus.ino , I am not sure what wires to connect to make this OV5640 work with my Arduino Uno.

The read_fifo_burst() function appears to be doing SPI.transfer(), and my understanding of SPI is that it uses 4 lines (MISO, MOSI, SCLK, and CS). I'm not sure which of the pins on the module map to the SPI pins.

I have seen wiring diagrams for similar cameras that connect all the D* pins to the microcontroller, but I am not sure this is compatible with the ArduCAM Arduino library.

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

That library is for a different product. They're using an Arducam OV5642 Mini Module Shield, and what you have is a standard OV5642 breakout module.

The camera you have uses MIPI or DVP to output pixel data. The output data rate is too high for an Arduino Uno to directly interface with - the Uno's Atmega328P MCU runs at 16MHz, and the pixel clock for the lowest resolution output of the OV5640 is 24MHz. Even if the MCU ran twice as fast, it couldn't keep up.

You can directly interface these modules with certain faster Arduino boards, like the Due, with some limitations on supported formats and the amount of CPU time left over for other tasks. This is a very wasteful approach, though.

To get around these issues, most people use an Arducam Shield as an intermediary. The camera module connects to the shield, and the shield connects to the Arduino. The shield has a dedicated CPLD and memory onboard to handle the high-speed download of frames from the camera using MIPI or DVP. The shield handles all the data conversion and provides a more convenient low-speed SPI interface for microcontrollers to talk to. It's effectively a MIPI/DVP-to-SPI bridge with an integrated frame buffer.

The Arducam OV5642 Mini Module Shield, which the code you linked is written for, integrates a camera sensor and the memory/CPLD from an Arducam Shield into one single package with a SPI interface. It has an 8-pin interface rather than the larger 18 or 20 pin interface of a MIPI/DVP camera module.

Since you've just got the OV5642 breakout, you're going to need the Arducam Shield as an intermediary interface if you want to use it with an Arduino Uno.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Lucky me: my office manager ordered two cameras instead of one, and the other one had the SPI&i2C 8-pin interface. It came with a printed wiring diagram for how to connect SPI, I2C, 5V, and ground. I guess the other one will just live in its anti-static bag until I have a faster device to attach it to. \$\endgroup\$
    – Mutant Bob
    Mar 9, 2022 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.