top of page

How to Enable Camera on Raspberry Pi 5: Connect and Test

15 hours ago
6 min read

To enable the camera on a Raspberry Pi 5, shut the board down, connect the camera with the right 22-pin ribbon cable, and boot Raspberry Pi OS Bookworm or later. Official cameras are detected automatically, so there is no camera switch to turn on. Run rpicam-hello --list-cameras to confirm the Pi sees it, then capture a test image.


The confusion is understandable. Older tutorials tell you to open raspi-config and enable a camera option, and on the Pi 5 that option no longer exists. The Pi 5 also changed the camera connector, so the cable that came in the box with your camera may not fit. Skip either detail and you end up with the dreaded "no cameras available" message and no idea where to look.


This guide walks through the whole path in four steps: connect the cable, check the software configuration, test the camera, and fix detection problems. We build MIPI CSI-2 camera modules at Vadzo, with driver support for the Raspberry Pi 5, so we also cover what changes when you use a non-official sensor.


How to Enable Camera on Raspberry Pi 5


You need a Pi 5 running Raspberry Pi OS Bookworm or later, a CSI camera, and a 22-pin ribbon cable that matches the camera. Collect these first, because the cable mismatch is the most common reason a first attempt fails.


Hardware and software checklist


  • A Raspberry Pi 5 with its power supply and a bootable microSD card.

  • Raspberry Pi OS Bookworm or later, fully updated.

  • A camera with a CSI (MIPI) ribbon connector.

  • A ribbon cable with a 22-pin end for the Pi 5. Older camera boards use a 15-pin connector, so you need a 15-pin to 22-pin cable.

  • A monitor or a remote desktop session if you want a live preview. Without one, you can still capture files.


Which cameras work out of the box


The Pi 5 has two camera ports, so you can attach two cameras at once. Official modules are recognized automatically. The table shows the current official lineup.


Camera

Resolution

NoIR version

Notes

Camera Module 2

8 MP

Yes

Fixed focus, adjustable by hand

Camera Module 3

12 MP

Yes

Motorised autofocus, standard and wide lens

High Quality Camera

12 MP

No

Needs a CS or M12 lens

AI Camera

12 MP

No

On-sensor AI processing

Global Shutter Camera

1.6 MP

No

Suited to fast motion


Third-party sensors follow the same hardware steps but need an extra line in the configuration file, covered in Step 2.


Check the cable end before anything else, because the Pi 5 needs a 22-pin connection.

Step 1. Connect the ribbon cable


Power the Pi off completely, lift the connector clip, slide the cable in with its contacts facing the contacts inside the port, and press the clip back down. Take 30 seconds on this step. A half-seated cable produces the same symptoms as a broken camera.


Match the cable to the port


The two camera and display ports sit along the edge nearest you, between the micro HDMI connectors and the Ethernet port. Each is labeled CAM/DISP. Both accept a camera, and the same port type can also drive a display.



Camera Module 3 and other older boards ship with a 15-pin cable, which does not fit the smaller Pi 5 port. Buy a 15-pin to 22-pin cable, or a camera that already ships with a 22-pin end. Most failed first attempts on the Pi 5 trace back to this mismatch.


Seat the cable


  1. Shut down with sudo shutdown -h now and unplug the power.

  2. Gently pull up the edges of the port's plastic clip.

  3. Insert the cable so the metal contacts face the contacts in the port. The cable should go in straight and stop firmly.

  4. Push the clip back down to lock it.

  5. Attach the other end to the camera board the same way.

  6. Power the Pi on.


Never connect or disconnect a camera while the Pi is running. Hot-plugging can damage the camera or the port.


A correctly seated cable sits square in the port with the clip fully closed.

Step 2. Check the camera configuration


There is nothing to enable in raspi-config on the Pi 5. Bookworm detects official cameras on boot through one line in the boot configuration file. Your job is to confirm that line is present and the system is current.


Confirm automatic detection


Open the configuration file and look for the detection setting:


grep camera /boot/firmware/config.txt


You should see camera_auto_detect=1. That is the default on a fresh image. Then bring the system up to date and reboot:


sudo apt update sudo apt full-upgrade -y sudo reboot


Updating matters because camera drivers and the rpicam tools ship through the normal package updates. An old image can hide a camera that a current one finds.


Add an overlay for non-official sensors


Auto-detection only knows official sensors. For a different sensor, disable it and load a device tree overlay for that sensor. Edit the file with sudo nano /boot/firmware/config.txt and set:



camera_auto_detect=0 dtoverlay=imx219,cam0


Replace imx219 with your sensor's overlay name, and use cam0 or cam1 to match the port you used. Reboot afterward.


Third-party MIPI modules depend on a driver from the maker. Our MIPI cameras, such as the Bolt-234CGH global shutter autofocus camera, come with Raspberry Pi 5 driver support, so you do not write a driver yourself. Follow the integration guide that ships with every Vadzo evaluation unit for the setup.


On a Pi 5, enabling the camera means checking one config line, not flipping a switch.

Step 3. Test the camera


A working camera shows up in rpicam-hello --list-cameras, previews with rpicam-hello, and saves a file with rpicam-still. Run them in that order, and stop at the first one that fails.



Confirm detection and preview


First list what the Pi can see:


rpicam-hello --list-cameras


A detected camera appears with its sensor name and available modes, for example 0 : imx708. Then start a five-second preview:


rpicam-hello -t 5000


The preview needs a monitor or a remote desktop session. Over plain SSH, add -n to skip the preview window. On some older Bookworm images, the same commands are named libcamera-hello and libcamera-still.


Capture a still, a clip, and a Python frame


rpicam-still -o test.jpg rpicam-vid -t 10000 --codec libav --libav-format mp4 -o test.mp4


The first command saves a photo. The second records ten seconds of video, since -t is in milliseconds. The Pi 5 has no hardware H.264 encoder, so the libav codec handles the encoding in software. To test from code, use Picamera2:


import time from picamera2 import Picamera2 picam2 = Picamera2() picam2.start() time.sleep(2) picam2.capture_file("test.jpg")


If rpicam-still saves a sharp image, the whole chain from cable to driver works.

Step 4. Fix "no cameras available"


When rpicam-hello --list-cameras reports no cameras, start with the physical connection, then the configuration, then the kernel log. Nearly every case falls into one of the causes below.


Work through the causes in order


Symptom

Likely cause

Fix

"No cameras available"

Cable not fully seated or flipped

Power off, reseat both ends, check contact direction

Camera never appears

15-pin cable in a 22-pin port

Use a 15-pin to 22-pin cable

Works on one port only

Faulty cable or port

Try the other port, then another cable

Third-party sensor missing

No overlay loaded

Set camera_auto_detect=0 and add the sensor dtoverlay

Commands not found

Outdated image

Run sudo apt update && sudo apt full-upgrade

Preview fails over SSH

No display attached

Add -n or use remote desktop


Test with a second cable before you blame the camera. Ribbon cables fail more often than sensors.


Read the kernel log


If the table does not settle it, ask the kernel what it found:


dmesg | grep -i -E "imx|ov5647|csi|camera"


A line naming your sensor means the driver loaded, and the problem is in the tools or configuration. Silence means the Pi never talked to the sensor. In that case, recheck the cable, the port, and the overlay name.


No sensor name in the kernel log means the problem is physical or in the overlay, not in your code.

Your camera is ready to use


You have the full sequence now: power off, fit the correct 22-pin cable, confirm camera_auto_detect=1 or add an overlay for a third-party sensor, then verify with rpicam-hello --list-cameras and a test capture. When detection fails, the cause is almost always the cable, so check it first.


If your project needs a sensor beyond the official lineup, such as global shutter, 4K autofocus, or HDR, explore Vadzo's MIPI camera modules with Raspberry Pi 5 driver support. Our application engineering team can help you choose a camera for your build.

 
 

Reach Vadzo Team for the Customization

Vadzo team shall be able to assist you with the details on this.

contact form camera image
bottom of page