This is an old revision of the document!
Pi Lens Info
This is a collection of facts and trivia found on the web with technical details about the Pi camera mounts and fitting an M12 mount to it.
The mounting holes on both v1 and v2 RPi cameras are on 21 mm centers:
You have to manually cut or file down a notch in the M12 mount for the micro-flex cable that comes out of the camera module. That isn't too hard, but there is also a M12 mount specifically designed for the RPi cameras, with a notch already:
The v1 and v2 sensor sizes are the same, the so-called 1/4-inch format. On V1 the lens focal length is f=3.6mm with Angle of View: 54 x 41 degrees and on V2 it is f=3.0mm with Angle of View: 62.2 x 48.8 degrees. Note the angle of view is quoted at full-frame; remember some video modes use a cropped subset of the full frame. This is a moderately wide angle lens. If you double the focal length, you'll get half the field of view. If you get a 8mm lens that's a moderate telephoto, and a 16mm lens is definitely telephoto. I've tried a number of cheap M12 lenses that work “ok”:
but don't expect perfectly sharp images with the tiny 1.4 or 1.1 micron pixels these camera sensors use. Lower f-number lenses are “faster” (let in more light) but will have more shallow depth of field and more blurry overall. You will see f/1.4 or lower sold for use in low light, but I have not had good images with those; I would recommend f/2.0 or above if you want decent resolution.
The longest lens I've tried is a reversed 4x microscope objective, about f=27mm delivering 8 degrees horizontal field of view:
I made a 3D printed holder for it:
That lens is good enough to recognize faces from over 100 feet away. Attached image is a crop from 1640×1232 (full-frame) mp4 video from v2 camera, using that lens.
person about 140 feet (43 m) away
3D V2 M12 lens adapter
I have remixed the existing M12 lens adapter to fit the Pi V2 camera.
Apparently the mini connector on the V1 camera is centered whereas the V2 camera connector is offset.
I printed this and after cleaning up the supports, fits like a glove.