M12 S-Mount lens focusing for board level cameras requires systematic adjustment of the threaded mount while monitoring image sharpness.

Each rotation = 0.5mm of lens movement.

The key is using the ceiling target method to eliminate image tilt.

Thread tolerance mismatches between M12 lenses and holders often cause the lens to sit at a slight angle. This makes one side of your image sharp while the other is blurry - a common problem detailed in our M12 lens technical guide.

The fix?
Point your camera straight up at a ceiling target. Gravity keeps everything parallel.

1 Mount Camera Securely

Fix the board level camera rigidly-either facing your target or pointing upward for the ceiling target method.

Even small movements during focusing will affect results.

2 Position Test Charts

Place four test charts at 50% of the image diagonal from center.

This reveals any image plane tilt immediately during adjustment.

3 Illuminate Uniformly

Add consistent lighting across the field of view.

Uneven lighting can mask focus issues by creating false contrast gradients.

4 Set Proper Exposure

Establish correct exposure settings using gray cards before focusing.

Tip: reaching an average digital number of around 128 is a good way to work.

5 Thread Lens to Focus

Rotate in 1/16-turn increments (31.25μm axial movement).

Watch for equal sharpness across all test points, not just center.

6 Lock and Verify

Apply a mechanical lock ring or UV + heat dual cure adhesive, then verify no focus shift occurred during locking.