Every project eventually asks it: the tablet already in the technician's hands has a camera, so can it read the barcode too? It can, inside limits the optics set. Whether a 12 MP rear camera decodes a 10-mil Code 128 label or a QR code at your working distance comes down to three numbers: pixels per module, focus distance and exposure time. The sections below give you those numbers, a worked distance calculation you can redo for your own label, the failure modes you will meet — autofocus hunting, hand shake, flash glare — and the point at which a fixed reader or a handheld scanner becomes the right answer instead.
What a tablet camera actually delivers
A current tablet rear camera is a 12-13 MP sensor shooting 4:3 stills of about 4032 × 3024 pixels, behind a lens with a horizontal field of view near 60°. It autofocuses continuously, focuses down to roughly 8-10 cm, and carries a single LED flash a centimetre or two from the lens. The front camera is a different tool entirely: usually fixed focus, tuned to arm's length for video calls, and unable to sharpen a label held at 20 cm. Scan with the rear camera.
The decoder is not the bottleneck. Modern barcode libraries decode 1D and 2D symbols at 30 or more frames per second on a tablet-class processor. What decides success is whether the optics deliver a decodable frame at your distance, and one geometry rule sets that.
Your HMI or SCADA client matters too: capture permissions, capture resolution and image storage are configured at the client, as in this Ignition tablet camera capture and storage walkthrough. If you build the capture loop yourself instead, Android barcode scanning without a scanner app: your own preview loop is the DIY path. Either way, check that the optics close your distance before wiring anything.
The pixels-per-module rule that sets read distance
A decoder needs each printed module — the narrow bar of a 1D code, one square of a QR grid — to span enough pixels to separate it from its neighbours. The entire distance question is that ratio:
X is the module width printed on the label, N the pixel count across the frame, W the field-of-view width at working distance D. Field width grows linearly with distance, so pixels per module falls at the same rate.
The thresholds that matter in practice: decodes begin around 2 px per module, and first-pass rates fall fast below 3, so plan on 3 px per module — margin for print wear, focus error and slight tilt. Past about 5 px per module, decode rate stops improving and larger frames only slow the reader down.
Two scalings follow, and they are exact: double the module width and the working distance doubles; double the pixels across the frame and it doubles again; widen the field of view and the distance shrinks in proportion to 2 tan(FOV/2). Scanning at an odd angle wastes those pixels — the camera-orientation fixes in Mobile camera orientation: fix barcode decoding at any tablet angle recover them in software.
Module geometry for the common 1D symbologies, including reading angle, is worked through in Code 128 barcode module size, reading angle and reader distance.
Worked example: a 10-mil Code 128 label on a 12 MP, 60° tablet camera
Inputs, with where each comes from:
- Module width X = 0.254 mm (10 mil) — the smallest X-dimension common on carton and logistics labels.
- Frame width N = 4032 px — the long edge of a 12 MP, 4:3 still, typical of current tablet rear cameras.
- Field of view FOV = 60° — typical for the ~26 mm-equivalent lens on that camera class.
- Decode rule n = 3 px per module for reliable reads, 2 px as the floor — from the rule above.
The rule in words: the farthest working distance is where a module still spans 3 px, D_max = X × N / (3 × 2 × tan(FOV/2)).
The arithmetic:
- tan(30°) = 0.577
- Field width at 300 mm: W = 2 × 300 mm × 0.577 = 346 mm
- Pixel scale: 346 mm / 4032 px = 0.0859 mm per px
- Pixels per module at 300 mm: 0.254 mm ÷ 0.0859 mm/px = 2.96 — just under the line
- Solving for the limit: D_max = (0.254 mm × 4032 px) / (3 × 2 × 0.577) = 1024 / 3.46 = 296 mm
- The 2 px floor: 1024 / (2 × 2 × 0.577) = 1024 / 2.31 = 443 mm
Result: about 30 cm of reliable working distance for a 10-mil label on this camera. Decodes still occur out to about 44 cm, with the first-pass rate falling as you go; beyond 44 cm the modules drop under 2 px and decoding stops.
Decision: hold 30 cm or closer for 10-mil codes and 59 cm or closer for 20-mil (0.508 mm) codes — the linear scaling doubles every figure. When someone proposes a tablet for scanning 10-mil labels at 1 m, the arithmetic says no: the distance must shrink or the label must grow.
Focus: why close-range scans fail before resolution does
At 30 cm the frame has plenty of pixels — the failures move to focus. Three of them:
Autofocus hunting. Continuous AF refocuses every few hundred milliseconds and the in-between frames are soft; the decoder discards them and your read rate collapses even at the right distance. Switch to single-shot focus at your measured working distance — the FAQ below covers the exact setting — and refocus only when the distance changes.
Minimum focus distance. Rear cameras focus down to roughly 8-10 cm, so 30 cm sits comfortably inside range. Front cameras are the common failure: fixed-focus modules tuned to arm's length cannot sharpen a label at 20 cm at all, which is why id-card scanning dies on tablets whose rear camera is fine.
Shallow depth of field. Estimated from the thin-lens formula 2Nc/m² with an f/2 lens, a 2-pixel circle of confusion (c = 2.8 µm) and magnification m ≈ 0.013 (a ~4 mm lens at 300 mm): total sharp zone = 2 × 2 × 0.0028 mm / 0.0133² = 63 mm, or about ±30 mm around the focus point. A label tilted 10° over 100 mm of width moves one edge 50 mm × sin 10° = 8.7 mm — still inside the zone, so focus forgives modest tilt. Tilt costs you pixels and glare instead, as the next section shows.
Hold the tablet parallel to the label, brace your wrists, and the focus problem is gone.
Motion, glare and contrast: the rest of the read budget
Motion blur spends the pixel budget the same way focus error does. The rule is drift × exposure < 1 px. At the worked example's 0.0859 mm per px, an unbraced hand drifting 5 mm/s during a 1/30 s exposure smears 0.17 mm — two pixels, enough to sink a 3 px module below the floor. A braced hold drifts nearer 1 mm/s, which smears 0.033 mm — under half a pixel — so brace both elbows or add light that buys a shorter exposure.
The flash is the glare source. Sitting centimetres from the lens, it lights the specular hot spot on glossy or laminated labels straight back into the sensor. Turn the flash off, let angled room light do the work, or tilt the tablet about 15°. For laminated labels read every shift, the industrial fix is polarized light, which is why glare-prone pharma and electronics labels end up on a polarized fixed reader rather than a tablet.
Low contrast and damage are partly software problems; the preprocessing and re-grade moves that lift marginal labels are in Improve barcode decode rate on damaged low contrast codes. Dot-peen and etched direct-part marks need low-angle dark-field lighting a tablet cannot provide — route them to a dedicated reader from the start.
Tablet, fixed reader or handheld scanner: the decision per case
| Task | Tool | Why |
|---|---|---|
| Occasional QR codes or paperwork labels with modules 0.5 mm or wider | Tablet rear camera | 3 px rule met at 30 cm or closer, focus locked |
| 10-mil carton labels at a fixed station | Fixed reader | Optics tuned to one distance, trigger-timed captures |
| Laminated or glossy labels | Polarized fixed reader | Removes the glare a tablet flash cannot |
| All-shift picking with gloves on | Handheld scanner | Trigger and aim dot, types into the focused field |
| Codes moving on a conveyor | Fixed reader with a trigger sensor | Motion blur and timing no hand can meet |
For the station cases, browse the fixed code readers; for the mobile case, the handheld code readers.
At a station the geometry never changes, so a reader built for that geometry wins on first-pass rate. The MV-IDB005EXI-05NRP is a 1.3 MP polarized code reader with a 4.63 mm focal length, set to focus at 70 mm for close-range label reading; its polarization removes exactly the glare the tablet flash creates.
- Interface
- Fast Ethernet
- Resolution
- Up to 3 MP
- Shutter
- Global
- Lens mount
- M5.8
Focal length does the distance trade the tablet cannot: the MV-ID3013PM-12M-WBN carries a 12 mm focal length on a 1.3 MP sensor for tighter, longer views, while the MV-ID813M-05S-WBN-SR pairs a 4.9 mm focal length with white light illumination for short, wide ones. For throughput, the LS-CRD-0028 decodes up to 60 codes per second from a 2560 × 2048, 5 MP sensor behind an 8 mm lens.
| Specification | MV-ID3013PM-12M-WBN | MV-ID813M-05S-WBN-SR | LS-CRD-0028 |
|---|---|---|---|
| Symbologies | 1D codes: Code 39, Code 93, Code 128, CodaBar, EAN 8, EAN 13, UPCA, UPCE, ITF 14, ITF 25, Matrix 25, MSI, China Post, Code 11, and Industrial 25; 2D matrix codes: QR Code (GS1-QR included), Data Matrix (GS1-DM included), MicroQR, AZTEC, HanXin, Maxi code; Stacked codes: PDF417, MicroPDF417 | 1D code: Code 39, Code 93, Code 128 (incl. GS1-128), ITF14, ITF25, CodaBar, EAN8, EAN13, UPCA, UPCE; Matrix 2D code: QR Code (incl. GS1-QR), Data Matrix (incl. GS1-DM), Micro QR, AZTEC, Han Xin; Stacked 2D code: PDF417 | 1D: Code 39, Code 93, Code 128, CodaBar, EAN8, EAN13, UPCA, UPCE, ITF14, Matrix 2 of 5, Matrix 25, MSI, China Post, Code 11, Industrial 25; 2D: QR Code, Data Matrix; Stack codes: PDF417 |
| Max. frame rate | 60 fps | 60 fps | 30 fps |
| Max. reading speed | 84 codes/sec | 20 codes/s | – |
| Sensor type | Global shutter, mono, 1/2.7", 4 μm × 4 μm | Mono, 1/4", 2.7 μm × 2.7 μm | CMOS |
| Resolution | 1280 × 1024 | 1280 × 1024 | 2560× 2048 px |
| Exposure time | 35 μs to 1 sec | 60 us ~7000 us | 35 μs ~ 1 s |
| Gain | 0 dB to 28 dB | 1 dB ~ 15 dB | – |
| Data interface | Fast Ethernet (100 Mbit/s) | RJ45 | Fast Ethernet (100 Mbit/s) |
| Communication protocol | SmartSDK, TCP Client, TCP Server, Serial, FTP, Profinet, Ethernet/IP, MELSEC/SLMP, ModBus, UDP, Fins, Modbus RTU | SmartSDK, TCP Client, Serial, FTP, TCP Server, UDP | – |
| Digital I/O | 17-pin M12 connector provides power and I/O, including non-isolated input (LineIn 0/1/2) × 3, non-isolated output (LineOut 3/4/5) × 3, RS-232 × 1. Supports device triggering via pressing button on top.;17-pin M12 connector provides power and I/O, including isolated input (LineIn 0/1/2) × 3, isolated output (LineOut 3/4/5) × 3, RS-232 × 1. Supports device triggering via pressing button on top. | 1 non-isolated input (pin 1 input), 1 non-isolated output (pin 3 output), 1× RS-232; Device trigger via top button supported | 3 non-isolated inputs, 3 non-isolated outputs, 1 RS-232 |
| Power supply | 24 VDC | 12 ~ 24 VDC | 24 V |
| Power consumption | Avg.: 9 W @ 24 VDC (light source enabled); Max.: 48 W @ 24 VDC (light source enabled) | Max. power: 2.5 W @ 12 VDC | 20 W @ 24 V |
| Price | $1,979.00 | $719.00 | $920.00 |
Values as printed in each product's data sheet; open a part for its drawing and full specifications.
When scanning is mobile and continuous, a trigger beats aiming a whole tablet. The LS-HCR-0001 pairs a 1.0 MP sensor with USB 2.0 for a wired desk or cart, and the LS-HCR-0002 adds a wireless link over Ethernet; both type the decoded value into whatever field has focus. The HID-keyboard route into a tablet specifically is shown in Send barcode text to an Android tablet over USB as HID keyboard.
- Resolution
- Up to 3 MP
- Shutter
- Global
- Resolution
- Up to 3 MP
- Shutter
- Global
Match a reader to your own distance with the code-reader finder or start the system configurator at the camera step.
When more megapixels will not save the scan
Distance scales linearly with pixels across the frame, so the tempting fix for a failing scan is a higher-resolution camera. Two limits close that door. First, the sampling rule caps out near 5 px per module — beyond it, frames get bigger and decodes get slower without getting better. Second, tablet lenses rarely resolve to their pixel pitch: a 50 MP sensor in full-resolution mode puts 8160 px across the frame, which would double the 10-mil example to about 59 cm, but only if the lens stayed sharp at 0.7 µm features — in practice you collect part of that gain at a real cost in decode speed and storage.
Meanwhile, the failures that actually stop tablet scanning — focus hunting, minimum focus distance, glare — do not care about pixel count. That is why the answer at a fixed station is a reader whose lens, focus and light were designed for one distance, not a bigger camera in the same tablet.
A five-minute bench test before the tablet goes to the floor
- Print or pick a label whose module width you know in millimetres — the 10-mil example is a good worst case.
- Photograph a ruler spanning the frame at your intended distance; field width divided by pixels across the photo gives mm per px.
- Divide module width by mm per px. Under 3 px per module, move closer or print a larger label — nothing downstream fixes it.
- Lock focus at the measured distance and switch off continuous autofocus.
- Scan 20 times without re-aiming and count first-pass decodes. 19 or 20 out of 20 is the go line; 15-18 means pull the distance in by 20% or change the lighting before blaming the decoder.
How far a single decode can be trusted — grading, edge determination, error correction — is its own subject; Barcode read confidence: how to judge whether a decode is trustworthy walks it. More decode-side limits and fixes sit under code reading.
If the bench test fails at your distance, the fixed-reader route is one part and one cable, and the arithmetic above tells you which focal length to filter for. If the label, distance and cycle time are odd, describe the task through the contact page and we will help you spec it.
Questions
Does the 3-pixel rule apply to QR codes and Data Matrix too?
Yes — count modules, not characters. A QR code also needs its 4-module quiet zone clear on all sides, so size the field of view to the whole symbol plus that zone, or the finder pattern sits at the frame edge where decoders lose it. Data Matrix on metal is the exception: etched and dot-peen codes need low-angle dark-field lighting a tablet camera cannot provide, so they go to a dedicated reader.
Why does my tablet read a code once and then ignore the same code?
Most scan libraries and industrial readers suppress duplicate decodes for a short window so a held trigger does not fire repeatedly. If you need to read the same label twice — check-in, then verification — shorten or disable the duplicate interval, or force a new capture event between reads. That is a software setting, not a failing camera: the optics deliver the same image every time.
Can a tablet camera read a QR code shown on another phone screen?
Yes, and it is a common ticketing workflow. Screen-emitted codes are bright and sharp, so the pixel rule is easy to meet, but expect inverted contrast — light modules on a dark background — and moiré if you shoot too close. Work from 10-20 cm, angle the tablet slightly off-axis, reduce screen brightness to cut glare off the glass, and confirm your decoder accepts inverted symbols.
Can a tablet camera read a code through shrink wrap or a plastic bag?
Often yes, with distance tightened. Clear film adds a specular layer, so keep the flash off, let room light work at an angle, and pull 20-30% closer than the bare-label distance to recover the contrast the film steals. Wrinkled film scatters light randomly and is where tablet scanning usually fails for good; a polarized reader handles it.
How do I stop the camera refocusing between scans?
Switch the camera to single-shot focus and set the focus distance to your measured working distance; tablet camera APIs expose both controls. Refocus only when the distance changes. This removes the soft frames during each refocus cycle and typically doubles the scans per second you get from a handheld tablet.

