Note
Welcome to the SunFounder Raspberry Pi, Arduino & ESP32 Community on Facebook!
Get technical support and troubleshooting help.
Learn and share projects, tips, and tutorials.
Access early product previews and updates.
Enjoy exclusive discounts and giveaways.
👉 Join us here: [here]
Camera Module
Note
The Pironman 5 series does not include a camera module. You will need to prepare one yourself or purchase it from our official website:
In this section, you will learn how to:
Disassemble the Pironman 5.
Install the camera module onto the Raspberry Pi 5.
Reassemble the case.
Test the camera module by capturing photos and recording videos.
By the end of this section, you will have a fully installed and functional camera module ready for your projects.
Assemble the Camera Module
Follow these steps to assemble the Camera Module:
Remove the two acrylic panels from the case.
Detach the 2-pin wire and FPC as shown in the image.
Unscrew the four screws to remove the NVMe PIP and Power Switch Converter module group.
Disassemble the module group. This involves removing a rivet, which should be done by pushing the central shaft of the rivet out with a screwdriver, then removing the entire rivet.
Connect the Camera Module to the FPC cable.
Thread the FPC through the CAMERA hole in the case.
Continue to thread the FPC through the CAMERA hole in the case.
Connect the FPC to the Raspberry Pi. This step is very compact and requires careful handling.
Power on the Raspberry Pi 5 and check if the Camera Module is properly connected.
First, connect a display to the Raspberry Pi or establish a VNC connection.
After booting into the system, run the following command to check if the camera works:
libcamera-helloIf you see a preview window, the camera is working correctly.
Reassemble the Power Switch Converter back into the case.
Reassemble the NVMe PIP back into the case.
Reassemble the case cover.
Use the Camera Module
Test the Camera
Raspberry Pi OS (Bookworm and later) uses the libcamera stack. After booting into the system, run the following command to check if the camera works:
libcamera-hello
If you see a preview window, the camera is working correctly.
Take a Photo
libcamera-jpeg -o test.jpg
This will capture a still image and save it as test.jpg.
Record a Video
libcamera-vid -t 10000 -o test.h264
-t 10000means recording for 10 seconds.-o test.h264saves the output as H.264 video.
To convert the video to MP4 format:
ffmpeg -i test.h264 -c copy test.mp4
Python Example
You can also control the camera with Python using the picamera2 library.
Install dependencies:
sudo apt install python3-picamera2 -y
Create a Python file:
nano camera_test.py
Then paste the following code:
from picamera2 import Picamera2
import time
picam2 = Picamera2()
picam2.start()
time.sleep(2)
picam2.capture_file("image.jpg")
Save and exit nano by pressing CTRL+O, then ENTER, and CTRL+X.
Run the script:
python3 camera_test.py