System designGuide

Driving a linear image sensor with a DAQ card clock and trigger

How to clock a linear image sensor with a DAQ card: supply, master clock, start pulse, sampling the video output, and when a line scan camera wins instead.

LumaSpec Vision11 min read Share on LinkedIn

On this page 8 sections
  1. 01What does a bare linear image sensor need to make an image?
  2. 02How do you set the line rate from the clock pulses?
  3. 03Can a multifunction DAQ card supply all three signals?
  4. 04How do you sample the analog video output without smearing pixels?
  5. 05When is a DAQ card the wrong tool?
  6. 06What do you check before wiring the sensor to the card?
  7. 07Which route do you order for your case?
  8. 08Questions

A bare CMOS linear image sensor is a strip of photodiodes with three wires that make it talk: supply, master clock, start. Nothing about it is digital until the video output is sampled correctly, which is why the obvious move — wire it to a multifunction DAQ card and treat the video as an ordinary analog channel — works well on the bench. This guide is for engineers characterising a sensor, building a one-off instrument, or testing custom optics before committing to a packaged camera. You will get the three-signal wiring plan, the arithmetic from clock period to lines per second, the sampling rule that keeps pixels sharp, and the line rate at which a packaged line scan camera becomes the cheaper answer.

What does a bare linear image sensor need to make an image?

Three signals: a supply rail at the voltage the datasheet prints (3.3 V on most current CMOS parts), a master clock that steps pixels out one by one, and a start pulse per line — the video output is an analog waveform, not a digital stream.

Each active pixel holds its charge until its turn; on its clock edge the sensor connects that charge to the video pin, and the pin sits at a voltage proportional to the light the pixel saw — dark level plus signal — until the next edge calls the following pixel. Every other interval on the timing chart, from start pulse width to the blanking at the end of a line, is printed in master clock cycles, so once you fix the clock period the whole sequence is fixed. That is both the appeal and the cost of driving a bare sensor: complete control of the timing, and complete responsibility for it.

A packaged line scan camera is the same die with driver logic, digitizer and sequencer bolted on behind a standard interface. Most CMOS linear parts advance one pixel per clock; a few take two. The timing chart's pixel interval tells you which, and it divides into every line-rate number below.

How do you set the line rate from the clock pulses?

Divide the master clock by the clocks per line: a 1024-pixel sensor clocked at 2 MHz delivers about 1953 lines per second, because each line consumes 1024 clock periods of 0.5 µs — 512 µs — before the next line begins.

line rate (lines/s) = clock frequency (Hz) / clocks per line line period (s) ≈ clocks per line × clock period (s)

Clocks per line is active pixels plus the blanking clocks the timing chart adds; 1024 active pixels often means 1064 total. The difference matters: at a 2 MHz clock, 1024 clocks gives 1953 lines/s and 1064 gives 1880 — about 3.7 % fewer lines. Read the total off the chart, not off the pixel count.

Worked example. A web moves at 300 mm/s and the inspection wants 0.15 mm of travel per line:

  • Line rate: 300 mm/s ÷ 0.15 mm = 2000 lines/s.
  • Clock: 2000 lines/s × 1024 clocks = 2,048,000 Hz ≈ 2.05 MHz.
  • Pixel period: 1 ÷ 2,048,000 Hz ≈ 0.49 µs, so the line period is 1024 × 0.49 µs ≈ 500 µs.
  • The analog input must sample at 2.05 MS/s, locked to that clock.

If the card's analog input tops out at 1 MS/s, drop the clock to 1 MHz: 1,000,000 ÷ 1024 ≈ 976 lines/s, and travel per line grows to 300 ÷ 976 ≈ 0.31 mm. Recover the resolution with optics, or accept the coarser along-motion pixel. The calculator below runs this division from web speed and pixel pitch, and how to set the line rate of a line scan camera covers the packaged-camera case, where the rate is a register value rather than a clock wire.

Line-scan camera line rate
Units
Pixel on the part
– mm
Line rate needed
– kHz
Longest exposure
– µs
Data rate
– MB/s
Lines per metre
–
Encoder setting
–

Square pixels: line rate = speed / pixel on the part; the exposure must end within one line period. Encoder: lines per pulse = (π × roller diameter / pulses per revolution) / pixel on the part.

Find line scan cameras Open the full calculator

Can a multifunction DAQ card supply all three signals?

Yes below a few thousand lines per second: a counter output makes the master clock pulse train, a second counter or digital line issues the start pulse, and the video lands on an analog input channel sampled from the same clock.

Clock. Take a counter's hardware pulse-train output, its period set from the counter timebase; single kilohertz to tens of MHz is routine, so the 2.05 MHz from the example sits comfortably inside. Software-timed toggling of a digital line is not an alternative: operating-system scheduling jitters by microseconds — several pixel periods at 0.49 µs — and drifts with load. Frame grabbers play the same trick for their cameras; generating a camera trigger pulse train without a function generator shows that version of it.

Start pulse. A second counter in pulse mode, aligned to a clock edge to meet the sensor's set-up window. Some sensors want a start pulse per line, others free-run once armed; the timing chart says which, and the pulse rate follows the line rate.

Supply. A bench supply at the datasheet voltage, decoupled at the sensor pins, is the clean answer. An analog output channel can serve if the rail must switch under software control, but analog outputs are signal sources moving milliamps, not power rails — read the sensor's rated current first.

Levels and grounds. Many DAQ digital outputs swing 5 V, while a sensor with a 3.3 V I/O rail may not tolerate that on its inputs; a series resistor or a level shifter fixes the margin. Tie supply, card and sensor grounds at one point. If the start trigger never fires although the wiring looks right, the usual culprit is a floating trigger input, not broken code — floating digital trigger input checklist walks that diagnosis line by line.

How do you sample the analog video output without smearing pixels?

Clock the analog input from the sensor's master clock — one sample per pixel period — and arm the acquisition with a hardware start trigger on the start pulse line; a free-running input at an unrelated rate puts pixel boundaries between samples and smears every pixel into its neighbours.

Three settings do the work:

  • Sample clock: take the analog input's sample clock from the master clock, or from the pixel strobe output many sensors expose for exactly this purpose, so each sample lands in the flat part of a pixel's video level. The timing chart prints where in the cycle the video is valid; centre the sample point there if the card allows an offset.
  • Start trigger: arm the acquisition on the start pulse line, so buffer sample 0 is the first pixel of the line instead of an arbitrary phase.
  • Range: use the smallest analog input range that covers dark level to saturation. On a 16-bit input, a ±1 V range resolves 2 V ÷ 65,536 ≈ 31 µV per count; a ±10 V range is 305 µV per count, ten times coarser on the same converter.

Bandwidth check: the worked example streams 2.05 MS/s × 2 bytes ≈ 4 MB/s, which any PC absorbs. The strain arrives later, in processing, when the camera outruns the code — the acquisition-versus-processing frame rate gap covers the buffer arithmetic. For scale: a 2K camera at a 58 kHz line rate moves 2048 × 58,000 ≈ 119 MB/s at 8 bits, a different league of interface entirely.

When is a DAQ card the wrong tool?

Past a few thousand lines per second, or whenever the rig must run every shift, buy a packaged line scan camera: the driver, timing sequencer, digitizer and calibration live inside its housing, and you receive calibrated pixels over a standard camera interface.

The packaged camera's value is exactly the work you were doing by hand, done for you and characterised: driver timing, gain and offset calibration, a digitizer matched to the sensor, and a link that carries finished pixels. The numbers decide it: 58 kHz against the worked example's 2 kHz is thirty times the lines per second, with uniformity a bench wiring loom will not reach. The boundary for the bench route is a line rate under roughly 2 kHz for a 1024-pixel sensor, scaled by the card's analog input rate, on work where a rebuild costs an afternoon rather than a shift.

The camera below pairs a 58 kHz line rate with TDI rows that add sensitivity along the motion, over GigE on an M42 mount.

Line scan cameras2K GigE line scan camera, 7 μm, 58 kHz, TDI, M42 (LS-LCM-0016)LS-LCM-0016
Lens mount
M42
Interface
GigE
Line length
2K
Pixel size
7 μm
$950.00View partBuild a system with it

Line length and colour move the choice. The LS-LCM-0005 reads 8K-pixel mono lines over GigE, and the MV-CL042-91GC-V2 covers colour webs with 4K lines, 7 µm pixels, a 29 mm image circle and an M42 mount, also over GigE.

Line scan camerasLine scan industrial camera, 8K, GigE, Mono (LS-LCM-0005)LS-LCM-0005
Lens mount
M72
Interface
GigE
$1,129.00View part
Line scan camerasHikrobot MV-CL042-91GC-V2 4k GigE line scan, Color, Isolated versionMV-CL042-91GC-V2
Lens mount
M42
Interface
GigE
$1,459.00View part

Interface follows bandwidth. GigE cameras need a network interface card, and a machine-vision NIC that powers the camera over its cable is the tidy choice on a moving deck.

Frame grabbersHikrobot MV-GE2002P Dual-port PoE NIC, full height V2.0MV-GE2002P
Interface
GigE
Ports
2 ports
$249.00View partBuild a system with it

Camera Link and XoFLink cameras do need a frame grabber, and Camera Link frame grabber compatibility for line scan cameras is the pairing checklist to read before ordering either end of that cable. Two bench realities push the decision further. Short line periods starve the sensor of light, and the illumination ends up working in pulses at growing power — how much power a fast line-scan light really needs puts numbers on that. And the bench rig has no housing, mount thread or lens mount at all: the sensor sits on your evaluation board, which is precisely why it belongs on the bench.

What do you check before wiring the sensor to the card?

Check five things on the bench before the sensor is connected: the supply voltage and current, logic levels of clock and start against the card's output swing, the video swing against the analog input range, clock integrity at the sensor end, and one common ground.

  • Supply: exact rail voltage and rated current, decoupled at the pins; the bench supply carries this, not the card, for anything beyond a few milliamps.
  • Logic levels: the card's output swing against the clock and start inputs' thresholds; a 5 V output into a 3.3 V-only input gets a series resistor or a level shifter.
  • Video swing: dark level and saturation from the timing chart; set the analog input range just above saturation, as in the ±1 V example above.
  • Clock integrity: scope the clock at the sensor end of the wiring; ringing or slow edges at 2 MHz come from stub wires and missing ground returns, and they double-count pixels.
  • Grounding: one star point for supply, card and sensor, with the clock return routed away from the video wire.

Grounds first, then supply, then clock, then the rest.

Which route do you order for your case?

Order the DAQ route only when you must characterise a bare sensor or build a one-off instrument below roughly 2 kHz line rate; order a packaged camera with a network card or a frame grabber for anything that runs in production.

  1. Sensor characterisation, custom optics, line rate under about 2 kHz: the DAQ rig — counter pulse train for the clock, a trigger line for the start pulse, an analog input clocked at the pixel rate. Nothing else to buy.
  2. Production web, mono, fine detail: a high-line-length camera with the interface card to match; when web speed varies, tie the line rate to a motion encoder — encoder-triggered line scan capture: wiring quadrature inputs covers that wiring.
  3. Production web, colour: a colour line scan camera over GigE, sized with the same pixels-per-defect division you ran for the bench pixel pitch.

Compare line scan cameras by line length, pixel size and interface, or go straight to the camera configurator with your web speed and pixel pitch; the camera finder filters by line length and interface directly. Frame grabbers enter only once you cross to a packaged Camera Link or XoFLink camera. If the sensor's timing chart fights back, write to us through the contact page with the chart, and we will read it with you.

Questions

Why does my captured video show diagonal stripes across the pixels?

Diagonal stripes mean the analog input is not locked to the pixel clock: the sample phase slips a fraction of a pixel every line, and the drift draws a stripe. Re-clock the acquisition from the sensor's master clock. If the card cannot accept an external sample clock at the needed rate, slow the clock until it can — the line rate falls with it.

Can the same DAQ setup read a CCD linear sensor?

Yes, with more wires. A CCD linear sensor usually wants two or more clock phases, a transfer gate pulse and a reset, sometimes at higher voltage levels than a CMOS part, and its output often rides on a dark-level clamp you subtract in software. The acquisition side is unchanged: clock the analog input from the pixel clock and trigger on the start-of-scan pulse.

What line rate can a typical multifunction DAQ card reach?

The card limits you before the sensor does. Whatever maximum analog input sample rate the card prints becomes, with an external clock, your pixel clock ceiling: 1 MS/s gives a 1 MHz clock, about 976 lines per second on a 1024-pixel sensor; 2 MS/s doubles that to about 1953. A card with no external sample clock input cannot do this job properly at any speed.

Do I need a frame grabber as well as the DAQ card?

Not for this rig — the DAQ card is standing in for the frame grabber, doing the clocking, triggering and digitizing. Frame grabbers exist for packaged cameras with Camera Link or XoFLink outputs, and GigE cameras need only a network interface card with enough bandwidth and, ideally, power over the cable. Once you move to a packaged camera, the DAQ card goes back in the drawer.

Can I generate the master clock in software instead of a counter?

Only as a proof of concept. An operating-system-timed digital output jitters by microseconds and shifts under CPU load; 1 µs of jitter is two full pixel periods at the 0.49 µs clock from the worked example. Software clocking is honest below a few lines per second. For anything faster, use a counter's pulse train output, which runs from the card's hardware timebase.