LightingExplainer

LED status indicator inspection: verify board test LEDs by camera

Status indicator inspection by camera: sync the exposure to a blinking LED's on-phase, judge red and green colour, and fail any stuck-on board test LED.

LumaSpec Vision12 min read Share on LinkedIn

On this page 10 sections
  1. 01What a status LED can and cannot prove
  2. 02The timing rule: exposure against the blink code
  3. 03Worked example: a 1 Hz, 50% duty code at 60 frames per second
  4. 04Judging red, green and amber
  5. 05Ambient light, auto exposure and the off-state reference
  6. 06Camera and light choices for the station
  7. 07When the usual answer is wrong
  8. 08Checks before you sign off the station
  9. 09The decision, case by case
  10. 10Questions

A status LED is a board's own verdict on itself. Firmware lights it when the supply rails come up, when the microcontroller reaches its self-test, and in blink codes when a fault is latched. At end of line and on the service bench, a camera can read that verdict faster and more consistently than an operator's eye, but only if the exposure is timed to the blink. This guide gives the timing rule with the arithmetic worked through for a 1 Hz fault code at 60 frames per second, the colour test for red, green and amber indicators, the handling of ambient light, and the camera and light choices for the station, ending with pass and fail criteria for each case.

What a status LED can and cannot prove

A lit LED is driven by the board's own firmware, so it is a functional output, not a continuity probe. Steady light says the supply rails came up and the microcontroller reached its boot and test code. A blink code — three blinks, a pause, repeat — names a latched fault. What it never proves is net-level integrity: a hairline open trace that the firmware cannot see still passes. The in-circuit or flying-probe tester keeps that job. The camera check adds the functional layer on top, catching the board that powers up but reports a fault.

Blink codes run at human-visible rates, roughly 0.5 to 5 Hz, because they were designed for eyes before anyone pointed a camera at them. That fits a machine-vision frame budget with room to spare. Clock-level activity is the opposite case: a bus line toggling at 2 MHz looks like a faint half-lit glow to the eye and averages away in any practical exposure. Electrical verification stays on the bench instruments.

The decision: the camera verifies the indicator — on, off, colour and code — at the slow rates the firmware drives it; it never substitutes for electrical test.

Two numbers set the budget: the code rate and its duty cycle. From them come the on-phase length, the exposure ceiling, and the frame count the verdict needs.

T_on = D / f_code t_exp ≤ T_on / 10 N_on = T_on × fps N_burst = 1.5 × fps / f_code

T_on is the on-phase, D the duty cycle and f_code the blink rate in hertz. Keep the exposure t_exp at or under a tenth of the on-phase, so no frame straddles an edge long enough to blur the state. N_on is the frames that land inside one on-phase at the camera's frame rate; N_burst is the burst that spans one and a half periods, which guarantees at least one full on-phase and one full off-phase in the set.

Timing comes in two forms. The wired method triggers the camera from the fixture's indicator-drive or test-start output, so frames land at a known phase; a fixture that forces the line can take the on-frame and the off-frame back to back, while an unforced pair completes within one code period. The unwired method free-runs and classifies a burst. What the trigger call starts and what the exposure window covers is the difference between the two — see trigger call versus exposure time.

Frames that come back black mean the exposure landed in the dark phase: a phase problem, not a dead camera, and the same gating arithmetic that governs a strobe applies (fix a black frame from strobe timing).

Worked example: a 1 Hz, 50% duty code at 60 frames per second

Inputs, with their sources: f_code = 1 Hz and D = 0.5, a typical fault code of half a second on, half a second off, inside the human-visible band. Frame rate: 60 frames per second, the rating of the LS-SMC-0063 smart camera in the parts list below. Exposure: t_exp = 5 ms, chosen by the ceiling rule.

The rule in words: the exposure may not exceed one tenth of the on-phase, and the burst must span one and a half periods.

  • On-phase: T_on = D / f_code = 0.5 / 1 Hz = 0.5 s = 500 ms
  • Exposure ceiling: 500 ms / 10 = 50 ms; the chosen 5 ms sits 10× under the ceiling and 100× under the on-phase
  • Frame period: 1 / 60 Hz = 16.7 ms, so a 5 ms exposure fits inside one frame with readout time to spare
  • On-frames per period: N_on = T_on × fps = 0.5 s × 60 frames/s = 30 frames; off-frames likewise 30
  • Burst length: N_burst = 1.5 × 60 / 1 = 90 frames, about 1.5 s of capture

Result: the full check takes 1.5 seconds and sees 30 candidate on-frames and 30 off-frames. The verdict rule is at least 10 frames classified on and at least 10 classified off.

Decision: a dead LED returns 0 on-frames — reject. A driver stuck high returns 30 on and 0 off — reject as a shorted indicator, a fault a single snapshot would bless. A shorter code still passes: a 100 ms on, 900 ms off pattern drops the ceiling to 10 ms and yields 6 on-frames per period, so burst two periods, 120 frames and 2 s, to clear the 10-frame floor. The unwired method costs 1.5 s per board and no wiring; the wired method takes two 5 ms frames and costs only the trigger line. Below 10 on-frames per period, lengthen the burst rather than the exposure.

Judging red, green and amber

Colour is a channel test. Red indicators peak around 620–640 nm and green around 520–530 nm, and a Bayer colour camera separates the two cleanly through its red and green channels. Amber sits at 585–595 nm and leaks into both, so judge it by red-dominance, the ratio R / (R + G), instead of a single channel. Starting bands: red above 0.7, green below 0.3, amber in between with total brightness above the on-threshold. Set the exact edges on five known-good boards of each colour, then fix them in the recipe.

If the verdict only needs on and off, a mono camera does the job and keeps a small sensitivity edge; colour earns its place the moment red-versus-green enters the spec. The LED colour choice for contrast matters most when you light the board yourself; here the LED is the light.

Size the pixels before the lens. A 5 MP, 4:3 sensor carries 2592 × 1944 pixels; over a 220 mm wide field that is 2592 / 220 = 11.8 pixels per millimetre, so a 3 mm light-pipe window spans about 35 pixels, ample for on and off plus colour. A 1 mm window still spans about 12 pixels; below that, shorten the field or step up in resolution.

Ambient light, auto exposure and the off-state reference

Ambient light reaches the sensor as reflection off the board and as a raised baseline, and both scale with exposure time: cutting the exposure from 50 ms to 5 ms cuts the ambient charge tenfold. The LED's own signal drops too, but a status LED at production drive current is a bright point against a dark, matte board. Reflection, not dimness, is what spoils these checks.

On the bench, shroud the station: any matte black hood that keeps ceiling light off the board. In situ, store one all-off reference image and compare every capture against it. Inside the frame, sample a coated patch 5 to 10 mm from the LED as the local baseline: the on-state must exceed roughly 5× the patch reading and the off-state must sit within about 1.5× of it. Set both numbers from a golden board and a board with the LED removed.

A short exposure and a dark shroud do what a strong strobe does for board lighting — the room stops mattering — but the LED is a weak source, so shielding carries more of the work.

Camera and light choices for the station

The first choice is where the check runs. On the device or at a gate with no PC, a smart camera performs capture, timing and verdict in one housing — the cameras finder filters them by resolution and frame rate. At a bench or in a multi-camera cell, a colour area scan camera feeding your software gives fuller control of the frame logic.

For an on-device station, the MV-SC3050XC-16M-ATN-H is a 5 MP colour vision sensor with a global shutter, a 1/1.45-inch sensor and an M12 mount, talking Fast Ethernet.

Smart cameras & vision sensorsHikrobot MV-SC3050XC-16M-ATN-H 5 MP color vision sensorMV-SC3050XC-16M-ATN-H
Interface
Fast Ethernet
Resolution
5 MP
Sensor format
1/1.45"
Shutter
Global
$1,809.00View part

For a bench fixture, the MV-CU020-90GC is a 2.5 MP colour area scan camera with a global shutter and a C-mount on GigE.

Area scan camerasHikrobot MV-CU020-90GC 2.5 MP Area Scan Camera, GigE, GMAX4002, ColorMV-CU020-90GC
Sensor format
1/1.7"
Lens mount
C-mount
Interface
GigE
Resolution
Up to 3 MP
$309.00View partBuild a system with it

The quickest start is the LS-SMC-0063, a 1.6 MP smart camera rated 60 fps with a built-in 16 mm lens and its own white light; that frame rate is the one the worked example assumes.

Smart cameras & vision sensors1.6 MP smart camera, 60 fps, 16 mm lens, white light (polarized, transparent light) (LS-SMC-0063)LS-SMC-0063
Interface
GigE
Resolution
Up to 3 MP
$1,110.00View part

Extra light serves the locator pass, not the status pass. Before judging the LED, the camera must find it, and a dim board under a shroud segments poorly. The LS-SPT-0162 is a 24 mm diameter white spot light that runs from 24 V; fire it for the position pass, then let the status pass run dark so the LED is the only source in frame. The spot lights range and the lights finder cover other wavelengths and sizes; if you strobe the locator light instead of running it continuously, the overdrive and duty-cycle budget sets the pulse rules.

Spot lightsSpot light, 24 mm dia., White (LS-SPT-0162)LS-SPT-0162
Size
Under 50 mm
Voltage
24 V
$349.00View partBuild a system with it

For the optics, work from field and working distance. A 1/1.45-inch-format sensor covers about 8.8 mm of width: the inch figure divides a 16 mm diagonal convention, and a 4:3 format takes 0.8 of the diagonal. At a 300 mm working distance over a 220 mm field, m = 8.8 / 220 = 0.040 and f = WD × m / (1 + m) = 300 × 0.040 / 1.040 = 11.5 mm, so an M12 lens near 12 mm covers it.

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

When the usual answer is wrong

  • Do not raise the LED current to help the camera. The production drive current is the condition under test. If the signal looks weak, spend exposure budget or shorten the working distance first.
  • Do not chase clock-level truth. A board with no indicator and no serial output can gain one for the price of a spare-GPIO blink at a few hertz — cheaper than any capture hardware.
  • Do not carry bare-LED colour calibration through a tinted window or light pipe. The window shifts both channels; calibrate on the assembled product.
  • Do not insist on a global shutter on principle. A 1 Hz blink is static by camera standards and a rolling shutter serves; the global shutter earns its place when the LED shares the frame with moving hardware or when the locator light is strobed.

For the neighbouring timing problems — strobe rise time, current droop, dark first frames — the lighting topic page collects the series, and the phone-camera LED test is the fastest way to confirm an indicator's visibility before any hardware is ordered.

Checks before you sign off the station

  • Run the four failure boards: LED not fitted, stuck on, stuck off, wrong colour fitted. The verdict rules must reject every one.
  • Set exposure, thresholds and the reference patch from a golden board, then lock exposure and gain to manual.
  • Confirm the burst covers 1.5 periods at the slowest code the firmware can output, not only the nominal one.
  • Repeat the ambient audit with room lights on and off; the off-state must stay inside the reference band in both.
  • Re-derive the timing budget whenever a firmware update changes code rate or duty; the budget is arithmetic on those two numbers.

The decision, case by case

Bench fixture with a trigger line: colour smart camera, two 5 ms frames gated into the on and off phases, verdict from the colour band plus the on and off counts. No trigger wiring: free-run at 60 frames per second and classify the 90-frame burst; 1.5 s per board. In-situ panel check: colour area scan camera, stored all-off reference, same thresholds. Sealed housing: no extra light at all — the LED is the source, and the shroud is part of the fixture.

Build the whole station

The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.

Start with the camera

To put numbers on your own code table, or if the blink rates sit outside the bands above, send the board and the code list through the contact page and we will work the timing with you.

Questions

Can a camera really check a circuit through its status LED?

It checks the firmware's own self-test output, not the copper. If the LED lights, the supply rails came up and the microcontroller reached its boot and test code; if it blinks the right code, the firmware is reporting the expected state. Continuity and net-level electrical checks remain the in-circuit tester's job. The two layers complement each other: the electrical test finds the open trace, the LED check catches the board that boots but reports a fault.

What exposure time should I set for a blinking LED?

Take one tenth of the on-phase as the ceiling. A 1 Hz code with 50% duty has a 500 ms on-phase, so anything up to 50 ms works; 5 ms leaves margin for phase drift. Capture a burst covering 1.5 blink periods — 90 frames at 60 frames per second, about 1.5 s — and require at least 10 on-frames and 10 off-frames for a pass.

Do I need a colour camera to check red and green LEDs?

Yes, if colour is part of the verdict. Red indicators typically peak at 620–640 nm and green at 520–530 nm, which a Bayer colour camera separates cleanly through its red and green channels. Amber, around 585–595 nm, leaks into both, so judge it by a red-dominance ratio rather than a single channel. If the station only checks on and off, a mono camera works and gives up nothing in verdict quality.

Why do my LED frames vary in brightness between captures?

Almost always auto exposure. A blinking target makes the auto loop re-balance at every toggle, so gain and exposure drift frame to frame. Turn both to manual and lock them at the golden-board values. If brightness still varies, check that no exposure straddles the blink edge — a frame that catches part of the off-phase reads dim — and that room light is not bouncing off the board.

How bright should the board drive its test LED?

At its production drive current, because that is the condition being tested; typical status LEDs run at 5–20 mA and efficient parts light well enough below that. A modern sensor needs very little light, so if the signal looks weak, lengthen the exposure within the on-phase budget or shorten the working distance before asking the board to burn more power.

Can the camera catch a blink too fast for the human eye?

Codes at a few hertz sit comfortably inside a machine-vision budget, and with typical exposures down to a few tens of microseconds, on-phases of a millisecond or so remain catchable if the camera can trigger or burst fast enough. Clock-speed or bus-level activity is different: it averages out in any practical exposure and belongs to an oscilloscope or logic analyser, not the camera.