Raspberry Pi just launched the Camera Module 3, which is a huge upgrade.
With a little camera like this, you just plug it into a Raspberry Pi,
and then you can program your Pi to do things like take pictures and video, be a custom webcam, or
even do face or object recognition like I did in my video about blowing Red Shirt Jeff last year!
[Jeff looks a bit put off]
But this new version has some major upgrades.
First, the image sensor is bigger. It's the Sony IMX708,
which is the same sensor Oppo used in their Find X2.
The sensor has new tech, like backside-illumination, and stacked CMOS,
which makes the image quality a lot better than the older Camera Modules. The sensor is 7.4mm,
which is close to the size of the HQ camera, and almost double the area of the old Camera Module 2.
But the best thing about this new camera is built-in autofocus.
You can set focus manually, autofocus once, or turn on continuous autofocus,
but in every case it works great. The sensor uses Phase-Detect,
and not the slower 'Contrast-Detect' method that hunts back and forth a lot.
The camera comes in three varieties, a normal model with either a 75° or 120° lens,
or a NoIR version that lets you take pictures in the dark. It costs $35,
and unlike most Raspberry Pis right now, you might actually be able to buy one!
Now this isn't the first autofocus camera for the Pi. That honor goes to ArduCam,
who launched two different autofocus cameras last year.
And Raspberry Pi also sells the High Quality camera, which doesn't have autofocus but lets
you screw on better lenses, and has a tripod screw that makes mounting a lot easier.
This new camera module has the same form factor as the earlier Camera Module and Camera Module 2,
but the lens and autofocus element is bigger, so it won't fit in most existing cases,
like my neat little Pi Zero enclosure, or this Pi camera case from Adafruit.
But new cases for the new Camera Module will be out soon. Also,
any case that doesn't cover the front of the camera module should still work.
I wanted a quick way to test the image quality, and also compare it to my iPhone
13 Pro. So I looked around and found a really cool 3D printed camera design
called the PIKON. Kevin McAleer designed this case that holds the Pi, a touchscreen,
the camera, and a shutter button in a compact 3D printed case. And it's really ergonomic!
So I decided to build my own version.
I bought all the parts I needed, including a 3.5" touchscreen,
a pushbutton for the shutter, and some screws to hold everything together.
I dry-fit everything besides the case, and it's already looking pretty good!
But to fit my parts into the PIKON case, I had to modify it a little. I'm using a
large pushbutton for the shutter, so I added a hole in the case for it.
And the PIKON was built for the HQ camera, not the Camera Module,
so I modified the front mounting holes too.
And when I went to print the case, I realized I still had
some rainbow filament I was using to print a unicorn for my daughter, and,
well... That filament doesn't work as well for a precise print like this camera case.
So I swapped back to black, and printed another case. This time it printed perfectly,
and after removing the supports, I went back to my desk to put it together.
By the way, I have instructions and code for everything in my pi-camera GitHub repository,
see the link below. First I slid the camera module's flat cable through the slot on the case,
and screwed the camera module to the front. Then I flipped it over,
and screwed the Raspberry Pi in place.
I soldered a 2x4 header onto the push button, so I could plug it into the GPIO pins,
then I took it back to my desk and slotted it through the hole. It's really hard to
tighten up the nut that holds it in place, but eventually I got it in.
I plugged the shutter into the GPIO pins, then I plugged the camera cable
into the Pi's Camera port. I plugged in the screen,
which uses the first bunch of GPIO pins, then I screwed in the bottom plate.
The PIKON case is great, but there are already some improvements I think we could make:
there's no tripod screw in the base plate, the screw holes aren't recessed so it
doesn't sit flat, and there's nothing really securing the screen in place.
But like I said, I have the details on GitHub, so maybe we can improve on it a
bit more. I love that about the Pi community. Kevin made this first design and has a whole
video about it on his YouTube channel. I saw that, and I remixed his work a bit,
changing it for my needs. And maybe someone else can take this case and take it to the next level!
Right now I have to power the Pi via USB-C, and that means there's a cable hanging outta the top,
which is a little annoying. Hopefully I can find a way to use a battery internally.
For software, I'm using this camera script, and to get the screen working,
I had to run a few commands and tweak the Pi's boot config.
Like I said, all the gory details are up on GitHub, so go check that out.
Since I didn't have a tripod screw, I used gaff tape to mount the camera next to my iPhone on
a two-camera tripod adapter. For power, I taped a power bank to the handle, and—well,
this thing won't win any awards for looks—but now I can compare my iPhone and the Camera Module 3.
I tested it out quickly with a picture of my black Xbox controller, and already,
you can see the camera module struggles a bit indoors, at least on auto settings.
The iPhone's picture has a lot more detail, and the exposure is a bit closer to reality.
Of course, the iPhone does HDR and multi-exposure magic to get better
pictures. But the Camera Module can actually do HDR also—I just haven't had time to test it yet.
So to get a better idea of how the camera performs, I grabbed the rig and headed outside.
First up, I went to an area overlooking Route 66. I hopped out of my car,
turned around, and snapped a picture of my trusty old Camry.
Everything in the Pi picture is a bit more muddy, and the Camera Module underexposed
a bit to save the highlights in the sky. Overall, a win for the iPhone.
And looking at the railroad overpass, besides the different field of view,
I was actually surprised how the Pi camera turned out. To my eye, the Pi got better
colors and exposure here. The iPhone seems to have overprocessed the darker parts.
For autofocus, shooting directly into the sun seemed to confuse the sensor. The iPhone focused
just fine, but on the Pi, it kept losing focus if the sky was in the majority of the frame.
Something I didn't really notice in other pictures—there was a bit
of waviness in the Pi pictures! If you look at the tower in the iPhone picture,
it's a nice straight line. In the Pi image, it's a bit wavy. It seems like this might be
due to the shutter speed, and maybe it's a bug in the beta software I was using.
But I did wanna point that out. It only seemed to happen outside in the sunlight.
Switching gears to an up-close macro shot, the Camera Module does better here. It's
only rated down to 10 centimeters, but I've found it can focus a little
closer than that. And when it does, the out of focus areas are pretty pleasing.
But jumping back to a wider shot, this picture really shows the difference the
lens makes. The Camera Module's lens just isn't as sharp as the iPhone's. And there's
a lot more distortion around the edges, like on this house. But I expected that: you're not
gonna get exquisite lens coatings and multiple correcting lens elements on a $35 Pi camera!
And here's another picture with wavy distortion in the tower,
and the Pi's colors also seem to be a bit off.
For this last outdoor photo, you can really see the difference the lens makes. The Pi
picture is good, but when you zoom in all the way on the tower in the middle of the photo,
the iPhone has a lot more detail, even though both cameras saved a 12 megapixel file.
Wrapping up the photo testing, I also got a wide angle Camera Module right
before publishing this video, so I did one test shot in my workshop with both cameras.
The wide angle is a lot wider; 120 degrees versus
75. And you can also see I'm wearing shorts in the middle of winter here.
Zooming in on the wide angle, though, the lens just can't keep up. It washes out a lotta detail.
Even so, I expected some distortion on the sides, but in that regard, it's not bad at all.
It can't compete with my iPhone, but it's plenty of quality for a
surveillance camera or something you'd put on a robot for object detection.
I haven't tested the NoIR camera yet, but I'll leave that for a future video.
And in general, I've only had time to take a few hundred pictures so far.
The sensor is very good, almost on par with the secondary ones on the iPhone. But the lenses are a
bit lacking. They don't do the sensor justice, so you waste a bit of that 12 megapixel resolution.
With the right lenses, the High Quality camera is
pretty much tack sharp. But with a similar sized, newer sensor,
the built-in lenses on the Camera Module 3s just can't resolve a full 12 megapixels of detail.
But they're decent—especially considering the whole thing is $35 bucks!
If you want a crisper autofocus camera,
the 64-megapixel Hawk-Eye from ArduCam is best. But it's also $60—almost twice as much.
The Camera Module 3 does seem to have better autofocus than the Hawk-Eye, though.
I won't spend much time discussing video quality, but I did take some videos. It's
certainly acceptable for webcam use or if you wanna do surveillance or or something like that.
But it's not as sharp as even a mid-range smartphone. My wife's iPhone SE gives
a better picture, and it can even shoot in 4K without frame dropping!
Some recordings from the Pi had a little stutter, like this video of traffic on Route 66. But again,
I'm using beta software so that might get better if the drivers are improved,
or if I can optimize my Picamera scripts a little better.
The video quality is certainly better than all but the most expensive webcams,
and this camera is a great upgrade over the Camera Module 2, for ten bucks more.
If you want autofocus and the highest image quality,
the ArduCam Hawk-Eye is best. And if you don't need autofocus at all,
the HQ Camera might be perfect. But those options are both more expensive!
I will say, the thing I liked most testing all this out, was the freedom it gave me.
I realized at one point I was SSH'ing into my camera. It was actually easier for me to
tweak settings and grab pictures off this Pi than it is on my expensive GoPro's,
Sony's, or heck, even my iPhone!
Having full control over my camera without any apps,
and free reign to change the OS or swap out components—that's pretty cool.
On the flip side, that also means the UI is all up to me, and, yeah... it's not great.
The touchscreen I used is pretty bland, and its drivers are terrible for a camera. So
overall I'd only recommend building you're own PIKON if you're a sucker for torture...
Just like this video's sponsor! No, I'm just kidding. Until next time, I'm Jeff Geerling.