A Reference Camera, Lens and Lighting Setup for Small-Part Inspection

"Any camera works" is not a spec. Start from the smallest defect you need to catch, size the sensor, lens and light to it, and Roboflow handles the model.

Automated vision inspection system detecting an undersized hole on a metal bracket.

Small Part Inspection Cameras AI Vision Solution

Roboflow runs on almost any camera, which is useful once you have one and unhelpful when you are choosing. For fasteners, connectors, machined components, stampings and electronic parts, the camera is chosen by one number: the size of the smallest defect you need to catch. Work backwards from it and the sensor, lens, lighting and compute follow.

Resolution: Start From the Smallest Defect

Two pixels across a feature is the minimum for finding an edge with excellent contrast; three to four pixels is what you want for a model to detect it reliably, and three to five per stroke for reading codes or text. Divide the defect size by that pixel count to get the resolution you need per pixel, then divide your field of view by it to get the sensor width in pixels. A 0.25 mm pinhole at 4 pixels needs 0.0625 mm per pixel, so a 40 mm field needs about 640 pixels across, and an 8 MP sensor at 3840 pixels wide can cover a 240 mm field at the same resolution. Treat the result as a floor: lighting, optics and part variation usually push you higher.

Lens: Working Distance and Field of View

The focal length bridges the working distance your station allows and the field of view you sized above; shorter focal lengths give a wider view. Choose a lens rated for your sensor size or larger so the image circle covers the whole sensor. A smaller aperture gives more depth of field for parts that sit at different heights, at the cost of light. For dimensional checks, a telecentric lens keeps magnification constant across the field and removes perspective error.

Lighting: Match the Light to the Defect

Lighting decides whether the defect is visible at all. The lighting types that matter most for small parts:

  • Ring light: the default for small, flat parts; even, on-axis and easy to mount around the lens
  • Dome or coaxial: curved or reflective parts and polished metal, where a dome removes hotspots and coaxial light makes a flat surface uniform
  • Dark field: low-angle light so only scratches, burrs and raised edges catch the light and show bright on a dark part
  • Backlight: a silhouette for holes, gaps, edges and dimensional checks
  • Polarizer: a filter on the lens and light to cut glare from metal, plastic and glass

If parts move past the camera, add a hardware trigger and strobe so every frame is sharp, and mount the camera rigidly at its final distance before you collect training images.

Compute: Where the Model Runs

For a single station, Roboflow AI1 is the reference setup in one housing: an 8 MP sensor at 4K and 30 fps, a 4 mm lens with electronic focus, a built-in ring light, an NVIDIA Jetson Orin NX with 8 GB of memory, M12 Gigabit Ethernet, 24V DC power and an IP54 rating. Mount it closer for smaller defects. When the resolution math calls for a larger sensor, a telecentric lens or several cameras on one cell, pair GigE Vision cameras from makers such as Basler, Lucid or IDS with a Roboflow edge device: RF-NX16 runs one to four streams over PoE, and RF-AGX64 runs four or more with line scan support.

How Roboflow Works with Small Part Inspection Cameras

  • Collect: Capture good and defective parts with the production camera, lens and lighting, and upload them to Roboflow
  • Label and train: Label the defects and train a model such as RF-DETR, so it learns from the same frames it will see on the line
  • Deploy: Run the model with Roboflow Inference on the edge device, and send pass or reject to your PLC before the part reaches the reject point

‍

Want AI without the integration work? Roboflow's AI1 deployment device packages onboard AI compute, integrated lighting, and an industrial camera into a plug-and-play system for real-time computer vision, with no separate camera, lighting, or edge computer to spec.

AI for Small Part Inspection Camera Workflows

Choosing a camera for small-part inspection? Explore Workflows you can get started with to create computer vision apps in minutes. Try the top open and closed source models on images from your camera for free, then train a custom model in Roboflow and deploy it with Roboflow Inference.

How to Setup Small Part Inspection Cameras with AI

Size the sensor to the smallest defect, pick a lens for your working distance, light the part for the defect type, and mount it all rigidly. Collect images from that setup, label and train a model in Roboflow, then run it on AI1 or a Roboflow edge device connected to GigE cameras.

  • Meet Roboflow AI1

    AI1 packages onboard AI compute, integrated lighting, and an industrial camera into one plug-and-play vision system.

  • Machine Vision Lighting Guide

    Compare ring, dome, coaxial, dark field, backlight and polarized lighting, and pick the one that makes your defect visible.

  • How to Choose a Lens for Machine Vision

    Learn what to consider when choosing a lens, from working distance and field of view to sensor coverage and telecentric optics.

“The vision AI solutions we developed with Roboflow have been a core component of connecting our teams and unlocking their ability to collaborate.”

Lou Stocco

Director of Manufacturing Advanced Analytics, USG

Speak with an AI expert

Our team will help you start solving business problems on the first call.

Ask us about:

  • Solution architecting
  • Live demonstration
  • Pricing and specifications
  • Feasibility assessment

Over 80,000 organizations build with Roboflow.

  • Rivian
  • Pella
  • Chobani
  • USG Corporation
  • BNSF Railway
  • American Woodmark
Start where you are

Additional resources