System designHow-to

One camera for pick and place and barcode scanning: the shared setup

Plan one camera for pick and place guidance and barcode scanning: pixels per module sizing, the scan pose, exposure timing, and when a code reader is needed.

LumaSpec Vision10 min read Share on LinkedIn

On this page 8 sections
  1. 01What the two jobs demand
  2. 02Step 1: Choose the layout before the camera
  3. 03Step 2: Worked example: 400 mm table, 0.25 mm DataMatrix code
  4. 04Step 3: Pick the camera to match the branch
  5. 05Step 4: Time and light the two exposures
  6. 06Step 5: Verify on the bench before wiring the cell
  7. 07Mistakes that cost weeks
  8. 08Questions

One overhead camera, one six-axis robot, two jobs: find each loose part on the table, then read its code before the part ships. The instinct is to serve both from one snapshot, and that instinct is right — as long as you size the pixels for the barcode first, because the code asks for roughly ten times the resolution the pick does. This how-to gives you the pixels-per-module math, the three layouts that work, a worked example on a 400 mm table, and the exposure and bench checks that finish the build.

What the two jobs demand

A decoder rebuilds bars and dots from pixels, and it needs at least 2 pixels per module; below that, reads go intermittent. Design to 3 pixels per module and treat 4 as comfortable. For a 0.25 mm module that is a pixel scale of 0.083 mm or finer, and on a 2448-pixel sensor the field of view then caps at 204 mm.

Locating a part for a pick is an easier ask. Sub-pixel edge tools place an edge to about a tenth of a pixel, so the same 400 mm field on 2448 pixels — 0.163 mm/px — still locates features to a few hundredths of a millimetre. The robot's own repeatability, ±0.05 to ±0.1 mm on a typical six-axis unit, dominates that stack-up. The design rule: the code sets the pixel scale, the pick only sets the field of view.

pixels per module = module size × pixels across / FOV width pixel scale = FOV width / pixels across (mm per pixel) m = sensor width / FOV width f = WD × m / (1 + m)
How sensor width, working distance and field of view set the focal length Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.CameraField of view (FOV)Working distance (WD)≈ fsensor width slensm = s / FOVf = WD × m / (1 + m)
How sensor width, working distance and field of view set the focal length. Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.

Step 1: Choose the layout before the camera

Three layouts make one camera serve both jobs. The pixels-per-module number at the table plane picks between them.

Layout How the code reaches 3 px per module Cycle cost Fits when
One wide shot A sensor large enough for the table: at 0.25 mm modules the field must stay under 204 mm (5 MP), 341 mm (12 MP) or 456 mm (20 MP) wide none, one grab the sensor carries the whole table
Wide shot + scan pose The robot lifts the part to a pose near the lens; a liquid or motorized lens refocuses between exposures about 0.7 s per part every part can be lifted and held
Pick camera + dedicated reader A reader with its own close-range optics at the scan station about 0.3-0.5 s parts cannot be lifted, or modules run under 0.2 mm

The refocus line is not optional. With the lens focused for a table 580 mm below the lens, a part presented at 300 mm sits far outside depth of field and blurs about 18 pixels — enough to kill both the code and the edges. Fixed focus serves one plane; the refocusing lens, or a second reader, buys the second plane.

Running the pick and the scan as two separate locates with different accuracies, rather than one generic pick, has control-side consequences too; this camera pick-and-place two-locates guide walks that part of the build.

Step 2: Worked example: 400 mm table, 0.25 mm DataMatrix code

Inputs as they come off the bench:

  • Table working area 400 × 300 mm, parts loose on the surface.
  • Code: DataMatrix, 0.25 mm modules, target 3 px per module, floor 2.
  • Bench camera: 5 MP, 2448 × 2048 pixels at 3.45 µm, sensor 8.45 mm across.
  • Upgrade candidate: 20 MP, about 5472 pixels at 2.4 µm, sensor 13.1 mm across.

Rule in words: pixels per module = module size × pixels across / FOV width; magnification m = sensor width / FOV; focal length f = WD × m / (1 + m).

Table plane on the 5 MP camera: 0.25 × 2448 / 400 = 1.53 px per module. Below the floor of 2 — the wide shot cannot decode this code. It still locates: 0.163 mm/px leaves edges good to a few hundredths of a millimetre, and the 400 mm field puts a 12 mm lens at WD = 12 × 1.021 / 0.0211 = 580 mm.

Table plane on the 20 MP camera: the field needs 400 / 0.0833 = 4800 pixels and the sensor offers 5472, so 0.25 × 5472 / 400 = 3.42 px per module — above target. Optics: m = 13.1 / 404 = 0.0324, and f = 510 × 0.0324 / 1.0324 = 16.0 mm — a 16 mm lens at 510 mm working distance frames the 404 mm field. Depth of field at f/4 with a 2-px circle of confusion of 0.0048 mm: 2 × 4 × 0.0048 / 0.0324² = 36 mm, about ±18 mm around the table surface.

Scan pose keeping the 5 MP camera: the 0.0833 mm/px target caps the field at 2448 × 0.0833 = 204 mm, so m ≥ 8.45 / 204 = 0.0414 and WD ≤ 12 × 1.0414 / 0.0414 = 302 mm. Hold the label plane 300 mm under the 12 mm lens: 3.02 px per module. That is a 280 mm lift, about 0.7 s at 500 mm/s plus a 100 ms settle, and a liquid or motorized lens refocus on every part.

Decision: the 20 MP camera decodes the code in the same exposure that locates the part — no lift, no refocus, cycle cost zero. Keep the 5 MP scan-pose branch only when the robot can present every part at the pose and you accept a refocus per shot; if parts cannot be lifted, the code earns its own reader at the station. The same pixels-to-millimetres chain, worked end to end on a measuring task, is in coin size sorting with a single camera.

Lens focal length, field of view and working distance
Units
Solve for
Focal length
– mm
Field of view
– mm
Working distance
– mm
Magnification
– x
Angle of view
– °
Pixel on the part
– mm

Thin-lens model: m = sensor width / field of view, f = WD × m / (1 + m). Accurate to a few percent above about 150 mm; check the lens's minimum object distance.

Find lenses with this focal length Open the full calculator

Step 3: Pick the camera to match the branch

For the single-shot branch, 20 MP carries the table alone: the MV-CS200-10UM is a 20 MP mono camera on a 1" sensor with USB3 and a C-mount. Its rolling shutter costs nothing here because the parts sit still during the exposure.

Area scan camerasHikrobot MV-CS200-10UM 20 MP Area Scan Camera, USB3.0, IMX183, 2nd Gen., MonoMV-CS200-10UM
Sensor format
1"
Lens mount
C-mount
Interface
USB3
Resolution
16-25 MP
$759.00View partBuild a system with it

On tables between the 204 mm five-megapixel cap and the full 400 mm width, 12 MP is the balance point. The MV-CH120-11UC runs 12 MP with a global shutter on USB3 in a 1.1" format, so a moving part in the wide shot stays unskewed.

Area scan camerasHikrobot MV-CH120-11UC 12 MP Area Scan Camera, USB3, IMX304, High-speed version, ColorMV-CH120-11UC
Sensor format
1.1"
Lens mount
C-mount
Interface
USB3
Resolution
12 MP
$2,339.00 · quotedView and quoteBuild a system with it

Without a PC in the cell, a smart camera runs locate and decode on the device: the MV-SC5060XM-08M-WBN carries 6 MP mono, an 8 mm M12 lens and GigE. About 3000 pixels across a 6 MP sensor decode 0.25 mm modules on tables up to about 250 mm in one shot; on wider tables the smart camera keeps the pick and the code moves to a reader.

Smart cameras & vision sensorsHikrobot MV-SC5060XM-08M-WBN SC5000X series Smart Camera, 6 MP, Mono, 8 mm focal length, M12-mountMV-SC5060XM-08M-WBN
Interface
GigE
Resolution
6-10 MP
Sensor format
1/2.4"
Shutter
Rolling
$1,629.00View part

When parts cannot be lifted and the table is wide, mount a dedicated reader where the robot presents each part: the MV-ID3013PM-12M-WBN is a compact 1.3 MP reader with a fixed 12 mm lens on Fast Ethernet, and the robot triggers it as its own cycle step. The fixed code readers page lists short-range and logistics variants.

Fixed code readersHikrobot MV-ID3013PM-12M-WBN 12mm focal length 1.3 MP Compact Industrial Code ReaderMV-ID3013PM-12M-WBN
Interface
Fast Ethernet
Resolution
Up to 3 MP
Shutter
Global
Lens mount
M12
$1,979.00View part

The PC-based branches draw from the area scan cameras page; the camera finder filters by pixels, interface and shutter, and the smart cameras page holds the no-PC line.

Step 4: Time and light the two exposures

Give every exposure a motion budget: keep blur under a third of a pixel, so exposure time ≤ pixel scale / (3 × speed). Parts at rest on the table tolerate 10-20 ms under steady light. At the scan pose, dwell 100 ms after the in-position signal, then fire 10 ms: a 1 mm/s drift then blurs 0.01 mm, about 0.12 px at the 0.083 mm/px scan scale.

Set f/4 as the working aperture from the example: depth of field ≈ 2 × f-number × CoC / m², and at m = 0.032 that lands within about ±18 mm of the set plane — your pose height tolerance. Stop to f/5.6 only if poses wander; past that, diffraction starts to soften 2.4 µm pixels. The depth of field calculator runs your own numbers.

One diffuse white light over the table serves both exposures; add polarization if labels glare. When the jobs want different settings, hold two exposure sets on the camera and alternate per trigger — two exposure times, one camera shows the mechanism. For light that drifts through the shift, ambient light variation in pick and place vision gives the containment steps.

Step 5: Verify on the bench before wiring the cell

  1. Etch or print a golden 0.25 mm DataMatrix and place it at the four table corners and the centre.
  2. Require 100 consecutive decodes per spot; intermittent decodes mean pixels per module sit under target, not that the decoder needs tuning.
  3. Log the confidence value with every read and judge it the way barcode read confidence sets out.
  4. Constrain the decode ROI to the presented part; setting an ROI for inline code reading shows the speed and reliability gains.
  5. Calibrate the pixel frame to the robot, then structure the program so each located part maps to a drop target — structuring a vision-guided pick and place program around drop targets is the pattern.

Mistakes that cost weeks

  • Decoding from the 400 mm wide shot on a 5 MP camera because one good label decoded once. At 1.5 px per module the read rate collapses under print variation; the math above is the check.
  • One fixed focus across two working distances. Focused for 580 mm, a 300 mm pose blurs about 18 px — codes fail and edges smear together.
  • Firing the camera before the robot settles. Vibration for 50-100 ms after a move is enough to blur a code.
  • Full-frame decoding in the cycle. An ROI sized to the part cuts decode time by an order of magnitude and drops false reads from the neighbouring part.

One camera, two jobs, three layouts — the numbers decide. Take the table size, module size and cycle target into the system configurator, which walks camera, lens and light as one build; more builds of this kind sit on the systems topic page. If a branch stays open, send the numbers through the contact page and we will work the example for your parts.

Questions

Can one camera read the code and locate the part in the same exposure?

Yes, when the code is coarse enough for the table width. A 0.5 mm module over a 400 mm field on a 2448-pixel sensor works out to 0.25 × 2448 / 400 = 3.1 pixels per module, above the design target of 3. The same field on a 0.25 mm code gives 1.5 and will not decode reliably. Check the product of module size and sensor pixels against table width before planning a second pose.

How do I set the scan-pose distance for my own lens and code?

Work backwards from the pixel scale. Scale target = module / 3. FOV limit = pixels across × scale. Magnification m = sensor width / FOV, then WD = f(1 + m)/m. Example: 0.2 mm modules, 2448 pixels, 8.45 mm sensor, 12 mm lens: scale 0.0667 mm/px, FOV 163 mm, m 0.0518, WD about 244 mm. Each 50 mm closer adds roughly half a pixel per module.

What if the modules are smaller than 0.2 mm?

Direct-part-mark codes at 0.1 mm modules need 0.033 mm/px at the 3-pixel target, which caps a 2448-pixel field at about 82 mm even with the part presented close under the lens. That is dedicated-reader territory: a compact fixed-focus reader at the scan station, triggered as its own cycle step, holds those pixel densities across a whole shift without refocusing gymnastics.

Does the shutter type matter for the shared camera?

Only where things move during the exposure. At the scan pose and on a static table, parts are at rest, so a rolling-shutter camera locates and decodes cleanly. If parts travel on a conveyor through the wide shot, rolling shutter skews the frame and locate edges shift with it — choose a global shutter there, or freeze motion with a short exposure and a strobed light.

Can a smart camera run both the pick locate and the decoder on its own?

Yes. Smart cameras run the locate tool and the decoder on the device and hand the robot controller both the pose and the decoded string over Ethernet or serial, with no PC in the cell. Confirm the specific model ships both tools — some vision sensors carry locate-only tool sets — and size its field of view with the same pixels-per-module math as a PC-based camera.