A board-level camera has no housing of its own: the PCB is the product and the enclosure is your design. Get the geometry wrong and you pay twice — once in dark image corners where a wall clips the field of view, and again in refocus work when the lens seat depth turns out to be a guess. This guide shows how to build the housing from the maker's official STEP file, which numbers come from the model and which come from the mount, and how to size the front opening, the window and the clearances with arithmetic you can check. If the camera itself is not chosen yet, start with board level camera selection for embedded vision machines and come back with a model number.
Get the STEP file, then check its scale
Ask the seller for the STEP file by model number and board revision; many makers publish it on the product page beside the 2D drawing, and support sends it on request. Published CAD often covers frames and accessories rather than the sensor board itself — official STL files for a controller extension frame and housing color codes are a typical public example — so name the exact board model when you ask. Our board-level cameras pages list the mount and sensor format for every model, which is what you quote in that request.
STEP beats STL for housing work. STEP carries exact surfaces, so bores and outlines stay true circles; STL is a faceted mesh you can only look at, and any wall trimmed against it inherits the facets. If the maker ships only STL, rebuild every hole as a true cylinder at the drawing's dimension before the housing is cut.
Then check scale. Import the model, measure a known feature — the M12 bore is 12 mm across the thread — and compare it against the drawing or, once the board is in hand, against calipers. Fix the scale before you design, because every later number inherits the error.
Component bodies in free CAD files are simplified placeholders for collision checks. Trust the board outline, the hole pattern and the sensor position; confirm the height of the tallest parts with calipers when the board arrives.
What the model gives you and what it cannot
From the STEP file and its drawing you can take:
- the board outline, notches and thickness;
- the mounting-hole pattern, diameters and edge distances;
- connector positions, overmould keep-outs and the cable exit side;
- the sensor centre and its rotation relative to the board;
- the height stack as modelled.
Three things the model cannot tell you: the flange geometry the optics need, which comes from the mount standard; the thermal behaviour of the closed box, which comes from arithmetic and a warm-up check; and the tolerances of the housing you will make, which come from your own process, whether printed, machined or sheet metal.
Lens-side geometry: the mount is the contract
An M12 mount defines the thread, not a flange distance. The thread is M12×0.5, toleranced under ISO 965-1, the general-purpose metric screw thread standard, and focus is set by threading the barrel in and out until the image is sharp. Your housing provides a rigid seat, coaxial with the sensor, and leaves the barrel free to turn until focus is set and locked. A seat that clamps the thread pulls the lens off-axis.
C-mount is a different contract: 17.526 mm flange distance on a 1"-32 thread. The board already holds the sensor at that distance, so the housing only protects the barrel and adds no axial load. CS-mount is the same thread at 12.526 mm.
If the cell must be fixed-focus — a glued barrel with no adjustment — you compute the seat depth from the lens equation for the working distance and accept the drift risk; lens focal length vs back focus in board cameras works that arithmetic. How fit and flange distance interact, and how to confirm both before the housing closes, is in camera lens adapter focus: check fit and flange distance.
The M12 seat is the common case on compact boards:
- Sensor format
- 1/2.9"
- Lens mount
- M12
- Interface
- GigE
- Resolution
- Up to 3 MP
C-mount boards sit differently in a housing because their optics are already at a fixed flange:
- Sensor format
- 1/1.8"
- Lens mount
- C-mount
- Interface
- USB3
- Resolution
- 5 MP
Sensor keep-outs, standoffs and the cable exit
Mount the board the way the model says: standoffs at the drawn hole pattern and diameters, and nothing added through component areas. Support the board at standoffs only — a board held at two corners flexes every time a cable is touched, and the cracks appear first at the connector joints.
Leave 2-3 mm between the lid and the tallest feature, usually the lens barrel or the connector overmould. Take that height from the model, then confirm it on the physical board.
Plan the cable exit with strain relief and a service loop, and keep the connector reachable for reseating. Wiring that carries trigger or illumination signals deserves the same protection; camera GPIO wiring: prevent damage and triage power faults covers the damage modes.
A bare board — shipped with no mount at all — hands you the whole optic cell. Model the sensor and its cover glass as windows at the heights in the STEP, and read cameras without sensor cover glass: selection considerations before you decide on dust protection. The bare-board case looks like this:
- Sensor format
- 1/1.8"
- Interface
- USB3
- Resolution
- 6-10 MP
- Shutter
- Rolling
Plastic in front of the lens is an optical part
A window parallel to the lens axis reflects a few percent of the scene — and of your own lights — straight back into the lens. On a contrasty part that reads as a faint ghost; under directional lighting it reads as a haze that no image-processing fix removes cleanly. Four habits keep it quiet:
- tilt the window 5-10° so the specular return lands off the sensor;
- matte the housing interior, including printed walls, because layer gloss reflects;
- use flat glass or polycarbonate sheet rather than printed clear material, which scatters;
- keep translucent or glossy plastic away from the aperture entirely.
Acrylic and polycarbonate both pass visible light and the common 850 nm and 940 nm illumination bands; beyond roughly 1 µm, choose the sheet from its transmission curve. Size the opening from the field cone rather than from the thread — the next section runs that arithmetic.
Worked example: front-wall opening for an 8 mm lens at 100 mm
The case: a 1/1.8" sensor, active area about 7.2 × 5.4 mm with a 9.0 mm diagonal (the standard size for the format), behind an 8 mm M12 lens, inspecting at a 100 mm working distance, with the housing wall 15 mm in front of the lens. Those are the inputs; your cell substitutes its own.
The rule: light for the image corners leaves the lens at an angle set by the sensor half-diagonal over the focal length, and the beam widens by twice that tangent for every millimetre of distance from the lens. The opening must cover the cone at the wall plane, plus margin.
Arithmetic:
- tan θ = 4.5 mm / 8 mm = 0.5625
- Cone diameter at the wall plane: 2 × 15 mm × 0.5625 = 16.9 mm
- With 1 mm of margin per side: 16.9 mm + 2 mm = 18.9 mm, so cut a 20 mm opening.
The decision: cut 20 mm. A 12 mm hole — the thread diameter, a common first guess — leaves 6.0 mm of half-width where the corners need 8.44 mm, so the outer (8.44 − 6.0) / 8.44 ≈ 29% of each corner radius goes dark. The cone also exceeds any normal M12 barrel front of 12-14 mm, so here the cone, not the barrel, sets the bore. At the 100 mm working distance this field measures about 90 × 68 mm, and the wall had been trimming its corners by geometry alone.
Sensitivity: each further 10 mm of stand-off adds 2 × 10 mm × 0.5625 ≈ 11.3 mm to the opening, and 1 mm of position error changes it by 1.1 mm. Wide-angle M12 designs push the principal plane forward of the barrel, which adds to the effective distance; fisheye lens selection for M12 board cameras: circle, BFL and FOV covers that geometry. The FOV calculator runs the same field from your sensor, focal length and working distance.
Heat, vents and focus drift
A typical USB3 or GigE board camera dissipates on the order of 1-3 W, and in a sealed printed box that heat leaves only through the walls. A 60 × 40 × 30 mm box presents about 0.011 m² of surface, and natural convection carries roughly 10 W per square metre per kelvin, so the box runs near 10 °C/W: 2 W inside lifts the interior about 20 °C above the room. Treat that as a sizing estimate. Vent slots on faces that do not look at the optics, or metal standoffs conducting into the machine frame, pull it down quickly.
Warm-up matters twice. Interior heat moves the lens-to-sensor distance, and short focal lengths turn fractions of a millimetre into visible blur, so re-check focus after 20-30 minutes of running before locking the barrel. Camera focus drift with temperature: diagnose daytime blur walks the diagnosis.
If the plant requires a sealed, washdown-rated cell, the vent becomes a gland and condensation joins the drawing.
Mount the housing so the pose repeats
Build the machine mount into the housing: two locating pins plus two or three screws. The sensor pose then repeats every time the housing bolts back, and calibration survives the removal; without pins, every unbolt quietly invalidates the extrinsic calibration, the trap described in camera intrinsics unchanged after calibration: what to check.
Keep the focus ring and the lens-locking screw reachable through an access hole; the clearances a focusing tool needs are in lens locking screws: focus, aperture and enclosure clearance.
For bench bring-up before the housing exists, a slide-table stand from the camera stands range sets the working distance by hand while you confirm focus and field:
- Type
- Camera stands
Checks before you print or cut
- Scale: a known feature in the model measures true against the drawing or the calipered board.
- Bores: every housing bore is a true cylinder at the drawn dimension, not a mesh remnant.
- Seat: the M12 seat leaves the barrel free to turn; a C-mount housing adds no axial load to the 17.526 mm stack.
- Front opening: meets or beats the cone arithmetic for your lens, stand-off and margin.
- Window: tilted 5-10°, matte inside, sheet material, sized from the cone.
- Lid: 2-3 mm over the tallest feature, confirmed on the physical board.
- Cable: strain relief, service loop, connector reachable.
- Focus: checked after a 20-30 minute warm-up, then locked.
- Mount: locating pins in place before the first calibration is shot.
When the obvious answer is wrong
Gluing the barrel at a computed seat depth inside a sealed box stacks two errors: the print tolerance and the thermal shift. The warm-up drift can exceed either alone, so keep an adjustment path or at least an access hole.
Copying a housing between camera models fails quietly, because outlines, sensor offsets and mount positions differ between series at the same resolution. When a board goes end-of-line and a replacement arrives, the housing changes with it; board level camera replacement when a sensor goes end of line walks that swap.
A deep, narrow pocket in front of the lens does both jobs badly: it vignettes exactly as the worked example shows and multiplies internal reflections. A short, matte baffle beats a long tunnel.
Drafting from photos while order approval lags is a real situation, and it works only if the STEP arrives first and the physical board is calipered on arrival. Design from the model; confirm with the part.
For a cell that is still on paper, the camera configurator pairs sensor and mount while you draw the walls around them, and the cameras topic page gathers the rest of the camera guides.
Questions
Can I design the housing before the camera arrives?
Yes. Draft from the STEP file and the 2D drawing while the order is pending, then confirm three things on the physical board before cutting the lid and front wall: hole positions, the tallest component height and the connector side. Those two walls carry the clearances, so keep them editable until the board is in hand and calipered.
Does a clear plastic window in front of the lens ruin the image?
Not if it is designed in. A window parallel to the axis returns a small fraction of light into the lens as ghosts of bright features and as haze under directional lighting. Tilt the sheet by 5-10°, use flat glass or polycarbonate rather than printed clear material, and accept a small contrast loss as the price of protecting the lens.
Can I 3D print the whole housing?
For prototypes, yes. Print walls 2-3 mm thick, keep the interior matte because layer gloss reflects light, and remember a sealed printed box runs roughly 20 °C above ambient at a 2 W load, so vent it or conduct heat out through metal standoffs. For production, sheet metal or machining holds bores and seat tolerances better.
Do I need an IR-cut filter in the housing window?
Only if a color camera shares space with infrared light. Color board sensors respond strongly at 850 and 940 nm, so an IR illuminator or hot-metal glow washes the color out of the image. Plan the cut filter in the lens or as a coated window, because acrylic and polycarbonate sheet pass those bands and will not cut them for you.
How do I mount the housing so calibration survives removal?
Give the housing two locating pins plus two or three screws, so the sensor pose repeats each time it bolts back to the machine, and leave the lens untouched between removals. If the housing is remachined, moved or shimmed, treat the extrinsic calibration as stale and re-shoot the calibration target before the next production run.



