Using Canon and Nikon lenses with Raspberry Pi

Lately many subscribers are asking me how they can use their professional lenses like Nikon or Canon directly with Raspberry Pi. I have good news for you …. you can do it. You can use the PiCamera as a digital sensor and add a set of adapters that allow you to directly screw the lens on the PiCamera board. Personally I could not test the actual functionality of the whole (not having the material), but in this article you will find a wealth of information that will be really useful. If you are a Makers, you’ll find excellent opportunities for fabbricarti adapters alone, otherwise you can directly use the adapters available for sale.

Using Canon and Nikon lenses with Raspberry Pi 2

Starting material

If you are fond of Raspberry Pi certainly you will have all the necessary material, so you can skip this section. However, if you do not have any material I want to give you the necessary information on starting material.

Raspberry Pi

First you need of a Raspberry Pi board. Currently on the market there are still various models, I recommend everyone to buy a Raspberry Pi 3 (the latest model) that in terms of performance is much higher than previous models. It also has the built-in wireless, so you can take your photos remotely by commanding the board (eg from you smart phone) and get the photo from the network.

Raspberry PI 3 Model B CPU 1.2 GHz Quad Core, 1 GB RAM

If I had to start from scratch, and you do not have any accessories required as a power supply, SD card, cables, etc, I highly recommend you buy the complete kit.

Raspberry Pi 3 Starter Kit

The Raspberry PiCamera module

Raspberry PiCamera

The second required component is the module containing the camera designed to be integrated with all Raspberry models, called PiCamera. I recommend to read a series of articles in this site. They explain the PiCamera, how it is made, how it works and a series of tutorials on how to program it. Furthermore various possible applications with sample code are shown.

Replace lenses on PiCamera with other models (including Nikon and Canon lenses)

Richard J Kinch has designed and marketed a solution to directly embed the PiCamera module with professional lenses. He has designed and built a series of adapters that allow you to screw the lens and center their focus directly on the PiCamera sensor. That way you can shoot from Raspberry using professional equipment.

You can go see the page with all the documentation here. This article depth technical analysis of PiCamera is performed and all technical information is accurately described.

the table that lists all possible optical and procedures needed to mount them is really very interesting.

Raspberry Pi Camera Module Field of View (FOV)
With Various Typical Alternative Lenses
Lens   (Focal Length
and Mount)
Diagonal FOV
Angle in Degrees

(Full-frame still
Diagonal FOV
Angle in Degrees

(HD video
Required(See table
3.6mm stock lens65 °46 °NoneNone
6mm M12 lens41 °29 °M12 or Universal[1] or [2]
12mm M12 lens21 °15 °M12 or Universal[1] or [2]
25mm C-mount lens10 °7.0 °Universal[2]
35mm C-mount lens7.4 °5.0 °Universal[2]
50mm DSLR lens5.2 °3.5 °Universal + DSLR/C-mount[2] + [3]
Any given lens with
focal length f
2·atan(2.27mm ÷ f )2·atan(1.54mm ÷ f )Universal[2] + [4]
[1] Remove stock lens, install M12 adapter, install new lens.
[2] Remove stock lens, install universal adapter, install new lens.
[3] First attach additional DSLR/C-mount adapter to new lens. Examples: Canon EF, Nikon F.
[4] If given lens-mount is not M12 or C-mount, first attach additional lens-to-C-mount adapter to lens.

Taking the PiCamera module you will see that the rotation of the lens counterclockwise approaches the focus, instead clockwise the focus will be set to infinity. If you completely unscrew the lens system, you will remove it from the webcam. Removing the lens, you will see immediately below the IR filter. This filter also serves as a barrier to the dust, thus protecting the underlying surface of the optical sensor.

When a digital sensor is designed so small (as well as the one present on smartphones) and miniaturized optical devices are assembled, many issues arise that designers must meet. In fact, with decreasing the size of the optical system, the ideal behavior of the optical system deteriorates. The distortions of the acquired image increase becoming more noticeable (even including colors distorsions).

Instead of modifying the optics in order to solve these problems, the designers have created a post processing correction system. That is, the image is captured with the distortions and then the internal firmware will eliminate them “programmatically” before saving the image as a file. Even the PiCamera module performs these operations, in which the firmware corrects color distortions.

The approach of this solution which has led to the realization of digital webcam with small size and at very cheap prices. However, it creates more problems that you encounter. In fact the distortions are specific to a particular optical apparatus mounted over the sensor. Substituting the optical apparatus, the distortions produced will be different and the post-processing solution does not obviate the problem. In your project you will need to replace the original optical PiCamera with other models and then have to deal with these problems.

So even if you use the much higher quality professional lenses, the results will be very bad. Indeed

best optical not mean better pictures

If you want to replace the optical drive, you will need to necessarily change the firmware that performs the post-processing corrections. But this operation is very complex, since we do not know how these corrections are made and there are no tools that allow you to change those applications.

An alternative to this approach is to capture the image with the various distortions and then use the ImageMagick application to make corrections. This application is a command line and a simple scripting can automate the conversion process. Generally, the distortions will be of chromatic type, in particular of radial color corrections will be required.

Adapter for M12 lenses

The M12 lens are mounted on PC WebCam of higher quality, surveillance rooms, etc. They are often used for their quality and small size.

The adapter for these lenses proposed by Richard J Kinch is the following

Universal adapter lenses (including Canon and Nikon lenses)

Even in this case, Richard J Kinch proposes a universal adapter, in C-Mount format.

Mounting Canon Lens on Raspberry Pi

As regards the Canon world, there is an adapter specifically designed for Canon lenses that allows you to mount all the lenses using this universal adapter type C

Fotodiox Pro – Adapter C Mount

With this adapter you can mount your Canon lenses directly Raspberry

Mounting Nikon Lens on Raspberry Pi

As regards the Nikon world, there is another adapter specifically designed for Nikon lenses always using the universal adapter

Fotodiox Pro NikG-CMount-Pro

Other applications – Mounting Raspberry on microscopes to acquire scientific images

Another interesting application is acquiring images directly from optics of a microscope, in order to make the analysis of images successively. Even in this case the C-mount adapter is used.


I hope this article has been helpful to get ideas and helpful information for your projects. If you want to submit your project or your experiences on this, we would be happy to publish them in your name (you can send an email or contact me via the form).[:]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.