Using the Camera Module
The Zero W has a CSI camera connector, which opens the door to photo and video projects - but there's a hardware gotcha specific to the Zero family that trips up a lot of beginners, covered first below.
The Cable Gotcha
Connecting the Camera
With the correct Zero camera cable in hand, connecting it is a matter of careful, gentle handling:
- Power off the Zero W before connecting or disconnecting the camera cable.
- Gently lift the plastic clip on the camera connector on the board - it flips up, it doesn't need to be forced or pried off.
- Insert the ribbon cable with the contacts facing the correct way, matching the orientation shown on the board's silkscreen markings next to the connector.
- Push the plastic clip back down to lock the ribbon cable firmly in place.
- Double check the cable is seated evenly on both sides before powering back on - a cable that's in at an angle or only partially seated is a very common cause of "camera not detected" errors.
On current versions of Raspberry Pi OS, the camera is generally auto-detected without needing any extra configuration. If your particular OS version or setup requires enabling the camera interface explicitly, that option lives in the Raspberry Pi OS configuration tool - check there if the camera isn't being detected after connecting it correctly.
Taking a Photo and Recording Video
On current Raspberry Pi OS (Bookworm and later), the correct, actively-maintained commands are
rpicam-still for photos and rpicam-vid for video. Take a test photo with:
rpicam-still -o test.jpg
And record a 10-second test video with:
rpicam-vid -o test.h264 -t 10000
(the -t value is in milliseconds, so 10000 means 10 seconds). Both
commands save their output to the current directory by default - change the filename after
-o to control where the file goes.
libcamera-still and libcamera-vid still work as
symbolic-link aliases for backward compatibility, but rpicam-* is the name to actually
use going forward. The original raspistill / raspivid commands, from the
old MMAL-based camera stack, are deprecated and have been removed on current Raspberry Pi OS
(Bookworm) - don't rely on them in new projects.