Skip to content

Quick Start

Note

The following applies to the Bullseye system.

Hardware Connection

Warning

Cameras are sensitive to static. Earth yourself prior to handling the PCB.
A sink tap or similar should suffice if you don’t have an earthing strap.

Connecting Description

The Raspberry Pi and the camera module are connected using a flexible cable. The connection to the camera is called CSI interface and the connection to the Raspberry Pi is called MIPI interface.

  • Connect to Camera

There are two different kinds of Raspberry Pi CSI camera connectors: 15-pin and 22-pin.

  • Connect to Raspberry pi

The flex cable inserts into the connector labelled CAMERA on the Raspberry Pi, which is located between the Ethernet and HDMI ports. The cable must be inserted with the silver contacts facing the HDMI port. To open the connector, pull the tabs on the top of the connector upwards, then towards the Ethernet port. The flex cable should be inserted firmly into the connector, with care taken not to bend the flex at too acute an angle. To close the connector, push the top part of the connector towards the HDMI port and down, while holding the flex cable in place.

There are two different kinds of Raspberry Pi MIPI port connectors: 15-pin and 22-pin. The 15-pin connector is mostly seen on standard Raspberry Pi model; the 22-pin is on Raspberry Pi Zero-W and Compute Module IO Board.

15pin Pi3/Pi4

motherboard-pi-4-1536x1052

pi-4-to-cam-connection-1536x552

22pin Pi Zero/ Pi Zero 2 W

pi-zero-board-pinout-3

CM3/CM4

pi-compute-module-pinout-1536x1050

Connection schematic

  • Pi3/Pi4

pi4-1

pi4-2

  • Pi Zero/ Pi Zero 2 W

pizero-1

  • CM3/CM4

cm3-1

Software


Pivariety Cameras

Pivariety cameras Sensor list:

Resolution Camera Module
2MP IMX462
2MP OG02B10
2MP OV2311
2.3MP AR0234
16MP IMX298
18MP AR1820
21MP IMX230

Note

Since Raspberry Pi Bullseye OS 6.1.21, the arducam-pivariety driver has been merged into the Raspberry Pi kernel and the name of the device tree is changed to arducam-pivariety, dtoverlay=arducam-pivariety is required to set the overlay.

Use libcamera to access Arducam Pivariety Camera

Info

The Step 4. Install Camera Drivers is just suitable for the Raspberry Pi OS before 6.1.21. For later version, you just need to add dtoverlay=arducam-pivariety under [all] at the bottom of config.txt file(run the command: sudo nano /boot/config.txt to edit the config file), then reboot your Pi to take effect.

Step 1. Install Bash Script

wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
chmod +x install_pivariety_pkgs.sh

Step 2. Install libcamera

./install_pivariety_pkgs.sh -p libcamera_dev

Troubleshooting

If you receive the following error when installing libcamera, you can use the command ./install_pivariety_pkgs.sh -l to update your package:

libcamera-error-1

You can use following command to update your package:

./install_pivariety_pkgs.sh -l

Step 3. Install libcamera-apps

./install_pivariety_pkgs.sh -p libcamera_apps

Step 4. Install Camera drivers

Note

Please select the driver installation against the table above, just select one of the commands.

# PivarietyPlease se
./install_pivariety_pkgs.sh -p kernel_driver
Please reboot your Pi when you finish the installation.

sudo reboot

Step5. libcamera-apps

Preview 5 seconds.

libcamera-still -t 5000

If you do not have a display screen, you can save an image without displaying it. And an image of test.jpg will be saved in the current directory.

libcamera-still -t 5000 -n -o test.jpg

Use V4L2 Tools to Manually Control Arudcam Pivariety Camera

Step 1. Modify the Config File

sudo nano /boot/config.txt

Please manually add dtoverlay=arducam-pivariety,media-controller=0 at the end of the last line of config.txt file:

pi1

Save and reboot

sudo reboot

Step 2. Check the video0 node

ls /dev/video*

pi2

Step 3. Check the capture formats and controllers

v4l2-ctl --list-formats-ext

pi3

v4l2-ctl -l

匹

Step 4. Fetch Data

  • Test the frame rate
v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat='GREY' --stream-mmap

pi4

  • Save one-frame image
v4l2-ctl --device /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat='Y10P' --stream-mmap --stream-to=frame.raw --stream-count=1

pi5

  • Adjust exposure and gain
v4l2-ctl --device /dev/video0 -c exposure=1000 -c analogue_gain=200 --set-fmt-video=width=1920,height=1080,pixelformat='Y10P' --stream-mmap --stream-to=frame.raw --stream-count=1

pi6

  • Chech whether it is success
v4l2-ctl -l

pi7