M12 Lenses for a Raspberry Pi High Quality Video Conferencing Camera

Max Henkart - November 26, 2020

A few early users of our lenses are actively involved in the RPi community and mentioned the products in a thread. And many people were curious "well what lens should I use?"

This post should address these questions! This is a DIY hacky post I made during WFH in Covid. My professional optical engineering and camera design efforts are more comprehensive.

About Me (Max): I'm a freelance optical engineering and camera design consultant. I've been through several startups through the pre-seed days. I've been project based with a few Series A to Series D companies on their camera HW. I worked for a major US/Chinese lens manufacturer for 5 years. If you drive a US or European vehicle, you're likely driving around with several camera lenses from the company.

I'll show you the camera hardware and most importantly: the output images.

There are five sections to this post. Click below to skip forward to what you're interested in:

  • A Preface about Professional 4K Video Conferencing Cameras.
  • A Review of The Raspberry Pi High Quality 6mm Lens.
  • The Commonlands M12 Lens Options and FoV Comparison Testing.
  • A 4 Stage "How-To" on lens/accessory selection, and professionally focusing the HW.
  • Conclusion

Disclaimer: I am not a model and I did this at home.

Raspberry Pi High Quality Video Conferencing Camera
Section 1

The Preface about 4K+ Video Conferencing Cameras

Video conferencing applications vary widely. There are end-of-room huddle screens, lecture-style meeting rooms, executive board rooms, and personal desktops. Each situation has different field of view (FoV) requirements, resolution, and price point. Now that Zoom, etc. have been widely adopted, we'll see how things shape up. 

Here's some free market research on the 4K+ compatible video conferencing products on the market - up to date as of Nov 2020. This should give you a sense of the FoV which the PMs at large companies select. 

The closest models to a consumer webcam were chosen for the below report. 

Company NameProductUse-casePriceHFoVEffective Resolution*
CiscoNoneLecture RoomN/A95°1080p Zoom
DolbyRoomSmall Office~$1k95°12MP 4K+
HuddlyGoHome +
Small Office
$35095°16MP
JabraPanacastHome +
Small Office
$695180°3*13MP
KataiBlueJayHome +
Small Office
$X**360°20MP
LifeSizeIcon 300Small Office$1.5k113°12MP (4K)
LogitechBrio UltraHome$19982°12MP 4K+
Owl LabsMeeting ProHome +
Small Office
$999360°12MP (720p)
PolycomEagleEyeCubeSmall Office$750+110°12MP 4K+

* Not all cameras use every pixel on the sensor. Down-sampling due to de-warping has been included in the metric shown in parentheses. Absolute angular resolution (#px across a persons face on the horizon) and parallax has been factored in.
** Please inquire if you're interested as a user or an investor. It's the first zero-parallax 360 camera in the world which is available in corporate volumes. The quality is epic. Big supporters and we will get you in touch.

Section 2

The Raspberry Pi HQ Off-The-Shelf 6mm Lens

Here's an output from the standard Raspberry Pi 6mm CS lens. As a starter lens it works, but the optics team over at RPi missed the distortion problem entirely. Maybe they said good-enough cheap-enough.

Either way, they decided to retail an underperforming lens that explicitly says "3MP" as their primary 12MP "High Quality" lens. I barely get 720p equivalent resolution when I run a proper ISO 12233:2014 eSFR measurement with this lens. Definitely not High Quality. Read our blog post about resolution for more insight into the types of resolution.

Notice how the ceiling curves?

Section 3

The Commonlands M12 Lens Options

Our 4K+ lenses for video conferencing with the the RaspberryPi are below. All of these lenses have <2% distortion which is greatly improved relative to the 6mm Raspberry Pi CS mount lens:

CIL028: a 2.8mm F/2.4 lens with 96° Horizontal Field of View.
CIL033: a 3.3mm F/2.6 lens with 88° Horizontal Field of View. Not Shown. 
CIL039: a 3.9mm F/2.4 lens with 77° Horizontal Field of View.
CIL042: a 4.2mm F/2.8 lens with 72° Horizontal Field of View.
CIL060: a 6.0mm F/2.4 lens with 55° Horizontal Field of View.

The Field of View Output Comparison

Here is what each of the lenses looks like in a webcam setting. These were taken in the full resolution still image mode with the default settings. To get the perfect image, I'd recommend messing around with the Auto-White Balance and Auto Exposure settings of your camera.

Not worthy of Science Magazine. But it'll cut it for a DIY project. A white wall behind you and ring lighting makes Zoom video quality way better. I skipped these steps so that you can visualize the performance better. The curtains and windows are 10' behind where I'm sitting.

Section 4

The Camera Hardware Walk-Through

Step 1: Figure out where you want to position your video conferencing camera.

Positioning is key to field of view selection. A laptop camera 1' from where you are sitting requires a completely different lens than if you are sitting 3' away from your battle-station.

We've provided an Angle of View calculator that is free to use here. You can use this to calculate the AoV/FoV you need from your scene geometry. My personal preference is to have my face occupy about 30%-35% of field of view.

Step 2: Purchase a Lens (or Two) and Accessories.

Here you are. Make the FoV decision. 

Scroll back up to the competitive research chart and the comparison images. It may help you decide what field of view you want to target. There are additional output images from each lens on the lens page. You can also check the mechanical profile and detailed specs on the pages.

Regardless of what you choose, an M12 lens on the RPi HQ will probably look something like this. Then you can 3D print or laser cut a housing accordingly.

The Adapter Talk

If you're using an M12 lens, make sure to get an M12-to-CS adapter. We don't care where, but it's needed.

It's also great to get something that let's you lock the focus reliably. That's why our CS to M12 mount adapters come with a focus lock ring. These two pieces enable you to fix the position of an M12 lens within a CS or C mount, without any Teflon tape or adhesive.

I know the cheap adapters on Amazon are tempting. Yes, Arducam has been known to put a screen print on these and retail them. Go ahead and try them if you want.

Personally, I've bought from several different vendors on Amazon, including 30+ from a vendor who has now delisted because of quality problems and cost over-runs. Every unit went in the trash because the 1"-32TPI thread spec didn't pass a Go-NoGo gauge - the thread pitch was incorrect. When Amazon receives this many complaints from customers, you know its a problem. The adapters barely made a single full rotation into the Raspberry Pi HQ mount...

A Side-Bar about M12 Lenses: They Usually Outperform C and CS mount lenses.

Many people think that "More Glass is Better Glass" where in fact the exact opposite can be true.. It has to do with the fact that the C, CS, EF, F, and PL mount systems were developed for CCDs in the 1900's. There are artificial optical design constraints that substantially reduce the MTF. We're well into the 2000's now and CMOS technology has advanced rapidly.

Interchangeable C and CS mounts are fine for 1"+ sensors that have a huge (>3 micron) pixel pitch. So, they were popular until 2013 when Sony released the 20MP 1" IMX183. They remain popular in the surveillance and machine vision industries because of their ease-of-use. In these industries, the pixel sizes are still fairly large, and people want to easily swap lenses.

Let's take the iPhone 12 and iPhone 12 Pro cameras for case and point that less glass can achieve pretty good image quality. A Sony Alpha full-frame mirrorless cameras destroy Canon full-frame DSLR cameras on every image quality benchmark possible - there is no back focal length restriction on the optical design.

Step 3: Create a Focus Chart

This hacky step of the project will get you the most bang for your buck. Especially if you are trying to fiddle with the lens all the time. Companies like Apple spend $500k+ for a single AA machine to get this step right. You can get 50% of the way there for under $1.

Get a cardboard box that's pretty flat. Breaking down an old Amazon box works.

Download and Print Siemens Star Chart. I'd suggest a Sinusoidal one as it's ISO12233 compliant if printed professionally.

Once you've printed out the chart, you can cut the box to size. I find that leaving one of the flaps open is a convenient way to create a triangular base.

Tape down the chart in the corners and centers. Fold the bottom flap into a triangle (if you left it) and tape to the back side of the box.

Now you have a focus target which is better than what dozens of camera manufacturers use.

Step 4: Focus Your Camera 

Set up your camera in the location you want to use it for video conferencing. I'd keep this as 'in-situ' as possible - make the focus set up representative of your real use case set up.

Now, put your single target in the location of where your head will be located. You may need to set up boxes or tripods to get the Focus Chart into the correct position. You'll want the Focus Chart to be normal to the camera.

Illumination is important and an easy way to improve the appearance of your video. Light rings are the cheapest and easiest thing for video conferencing. Pick one up on Amazon as the cheap ones are <$10.

How to Focus a Lens

This is a cheap, fast, and effective way to optimize the image quality across your face in the video. This single point focus method is not what I would recommend in a manufacturing environment.

If you are selling cameras to others or using them in a commercial project, I'd go with a field weighted approach. You can read our How to Focus a Camera post for more details. If you have questions about camera module assembly in production, please reach out.

Step 5: Get the SW/FW running and start conferencing!

If you've kept your Raspberry Pi HQ intact with it's absorptive blue glass IR cut off filter, then you're all ready to go. You can tweak various settings to improve the image quality.

If you've modified the Raspberry Pi HQ (removed the IR cut off filter or have NOIR version) there will be image quality settings which need to be tweaked. In a professional scenario, this is called Image Quality Tuning and includes tuning the 3As (Auto-White Balance, Auto-Exposure, Auto-Focus) Tuning. For this fixed focus project, it would only be 2A's.

At this point, I'll hand the project back on over to you. If you need another walkthrough with FW/SW guidance, check out the ShowMeWebcam (Hackaday) Project. Feel free to contact me at (mhenkart@commonlands.com) if you have any feedback or questions.

In Conclusion

You can make a pretty good 4K webcam using the Raspberry Pi High Quality camera. It'll outperform most of the cheap 1080p Logitech cameras on the market. And, you can customize the Field of View precisely to your set up. 

Read About Other Camera Engineering Topics

Use our Camera Calculators

Lens Focal Length Calculator. EFL Calculator.
Camera Angle of View Calculator. Camera AoV Calculator.
Camera Depth of Field Calculator. DoF Calculator.

Find a Lens For Your Project Using Our M12 Lens List Or By Clicking Below

210deg M12 Mini Fisheye Lens
210deg M12 Mini Fisheye Lens
210deg M12 Fisheye Lens
S mount Fisheye Lens 1mm
CIL211-F2.0-M12IR
210°@3.3mm Fisheye M12 Lens
$49.00
Mini M12 Fisheye Lens for Board Mount Cameras
Mini M12 Fisheye Lens for Board Mount Cameras
S-Mount Fisheye Lens
Arducam Mini Fisheye Lens
Mini Fisheye 1mm M12 Lens
CIL212-F2.0-M12IR
226°@3.9mm Fisheye M12 Lens
$49.00
A miniature fisheye 1.5mm M12 lens for All-Sky cameras.
A miniature fisheye 1.5mm M12 lens for All-Sky cameras.
A 1.5mm S Mount RPi mini fisheye lens. The lens has an EFL of 1.5mm, F/# of 1.8, and a M12 Interface.
A fisheye 1.5mm M12 lens. The lens has an EFL of 1.5mm, F/# of 1.8, and a M12 S Mount Interface
CIL015-F1.8-M12NIR
190°@4.2mm All-Sky M12 Lens
$49.00
200° M12 Fisheye Lens
200° M12 Fisheye Lens
200° Mini Fisheye Lens
Mini M12 Fisheye Lens
CIL219-F2.5-M12IR
200°@6.3mm Fisheye M12 Lens
$49.00
3mm Mini Fisheye M12 Lens
3mm Mini Fisheye M12 Lens
3mm S Mount Fisheye Lens Raspberry Pi
180°@9.1mm Fisheye M12 Lens
3mm Fisheye Lens for M12 Cameras
CIL231-F1.8-M12IR
180°@9.1mm Fisheye M12 Lens
$65.00
135° 4K+ low distortion M12 lens
135° 4K+ low distortion M12 lens
135° low distortion S-Mount Lens
Low Distortion 1.8mm M12 Lens
CIL018-F2.8-M12IR
Low Distortion 1.8mm M12 Lens
$39.00
Low Distortion Wide Angle M12 Lens 2mm
Low Distortion Wide Angle M12 Lens 2mm
Wide Angle Low Distortion 2mm S-Mount Lens CIL023
2mm M12 Lens Low Distortion
2mm M12 Lens Wide Angle No Distortion
CIL023-F1.8-M12IR
Low Distortion 2.2mm M12 Lens
$39.00
2.7mm M12 Lens for IMX226
2.7mm M12 Lens for IMX226
A 2.7mm M12 Lens for S-Mount FLIR
Arducam IMX477 2.7mm M12 Lens
CIL027-F2.8-M12IR
Low Distortion 2.7mm M12 Lens
$39.00
A wide angle 2.8mm M12 lens no distortion.
A wide angle 2.8mm M12 lens no distortion.
A 2.8mm M12 lens with a wide angle and no distortion for the RPi HQ Camera.
A wide angle no distortion 2.8mm S Mount Lens.
Low Distortion 2.8mm M12 Lens
CIL028-F2.4-M12IR
Low Distortion 2.8mm M12 Lens
$39.00
A 3.3mm M12 lens that is wide angle no distortion.
A 3.3mm M12 lens that is wide angle no distortion.
A 3.3mm S Mount lens for the Raspberry Pi High Quality Camera.
A 3mm FLIR camera lens. A wide angle no distortion M12 Lens
3mm S Mount Lens with Arducam
No Distortion 3.3mm M12 Lens
CIL033-F2.6-M12IR
No Distortion 3.3mm M12 Lens
$39.00
A 2.1mm M12 Lens for 1/3
A 2.1mm M12 Lens for 1/3
Tiny Pinhole Lens for S-Mount Cameras
15mm TTL Short M12 Lens for Surveillance
CIL821-F2.4-M12IR
Small 2.1mm M12 Lens
$39.00
Short Compact 3.6mm M12 Lens CIL036
Short Compact 3.6mm M12 Lens CIL036
Compact 3.6mm M12 Lens CIL036
Compact 3.6mm S Mount Lens CIL036
CIL036-F2.0-M12IR
Small 3.6mm M12 Lens
$39.00
210deg M12 Mini Fisheye Lens
210deg M12 Mini Fisheye Lens
210deg M12 Fisheye Lens
S mount Fisheye Lens 1mm
CIL211-F2.0-M12IR
210°@3.3mm Fisheye M12 Lens
$49.00
Mini M12 Fisheye Lens for Board Mount Cameras
Mini M12 Fisheye Lens for Board Mount Cameras
S-Mount Fisheye Lens
Arducam Mini Fisheye Lens
Mini Fisheye 1mm M12 Lens
CIL212-F2.0-M12IR
226°@3.9mm Fisheye M12 Lens
$49.00
A miniature fisheye 1.5mm M12 lens for All-Sky cameras.
A miniature fisheye 1.5mm M12 lens for All-Sky cameras.
A 1.5mm S Mount RPi mini fisheye lens. The lens has an EFL of 1.5mm, F/# of 1.8, and a M12 Interface.
A fisheye 1.5mm M12 lens. The lens has an EFL of 1.5mm, F/# of 1.8, and a M12 S Mount Interface
CIL015-F1.8-M12NIR
190°@4.2mm All-Sky M12 Lens
$49.00
200° M12 Fisheye Lens
200° M12 Fisheye Lens
200° Mini Fisheye Lens
Mini M12 Fisheye Lens
CIL219-F2.5-M12IR
200°@6.3mm Fisheye M12 Lens
$49.00
3mm Mini Fisheye M12 Lens
3mm Mini Fisheye M12 Lens
3mm S Mount Fisheye Lens Raspberry Pi
180°@9.1mm Fisheye M12 Lens
3mm Fisheye Lens for M12 Cameras
CIL231-F1.8-M12IR
180°@9.1mm Fisheye M12 Lens
$65.00
135° 4K+ low distortion M12 lens
135° 4K+ low distortion M12 lens
135° low distortion S-Mount Lens
Low Distortion 1.8mm M12 Lens
CIL018-F2.8-M12IR
Low Distortion 1.8mm M12 Lens
$39.00