Pi Camera Module Deep Dive: libcamera, Lenses, Night Vision
libcamera Replaced raspistill/raspivid
If you're following an old tutorial that uses raspistill or raspivid, it's outdated — modern Raspberry Pi OS uses libcamera-based tools instead: libcamera-still, libcamera-vid, libcamera-hello (or the newer rpicam-* naming on very recent OS versions). Functionally similar commands, different binary names.
# Quick preview rpicam-hello # Take a photo rpicam-still -o photo.jpg # Record 10 seconds of video rpicam-vid -t 10000 -o video.h264Camera Module Versions
- Camera Module 3 — autofocus, HDR support, best all-around choice for most projects now.
- HQ Camera — interchangeable C/CS-mount lenses, sensor-only (no fixed lens), best when you need specific field-of-view/aperture control (telephoto wildlife cams, macro work).
- Global Shutter Camera — no rolling-shutter distortion, the right pick for anything with fast motion (robotics vision, high-speed capture) where a rolling shutter's "jello effect" would corrupt tracking.
NoIR Variant + Night Vision
The "NoIR" camera versions have no infrared filter, meaning they can see IR light — pair with IR illuminator LEDs (850nm or 940nm — 940nm is invisible to the human eye, 850nm has a faint visible red glow) for genuine night vision. Without an IR illuminator, NoIR just gives you slightly odd color rendering in daylight — the illuminator is what actually makes night vision work.
Common Wiring Mistake
The ribbon cable has a specific orientation — the blue backing faces the Ethernet/USB side on most Pi models (check your specific model's silkscreen). Inserted backward, the camera won't be detected at all, and it's the single most common "camera not found" support issue.
Lens Selection for HQ Camera
- Wide field of view (security, overview shots) → 6mm lens
- Standard/general purpose → 16mm lens (most common choice)
- Telephoto (distant subjects, wildlife) → 25mm+ lens with a CS-to-C adapter if needed
Performance Tips
- Lower resolution = higher frame rate — for motion detection or robotics vision where speed matters more than pixel count, drop to 640x480 rather than running full sensor resolution.
- libcamera-vid's hardware H.264 encoding is far more efficient than software encoding elsewhere in your pipeline — let the Pi's ISP do the encoding rather than piping raw frames to something like OpenCV for compression.
Related Guides
- How to Install Klipper on Any 3D Printer: Complete Setup Guide
- How to Hack Infrared Protocols with the Flipper Zero: NEC, RC5, Sony, and Raw Analysis
- How to Set Up OpenCV Machine Vision on a Raspberry Pi
- Raspberry Pi: Complete Headless Setup Guide (No Monitor Needed)
- Flipper Zero: Creating Universal IR Files
- Raspberry Pi: Headless OS Setup
- How to Set Up a Raspberry Pi Headless with SSH and WiFi
- How to Install and Configure Pi-hole on Raspberry Pi