SPECBUILDR
lens overview · free lens spec template
The complete guide · custom optics

How to specify a custom lens, step by step

Everything a lens manufacturer needs to quote your part, in the order a working optical engineer would pin it down — with the formulas shown, a worked example, and the checks that catch impossible specs before they cost you a requote.

Build my spec with the interview → Free · no signup · physics-checked

The short version

01Anchor the job: sensor, distance, field of view

A lens spec starts from what it must image, not from lens jargon. Name the sensor (model or format + pixel pitch), the working distance, and the field of view — either the angle or “I need to see an object this wide at this distance.” Those three facts anchor everything else.

With sensor width w and full field of view θ, the focal length is fixed: EFL ≈ w / (2·tan(θ/2)). A 7.6 mm-wide sensor that must cover 40° needs EFL ≈ 10.4 mm — no catalog browsing required.

02Choose the f-number with the diffraction limit in view

The f-number sets how much light the lens collects and how deep the focus zone is. Smaller f-number = more light, shallower depth of field. But there is a floor nobody escapes: diffraction.

The diffraction-limited spot is about 2.44·λ·N across. At f/16 in green light that is ≈ 21 µm — on 2.2 µm pixels you have specified a blur filter, not a lens. Keep the spot comparable to the pixel: on small mobile-class pixels that means staying near f/2–f/5.6.

03Specify sharpness as MTF at Nyquist

“Sharp” is not quotable. The measurable request is contrast (MTF) at the highest spatial frequency your sensor can use — its Nyquist frequency, which is 1/(2·pixel pitch).

A 2.2 µm-pixel sensor has Nyquist ≈ 227 lp/mm. A solid, buildable ask is MTF ≥ 0.3 at half-Nyquist, ≥ 0.15 at Nyquist across the field. Asking for high MTF at frequencies past Nyquist buys nothing the sensor can record.

04Name the waveband — and stick to it

Glass dispersion, coating design, and even which glasses are allowed all follow from the spectrum: visible (roughly 420–680 nm), visible+NIR (to 950 nm for IR illumination), SWIR, or a single laser line.

A lens color-corrected for visible light will typically shift focus in NIR — “works with our 850 nm illuminator too” is a real requirement that changes the design. Say it up front; retrofitting it is a redesign, not a tweak.

05Bound the envelope, mount, and back focal distance

The mechanical facts vendors get burned by: maximum barrel length and diameter, the mount (M12, C/CS, custom thread), and the back focal distance — the clearance between the last glass surface and the sensor, including any filter glass in the path.

State filters explicitly: a 0.5 mm IR-cut filter in the optical path shifts focus by roughly a third of its thickness. The vendor needs to design it in, not discover it.

06Set the environment and quantity

Temperature range, humidity, vibration/shock, and washdown/sealing silently drive glass choice, housing material, and adhesives. Quantity drives everything about price: a one-off prototype and a 10k/year production part are different designs.

Give quantity as: prototype quantity now, expected annual volume if it goes to production. Vendors quote completely differently against that one line.

07Defer the rest — by name, to the vendor

Element count, glass selection, aspheres vs. spheres, coating recipe, exact tolerancing: that is the lens designer's craft. A good spec lists these explicitly as “vendor's choice, meeting the requirements above” — an empty section reads as an oversight; a deferred list reads as competence.

The litmus test for a finished spec: a vendor who has never met you can quote it without a clarifying phone call, and later prove the delivered lens meets it — every requirement is a number with a tolerance and a named test.

Worked example: a machine-vision inspection lens

The whole chain, numbers shown — the same derivations the SpecBuildr interview performs and prints in your spec's math appendix.

Sensor1/2.5″, 5.7 × 4.3 mm, 2.2 µm pixels
Field of view needed60 mm-wide scene at 200 mm working distance → θ ≈ 17°
Focal lengthEFL ≈ 5.7 / (2·tan(8.5°)) ≈ 19 mm
Nyquist1 / (2 × 0.0022 mm) ≈ 227 lp/mm
MTF ask≥ 0.3 @ 114 lp/mm, ≥ 0.15 @ 227 lp/mm, full field
f-numberf/4 — diffraction spot ≈ 5.4 µm, acceptable; f/11 (≈15 µm) would not be
Wavebandvisible + 850 nm NIR (shared illuminator)
Envelope / mount≤ 30 mm long, M12; BFD ≥ 6.5 mm incl. 0.7 mm filter stack

The mistakes that make quotes expensive

Specifying magnification when you mean field of view
Magnification only means something with a named sensor at a named distance. FOV + sensor + distance is unambiguous.
“As sharp as possible”
Unquotable — it invites either a padded price or a guess. MTF at Nyquist is the same wish, made testable.
Stopping down to fix everything
Depth of field grows, but past the diffraction floor resolution falls. The check is one multiplication before you send the spec.
Forgetting the filter and cover glass
Every millimeter of glass between lens and sensor moves focus. List the whole optical path.
A bare “TBD” anywhere
A TBD without an owner stalls the quote. Every open item gets a name: yours, or explicitly the vendor's.

Frequently asked questions

What does a lens manufacturer actually need to quote a custom lens?

Seven things: sensor (or detector) details, working distance and field of view, f-number, a measurable sharpness target (MTF at a stated frequency), waveband, mechanical envelope and mount, and environment plus quantity. With those, a vendor can quote without a round of clarifying questions.

How do I work out the focal length I need?

From the sensor width and field of view: EFL ≈ sensor width / (2·tan(FOV/2)). You almost never pick focal length first — it falls out of what you must image.

What f-number should I ask for?

The smallest (brightest) your depth-of-field allows, bounded below by diffraction: the spot is about 2.44·λ·N, and once that exceeds your pixel pitch you are past the useful floor. On small pixels that usually means f/2–f/5.6.

What is MTF at Nyquist and why should my spec say it?

MTF is measured contrast at a spatial frequency; Nyquist (1/(2·pixel pitch)) is the finest detail your sensor can record. Asking for a stated MTF at Nyquist turns “sharp” into a number a test bench can verify.

Can I write a lens spec without an optics background?

Yes — if something asks the right questions in your language. That is exactly what the SpecBuildr interview does: you answer in plain engineering terms, and it derives the optical quantities and runs the physics checks.

Skip the blank page

The interview asks you these exact questions in plain language, runs the physics checks, and prints a complete, quotable spec — free.

Start the lens interview →