An S-mount lens holder is the part that turns a bare board camera into a working camera: it holds the lens at one fixed distance from the sensor, and that distance decides where the lens can focus. Set the height wrong and the lens runs out of thread before it reaches your working distance, or it focuses only millimetres from the target. This guide walks through choosing the holder variant the board actually needs, setting the height from the lens data sheet, computing the focus travel and tolerance, then focusing on a live image and locking without moving the result.
The one distance that decides everything
S-mount specifies the thread — M12×0.5 — and nothing else. C-mount fixes its flange focal distance at 17.526 mm for every lens and camera; S-mount leaves the lens-to-sensor distance to each design. The lens data sheet prints it as a reference distance from the lens's mounting face to the sensor surface, cover glass included, and most board lenses fall in a 4.5–8.5 mm band. That printed value is the number your holder has to reproduce.
Back focus is therefore the usual culprit when a board camera will not sharpen; the concept is covered in lens focal length vs back focus in board cameras. The holder here has four jobs: hold the reference face at the rated height, keep the lens axis square to the sensor so both sides of the field sharpen together, stay rigid against vibration, and clear the components around the sensor without stacking the lens higher than the optics allow.
Pick the mount variant at order time
Three hardware cases exist, and the choice is fixed when you order the board, not afterwards.
Some boards form the mount as part of the PCB itself — a machined M12 lens mount on the board, so no separate holder exists to buy.
- Sensor format
- 1/2.9"
- Lens mount
- M12
- Interface
- GigE
- Resolution
- Up to 3 MP
The other extreme is a board shipped with no mount at all.
- Sensor format
- 1/1.8"
- Interface
- USB3
- Resolution
- 6-10 MP
- Shutter
- Rolling
A board like this needs the camera maker's dedicated board-level mount. Do not substitute a generic M12 standoff that happens to clear the connectors: generic parts clear the components by sitting high, and the extra height is travel the lens cannot get back. If the board itself is still an open choice, board level camera selection for embedded vision machines lists what to check, mount included.
The mount type is also a variant decision. The same sensor is offered with an M12 boss or with a CS-mount receptacle.
- Sensor format
- 1/1.8"
- Lens mount
- CS-mount
- Resolution
- 6-10 MP
- Shutter
- Rolling
The trade-offs are set out in CS mount vs S-mount camera variant: choose at order time. Within one mount type, colour and mono boards of the same sensor often take different mounts: a mono part carries a plain cover glass of roughly 0.4–0.5 mm, while a colour part usually bonds an IR-cut window on top of it, adding a few tenths of a millimetre. Order the variant the camera documentation names for your exact part number and colour, not one that looks the same.
The height math: travel, tolerance and sensitivity
Five relationships carry the job. Magnification comes first, m = sensor width / field width, and the rest follows. For fields wider than a few times the sensor these thin-lens numbers are layout values — the live image has the final word.
The extension term is what the lens's focusing thread must supply, and an M12 thread advances 0.5 mm per turn — the mechanics are in M12 lens thread pitch and focus shift — so extension converts directly into turns.
The last two lines set the tolerances. T' is the total slack at the sensor; half of it is your height budget each way. Δs prices a height mistake in object space. On a 7.4 mm wide sensor:
| Magnification | Field width | Focus shift per 0.1 mm height error |
|---|---|---|
| 0.05 | 148 mm | 40 mm |
| 0.10 | 74 mm | 10 mm |
| 0.20 | 37 mm | 2.5 mm |
Every 0.1 mm of holder height is a large slice of the working distance at low magnification, which is why the height belongs to machined metal and not to stacked shims.
Worked example: a 74 mm field at 132 mm
Take the 6 MP, 1/1.8" mono sensor of the bare board above: a 6 MP count across a 1/1.8" chip works out to about 2.4 μm pixels and a 7.4 mm wide active area (3096 columns × 2.4 μm ≈ 7.4 mm). Target a field of 74 mm, ten times the sensor width:
- m = 7.4 mm / 74 mm = 0.10
- s = 12 mm × 1.10 / 0.10 = 132 mm working distance
- v = 12 mm × 1.10 = 13.2 mm, so Δv = 0.10 × 12 mm = 1.2 mm of extension past the infinity position
- turns = 1.2 mm / 0.5 mm per turn = 2.4 turns
Tolerances, with the lens at N = 2.8 and the circle of confusion set at the 2.4 μm pixel pitch: T' ≈ 2 × 2.8 × 2.4 μm × 1.10 ≈ 15 μm total at the sensor, so ±7 μm. At the object that is ±7 μm / 0.10² = ±0.7 mm. Sensitivity: a 0.1 mm holder error moves best focus 0.1 mm / 0.10² = 10 mm.
The example lens is a 12 mm, F2.8, 5 MP M12-mount design rated for the 1/1.8" format — a direct match for this sensor.
- Sensor format
- 1/1.8"
- Mount
- M12
- Image circle
- 8-11 mm
- Focal length
- 12-25 mm
Fitting it: seat the lens at the rated reference distance and expect best focus in the region of 2.4 turns out from the infinity position. Starting half-way into the travel and finishing on the live image absorbs the gap between the thin-lens estimate and the real design.
Fit, focus and lock
What you need:
- the board's dedicated holder in the variant named for your exact part
- a lens matched to the sensor format — M12 lens selection for board cameras covers the filter by format, focal length and IR cut
- a printed dot target about the size of your field
- a ruler or gauge for the working distance
- the camera on its host with live view running
- an ESD wrist strap and mat
- Check the clearance. Hold the holder over the board and sight through the bore: every component under it must sit below the holder's relief. If anything fouls, stop — that is the wrong variant.
- Fix the holder square. Drive the specified screws evenly so the reference face sits parallel to the sensor; uneven torque now is tilt later.
- Thread the lens to mid-travel, leaving range in both directions.
- Set the working distance from target to lens front with the ruler, at the value from the height math.
- Focus on the live image, moving the lens in small steps until the target centre peaks.
- Walk the corners. If the centre is sharp and one side is soft, the lens is tilted: loosen, re-seat square, refocus. The corner routine is the same as any M12 fit — M12 lens focusing: adjust, check corners and lock.
- Lock. Snug the setscrew in small steps while watching the image; a shift of a few tens of micrometres at the sensor is normal, so aim slightly past focus before the last step.
- Record the position as turns from the fully seated distance. A rebuilt station reproduces the setup from that number alone.
How you know it worked
Three checks, in order. The whole field sharp: focus the centre, then sweep the target and confirm the field edges hold detail at the same working distance. The setup survives locking: with the setscrew tight, the image must match the pre-lock image. The setup survives temperature: if the cell runs warm, re-check after an hour at operating temperature — focus drift with heat is common enough that we cover it separately in camera focus drift with temperature.
The dot target earns its keep here too: 0.5 mm dots on a 76 mm × 76 mm grid cover this field size, and any residual tilt or decentering shows as uneven dot spacing toward one side.
- Type
- Calibration targets
The lens accessories range includes these targets alongside the adapters, tubes and filters.
Common mistakes
- A stacked generic holder. A standoff that clears the connectors by sitting high leaves the lens permanently extended: it focuses only close and never reaches your distance — the lock-out described in M12 lens thread travel and in lens focuses only at close distance. Fix: the dedicated mount at its rated height.
- The wrong colour/mono variant. The thread feels fine and the image is close to focus everywhere, sharp nowhere. The package swap moved the image plane by several times the worked example's ±7 μm budget.
- Counting turns from bottomed-out. The seat is not a focus reference; the live image is, and seating hard leaves burr and grit between seat and lens shoulder.
- Hard setscrew. Overtorque tilts the barrel and one side of the field goes soft. Snug, then walk the corners again.
- Skipping the thermal check. A mount that holds focus at room temperature can lose it at operating temperature; the hour-long soak finds it before the line does.
Ordering the set as one decision
Order the board, the mount variant and the lens together: the board-level cameras and M12 board lenses categories filter by sensor format and image circle, and the lens configurator narrows the pairing once you know the field. If the correct holder variant is unclear, contact us with the board's part number and the lens data sheet — those two documents fix the height.
Questions
The lens data sheet has no reference distance — how do I find the right holder height?
Find the infinity height empirically. Fit the holder loosely, view a distant target, and thread the lens out until focus peaks; the axial distance from sensor surface to lens seat at that point, measured with a depth micrometer, is the lens's infinity reference. Add the extension m × f for your working distance from the height math, set the holder to the sum, then confirm at the real distance on a live image.
Why do colour and mono cameras take different holders, and what happens if I swap them?
The sensor package thickness differs: a mono part carries a plain cover glass of roughly 0.4–0.5 mm, while a colour part usually bonds an IR-cut window on top, adding a few tenths of a millimetre. Swap the mounts and the image plane moves by several times the sensor-side focus budget, so the board focuses only at shifted distances. Store the variants separately and label them with the full part number.
How accurately does the holder height need to be set?
Close enough that the thread can reach, then let the thread finish. At 0.1× magnification, a 0.1 mm height error moves best focus 10 mm in object space, and the ±7 μm tolerance at the sensor equals ±0.7 mm at the object. Aim the machined height within about a tenth of a millimetre, focus on the live image in quarter-turn steps, and lock.
Can I skip the holder if my board has a threaded M12 boss?
Yes, if the boss is machined to the rated height for that sensor package. Treat it as the holder: thread the lens to mid-travel, set the working distance, focus on the live image and lock. If the thread runs out before focus, the boss height does not suit that lens — shimming a lens thread is fragile at tenths-of-a-millimetre scale, so select the correct mount variant instead.
How do I stop the lock screw from shifting focus?
Tighten in small steps while watching a live image at high magnification, and aim slightly past best focus before the final step so the shift lands centred. Expect a few tens of micrometres of shift at the sensor. Re-check the corners afterwards, because an overtightened screw tilts the barrel and softens one side of the field. If the shift repeats every time, reduce the preload or use a nylon-tipped screw.




