If you program PLCs, machine vision can look like a different discipline: image formats, optics, lighting angles, software tools. In practice it is closer to a smart field device than a computer project. A camera or code reader takes a picture when you trigger it, makes a decision, and hands you a pass or fail signal, a code string, or part coordinates. This guide explains what each part of a vision system does, which numbers decide the selection, and how to plan a first inspection so it survives life on a real line.
What a vision system actually is
Strip the terminology away and every vision system has the same five parts:
- A sensor: an area scan camera or a dedicated code reader.
- A lens: sets the field of view and working distance.
- Lighting: makes the feature you care about visible, reliably.
- Processing: the inspection tools, running in the device or on a PC.
- An interface to your control system: I/O, industrial Ethernet, or serial.
The processing side is where vendors differ, but the physics of the first three parts is the same everywhere. If the image does not show the feature with stable contrast, no software setting will save you. That is why experienced integrators spend most of their commissioning time on trigger timing, fixturing and light, not on parameter tuning.
Cameras, smart cameras and code readers: which one fits
Three device families cover most first projects:
- Area scan cameras feed a PC or controller and give you full control over exposure, gain and image handling. They suit multi-camera cells and custom processing.
- Smart cameras and vision sensors run the inspection on the device and talk straight to the PLC. This is the fastest route for a first project: no PC, no image transport, one cable for power and network.
- Fixed code readers are dedicated 1D/2D decoding engines. They find codes anywhere in the frame, decode them at line speed, and report the string over I/O or Ethernet.
For a straightforward check, reading a data matrix code on a part and verifying it against the job, a reader alone is enough; for pattern matching a code to the correct variant, see the guide on barcode to part verification for similar assemblies. For presence, orientation or defect checks, start with a smart camera from the smart camera category or use the camera finder to filter by resolution and interface.
The MV-SC3050XC-16M-ATN-H is a typical entry point: a 5 MP color vision sensor with a global shutter and an M12 mount, running inspections on the device.
- Interface
- Fast Ethernet
- Resolution
- 5 MP
- Sensor format
- 1/1.45"
- Shutter
- Global
If the job is purely code reading, the fixed code reader category holds dedicated devices such as the MV-ID3013PM-12M-WBN, a compact 1.3 MP reader with a 12 mm lens on an M12 mount.
- Interface
- Fast Ethernet
- Resolution
- Up to 3 MP
- Shutter
- Global
- Lens mount
- M12
The numbers that drive camera selection
Two calculations decide almost every first camera choice: field of view and resolution.
Field of view comes from the sensor size and the lens:
Resolution comes from your smallest feature. Aim for 3 to 5 pixels across it:
Worked example: a 60 mm wide part, smallest feature 0.3 mm, working distance about 150 mm. A 5 MP sensor with a 2,592-pixel width gives 60 / 2,592 ≈ 0.023 mm per pixel, which puts 13 pixels across a 0.3 mm feature, comfortable. The camera resolution calculator runs this the other way, from part size to the pixels you need:
Exposure time is the third number, and it matters on anything that moves. Keep motion blur under one pixel:
At 0.023 mm pixels and a 100 mm/s part, that is about 230 µs, well within reach of a strobed setup. The trade between exposure and motion is covered in detail in exposure time vs shutter speed for moving-part inspection.
Lighting: the part PLC programmers underestimate
On the shop floor, lighting decides pass or fail more often than the camera does. The rule is simple to state and easy to get wrong: light the feature, not the part. Different geometries need different light shapes:
- Ring and bar lights for flat, matte surfaces and general presence checks.
- Dome or coaxial lights for shiny, curved parts where direct light becomes glare.
- Dark field low-angle light for raised or recessed edges, engraving and scratches.
- Backlighting for silhouette measurement, where shape matters more than surface.
Ambient light is the silent failure mode. A skylight or a work lamp that swings into view changes your histogram and your thresholds. Shield the inspection volume, strobe the light, or both. Strobing also lets you overdrive an LED briefly, freezing motion with more light than continuous operation could deliver; the constraints are set out in strobe machine vision light: overdrive, duty cycle and timing.
A light controller does more than switch the light on: it dims channels, strobes on a trigger, and sequences multiple lights so one camera can take several differently lit exposures of the same part.
- Output
- Constant voltage 24 V
- Channels
- 4 channels
- Control
- Digital
If glare is the core problem in your application, the techniques in lighting shiny metal pins without glare: dome, diffuse and polarizer transfer directly to other reflective parts.
How the vision device talks to your PLC
Plan the handshake the same way you plan any smart device:
- Trigger in. A PLC output or photoelectric sensor fires the camera. Hardware triggering beats software polling for timing consistency; wiring details are in hardware trigger source not detected: check GenICam line settings.
- Result out. Minimum: a pass/fail output. Better: code strings, measurement values or pick coordinates over Ethernet, mapped to registers the PLC reads cyclically.
- Diagnostics. Map camera status and fault bits into your alarm structure so a lens covered in dust becomes an operator message, not silent failures; the pattern is described in vision system diagnostics to PLC: status and alarm mapping.
- Images for debugging. Agree on where images go when a result is disputed. Even a device-level system usually supports FTP or a viewer connection for this.
Planning your first inspection: a worked example
Task: verify a 2D data matrix on a plastic housing, 40 × 60 mm field of view, part stops for 500 ms under a fixture.
- Sensor: a 1.3 to 5 MP device; at 5 MP the pixel size is about 0.023 mm, far more than a code reader needs, so a 1.3 MP reader is the economical choice.
- Optics: a reader with a fixed lens matched to the working distance; mounts such as M12 keep the setup compact and repeatable.
- Light: a diffuse ring at a 45 to 60 mm stand-off, strobed on the trigger to kill ambient light variation.
- Handshake: photoelectric sensor triggers the reader, one pass output and one fail output to the PLC, code string over Ethernet for traceability.
- Verify: read 100 parts, including 10 deliberately rotated or shifted ones, and confirm the grade stays consistent before accepting the station.
When several codes sit on one part or in one field of view, decoding logic gets harder; the isolation approach in multiple QR codes not reading: isolate image and search faults shows how to separate image faults from decode settings.
When the obvious answer is wrong
- A bigger camera is rarely the fix. If contrast is poor, lighting is the problem; more pixels only gives you a sharper picture of a bad image.
- A PC is not required. Device-level systems handle the majority of single-station checks; add a PC when you need several synchronized cameras or custom algorithms.
- Do not inspect what you can fixture away. Moving the check to a stop station with a consistent part position removes most vision complexity at zero pixel cost.
- Reading a code is not verifying it. A correct-format read of the wrong code still passes; pair the string with the job or recipe, as in camera barcode decoding: from image to validated data.
Pre-order checklist
- [ ] Field of view, working distance and smallest feature written down, with the pixel-size calculation done.
- [ ] Part speed known, exposure budget for motion blur calculated.
- [ ] Surface finish described (matte, glossy, curved) and a light shape chosen to match.
- [ ] Ambient light at the station checked, shielding or strobing planned.
- [ ] Handshake defined: trigger source, outputs, registers, heartbeat and fault bits.
- [ ] Mounting planned so camera, lens and light cannot shift; a bracket that moves is a threshold drift generator.
- [ ] A test set agreed: good parts, borderline parts, known rejects.
Once the checklist is done, the lighting finder and the system configurator walk the remaining choices in order: camera, lens, light, controller, trigger hardware.
Where to go next
Start small and learn on one station. Pick the inspection you understand best, fixture the part, light it properly, and wire the handshake before touching any inspection tool. If a first application involves reading codes on the line, the code reading topic page collects the deeper guides, and the free support that comes with every order can review your field of view and lighting plan before you order.
Questions
Do I need a PC for a first machine vision project?
Usually not. A smart camera or vision sensor runs the inspection on the device and reports results over digital outputs or Ethernet, so the PLC talks to it like any other smart field device. A PC-based system earns its keep when you need multiple high-resolution cameras, custom image processing, or a shared database of images across several stations.
What is the difference between a smart camera and a fixed code reader?
A code reader is tuned for one job: finding and decoding 1D and 2D codes quickly and reporting the string. A smart camera runs general inspections such as presence checks, measurement, OCR or defect detection using configurable tools. If the task is only reading codes, a reader is simpler; for anything else, start with a smart camera.
How does the vision system talk to my PLC?
The two common paths are discrete I/O and industrial Ethernet. With I/O, a trigger input starts the exposure and ready, pass and fail outputs report the result. Over Ethernet, the camera exchanges results, codes and offsets as registers or via a supported protocol, and can also send images for diagnostics. Most beginners start with I/O and add Ethernet when they need part coordinates or data strings.
How much light does a vision inspection need?
Enough that the feature you care about has stable contrast in every image, not a bright picture for its own sake. A practical target is an exposure time short enough to freeze motion, with the light driven hard enough at that exposure to reach a mid-range histogram. If you cannot get there without overdriving, add light area, shorten the working distance or pick a more sensitive sensor.
What resolution camera do I need for my part?
Work backwards from the smallest feature: you want roughly 3 to 5 pixels across it for reliable detection. Divide the field of view by the sensor's horizontal pixel count to get the pixel size, then check it against the feature. A 5 MP sensor has about 2,592 horizontal pixels, so a 100 mm field of view gives roughly 0.04 mm per pixel, enough for features around 0.12 to 0.2 mm.
Where should a beginner spend effort first?
On lighting and fixturing, not on software. Most failed first inspections trace back to inconsistent part position, ambient light leaking in, or glare hiding the feature. Build a repeatable trigger, mount the light and camera rigidly, and shield the inspection volume from factory lighting before you tune any tool.


