Skip to content

Converting a Raspberry Pi camera to M12 thread

Andreas Kahler edited this page Jul 29, 2022 · 5 revisions

This guide shows how to convert a Raspberry Pi camera to M12 thread (a.k.a. S-mount) using a 3d printed fixture

Items needed:

For all steps: be careful! Do not damage the sensor, the cable or the connectors!

Follow this guide at your own risk! This documentation is distributed WITHOUT ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS FOR A PARTICULAR PURPOSE.


First unplug the camera connector using a screw driver or your fingernails.

Image600804205072688157 Image6736906115495920058 Image3973657682711922051 Image928667062888910871

Then carefully lift off the camera module and remove the glue under it (we need to replace it, as we need to make sure the sensor sits flat on the PCB)

Image1098017799371113776 Image3584599373362362796 Image4020208658315945542 Image7720743845251000893 Image8392015631452969143

Now we remove the lens. We replace it with a M12 threaded lens, so we do not need it any more. I'd suggest to keep it anyway, so be careful and do not scratch it. The lens can to screwed out by rotating it anti-clockwise. The Pi cam comes with a white "wheel" tool that lets you do that easily:

Image7086595450478457419 Image1114355237742376596

You can also use a set of pliers to do that if you do not have the tool. If you have problems, you can also try a 3d printed tool: https://www.thingiverse.com/thing:4774511

Image5513300407185744137 Image7964327414816687666

The camera sensor is now unprotected! Make sure you do not touch or even damage the sensor in the following steps!

Then add the new piece of double-side sticky tape on the PCB. It should be the size of the white square on the PCB or little bit smaller (not larger!)

Image1071784062018889570 Image1258256931785081132

Now we put the sensor back on the PCB. Our suggested way to do this:

  • plug in the connector again (this will assure correct alignment)
  • remove protective film from sticky tape
  • press sensor onto sticky tape. Make sure the connector facing side makes contact with the sticky tape first, then the opposing side! This way it is ensured the cable is not stretched.
  • press down the sensor enclosure firmly

Image2897668538855766657 Image6757966938561853011 Image992514592725236178 Image2851073561311163789

Finally, put the 3d printed lens holder over the sensor. There is a cutout for the cable, defining the orientation. The alignment is done by two M2 screws. For use in StereoNinja, the screws go into the camera holder. We suggest to attach it there immediately, as the lens holder also protects the sensor. For the same reason also screw in a M12 lens at all time.

Image7550020075033378780 Image1754890696017754458

Clone this wiki locally