First Steps with Arducam CSI Camera Module 5MP OV5640
Introductionâ
This article provides information on how to start working with the CSI Camera Module based on the OV5640 image sensor from Arducam.
The following topics will be covered:
Featuresâ
The OV5640 is a high-performance CMOS image sensor designed for a wide range of imaging applications. It offers a combination of high resolution,advanced imaging features, and versatility, making it a popular choice for mobile and embedded camera systems.
Arducam has designed the OV5640 camera module and integrated it into the Toradex carrier boards via the MIPI protocol. The camera circuit board, after being improved by the Arducam technical team, has reached a mini size of 24x25mm, which makes it easier for visual projects to be applied in narrow spaces with limited size.
Sensor Features:
- Image Sensor: OV5640 from OmniVision
- Still Resolution: 5Megapixels
- Interface: MIPI CSI-2
- Output Format: 8-/10-bit RGB RAW, RGB, YUV, JPEG
- Max Pixel Array: 2592 x 1944 pixels
- Sensor image area: 6.287mm x 4.712 mm (7.9mm diagonal)
- Pixel Size 1.4Ξm x 1.4Ξm
- Optical Size: 1/4"
Lens Features:
- IR Sensitivity: Integral IR-cut Filter, visible light only
- Focal length: 4.22mm
- Aperture: F2.0 +-5%
- Field of View (FOV): 84.2°(D)Ã71.7°(H)Ã57°(V)
- Lens Mount: Stock Lens
Datasheetsâ
Arducam CSI Camera Module OV5640 Datasheet
Hardware Setupâ
What I need to orderâ
You can have the Arducam OV5640 CSI Camera Module working with specific Toradex computers on modules and carrier boards. See the compatible products.

Besides the Module and the Carrier Board, you will need to order:
- The Arducam OV5640 Camera Module;
- The flat cable for connecting the Camera Module to the Carrier Board.
Where do I orderâ
You can order the Toradex computer on Modules and the carrier boards online in the Toradex Webshop.
You can order the Arducam Camera Module and the needed accessories on the Arducam Shop.
Please refer to the instructions below for connecting the camera module to your specific carrier board.
Cable Connectionâ
Connect the flat cable to the camera module as shown in the following pictures:
Please disconnect any power and USB cables from the board before connecting the flat cable to the MIPI-CSI bus to avoid any damage to the camera!
Connection to Dahlia Carrier Boardâ
Connect the camera to the Dahlia Carrier Board, assuring that the flat cable contacts are on the correct side, as indicated in the figures below.
- For the Dahlia Carrier Board, the MIPI-CSI Camera interface is on connector X16.
Connection to Mallow Carrier Boardâ
Connect the camera to the Mallow Carrier Board, assuring that the flat cable contacts are on the correct side, as indicated in the figures below.
- For the Mallow Carrier Board, the MIPI-CSI Camera interface is on connector X3.
Connection to Ixora Carrier Boardâ
Connect the camera to the Ixora Carrier Board, assuring that the flat cable contacts are on the correct side, as indicated in the figures below.
- For the Ixora Carrier Board, the the MIPI-CSI Camera interface is on connector X28.
Connection to Verdin Development Boardâ
Connect the camera to the Verdin Development Board, assuring that the flat cable contacts are on the correct side, as indicated in the figures below:
- For the Verdin Development Board, the MIPI-CSI Camera interface is on connector X47.
Connection with the Mezzanine
The Verdin iMX8M Plus Mezzanine can be installed on the Verdin Development Board to provide an additional MIPI-CSI connector. Connect the camera to the mezzanine as indicated in the figures below.
- The mezzanine MIPI-CSI Camera interface is on connector X5.
Mezzanine Jumper Configuration
The mezzanine includes jumpers on the MIPI-CSI interface that must be configured according to the intended use:
- Default: use this position when operating the mezzanine camera port alone.
- Alternate: use this position when using the mezzanine together with the native carrier board port simultaneously.
Dual Camera Setup
To use both cameras simultaneously, connect one camera to the native CSI connector (X47) and the other to the mezzanine connector (X5), and make sure the mezzanine jumper is set to the Alternate position.
The flat cable (used to connect the carrier board and the camera adaptor) is fragile. If your camera does not work, make sure to test the cable connections on the flat cable.
Compatible Productsâ
Hardwareâ
The Arducam CSI Camera Module 5MP OV5640 is sold together with a connector cable.
The following Toradex carrier boards that support the MIPI CSI-2 interface connect to the camera kits out-of-the-box, hardware-wise:
This camera module is supported for the following SoMs:
Softwareâ
Software support for this camera is fully integrated from BSP version 7.
To integrate the camera on the software side, you need to apply an device tree overlay to the image, as shown in the next sections.
Camera Usageâ
This article covers three possible configurations for using the camera:
- Native port only: connect the camera directly to the native MIPI-CSI port on the carrier board.
- Mezzanine only: connect the camera to the mezzanine port, with the jumper in either Default or Alternate position.
- Native + Mezzanine: For dual camera support using both ports simultaneously, with the mezzanine jumper set to Alternate.
For hardware setup and jumper configuration of the mezzanine, see the Connection to Verdin Development Board section.
We recommend using a display to be able to visualize the captured image during camera testing.
Connect to the SoMâ
After completing the hardware setup for your intended configuration, connect to the device via SSH or a serial terminal.
Select and Apply the Device Tree Overlaysâ
The overlays required depend on which port, or ports, you intend to use. Once you know your setup, check which overlays are currently applied:
# cat /boot/overlays.txt
The output shows the contents of the fdt_overlays variable, for example:
# fdt_overlays=verdin-imx8mp_hdmi_overlay.dtbo verdin-imx8mp_dsi-to-hdmi_overlay.dtbo
Select the tab that matches your intended configuration and append the indicated overlays to the fdt_overlays variable in /boot/overlays.txt:
Append the native overlay for your SoM:
- Verdin Family SoMs:
verdin-[SoM name]_ov5640-27mhz_overlay.dtbo - Apalis iMX8:
apalis-imx8_ov5640-27mhz_overlay.dtb
Example for Verdin iMX8MP:
# fdt_overlays=verdin-imx8mp_hdmi_overlay.dtbo verdin-imx8mp_dsi-to-hdmi_overlay.dtbo verdin-imx8mp_ov5640-27mhz_overlay.dtbo
Jumper configuration: the jumper can be set to either Default or Alternate (see Mezzanine Installation and Jumper Configuration). The functional result is the same in both cases; only the overlay name differs.
Append the mezzanine overlay that matches your jumper position:
- Jumper Default:
verdin-[SoM name]_mezzanine_ov5640-27mhz-default-jumpers_overlay.dtbo - Jumper Alternate:
verdin-[SoM name]_mezzanine_ov5640-27mhz-alt-jumpers_overlay.dtbo
Example for Verdin iMX8MP with jumper in Default position:
fdt_overlays=verdin-imx8mp_hdmi_overlay.dtbo verdin-imx8mp_dsi-to-hdmi_overlay.dtbo verdin-imx8mp_spidev_overlay.dtbo verdin-imx8mp_mezzanine_ov5640-27mhz-default-jumpers_overlay.dtbo
Jumper configuration: the jumper must be set to Alternate â see Mezzanine Installation and Jumper Configuration.
Append both overlays, the native overlay for your SoM and the mezzanine alternate overlay:
- Native (Verdin Family):
verdin-[SoM name]_ov5640-27mhz_overlay.dtbo - Native (Apalis iMX8):
apalis-imx8_ov5640-27mhz_overlay.dtb - Mezzanine Alternate:
verdin-[SoM name]_mezzanine_ov5640-27mhz-alt-jumpers_overlay.dtbo
Example for Verdin iMX8MP:
fdt_overlays=verdin-imx8mp_hdmi_overlay.dtbo verdin-imx8mp_dsi-to-hdmi_overlay.dtbo verdin-imx8mp_spidev_overlay.dtbo verdin-imx8mp_ov5640-27mhz_overlay.dtbo verdin-imx8mp_mezzanine_ov5640-27mhz-alt-jumpers_overlay.dtbo
After editing the file, reboot the board to apply the overlay:
# reboot
At the beginning of the boot process, you can confirm that the overlays were applied successfully in the boot messages:
Found U-Boot script /boot.scr
5974 bytes read in 1 ms (5.7 MiB/s)
## Executing script at 50280000
Loading DeviceTree: imx8mp-verdin-wifi-dev.dtb
87774 bytes read in 2 ms (41.9 MiB/s)
152 bytes read in 1 ms (148.4 KiB/s)
Working FDT set to 50200000
Applying Overlay: verdin-imx8mp_hdmi_overlay.dtbo
2219 bytes read in 2 ms (1.1 MiB/s)
Applying Overlay: verdin-imx8mp_dsi-to-hdmi_overlay.dtbo
4099 bytes read in 1 ms (3.9 MiB/s)
Applying Overlay: verdin-imx8mp_spidev_overlay.dtbo
561 bytes read in 1 ms (547.9 KiB/s)
Applying Overlay: verdin-imx8mp_ov5640-27mhz_overlay.dtbo
3217 bytes read in 1 ms (3.1 MiB/s)
8106902 bytes read in 33 ms (234.3 MiB/s)
Find the Deviceâ
To check which /dev/video* is a capture device, use the Video4Linux Control (v4l2-ctl) application from the v4l2-utils package.
List the video devices:
# ls /dev/video*
/dev/video0 /dev/video1 /dev/video2 /dev/video3
Show information about a specific device, for example /dev/video3:
# v4l2-ctl -d3 -D
Driver Info:
Driver name : mxc-isi-cap_v1
Card type : mxc-isi-cap_v1
Bus info : platform:32e00000.isi:cap_devic
Driver version : 6.6.23
Capabilities : 0x84201000
Video Capture Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04201000
Video Capture Multiplanar
Streaming
Extended Pix Format
The video device can appear on any of the listed /dev/video* nodes. Check all of them to identify the correct one before running the pipeline.
When using both MIPI-CSI ports simultaneously, two capture devices will be available, one for each camera.
View the Video Outputâ
To view the video output, run the command according to your SoM:
For a single camera:
# gst-launch-1.0 -v v4l2src device=/dev/video3 ! video/x-raw ! videoconvert ! waylandsink
For the dual camera setup, the following pipeline displays both cameras side by side in a single output window:
# gst-launch-1.0 compositor name=mix \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=640 sink_0::height=480 \
sink_1::xpos=640 sink_1::ypos=0 sink_1::width=640 sink_1::height=480 ! \
videoconvert ! waylandsink \
v4l2src device=/dev/video3 ! video/x-raw,width=640,height=480 ! videoconvert ! mix.sink_0 \
v4l2src device=/dev/video4 ! video/x-raw,width=640,height=480 ! videoconvert ! mix.sink_1
# gst-launch-1.0 -v v4l2src device=/dev/video2 ! video/x-raw ! videoconvert ! waylandsink
The media pipeline is already set up by the device tree settings. However, you must configure the video source format and force a matching format in the GStreamer pipeline:
# media-ctl --set-v4l2 '"ov5640 4-003c":0 [fmt:YUYV8_1X16/640x480@1/30]'
# media-ctl --set-v4l2 '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:YUYV8_1X16/640x480]'
# media-ctl --set-v4l2 '"30102000.ticsi2rx":0 [fmt:YUYV8_1X16/640x480]'
Then start the GStreamer pipeline:
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,format=YUY2 ! waylandsink sync=false -v
The media pipeline is already set up by the device tree settings. However, you must configure the video source format and force a matching format in the GStreamer pipeline:
# media-ctl --set-v4l2 '"ov5640 4-003c":0 [fmt:YUYV8_1X16/640x480@1/30]'
# media-ctl --set-v4l2 '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:YUYV8_1X16/640x480]'
# media-ctl --set-v4l2 '"30102000.ticsi2rx":0 [fmt:YUYV8_1X16/640x480]'
Then start the GStreamer pipeline:
# gst-launch-1.0 -v v4l2src device=/dev/video3 ! video/x-raw ! videoconvert ! waylandsink
# gst-launch-1.0 -v v4l2src device=/dev/video4 ! video/x-raw ! videoconvert ! waylandsink
Remember to replace the /dev/video* node in the commands above with the one corresponding to your camera, as identified in the Find the Device step.
Click here to see a sample of the Gstreamer command output. This may vary depending on the used SoM.
# gst-launch-1.0 -v v4l2src device=/dev/video3 ! video/x-raw ! videoconvert ! waylandsink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstWaylandSink:waylandsink0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
Redistribute latency...
0:00:12.3 / 99:99:99.
How to Use Video Streams on Linux - Video4Linux & GStreamerâ
For more details about using Video4Linux and GStreamer tools to interact with cameras and collect video frames, see Cameras on Toradex System on Modules.
Having Trouble?â
Please contact our technical support. Various options are listed in the article below.
















