Changing Lenses on Raspberry Pi Spy Camera



I wanted to put very wide angle lenses on the Raspberry Pi Spy Camera (Adafruit and Arducam have slightly different versions). These cameras come with a M6 lens. The smallest wide angle lenses I could find are advertised as M7. You have to replace the lens holder to accomodate the new lens size. That is what this page is about.

Unfortunately, there seem to be a lot of different M7 lenses out there, with different thread patterns. So one M7 lens may not fit another M7 lens holder, so things are not as swappable or standardized as one might like. Usually a lens is sold with a lens holder that fits it.

Another set of folks doing a similar thing suggest using a lathe to re-thread the new lens, if possible. The thread size of the standard lens holder is M6x0.35mm.


This is one source of very wide angle lenses (more than 180) that work with the Raspberry Pi Spy Camera. Lens holders come with each lens.

Model: 130108MPF-M7
MOQ 100pcs: USD8.00 per piece
Qty 1K+: USD6.50 per piece
Qty 5K+: USD5.50 per piece
For large orders, our payment method is T/T wired transfer.

Ms. Kay, Sales Manager
CCOM Electronics Technology, Professional Lens Supplier
Phone: +86-183 9653 2780
E-mail: cctv.lens@ccom-tech.com; sales01@megapixellenses.com
Website: www.megapixellenses.com; www.ccom-tech.com

Need to put screen capture here.


M7 1.8mm 180 Degree Wide Angle Lens For Mini Camera (962825)
I am having a little trouble fitting these on now. They worked in the past ... Will investigate more. These are more like 160 on the Raspberry Pi Camera.

Need to put screen capture here.

Google "M7 wide angle lens" for lots of sources of these.

Also Google Images "M7 wide angle lens" for lots of sources and alternatives.


These pictures show the tool I designed to hold the current lens holder of the Adafruit spy camera during its removal. The diameter of the round part of that lens holder is 0.270in. I drilled a hole in a piece of aluminum with a 0.262in drill, and then cut a slot with a band saw so the two halves could move. The camera lens holder fits into this device, and a vise is used to tighten the grip.





I slice off the camera board from the old lens holder with an xacto knife. The slice is about midway on the square part of the lens holder. I first put a little slice into the four corners. After the slice is done, I gently push aside any remaining black plastic on the camera board.


I hold the camera board down with a combination of Removable Double Sided Tape under the board and regular tape across the flex cable.



Test the board to see if it is still working using raspivid. If not, start again with a new camera.

raspivid -t 0 -w 640 -h 480 -hf -p 0,0,640,480 -e

This is what working looks like:



Cut the alignment pins off the new camera holder with an xacto knife.



I glue the new lens holder on with model cement.



Put a bead on a surface and spread it out.



Put the lens holder in the puddle of glue to coat the bottom (not too much, and you really done't want to get any glue on the optics or imaging chip when you put it on.)


Put the lens holder onto the board. Let the glue dry for 24 hours.



You can test the camera right away, though. Don't try to focus until the glue dries.