Turn an S-mount lens half a revolution and focus can leap clean off the part. Turn a different lens the same amount and nothing visible happens. That is not luck: an M12×0.5 thread always delivers the same travel per full turn. A quadratic optical lever turns that travel into anything from half a millimetre to well over 100 mm of focus shift at the object. This page gives you the mechanics, the lever formula, a worked example you can re-run with your own station's numbers, and the decisions that follow: how coarse a turn you can afford, when to stop down instead of turning, and why C-mount focus behaves differently. The same math applies to any M12 lens on any board-level camera.
What M12×0.5 does mechanically
The designation carries both numbers that matter. M12 is the 12 mm nominal thread diameter, and 0.5 is the pitch: the distance the barrel advances along the axis in one full revolution. A single-start thread has a lead equal to its pitch. So one full turn is 0.5 mm of travel, a quarter turn is 0.125 mm, and a sixteenth is about 0.03 mm.
S-mount defines no standardized flange focal distance. The thread is the focus mechanism: you move the whole optical stack relative to the sensor until the image distance matches the working distance, then lock it. Every M12 fitting is therefore two decisions — where the lens sits relative to the sensor (back focus), and how much thread travel you have to reach it. Lens focal length vs back focus in board cameras covers the first; this page covers what each turn of travel buys you.
Counting turns beats any printed scale. Mark the barrel shoulder against the holder, count full turns in or out, and multiply by the pitch. If the barrel binds, stop and check it is square before forcing it: camera lens mount thread binding: safe checks before fitting lists the safe checks.
The lever: half a millimetre at the lens, up to 180 mm at the object
Turning the lens changes the image distance, and the thin-lens equation links the two sides:
WD is the working distance, f the focal length, v the image distance, and Δv the travel you dial in. The second line is the rate of change of the first: the object-side focus shift per millimetre of lens travel. It is exact to first order and good to a few percent for a one-turn move.
The square is the story. At WD = 2f the lever is (2 − 1)² = 1, so a full turn moves focus one pitch length at the object. At WD = 10f it is 81: 40.5 mm. At WD = 20f it is 361: 180.5 mm. Because only the ratio matters, one table reads every lens:
| WD / f | Shift per full turn (mm) | Per quarter turn (mm) |
|---|---|---|
| 2 | 0.5 | 0.13 |
| 3 | 2 | 0.5 |
| 5 | 8 | 2 |
| 10 | 40.5 | 10 |
| 15 | 98 | 24.5 |
| 20 | 180.5 | 45 |
A 25 mm lens at 500 mm and a 12 mm lens at 240 mm both sit at WD/f = 20 and inherit the same 180 mm per turn. The ratio also explains the hair-trigger feel at distance. Focusing the example lens from 120 mm out to infinity uses only 1.3 mm of thread, barely two and a half turns, while reaching 30 mm costs 6.7 mm more, about thirteen turns.
Half a turn on the example lens at 120 mm working distance
The inputs: f = 12 mm (the lens spec below), Δv = 0.5 mm per full turn (the M12×0.5 pitch), WD = 120 mm (a common compact-stand-off distance, giving WD/f = 10), and a focus tolerance c = 5 µm, about two pixels for a 5 MP 1/1.8" sensor.
The rule in words: the sharp plane at the object moves by the lens travel times the square of (WD/f − 1), and the usable depth around it is DOF ≈ 2 × N × c × (WD/f)² with N the f-number.
The arithmetic:
- (WD/f − 1)² = (120/12 − 1)² = 9² = 81
- Full turn: 0.5 mm × 81 = 40.5 mm of shift at the object
- Half turn: 0.25 mm × 81 ≈ 20 mm
- Quarter turn: 0.125 mm × 81 ≈ 10 mm
- Depth of field at F2.8: 2 × 2.8 × 0.005 mm × 10² = 2.8 mm total
One full turn therefore sweeps about 14 times the entire depth of field; a quarter turn sweeps about 3.5 times.
The decision at WD/f near 10: half turns are for bracketing only, since a half turn is a 20 mm overshoot. Approach sharpness in quarter turns, then trim in sixteenths, where 0.03 mm × 81 ≈ 2.5 mm sits close to the depth of field. If a quarter turn still jumps past the part, stop down one or two stops and accept the resolution trade covered in M12 lens light gathering: pick a lower f-number, same focal length.
The example's optics match the 12 mm, F2.8, 5 MP lens below, which covers a 1/1.8" sensor:
- Sensor format
- 1/1.8"
- Mount
- M12
- Image circle
- 8-11 mm
- Focal length
- 12-25 mm
Same station, different lenses
Hold the 120 mm station and swap focal length. A 25 mm lens shifts 0.5 × (120/25 − 1)² = 0.5 × 3.8² ≈ 7.2 mm per turn, fine gearing where the example lens leaps. Move that 25 mm lens out to its natural 500 mm stand-off and the lever returns: 0.5 × (20 − 1)² = 180.5 mm per turn. At 60 mm the pair gives 8 mm and about 1 mm per turn respectively.
So focal length sets the gear ratio at your station. Choose it for field of view first — M12 lens selection for board cameras: format, focal length and IR cut walks that choice — then check the focus mechanics against the table above. Both parts below are 5 MP lenses covering a 1/1.8" sensor:
| Specification | LS-MBL-0113 | LS-MBL-0031 |
|---|---|---|
| Focal length | 12 mm | 25 mm |
| Mount | S-Mount | M12 |
| Price | $39.00 | $60.00 |
Values as printed in each product's data sheet; open a part for its drawing and full specifications.
Why short threads lock out close focus
Run the lever backwards and the thread-length problem appears. The image distance grows as the working distance shrinks: v = f × WD/(WD − f). The example lens at 120 mm sits at v ≈ 13.3 mm; at 30 mm it needs v = 20 mm, and at 24 mm, v = 24 mm. Each turn is worth less as you come closer (the WD/f = 2 lever is one pitch per turn), yet close focus eats the thread fastest. That is why some S-mount barrels need a spacer to reach a near working distance at all: M12 lens thread travel: why short threads lock out close focus works that problem, and M12 lens focusing: adjust, check corners and lock covers the hands-on side.
C-mount and CS-mount: focus off the thread
C-mount fixes the distance from mount face to sensor at 17.526 mm and CS-mount at 12.5 mm; the 5 mm difference is what a CS-to-C adapter ring corrects (flange focal distance). A C-mount lens holds that distance and focuses by moving groups inside its own barrel, so the thread-pitch lever never enters the focus path and the back focus is standardized instead of tuned.
S-mount moves the entire stack, which is cheaper and slimmer but leaves the station's mechanics to you. The split in practice: if the station sits at WD/f above 15 and needs repeatable, serviceable focus, a C-mount lens on a board-level camera is the sturdier build. If the camera must fit inside 30 mm of depth, S-mount plus the turn-count discipline works. The adapter arithmetic lives in C mount vs CS mount: adapters, focus and clearance, and the fitting checks follow the same article's lock-and-verify steps.
Where the usual advice fails
- "Just turn until it looks sharp." At WD/f ≥ 10 each turn sweeps 40 mm or more at the object, so you bracket the plane without landing on it. Count turns and use the table.
- "A finer thread pitch would fix it." Halving the pitch to 0.25 mm halves the lens-side step and the object-side shift with it: still 20 mm per turn at WD/f = 10. The coarseness at distance is optical, not mechanical.
- "Lock it and forget it." The lock is a second mechanical event. A set screw can drag the barrel a hundredth of a turn: 0.005 mm of travel, which the 81 lever turns into 0.4 mm at the object. Recheck corners after locking — the procedure is in the focusing article above — and again after the first thermal cycle, as camera focus drift with temperature: diagnose daytime blur explains.
The decision, case by case
- WD/f ≤ 3, close and macro work. Turns are worth 2 mm or less at the object, so focus in full turns and spend the thread length on getting near enough; add a spacer when the near end stays out of reach. The working-distance arithmetic behind such set-ups is in blister inspection: working distance and field of view formula.
- 3 < WD/f ≤ 8, general inspection. Quarter turns for coarse focus (0.5 to 6 mm at the object), sixteenths to finish. Check corners before locking.
- 8 < WD/f ≤ 15, long stand-offs. Quarter turns already exceed depth of field, so approach in sixteenths or move the camera on a stage, then lock and re-verify.
- WD/f > 15, distance scenes. Stop threading to focus: fixture the distance, or move to a C-mount lens with internal focus from the machine vision lenses range.
More lens-choice guides sit on the lenses topic page. Next step: pick the lens by sensor format and focal length in the M12 board lenses category, or start at the lens finder and the configurator with your sensor and working distance. If the camera side is still open, the board camera finder filters by mount, interface and shutter.
The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.
Questions
How far does one turn of an M12 lens move focus at the object?
The lens itself always moves 0.5 mm per full turn on an M12×0.5 thread. At the object, multiply the per-turn travel by the lever (WD/f − 1)²: a 12 mm lens focused at 120 mm working distance shifts pitch × 81 = 40.5 mm per turn, about 10 mm per quarter turn. At 50 mm the same lens shifts only about 5 mm per turn; at 30 mm, 1.1 mm.
What is the flange focal distance of C-mount and CS-mount?
C-mount sets the distance from mount face to sensor at 17.526 mm; CS-mount sets 12.5 mm, so a C-mount lens on a CS-mount camera needs a 5 mm spacer ring. The reverse fails: a CS-mount lens sits 5 mm too far from a C-mount sensor to focus distant objects. S-mount defines no flange distance at all; the thread and holder decide it.
Does focal length change how coarse each turn feels?
Yes. At the same working distance a longer focal length gears focus finer, because (WD/f − 1)² shrinks: at 120 mm a 25 mm lens moves 7.2 mm per turn against the example lens's 40.5 mm. But focal length usually pushes the working distance out, and the square dominates: the example lens at 500 mm shifts about 830 mm per turn.
Can I stop the lens down so thread pitch stops mattering?
Depth of field scales linearly with f-number: DOF ≈ 2 × N × c × (WD/f)². At the 120 mm example station with a 5 µm tolerance, F2.8 gives about 2.8 mm of total depth and F5.6 about 5.6 mm — still under a quarter turn's 10 mm shift. Stopping down makes the lock and thermal drift more forgiving; it never makes half-turn focusing acceptable.
How much focus range does a lens barrel's thread length give me?
Divide usable thread length by the pitch: 3 mm of thread is six turns. The object-side sweep follows the lever: six turns at a 120 mm station with the example lens covers roughly 240 mm, six turns near 600 mm cover metres, and six turns at 30 mm cover only about 5 mm. Thread length sets the near limit.
