🛠 Caméra MIPI CSI : brancher une Raspberry Pi Camera (OV5647/IMX219) sur la ZERO 3W
Objectives
One of the unusual strengths of the ZERO 3W: its MIPI CSI camera port (4 lanes, 22-pin 0.5 mm FPC connector) accepts Raspberry Pi Camera V1.3 (OV5647) and V2 (IMX219) modules — rare on a non-Raspberry board. You will correctly wire the ribbon cable, enable the sensor driver, and capture an image via V4L2. This is the building block for IP camera, NPU vision, and robotics projects listed in the project sheet (IPC car, KVM, etc.).
Hardware
- 1 Radxa ZERO 3W (Radxa OS bookworm b1 recommended: it is the officially fully tested image)
- 1 Raspberry Pi Camera V1.3 (OV5647) or V2 (IMX219) module
- 1 22-pin CSI ribbon cable (pay attention to contact orientation!)
- GPIO Tutorial: the 40-pin connector is not required here, only the CSI port matters
Procedure
- With the board powered off, open the FPC connector latch, insert the ribbon cable with contacts facing the board (check orientation on the connector silkscreen), and close the latch. On Pi cameras, the ribbon is shorter on the lens side — use this as a reference.
- Enable the sensor overlay. Under Radxa OS, the
rsetuptool (overlays menu) exposes device trees for supported sensors; for OV5647/IMX219, enable the corresponding overlay and then reboot.
sudo rsetup # Menu > Overlay > caméra (ov5647 ou imx219)
sudo reboot
- After reboot, verify the sensor → pipeline chain:
dmesg | grep -iE 'ov5647|imx219|mipi|isp' # le driver a-t-il répondu sur I2C2 ?
v4l2-ctl --list-devices # apparaît : /dev/video-csi ou rkcif
# Capture d'une frame :\nsudo apt install v4l-utils
v4l2-ctl -d /dev/video-csi --set-fmt-video=width=1920,height=1080,pixelformat=NV12 --stream-mmap --stream-count=1 --stream-to=frame.raw
# Ou via ffmpeg si présent (nom du périphérique selon l'image) :
ffmpeg -f v4l2 -video_size 1920x1080 -i /dev/video-csi -frames:v 1 frame.jpg
- The sensor is controlled via I2C (I2C2_SCL/SDA_M1 on the CSI connector): run
i2cdetect -l, then the relevant bus should show the sensor address (0x10/0x36 typical for OV5647/IMX219).
Expected Verification
dmesg displays a successful sensor probe (ov5647 found / imx219 x:x); v4l2-ctl --list-devices lists a video pipeline linked to the CSI; a .raw frame is produced with a consistent size (1920×1080 NV12 ≈ 3.1 MB). A blurry image in the foreground is normal: these modules come focused at infinity from the factory, gently rotate the lens to adjust.
Common Errors
- Ribbon cable inserted backwards: nothing on the I2C bus, no sensor messages in dmesg — power off and flip it.
- FPC latch not properly closed: partial contact, noisy image or random detection.
- Enabling the overlay AND another conflicting device on I2C2: the CSI occupies I2C2_M1, take this into account in your overlays.
- Expecting libcamera/rpicam as on a Raspberry Pi: here the pipeline is Rockchip (rkcif/rkisp on BSP) — rpicam-* tools do not apply.
- Looking for the camera on the 40-pin connector: the CSI is a dedicated 22-pin connector, distinct from the GPIO.
- Mainline image: sensor support is less mature there than on the Radxa BSP — for a reliable camera project, stick to the officially tested image (bookworm b1).
Other tutorials for this board
- Premiers pas avec la Radxa ZERO 3W : flasher Radxa OS et démarrer
- Wi-Fi 6 et Bluetooth 5.4 : se connecter, choisir l'antenne, connaître sa révision
- GPIO avec libgpiod : faire clignoter une LED et lire un bouton
- Installer le système sur l'eMMC : rkdeveloptool, MaskROM et gain de fiabilité
- Noyau mainline avec Armbian : vérifier le device tree, ajouter un overlay, lire le SARADC
- NPU 0,8 TOPS : inférence RKNN (YOLO, Whisper) sur la ZERO 3W
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash