Trying to use one of the Arducam M12/CS/C mount lenses on my Raspberry Pi 4B and I can’t get it to focus beyond 1 or 2 inches no matter how much I turn the focus. If I crank the aperture down to almost fully closed it sort of fixes it, but then the image is basically black. What’s weird is I also have the 16mm version of this lens and that one doesn’t have the problem at all. I’ve honestly never gotten this one to work.
So far the only things I’ve tried are moving both the aperture and the focus all the way to their extreme positions while watching the live preview on the Pi. That’s it.
If I missed something obvious a simple fix would be welcome, but if this lens is just bad out of the box I’d like to understand what’s going on. Any ideas?
Hi, thanks for the detailed write-up, that actually gives us a lot to work with. Let’s narrow it down a bit before jumping to conclusions.
First question: which camera board are you using this lens on? The Pi 4B itself usually isn’t the factor here - on a CSI-based setup the board and the mount/adapter are what affect whether you can reach focus.
A couple of things about your symptom that stand out to us:
Closing the aperture down improving focus but making the image very dark is typical of an optics/assembly issue rather than a software or Pi problem. Stopping down increases depth of field, which can mask a focus problem, but the trade-off is exactly what you’re describing.
The fact that your 16mm version of the same product focuses fine points away from a platform/config problem.
If you can tell us the board and post a photo of how the lens is mounted, that would help a lot.
Since the HQ camera is a C/CS mount board, just double-checking the obvious before we look at the lens itself:
Is there any adapter in the chain (e.g. C-to-CS or an M12 adapter), or is the lens going straight onto the board’s C/CS threads?
When you run the focus ring through its full travel, do you feel any point where it starts to come into focus at distance, even briefly? In other words, does it get closer to sharp and then fall back off, or does it never get anywhere near it?
Does the lens ever reach infinity focus, even with the aperture wide open and the focus ring at the extreme end?
Your “works at 1-2 inches but nowhere past that” description, combined with the aperture behavior, looks a lot like the optics/back-focus of this particular unit rather than anything on the Pi side. But answers to the above will confirm it.
No adapter that I know of - the lens threads right onto the HQ camera board.
No, it never gets close to sharp at distance. It’s fine at 1-2 inches and then it just stays blurry no matter where I put the focus ring.
No, I can’t get infinity focus out of it at all, even wide open with the focus ring maxed out.
Meanwhile the 16mm version screws onto the exact same board and focuses fine, which is why I keep coming back to this specific lens being the problem. Aperture nearly closed is the only thing that makes the distant image even vaguely usable, and then it’s way too dark to actually shoot with.
That confirms our suspicion. Here’s where things stand based on everything you’ve given us:
The focus range on this unit tops out at roughly 1-2 inches and never reaches infinity, even with the focus ring at its limit. A lens that can’t reach infinity focus on a known-good board is an optics/mechanical focus issue, not a settings one.
Closing the aperture improves things slightly but darkens the image. That’s expected behavior - stopping down widens depth of field and can partially hide a focus error - so it isn’t really a fix, just a symptom mask.
Your 16mm version of the same product focuses correctly on the same HQ camera and Pi 4B, which effectively rules out the board, the mount, and the Pi as the cause.
So this points to the optics/focus assembly of this particular unit rather than anything you’re doing wrong or any general design characteristic of the lens. We don’t have a confirmed fix for it here, and nothing you’ve tried so far suggests one is going to turn up from the settings side.
We’re following up on this internally - I’ll get back to you once I have more to share. In the meantime, if you notice anything else about the behavior (like whether it’s any different at different focal distances or with the aperture in between), feel free to add it here.