HomeRaspberry PiMy first steps with Raspberry Pi Camera Module 3

My first steps with Raspberry Pi Camera Module 3

I will not buy a Camera Module v3... I'll buy two!

I have to wait for Raspberry Pi 5 until at least 2024, but it doesn’t mean that Raspberry Pi Foundation is done with releasing new hardware. My favourite SBC has a new add-on board: Raspberry Pi Camera Module V3, which comes in 2 flavours (technically in 4) and can be yours for as little as £25 (at least this is how much I paid for mine on the launch date). The question is – what can you do with it?

Camera Module V3

Pi Camera Module V3 wide and standard

From the physical footprint standpoint, the new Pi Camera Module V3 is almost identical to previous revisions with the exception of the pointy lens, which comes in 2 flavours. There are actually 4 SKUs for this particular product – two of them represent standard (72°) and wide-lens (120°) configurations and both come with and without an IR filter (dark PCB).

The biggest upgrade is the new 12MP sensor (from Sony IMX708) capable of 4608×2592 which is very close to the pixel count of the Raspberry Pi HQ Camera with the added benefit of phase shift autofocus – the tech previously available only on 3rd parties cameras like Arducam.

Pi Camera Module V3 closes the performance gap between the more expensive HQ Camera while keeping a modest price of £25. Anyone keen on the wide-lens model will have to pay an extra – £35. How does it look on paper compared to previously released models? Pretty impressive:

You are getting more bang for your money, that’s for sure but what can you do with the new and improved camera and how much better it is? It’s hard not to be hardware envy so let’s first examine sample pictures from each camera and see if you really need the latest tech.

Camera Module V1.3, V2.1, V3.0 and HQ

My collection of Camera Modules includes all boards starting from v1.3 (the very first camera module with revised hardware). Upon closer inspection, I discovered that my oldest module has a nasty scratch on the microscopic lens and my dreams of comparing pictures from all modules were laid to rest unexpectedly. It’s a shame, but as the oldest Camera Module is no longer in production – I will get over it. At least I thoughts so, as I acquired one for the test later on, because I can’t leave you disappointed!

I have a nice stand for the camera to take pictures of my test setup. I got it at ThePiHut store with my HQ Camera Module and the purchase of Arducam. With a couple of spare photography adapters (recommend this Amazon listing) I was able to create a makeshift mini-tripod for Pi Camera Module V3 that also fits on my motorised slider.

The first image on a 4K monitor – wow!

I quickly put together a small scene, flooded it with saturated lights and impatiently submitted the wide-angle Pi Camera Module 3 to the torture test. A few moments later I had my first image downloaded on my desktop. My first impressions were: “Honestly, this looks like a picture taken by a decent mobile phone!”. Which is a testament to the camera’s quality and AF performance. I had it open on my 4K display, marvelling at what £35 can get you nowadays.

After playing with Pi Camera Module v3 for some time, it’s clear to me, that the actual camera sensor is very close to what I would expect to see on mid-range mobile phones. It may not be a match to my 108MP Xiaomi Mi11 main sensor, but switching over to an ultra-wide lens on my £700 phone – and I can’t really tell them apart. After looking up the specs of my phone, it comes as no surprise – the ultra-wide camera on my phone comes with a 13 MP sensor.

Switching over to the video tells a similar story. Some more work is required to streamline the process of capturing video in compressed format, but for now, shooting at 1080p with 60FPS is a pleasure. The phase shift-based autofocus does a pretty decent job of keeping things sharp. Without motion tracking, I’m at the mercy of default settings – but it’s hard not to imagine libraries like libcamera, offering more options over time.

Setting up

Where I was pleasantly surprised was how easy was to start with Raspberry Pi Camera Module 3. The documentation is, as usual, comprehensive and easy to understand and the whole experiment required me to update the Raspberry Pi OS image (Bullseye) connect the camera and reboot the SBC.

Switching over between V2.1, HQ and V3 was also trouble-free. In my experiments, I used libcamera (leaving rpicam and legacy camera in the rearview mirror) – and to use another Pi Camera Module only required a board reboot to get it to work. Within minutes, I was taking pictures, controlling autofocus manually and recording short test videos – all via SSH. It’s the greatest strength of the components released by the Raspberry Pi Foundation.

#ShotOnPiCamera

Handy commands

Here are some commands I tried to capture videos and pictures. These will get you started, but to get the proper deep dive into controlling your Raspberry Pi Camera Module V3 with libcamera, I strongly suggest reading the original documentation:

##I strongly suggest Raspberry Pi OS with Desktop environment

## IMAGES ##

#testing, 1.. 2.. 3..
libcamera-hello

#give me preview window forever  (or use -t in ms)
libcamera-hello -t 0

#snapshot at full resolution - save file in current location
libcamera-jpeg -o test.jpg

#snap a picture with a preview window save image at selected resolution
libcamera-jpeg -o test.jpg -t 2000 --width 640 --height 480


## AF manipulation ##

#add to test AF before capture
--autofocus-on-capture	

# AF modes
--autofocus-mode default|manual|continous
--autofocus-range normal|micro|full 

#MF - 0= infinity or move the lens to the 1 / number position, so the value 2 would focus at approximately 0.5m
--lens-position 0


## VIDEO ##

#record 10 sec video as .h264 and save in current dir
libcamera-vid -t 10000 -o test.h264

# record 1080p@60
libcamera-vid --intra 60 --width 1920 --height 1080 -o test.h264

#as above but mjpeg file (compressed)
libcamera-vid -t 10000 --codec mjpeg -o test.mjpeg


## STREAM ##

#hey look, I can stream
libcamera-vid -t 0 --inline -o udp://<ip-addr>:<port>

#I'm also RTSP camera
libcamera-vid -t 0 --inline -o - | cvlc stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/stream1}' :demux=h264

Camera Module V3 vs Arducam

It’s hard not to draw a comparison between the latest release from the Foundation and autofocus-enabled cameras available from Arducam. As it happens, I got one to compare it to (Arducam 16MP AF) – and I’m extremely keen to see the results.

While I could argue, that until the release of Pi Camera Module 3, Arducam was a go-to sensor if you wanted HQ to look and autofocus without splashing 4x the price on the HQ Camera Module.

Do you recall my praise for how easy it was to set the Pi Camera Module 3? When I initially received the Arducam camera, the board got shelved as I struggled to get it working. I got one close to the release date, so everything was very raw and unnecessarily complex. I have no doubt, that Arducam offered an excellent hardware value for their asking price of $25, but only just now, do I have the will and time to re-visit the module again. Finding the relevant documentation for my Arducam 16MP module took some time too.

Raspberry Pi Camera Modules are really well supported. Swapping from Camera Module v1.3 to Pi Camera Module v3 was as simple as plugging new hardware in, rebooting and updating the OS. The documentation is excellent and detailed, and the first time I connected the Arducam, I struggled to get it to work.

In defence of Arducam, I found documentation that was easier to follow than on the launch day and a set of instructions that allow the Arducam to work with Octoprint. If you are looking for the correct way to run it, follow the instructions in raspi-config from this page (step 4), install this driver, then use the libcamera.

Octorpint?

Ages ago, I wrote about taking the advantage of custom lenses and a bigger, more sensitive sensor of the HQ Camera to create even more stunning timelapses in Octoprint using Octolapse. Dropping extra cash on the hardware update doesn’t scale up in this case – as the plugin itself is limited to a 1080p stream due to various development reasons using FFmpeg.

Swapping your existing webcam, or older Pi Camera module can improve the clarity of the image due to changes in sensor size, but at the moment, it’s not possible to utilise the whole resolution of the module without workarounds. The whole thing get’s even more complicated as the default Octoprint image runs Buster and it doesn’t support Pi Camera Modules v3 right now.

If you want to treat your 3D printer to fantastic timelapses, you’ll need to spend extra time adding libcamera libraries to Octoprint or wait until the support for the latest revision of camera modules is implemented. The effort might be worth it, as in exchange you get to experiment with wide and standard lenses fitted onto Pi Camera Module v3.

I’m going to explore this path soon, and share more details in another post as this is slightly outside of the scope of this article.

Final thoughts

Raspberry Pi Foundation has a camera module for every situation. From cheap and cheerful V1.3 which provides the bare minimum for vision-enabled projects, to HQ Camera which brings high-fidelity images and a selection of lenses to Raspberry Pi ecosystems. Thanks to Raspberry Pi Camera Module V3, the selection expanded to autofocus-enabled modules in standard and wide configurations. What not to love? Got questions? Leave them in this Reddit thread.

💳 – See the transparency note for details.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

M5Paper

Programable, ESP32 based awesome dev platform with 4.7 e-ink display by M5Stack

More HATs

client-image
client-image

Argon One M.2

Enclose Raspberry Pi 4 inside this great case with custom I/O, cooling and GPIO and M.2 SSD support

More cases on

client-image
client-image

Best Raspberry Pi Projects

How to use Raspberry PI as WOL (wake on lan) server

0
While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

Slow Internet Warning

0
From time to time my Internet grinds to a stop. Since Raspberry Pi 4 comes with a 1Gbps Ethernet, I decided to take advantage of it and create a reporting system in NodeRED that will monitor and report when the ISP is not keeping the contractual agreements. Works with Alexa, Google Home, Android and Windows 10.

How fast Raspberry Pi NAS is?

0
Let's see how fast Raspberry Pi NAS really is?

Argon18: Argon ONE SSD modification

0
Argon One case just got better - now you can boot it from USB without ruining the design thanks to Argon 18: Argon One SSD modification

HOW TO...

It took me 2 months to boot CM4 from NVMe

0
Complete beginners guide to Compute Module 4 boot from NVMe.

Raspberry Pi Zero 2 W vs other Zero boards

0
It's time to test the Raspberry Pi Zero 2 W against other Raspberry Pi boards from Zero series: power, WiFi, temperature and core performance

C/C++ and MicroPython SDK for Raspberry Pi Pico on Windows

0
A guide to SDK toolchain for Raspberry Pi Pico and C/C++ , Micropython on Windows.

A comprehensive guide to Grafana & InfluxDB

0
How to use Grafana and InfluxDB on Raspberry Pi for IoT sensors in home automation

How to boot Raspberry Pi 4 from USB

0
How to set up and boot Raspberry Pi 4 from USB drive - headless guide.