IR Beam Perimeter Sensor (Photoelectric Beam) — Design Guide
← Back to: Security & Surveillance
Core idea: An IR beam perimeter sensor detects intrusion by interrupting a modulated infrared link between Tx and Rx, then uses synchronous detection + AGC + decision logic to reject sunlight, reflections, and weather noise. Real-world reliability comes from maintaining alignment margin, keeping the photonic AFE out of saturation, and exposing logs/counters so false alarms and misses can be proven and fixed quickly.
H2-1. Definition & Scope: What an IR Beam Perimeter Sensor Covers
An IR beam perimeter sensor is a paired transmitter (Tx) and receiver (Rx) photoelectric barrier that detects intrusion when a modulated optical link is interrupted. Modulation and synchronous detection are the core mechanisms that separate a real beam-loss event from ambient sunlight and slow background drift.
Scope boundary (must stay tight): this page covers through-beam and its practical variants (retroreflective, multi-beam) only. It does not cover PIR, microwave/radar intrusion, fiber fence systems, or camera/NVR platforms.
- Through-beam (Tx/Rx separated): longest range, best rejection when aligned; requires two-head mounting and alignment margin.
- Retroreflective (Tx/Rx in one head + reflector): simpler wiring; higher risk from glossy reflections and sun-angle injection.
- Multi-beam (stacked beams): reduces small-animal “one-beam” triggers; adds beam-quality scoring and alignment complexity.
- Detection range: stable operation at a stated false-alarm rate, under defined weather/soiling assumptions.
- Response time: interrupt-to-alarm latency including debounce/hold policy (not just analog comparator delay).
- Sunlight immunity: Rx front-end avoids saturation while maintaining beam margin headroom.
- IP & maintenance: optics soiling/condensation drives “margin drift” and must be observable.
- Tamper visibility: cover/mount/cable-tamper must create a distinct event, not a vague “alarm.”
- Output robustness: relay/OC/bus outputs remain stable over long cables and outdoor common-mode noise.
events_per_day: false-alarm rate bucketed by day/night to expose sunlight-coupled failure modes.rx_sat_count: Rx saturation counter (TIA/ADC/demod overflow), the fastest proof of “ambient injection.”agc_code: AGC operating point; abnormal drift indicates fog/soiling/misalignment before alarms explode.beam_margin_db: installation baseline vs runtime margin drift; the single most useful “health” metric.
Figure F1 — IR Beam Sensor Boundary & Couplings (link: #fig-f1).
H2-2. Operating Principle: Modulated Beam + Synchronous Detection
Sunlight immunity is not achieved by “a higher threshold.” It is achieved by converting the optical link into a known-frequency, known-phase signal and then extracting only that component at the receiver. In practice, this is a modulation + synchronous detection (lock-in) chain that turns ambient light into mostly rejectable background.
- OOK/PWM: simplest; tune duty/peak current for range vs EMI vs thermal drift.
- Burst / integrate: improves SNR under fog/soiling by accumulating energy in a fixed window.
- Reference stability: Tx and Rx must share the same timing reference (local MCU clock is usually enough).
- Avoid low-frequency lighting artifacts: keep clear of 100/120 Hz and near harmonics that cause slow amplitude wobble.
- Consider AFE bandwidth vs range: higher modulation improves rejection of slow ambient changes, but demands more receiver bandwidth and noise margin.
- Verify on-site interferers: nearby IR sources (illumination, other sensors) can create in-band energy; lock-in rejects off-phase, not saturation.
- Multiply & average: Rx multiplies the band-limited signal by a reference and integrates over a window → produces demod amplitude.
- DC ambient is mostly rejected: constant sunlight shifts the raw level, but does not correlate with the reference.
- Front-end saturation still breaks everything: if the TIA/ADC saturates, the demod amplitude becomes untrustworthy—optics and AFE headroom remain mandatory.
- Beam present / broken: compare demod amplitude to threshold.
- Hysteresis: separate “set” and “reset” thresholds to prevent chatter near the edge.
- Debounce & hold time: ignore micro-interrupts (insects/rain spikes) while bounding response time.
- TP1 Tx drive: frequency/duty/peak current (proves the reference is stable).
- TP2 Rx raw (TIA out): saturation vs headroom (fastest proof of ambient injection).
- TP4 Demod output: true correlated signal amplitude (tracks alignment/fog/soiling).
- TP5 Alarm out: debounce/hold behavior (proves logic vs analog confusion).
- TP2 saturates + TP4 unstable → likely sunlight leakage / insufficient optical rejection (fix: shielding/filtering, restore headroom).
- TP2 not saturated + TP4 low → likely misalignment / fog attenuation / Tx power drift (fix: alignment margin, emitter drive, clean optics).
- TP4 stable + TP5 chatters → likely threshold/hysteresis/debounce or output stage noise coupling (fix: logic parameters, output filtering, rail separation).
Figure F2 — Modulation & Lock-in Waveform Evidence (link: #fig-f2).
H2-3. Hardware Architecture: Tx/Rx Heads, Controller, Power, Outputs
A stable IR beam sensor is not “one optical link.” It is a set of separable fault domains: Tx emission, Rx photonic front-end, synchronous detection/decision logic, power domains, and outputs/interfaces. When false alarms or missed detections happen, the fastest path is to identify which domain lost margin first—using fixed TP points and minimal service counters.
- Emitter: IR LED / VCSEL / laser diode (range and optical power stability depend on junction temperature).
- Driver: constant-current or pulsed current with duty control; includes temperature derating input (NTC or temperature code).
- Failure signatures: demod amplitude slowly drifts down with temperature; peak current clamps; emission EMI couples into Rx ground.
- Evidence: TP1 Tx drive waveform; optional current-sense; derating flag; Tx temperature code.
- Detector: PIN photodiode or APD (APD adds gain but increases bias/temperature sensitivity).
- AFE: TIA + bandpass shaping to keep lock-in stable and prevent out-of-band energy from dominating.
- Demod/AGC: synchronous detection outputs a correlated amplitude; AGC maintains operating headroom.
- Failure signatures: TIA/ADC saturation under sunlight injection; wrong bandwidth causes “valid signal disappears”; AGC pins at limits.
- Evidence: TP2 TIA out (flat-top = saturation), TP3 bandpass out, TP4 demod amplitude,
rx_sat_count,agc_code.
- State machine: INIT → ALIGN → RUN → DEGRADED → ALARM/FAULT; separate “degraded margin” from “intrusion.”
- Self-test: Tx test bursts + Rx correlation check + output path verification (relay/OC/bus).
- Minimal service counters: make root cause measurable, not opinion-based.
- Evidence:
events_per_day,beam_margin_db(baseline vs drift),selftest_code,reset_reason.
- Tx pulses create rail droop and ground bounce that can mimic beam loss if Rx/logic share impedance.
- Outputs (relay coil kick, long cables) inject common-mode disturbances that can corrupt AFE if return paths are uncontrolled.
- Evidence: TP6 domain monitor (VTX or VRX_AFE) during Tx pulses / relay actuation; correlate with events.
- Relay: robust isolation but can chatter if decision logic or rails are noisy; needs coil flyback control.
- Open-collector: simple panel input; requires correct pull-up and cable noise tolerance.
- RS-485: adds diagnostics/control; device-side needs transceiver, termination strategy, and common-mode protection.
- Tamper: cover/mount/cable events must generate distinct logs, not a generic alarm.
- Evidence:
relay_act_count,relay_chatter_count,bus_err_count,tamper_count.
- Daytime false alarms → Rx saturation/ambient injection → TP2 flat-top + rising
rx_sat_count. - Range below spec → alignment/fog/Tx drift → TP4 low + falling
beam_margin_db(no TP2 saturation). - Output chatters → logic/output coupling → TP4 stable but TP5/relay toggles + rising
relay_chatter_count. - RS-485 drops during alarms → common-mode noise →
bus_err_countspikes correlated with relay actuation. - Power-up alarm → init threshold/state issue →
selftest_code+agc_codeout of expected init window.
Figure F3 — IR Beam Sensor Main Architecture (Domains + TP) (link: #fig-f3).
H2-4. Optical & Mechanical Design: Alignment, Aperture, Filters
Most real-world instability in IR beam perimeter sensors is driven by geometry rather than “algorithm bugs”: the Tx divergence, Rx field-of-view (FOV), and shielding geometry determine how easily sunlight or reflections enter the receiver. The goal is to preserve a measurable alignment margin so that fog/soiling and mechanical drift do not push the system into saturation or threshold ambiguity.
- Wider FOV is easier to align but increases risk of ambient injection, especially at low sun angles.
- Narrower FOV improves sunlight rejection but requires tighter mounting stability and alignment procedures.
- Engineering target: maximize correlated demod amplitude (TP4) while keeping TP2 far from saturation in worst-case sun angle.
- Hoods/baffles enforce a cutoff angle so the sun cannot “see” the sensitive detector path.
- Blackened surfaces reduce internal reflections that create an apparent beam even when alignment is marginal.
- Evidence: rising
rx_sat_countwithout true beam interruption is a signature of stray-light injection.
- IR bandpass: improves SNR and rejects visible/near-IR background, but becomes sensitive to emitter wavelength drift and angle-dependent filter shift.
- Broadband: more tolerant to wavelength drift, but relies heavier on lock-in and AFE headroom.
- Rule: filter choice must be paired with emitter stability + AFE saturation headroom, not chosen in isolation.
- Thermal: pole/bracket expansion changes pointing angle; even small angular error can reduce demod amplitude.
- Wind/vibration: causes intermittent marginal alignment → intermittent false alarms that mimic real intrusions.
- Soiling/condensation: reduces received energy and increases scatter; shows up as slow
beam_margin_dbdecay and AGC drift.
- Stacked beams allow “intrusion requires multiple beams” policies that reject small animals or ground-level clutter.
- Service evidence: per-beam margin and per-beam saturation flags prevent guessing during field servicing.
- Alignment margin:
beam_margin_db= demod amplitude (TP4) relative to decision threshold; record a baseline at installation. - AGC headroom:
agc_codeshould remain within a safe operating band; “pinned AGC” signals loss of optical energy or severe background. - Branching proof: TP2 saturation + rising
rx_sat_count→ sunlight/reflection injection; no saturation + fallingbeam_margin_db→ drift/soiling/fog.
Figure F4 — Optics & Alignment Margin (FOV + Sun Angle) (link: #fig-f4).
H2-5. Photonic Front-End: Sensor Choice + TIA/Filter/Noise Budget
Detection distance and sunlight immunity are ultimately limited by the photonic front-end (AFE). The AFE must keep enough dynamic range to avoid saturation under high ambient injection, while preserving SNR under weak received beam conditions (long distance, fog, soiling, alignment drift). The fastest way to diagnose AFE-limited behavior is to anchor the discussion on fixed test points: TP2 (TIA output), TP3 (post-filter), and TP4 (demod amplitude / correlated magnitude).
- PIN PD: simpler biasing, typically lower operational risk; weak-beam performance depends more on TIA noise and optical collection.
- APD: internal gain increases sensitivity for weak signals, but requires higher bias and tighter temperature control; drift and protection become first-order concerns.
- Field reality: APD systems can fail “softly” (gain drift → margin drift → nuisance alarms) even when optics and alignment are unchanged.
Evidence to log when available: temp_code, apd_bias_code; otherwise use TP2 baseline and AGC behavior as proxies.
- Transimpedance (Rf) sets gain: too high improves weak-beam SNR but reduces headroom under sunlight injection.
- Compensation (Cf) sets stability and bandwidth shaping: under-compensation oscillates; over-compensation eats modulation amplitude.
- Saturation modes: TP2 flat-topping can come from ambient shot current, internal reflections, or too-large Rf relative to output swing.
Minimum measurable set: TP2 noise RMS (Tx off / beam blocked), TP2 saturation signature (flat-top), and -3 dB bandwidth proxy at the modulation frequency.
- Bandpass (TP3) keeps energy around the modulation frequency and rejects slow ambient variation and wideband disturbances.
- Too narrow → valid beam energy is attenuated (range collapses). Too wide → more ambient energy enters the AFE (saturation risk rises).
- Filter design is only “correct” when TP3 preserves correlated amplitude without driving TP2 into saturation in worst-case sun angles.
- Bright background extreme: sunlight/reflection injection pushes TP2 toward saturation → demod output becomes distorted → nuisance alarms.
- Weak beam extreme: long distance / fog / soiling reduces TP4 toward threshold → jittery decisions → missed detections or chatter.
- Engineering target: keep TP2 away from clipping while maintaining a stable
beam_margin_dbat TP4 across weather and temperature.
- Key contributors: TIA input noise, detector dark current (shot noise), background shot noise, post-amp/ADC noise.
- The demod chain converts this into a TP4 jitter floor. If TP4 noise approaches the threshold band, false triggers rise.
- Practical rule: reduce TP4 jitter by balancing bandwidth, ensuring AGC headroom, and applying threshold hysteresis consistent with response-time limits.
- TP2 clips + rising
rx_sat_count→ ambient injection / headroom issue (optics + AFE saturation first). - TP2 clean but TP4 low → weak received beam (alignment/fog/Tx power) or filter mismatch attenuating correlation.
- TP4 present but
agc_codepinned → sustained weak optical energy or bias drift (APD risk) pushing the chain to its limits. - TP4 near threshold with high jitter → noise budget / bandwidth / hysteresis tuning issue.
Figure F5 — Photonic AFE Chain (Noise + Saturation + TP2–TP4) (link: #fig-f5).
H2-6. Tx Driver & Modulation: Current Control, Thermal Drift, Eye Safety
When range or stability degrades, it is common to blame the receiver first. In practice, the Tx side often sets the baseline: modulation purity, peak/average current behavior, temperature derating, and EMI-induced rail droop can all reduce correlated amplitude at TP4 or inject disturbances that look like beam loss. This chapter makes the Tx chain measurable via TP1 (drive waveform) and correlation against TP4 and TP6 (domain droop monitor).
- Constant current: simpler EMI profile and thermal stress; may limit peak optical power at long distances.
- Pulsed current: increases peak optical power while controlling average power via duty cycle; raises risk of EMI and rail droop.
- Failure signatures: peak clamp or supply droop causes TP4 to drop even with perfect alignment.
Evidence: TP1 frequency + duty + edge quality; optional i_tx_peak/i_tx_avg; correlate with TP4 amplitude.
- Synchronous detection assumes the transmitter is a stable reference. If modulation frequency or duty drifts, the demod correlation gain drops.
- Edges that are too fast raise EMI; edges that are too slow distort the effective modulation depth.
- Engineering objective: keep TP1 stable across temperature and supply variation so TP4 reflects real beam changes, not timing artifacts.
- Emitter optical power typically decreases with junction temperature; long-term aging reduces output at the same drive current.
- Compensation: NTC-based derating/boost tables (simple) or optical feedback (complex); both should avoid over-stressing the emitter.
- Proof method: hold alignment constant and record
temp_codevs TP4 amplitude drift. A monotonic drift points to Tx thermal behavior.
- High di/dt pulses can inject noise into shared impedance and raise the apparent noise floor at TP2/TP4.
- Rail droop on the Tx domain can also shift driver current, reducing modulation depth and correlated amplitude.
- Evidence: correlate TP1 pulses with TP6 droop and any bursts in
rx_sat_countor instability at TP4.
- Avoid “solving range” by uncontrolled peak current increases; prioritize optics, alignment margin, and AFE headroom first.
- Prefer mechanical shielding and installation geometry that reduces direct line-of-sight exposure.
- For laser-class emitters, apply stricter engineering limits and conservative derating; keep safety treatment as a design constraint, not a tuning knob.
- Keep alignment fixed. Log
temp_code, TP1 (frequency/duty), TP4 (demod amplitude), and TP6 (V_TX droop). - TP4 drops with temperature while TP1 stable → Tx optical power drift / derating behavior.
- TP4 follows TP1 duty/frequency drift → modulation stability issue.
- TP4 jitter correlates with TP6 droop → EMI/rail coupling that reduces effective modulation depth or raises Rx noise floor.
Figure F6 — Tx Driver + Thermal Compensation (TP1 + TP6) (link: #fig-f6).
H2-7. Sunlight Immunity & False-Alarm Rejection: AGC + Logic
Sunlight immunity is not a single trick. It is a layered defense that turns “ambient injection” into a measurable, rejectable condition. The chain is: Optics (reduce injected background) → Sync Demod (reject non-correlated energy) → AGC + Decision Logic (prevent abnormal waveforms from becoming alarms). This chapter focuses on the last layer: using AGC behavior, saturation evidence, and a beam-quality score to suppress nuisance alarms while keeping real beam breaks responsive.
- Optics: hood / aperture / bandpass filter reduce background injection before it becomes current.
- Sync demod: correlation rejects off-frequency/off-phase disturbances.
- AGC + logic: contain the remaining edge cases (saturation, spikes, slow drift) using gates and scoring.
Evidence fields to make false alarms diagnosable: agc_code, saturation_flag (or rx_sat_count),
beam_quality_score, false_alarm_histogram_hour.
-
Direct sun / backlight saturation → TP2 clip /
saturation_flag=1/ risingrx_sat_count, alarms cluster at specific hours → apply saturation gate (lock output + log) and enforce minimum “valid-beam” quality. - Mirror-like reflection spikes → short TP4 excursions with poor multi-sample consistency → use N-of-M confirm + minimum break duration (hold) so spikes do not trigger.
-
Cloud shadow / slow ambient drift → gradual
agc_codedrift + TP4 baseline drift but correlation never truly collapses → slow-path AGC + hysteresis band sized to response-time limits. - Vehicle headlights / IR flood / illuminators → in-band energy rises (TP3), TP4 confidence fluctuates without a stable “beam break” signature → tighten bandpass/quality gate and avoid decision based on single-sample threshold crossings.
- Hold time / debounce: require continuous “beam break” for ≥
hold_ms; logbreak_ms_accum. - N-of-M confirm: in an M-sample window, require ≥N “break” votes; log
confirm_n,window_m. - Saturation gate: if
saturation_flag=1, force decision into degraded/lock state; logsat_lock_ms. - Beam-quality score: fuse amplitude, stability, AGC headroom, saturation into 0–100; log
beam_quality_score,quality_bad_ms. - Time-of-day histogram: bucket nuisance alarms by hour/angle proxy; log
false_alarm_histogram_hour.
A stable design distinguishes beam absent (correlation collapses) from beam unreliable (saturation/spikes/drift), and refuses to alarm on “unreliable” without persistent evidence.
Figure F7 — Sunlight Immunity Defense Funnel (link: #fig-f7).
H2-8. Outputs & Interfaces: Relay/OC/Bus, Tamper Loop, Wiring Robustness
Outputs are where an IR beam sensor becomes a security building block. This chapter stays on the device side: output types, minimal protection elements, and the evidence needed to diagnose chatter, bus dropouts, and tamper false triggers. The goal is integration that is robust and diagnosable without turning into a system-level wiring course.
- Relay: strong isolation and good noise tolerance for external equipment; watch coil drive transients and mechanical wear.
- OC: simple, low-cost, fast; depends on external pull-up domain and wiring—long lines and weak pull-ups can be noise-sensitive.
- For both types, stability depends on the decision layer: if logic is jittery, relay chatter or OC toggling bursts appear.
Evidence: relay_actuation_count, relay_chatter_count, oc_toggle_count, alarm_state_transitions.
- Use a dedicated driver (low-side or high-side) with controlled flyback path to avoid injecting noise into logic ground.
- Chatter root causes split into: decision instability (TP4 near threshold) vs power integrity (rail droop resets/UVLO events).
- Log every actuation with timestamps so “chatter” becomes countable evidence, not anecdote.
- Document the allowed pull-up voltage range and recommended pull-up resistance for typical cable lengths.
- Add device-side deglitch/hold constraints so short TP4 spikes do not produce OC bursts.
- If output sense is available, detect and log abnormal conditions (stuck-low, short, leakage).
Evidence to expose when possible: v_out_sense (or status proxy), oc_short_flag, oc_toggle_count.
- Use an RS-485 transceiver with adequate ESD and common-mode handling; enable fail-safe bias behavior on the device side.
- Device-side minimum protection set: TVS + CMC and an optional termination element if the device may sit at a line end.
- Make link health diagnosable with counters: CRC/frame errors and timeouts; do not rely on “it seems fine” in the field.
Evidence: bus_crc_err, bus_framing_err, bus_timeout, optional bus_rx_level_stats.
- Implement cover/remove/tamper as a device-side loop with debounce and minimum persistence.
- Distinguish open vs short conditions and log their durations so intermittent wiring issues do not look like attacks.
- Treat tamper as its own event stream; do not merge it into “alarm” without context.
Evidence: tamper_event_log, tamper_open_ms, tamper_short_ms.
- Protection placement: TVS return path must be short and predictable; otherwise protection can become an EMI injector.
- Common-mode control: add CMC where long outdoor runs exist; log bus errors to validate that CMC helps.
- Output-induced PI: correlate output activity with any brownout/reset evidence to separate “logic jitter” from “power droop.”
- Diagnosability: require every “odd behavior” to map to a counter or timestamped event.
Useful global evidence fields: brownout_count, output_domain_fault, alarm_state_transitions.
Figure F8 — Outputs & Interfaces (Relay/OC/RS-485 + Tamper) (link: #fig-f8).
H2-9. Power Tree & Outdoor Robustness: Brownout, Local ESD/Surge at I/O
Outdoor false alarms and missed detections often trace back to power integrity, not optics. The Tx chain draws pulsed current that can induce rail droop, and outdoor I/O can inject transients that momentarily corrupt logic decisions or bus links. This chapter stays device-side: define power domains, make brownout behavior deterministic, and implement a minimal “local” protection set at terminals with short, controlled return paths.
- Tx domain: pulsed LED/laser drive; the primary noise injector (
tx_pulse_current). - Rx/AFE domain: TIA/demod/AGC; requires clean supply and stable reference ground.
- Logic/output domain: MCU + output drivers + bus transceiver; must survive droop without undefined outputs.
Evidence to log/observe: V_TX_min, V_RX_min, V_LOGIC_min, and an injection reference such as
tx_pulse_current or Tx PWM duty/width.
- Rail droop must be tied to a known source: Tx pulse edges. Measure droop at defined points and correlate with Tx drive timing.
- If nuisance alarms cluster at specific hours and droop signatures appear at those times, treat it as a power-integrity fault first.
- Mitigation priorities: shorten current loops, increase local decoupling, slow edge rates if needed, and keep Rx/logic rails isolated from Tx pulses.
Minimum test points: TP-PWR1 (VIN), TP-PWR2 (DC/DC to Tx), TP-PWR3 (clean rail to Rx), TP-PWR4 (MCU VDD).
- UVLO: supply drops below a regulator threshold; rails collapse in a predictable pattern.
- BOR: MCU brown-out reset; reset reason register indicates a voltage dip event.
- WDT: timing/clock instability during droop can stall firmware; watchdog reveals “soft” failures.
Evidence fields: reset_reason_reg (POR/BOR/WDT/EXT), brownout_counter, optional uptime_before_reset_ms.
- Define the output policy on brownout: fail-safe alarm, fail-silent, or latched fault (device-side policy code).
- During
saturation_flagor brownout gating, prefer “degraded/fault” signaling over toggling alarm output states. - Chatter must be countable: relay/OC transitions should be logged and correlated with droop evidence.
Evidence: output_state_on_brownout, power_fault_event_log, relay_chatter_count, alarm_state_transitions.
- TVS: place at the terminal entry with a short, low-inductance return path; avoid routing the clamp current through sensitive grounds.
- CMC: reduce common-mode injection on long outdoor runs (especially RS-485 and long OC lines).
- Diagnose: bus errors and brownouts must be timestamped to separate “line injection” from “Tx pulse droop.”
Evidence: bus_crc_err/bus_timeout, optional esd_glitch_count, plus rail minima around events.
- If alarms/misses coincide with dips: capture
VINdroop +reset_reason_reg+brownout_counter. - If no reset but behavior changes: check
V_RX_minandbeam_quality_scorestability around the event. - If bus link drops: align
bus_crc_err/timeouttimestamps with droop and output toggles.
Figure F9 — Power Domains & Droop Evidence Points (link: #fig-f9).
H2-10. Self-Test, Calibration & Maintenance: Beam Quality, Auto-Align Aids
A perimeter sensor becomes a maintainable product when it can prove its own health. Self-test must exercise Tx, Rx correlation, and output paths; calibration must store a baseline “margin” that makes drift measurable; maintenance must be guided by evidence (quality score, drift rate, and pass/fail codes), not guesswork.
- Tx loop: emit a known test sequence and confirm current/drive timing behavior indirectly via Rx correlation response.
- Rx loop: verify amplitude + phase confidence and AGC controllability under a controlled pattern.
- Output loop: validate relay/OC actuation and bus interface health (device-side counters).
Evidence fields: self_test_pass_fail, self_test_code (bitmask), test_pattern_id, self_test_timestamp.
- Pattern A: nominal modulation (baseline correlation response).
- Pattern B: slight frequency/phase variation (confirms sync demod selectivity and filter health).
- Pattern C: duty/width step (probes Tx drive strength and power-tree tolerance without leaving run mode).
Measurable outputs during test: tp4_amp, tp4_phase, agc_code_during_test, optional saturation_flag.
- During alignment, record a baseline margin: demod amplitude headroom and AGC operating point.
- Store a compact baseline record:
baseline_margin,baseline_agc_headroom,baseline_phase. - Use baseline comparisons to distinguish “dirty optics” vs “mechanical shift” vs “Tx aging.”
- Track
current_marginand compute a drift metric over time (e.g., margin loss per day). - Slow linear drift suggests contamination/aging; step-like changes suggest shock/misalignment.
- Use drift thresholds to enter DEGRADED state before alarms become unreliable.
Evidence: current_margin, drift_rate, last_service_time, beam_quality_score.
- After cleaning: expect quality score up, AGC back toward midrange, and margin recovery.
- After re-alignment: margin improves immediately; nuisance alarm histogram flattens.
- Record each service as a timestamped maintenance event.
Evidence: service_event_log, false_alarm_histogram_hour, baseline_margin vs current_margin.
- Events: alarm / tamper / power-fault / self-test.
- Counters: brownout / bus errors / saturation.
- Snapshot: latest margin + AGC + quality score.
Figure F10 — Self-Test & Maintenance State Machine (link: #fig-f10).
H2-11. Validation Plan & Field Debug Playbook (SOP)
This SOP is designed for the shortest fault-isolation path. Every diagnosis must be backed by measurable evidence: waveforms (TP points), counters, and state codes. Each symptom follows the same template: First 2 measurements → Discriminator → Isolate → First fix.
- Optical/quality:
beam_quality_score,current_margin_db(ordemod_amp_headroom),agc_code,saturation_flag - Power/reset:
VIN_min,V_TX_min,V_RX_min,V_LOGIC_min,reset_reason_reg,brownout_counter - Output/bus:
relay_chatter_count,alarm_state_transitions,bus_crc_err,bus_timeout - State/test:
state_code(INIT/ALIGN/RUN/DEGRADED/ALARM/FAULT),self_test_code,self_test_pass_fail
Suggested test points: TP-OPT1 (Rx raw/TIA out), TP-OPT2 (demod out), TP-PWR1..4 (VIN/Tx/Rx/MCU VDD), TP-IO1 (relay/OC drive), TP-BUS1 (RS-485 A/B).
Symptom 1 — False alarm in daytime, stable at night
- Read
saturation_flag+agc_code+beam_quality_scoreduring the alarm window. - Scope TP-OPT2 (demod output): confirm if
demod_ampcollapses or clips near the alarm moment.
- SAT-driven:
saturation_flag=1or AGC pinned high → sunlight/reflection entering Rx FOV. - Power-driven: alarm aligns with
V_RX_min/V_LOGIC_mindips orbrownout_counterincrements. - Logic-driven: no saturation/droop, but quality score oscillates with cloud shadow/car IR sources.
- Shade Rx side-FOV (do not block the main beam) and re-check
saturation_flag. - Short-distance test (bring Tx/Rx closer) to create large margin and see if alarms persist.
- Optical path: add a deeper baffle / adjust mounting angle; use a narrow IR bandpass window (mechanical/optical change).
- Rx saturation robustness: select a fast, low-cap photodiode (e.g., BPW34) and keep TIA headroom; consider a higher dynamic-range TIA (e.g., OPA380).
- Power gating: add an eFuse / inrush limiter on input (e.g., TPS25940) and a robust supervisor/reset IC (e.g., TPS3839).
Symptom 2 — Frequent alarms in rain/fog
- Log
current_margin_db(ordemod_amp_headroom) in clear weather vs fog/rain. - Trend
beam_quality_scoreover minutes (slow drift vs rapid jitter).
- Attenuation: margin drops steadily without saturation → scattering/absorption reduces SNR.
- Condensation: quality jitters + occasional spikes → droplets/condensation causing unstable optics.
- Electrical: bus/power errors increase simultaneously → water ingress / wiring injection.
- Clean optical window; check if margin recovers immediately (service-as-isolation).
- Run a controlled self-test pattern; compare phase/amplitude confidence before/after cleaning.
- Tx stability: use a constant-current LED driver with PWM dimming support (e.g., TLC5940 or LT3474 depending on design).
- Rx noise headroom: prefer a dedicated low-noise TIA (e.g., OPA380) and band-limit to modulation.
- Sealing/maintenance trigger: add humidity/temperature sensing for proactive maintenance (e.g., SHT31).
Symptom 3 — Range cannot reach the rated distance
- Record
current_margin_dbvs distance; check ifagc_codeis pinned. - Scope TP-OPT2 (demod) and verify amplitude drop curve (2–3 distance points).
- Alignment/optics: strong margin close-range but drops too fast → FOV/beam divergence/alignment.
- Tx weak or Rx noisy: margin low even at short distance → emitter aging/driver limit or TIA noise/incorrect bandwidth.
- Threshold issue: demod amplitude OK but still “broken” → hysteresis/logic config.
- Short-distance baseline: prove link gain is healthy at 2–5 m.
- Swap heads (Tx↔Tx, Rx↔Rx) if spare units exist to localize domain.
- Emitter/driver: IR LED like TSAL6200 with a controlled driver (e.g., MIC3172 as a controller or a dedicated LED driver).
- Photodiode: standard PIN diode BPW34; if APD is used, ensure bias/safety design (APD examples vary by vendor).
- Comparator/threshold: robust, low-power comparator for clean switching (e.g., TLV3201).
Symptom 4 — Occasional miss (person passes but no alarm)
- Correlate event timestamps: did
beam_quality_scoredip without alarm state transition? - Scope TP-OPT2: verify beam interruption truly crosses threshold for long enough (debounce/hold window).
- Filtering too strict: demod crosses threshold but alarm not asserted → debounce/confirm window too long.
- Partial blockage: demod barely changes → beam path bypass / multi-beam geometry / reflections.
- Mechanical drift: misses only at certain angles → alignment margin insufficient.
- Use an opaque test target at a fixed location to validate repeatable trigger.
- Temporarily reduce hold/confirm time and observe if misses disappear (logic isolation).
- Logic path: implement hysteresis + minimum assertion time in firmware/state machine (device-side).
- Clean switching: comparator like TLV3201 feeding MCU capture pin for deterministic edge timing.
- Clock stability: if timing windows drift, use a stable oscillator (e.g., SiT1602 MEMS XO).
Symptom 5 — Relay output chatters / sticks
- Compare
relay_chatter_countandalarm_state_transitionsvsbrownout_counterandbeam_quality_score. - Scope TP-IO1 (relay drive) and TP-PWR4 (MCU VDD) during chatter.
- Logic jitter: chatter tracks quality score oscillation → decision threshold/hold policy.
- Power/reset: chatter aligns with droop/BOR → output undefined during brownout.
- Load/relay wear: drive looks stable but contact behavior unstable → external load surge or relay aging.
- Disconnect field load; test with a known resistive load (replace-load isolation).
- Force output via self-test; verify clean actuation independent of beam logic.
- Relay driver: low-side driver array such as ULN2003A (with proper flyback) for clean actuation.
- Solid-state alternative: opto-triac SSR like MOC3063 (AC loads) or MOSFET-based output stage (DC loads) as design option.
- Brownout control: supervisor TPS3839 + defined
output_state_on_brownoutpolicy.
Symptom 6 — RS-485 intermittently drops
- Log
bus_crc_err+bus_timeoutwith timestamps. - Scope TP-BUS1 (A/B) and TP-PWR4 during error spikes (look for common-mode bursts and droop coupling).
- Line injection: bursts unrelated to Tx PWM → outdoor EMI/ESD/surge coupling.
- Internal coupling: errors correlate with Tx pulse timing → ground bounce or shared rail noise.
- Termination bias: only long lines fail → endpoint/termination bias mismatch (keep discussion device-side).
- Short cable direct-connect (few meters) to see if errors vanish.
- Disconnect relay/high-current loads to eliminate internal injection coupling.
- Transceiver: robust RS-485 device such as SN65HVD1781 (or similar rugged families) at the device port.
- TVS: RS-485 line TVS like SM712 at the connector/terminal.
- CMC: common-mode choke such as WE 744232090 (example) to reduce common-mode injection.
Symptom 7 — Alarms immediately on power-up / cannot enter RUN
- Check
state_code(INIT/ALIGN/FAULT) +self_test_pass_fail. - Read
reset_reason_regandbrownout_counter; scope TP-PWR4 during boot.
- Stuck in ALIGN: margin too low at startup → alignment/beam not established.
- FAULT on boot: self-test fails → Tx/Rx/output chain hardware fault.
- Reset loop: BOR/WDT repeats → startup droop / inrush / cable drop.
- Short-distance test to force high margin; see if state progresses to RUN.
- Disconnect outputs and bus; power from a stable bench source to remove cable drop.
- Input control: eFuse/inrush limiter TPS25940 to prevent boot droop.
- Supervisor: reset IC TPS3839 for deterministic reset behavior.
- Regulators: low-noise LDO for Rx rail (e.g., TPS7A02) to protect AFE stability at boot.
Symptom 8 — Becomes unstable after mounting angle change
- Compare
current_margin_db+agc_codeacross angles (make a small table). - Check
false_alarm_histogram_hourfor time-of-day clustering (sun angle / reflections).
- Sun/reflection: angle correlates with
saturation_flagspikes. - Mechanical drift: margin gradually decays and drift rate increases after remount.
- External IR: only certain hours/vehicles trigger → interference entering Rx FOV or modulation window.
- A/B compare: revert to previous angle and re-check margin + histogram.
- Add temporary baffle; verify immediate stability improvement.
- Re-baseline: re-run installation calibration and store
baseline_margin+baseline_phase. - Mechanical aids: add alignment indicators (LED/buzzer) controlled by MCU; driver example ULN2003A.
- Logging: add a small RTC + backup to preserve event timestamps (e.g., DS3231 + coin-cell or supercap depending on design).
Figure F11 — Field Debug Decision Tree (IR Beam Perimeter Sensor) (link: #fig-f11).
| Function | Example MPN(s) | Why here |
|---|---|---|
| PIN photodiode | BPW34 | Common, fast PIN PD for modulated IR receive paths |
| TIA / photodiode amp | OPA380 | Low-noise TIA option for demod/SNR headroom |
| Comparator | TLV3201 | Clean thresholding/hysteresis-friendly front end |
| Input eFuse / inrush | TPS25940 | Boot stability, droop prevention, defined fault behavior |
| Reset supervisor | TPS3839 | Deterministic reset/brownout handling |
| Low-noise LDO | TPS7A02 | Clean Rx rail for AFE robustness |
| Relay driver array | ULN2003A | Stable relay drive + simple interface from MCU |
| RS-485 transceiver | SN65HVD1781 | Rugged device-side interface option |
| RS-485 TVS | SM712 | Device port transient clamp for A/B lines |
| Common-mode choke | WE 744232090 (example) | Reduce common-mode injection on long outdoor cables |
| Humidity sensor | SHT31 | Maintenance trigger for condensation risk |
| RTC (timestamp integrity) | DS3231 | Stable timestamps for event correlation |
| IR LED (emitter example) | TSAL6200 | Common IR emitter family used in many IR systems |
| Optotriac SSR driver (AC option) | MOC3063 | One possible AC-load isolation approach |
| XO (timing stability option) | SiT1602 | Stable timing reference for deterministic windows |
Note: MPNs are examples to anchor design/debug decisions. Final selection depends on voltage, temperature range, safety, and compliance constraints.
H2-12. FAQs ×12 (Evidence-based, no scope creep)
Each answer names what to measure (TP points / counters / state codes) and points back to the chapter evidence chain.