123 Main Street, New York, NY 10001

Magnetic Contact / Reed Switch Sensor — Design & Debug Guide

← Back to: Security & Surveillance

This page turns a “simple” reed switch contact into an evidence-driven, production-ready node design: contact physics → debounce/threshold → event logic → EMC/ESD → ultra-low power and field debug. You’ll learn exactly what to measure (waveforms, current, counters) to stop false alarms, avoid missed events, and hit multi-year battery life without drifting into system/platform topics.

H2-1. Definition & Boundary (What this page solves)

30-second scope lock

A magnetic contact (reed switch) is an event-input node that converts a door/window magnet state into a debounced, threshold-qualified open/close/tamper event. This page stays at node level and uses an evidence chain that always maps back to: contact → threshold/debounce → event → counters/logs.

This page owns: reed contact behavior, debounce/threshold front-end, MCU wake/event logic, node power/leakage, node-level wireless retry evidence (if wireless), tamper switch inputs, and node-level EMC/ESD/EFT effects. No platform/system deep-dive

Typical use cases (node viewpoint)

  • Open/Close sensing for doors, windows, cabinets
  • Tamper (cover open, device removal) as a separate event
  • Reliability targets: low false alarm rate, low missed events, controlled latency

Two form factors (still node-only)

  • Wired loop node: NO/NC contact into a supervised input (EOL logic referenced only)
  • Wireless battery node: low-power MCU + radio; events + counters prove wake/retry causes

Evidence chain (must be measurable)

  • Signal evidence: bounce waveform, threshold crossings, hysteresis margin
  • Event evidence: event_count, bounce_count, wake_count, tamper_count
  • Power evidence: sleep leakage, wake spikes, retry-driven duty cycle
  • Pass/Fail: false/miss rate targets + latency budget + battery-life goal

Out of scope (explicit)

  • PIR / microwave intrusion / IR beam / glass-break / fence sensing
  • Access panel architecture, NVR/VMS ingest, PoE switch/PSE design, PTP timing network
  • Cloud/app onboarding and backend workflows
Figure F1 — Magnetic contact (reed switch) node boundary Block diagram showing reed contact input, debounce/threshold front-end, MCU event logic, wired/wireless outputs, power/leakage points, counters/logs, and explicit out-of-scope boxes. Magnetic Contact (Reed Switch) — Node Boundary Evidence chain: contact → threshold/debounce → event → counters/logs Magnet + Reed N S NO / NC contact Front-End Pull-up + RC Schmitt Threshold + Hysteresis Low-Power MCU GPIO Wake / IRQ Debounce SW Counters/Logs: wake • bounce • event • tamper Node Outputs Wired Loop I/O NO/NC + reference EOL Wireless Node TX retry_count • duty_cycle Event Record (node-level) timestamp • monotonic counter • reset_reason Power (node) Battery pulse + low-temp LDO / DC-DC IQ • UVLO Leakage Hotspots ESD • dividers • GPIO Out of Scope PIR / Radar / IR beam Access panel • NVR/VMS PoE switch • Cloud apps
Figure F1. Keep the discussion at the reed-contact event node. Any design choice must map back to measurable evidence: bounce/threshold crossings, event counters, and power/leakage contributors.
Cite this figure: Figure F1 — “Magnetic Contact (Reed Switch) — Node Boundary (Front-end → MCU → counters/logs).”

H2-2. Reed Switch Fundamentals That Matter (engineering-only)

Physics that changes false/miss rates

Reed switches look binary, but field failures often come from geometry tolerance (gap/offset/angle), operate/release distance spread, and contact chatter under vibration. Treat the reed input as an analog phenomenon that must be qualified before becoming an event.

NO vs NC (fault-safety lens)

  • NC loop: tends to expose open-circuit faults sooner (fail-safe behavior), but may be more sensitive to wiring/connector intermittency.
  • NO loop: may simplify some nodes, but broken wires can look like “normal” unless supervision is present.
  • Practical rule: pick the contact mode that makes the worst fault unmistakable for the intended installation and supervision method.

Operate/Release distances are distributions

  • Operate distance: where the reed closes; release distance: where it opens.
  • They vary with magnet strength, part tolerances, mounting stress, and angle.
  • Design to the worst-case tail (e.g., P95/P99), not the “typical” distance.

Geometry variables that dominate behavior

  • Gap: primary sensitivity axis; small changes can flip the event outcome.
  • Offset: lateral misalignment reduces effective field at the reed.
  • Angle: orientation can shift both operate and release points noticeably.
  • Field direction: magnet polarity/orientation can improve or worsen repeatability.

Chatter / bounce (why “one action” becomes many edges)

  • Contact bounce: multiple rapid transitions at closure/opening.
  • Door rebound: mechanical oscillation near the threshold causes repeated close/open.
  • Vibration + near-threshold: turns marginal geometry into bursts of interrupts and false alarms.
  • Design implication: physics here dictates the minimum need for hysteresis and time qualification (implemented in H2-3/H2-5).

What to measure (fast, evidence-first)

  • Operate/release sweep: scan gap (and angle) and record the close/open points per unit.
  • Edge burst count: count raw transitions during a single door action (bounce/chatter indicator).
  • Environment corners: low temperature + low battery voltage can change margins indirectly.

How to frame pass/fail without system creep

  • Define a node-only window: “Must close by gap ≤ A, must open by gap ≥ B, across angle ±θ.”
  • Define a false edge budget: raw burst ≤ N within T ms for the expected door mechanics.
  • These become inputs to debounce/threshold design and validation (later chapters), while staying within node scope.
Figure F2 — Magnet–reed geometry that controls margins Diagram showing magnet polarity, reed capsule, and the key geometry variables gap, offset, and angle. Includes NO/NC symbol hints and an operate vs release margin bar. Magnet–Reed Geometry Three variables that drive false/miss rates: gap • offset • angle Physical layout (simplified) N S Magnet Reed capsule gap offset angle Contact mode NO NC Margins (concept) Operate distance where reed closes Release distance where reed opens Why near-threshold fails vibration → chatter angle/offset → drift needs hysteresis + debounce
Figure F2. Reliability depends on gap/offset/angle margins and the spread of operate/release distances. Near-threshold geometry amplifies vibration into chatter, which must be handled by threshold hysteresis and time qualification (later chapters).
Cite this figure: Figure F2 — “Magnet–Reed Geometry: gap/offset/angle and operate/release margin concepts.”

H2-3. Front-End Topologies (Debounce / Threshold / Hysteresis)

First crime scene of false/missed events

The reed input is not “clean digital.” Field issues usually come from bounce, near-threshold chatter, or noise-driven threshold crossings. The front-end must convert that analog reality into a single qualified event with measurable margins.

Rule: treat the reed pin as a signal-processing problem. Every topology choice must be justified by evidence: raw waveformcrossing countqualified output.

Topology map (what each block is good at)

  • Pull-up + RC: removes fast bounce energy; simplest “first line” filter. Boundary: RC too large adds latency and can hide fast valid actions.
  • Schmitt trigger: adds hysteresis around the threshold; strong against near-threshold chatter. Boundary: too much hysteresis can create missed events at large gaps.
  • Comparator + hysteresis: tunable thresholds/windowing; suitable when long cables or supervision windows demand repeatable thresholds. Boundary: input bias/leakage and reference drift must be budgeted.
  • Digital qualification (time-window / majority / edge-qualification): converts “edge bursts” into one event and enables counters. Boundary: a noisy pin can create wake/interrupt storms unless analog conditioning is present.
RC Schmitt Comparator Time qualification

How to choose the time constant (evidence-first)

  • Measure bounce duration distribution on real mechanics (not only bench toggling). Record P50/P95/P99 bounce length.
  • Set a latency budget for event confirmation (e.g., acceptable delay for alarm/reporting) and keep debounce inside that budget.
  • Pick RC / time-window to cover the tail (P95/P99), then verify it does not suppress legitimate “quick open/close” actions.
  • Validate with counts: one physical action should yield raw_edges > 1 but qualified_events = 1.

Oscilloscope evidence (minimum set)

  • REED_RAW: direct pin (or before RC) to see bounce/chatter shape.
  • RC_NODE: after RC to confirm attenuation vs latency.
  • SCHMITT/COMP_OUT: thresholded signal to count crossings and check hysteresis behavior.
  • MCU_IRQ: interrupt line (if used) to detect wake storms.

Counter/log evidence (must exist later in firmware)

  • raw_edge_count per action (before qualification)
  • qualified_event_count (after debounce/qualification)
  • wake_count and interrupt_count (to reveal noise-induced wake storms)
  • debounce_reject_count (how often a burst is rejected)
Figure F2 — Debounce pipeline: bounce → RC/threshold → qualified event Block diagram showing raw reed waveform with bounce/chatter, conditioning blocks (pull-up+RC, Schmitt/comparator hysteresis), edge crossing counter, and qualified output producing a single event. Debounce & Threshold Qualification Evidence chain: raw waveform → crossing count → single qualified event Raw reed signal bounce / chatter time V Conditioning RC + hysteresis Pull-up + RC Schmitt / Comparator hysteresis window Crossing count raw edges / action raw_edge_count should be > 1 Qualified output (one action → one event) qualified_event_count should be 1 Time qualification window / majority / edge-qual
Figure F2. Convert a noisy reed waveform into a single qualified event using RC + hysteresis and time qualification. Validate using evidence: raw_edge_count vs qualified_event_count.
Cite this figure: Figure F2 — “Debounce pipeline: bounce → RC/threshold → single qualified event.”

H2-4. Wired Loop & Line Supervision (EOL) — node-level only

Open / Short / Normal / Alarm without panel creep

Wired magnetic contacts often fail in the field due to broken wires, shorts/moisture, and noise on long cables. Node-side EOL supervision turns those failures into distinct resistance (or voltage) windows that can be tested by injection.

Scope note: this section covers node-side loop measurement and windowing only. Zoning/arming logic and system-wide panel behavior are out of scope.

Single EOL vs Dual EOL (what changes at node level)

  • Single EOL: simpler ladder; can detect key faults but may have less separation depending on wiring mode.
  • Dual EOL: clearer four-state separation, but requires tighter window budgeting (tolerance + line resistance + drift).
  • Design goal: maintain non-overlapping windows across temperature, cable length, and component tolerance.

Node-side windowing: ADC vs Comparator

  • ADC window compare: flexible thresholds, allows calibration and statistics; costs sampling time/power.
  • Comparator windowing: low-power, instant; requires stable references and hysteresis design.
  • Noise reality: long cables can inject transients; add input conditioning but avoid “smearing” windows into overlap.

Evidence that proves correct supervision

  • Resistance/voltage window map: Normal / Alarm / Open / Short boundaries defined as ranges.
  • Open/short injection test: force each fault and verify the node lands in the intended window.
  • False classification rate: under EFT/noise, log “window-flip” counts per hour (node-level statistic).

Long cable trade-offs (node-only)

  • Line resistance shifts measured windows; budget it explicitly.
  • Common-mode noise creates brief threshold crossings; use RC + hysteresis at the measurement node.
  • Protection leakage can distort high-impedance ladders; select parts and bias values with leakage in mind.
Figure F3 — EOL supervision: four states and decision windows Diagram showing a reed loop with EOL resistors, and four classification states (Normal, Alarm, Open, Short) represented as non-overlapping resistance/voltage windows with ADC/comparator decision boundaries. Wired Loop Supervision (EOL) — Four-State Windows Goal: non-overlapping windows across tolerance + cable + noise Node-side loop (concept) Measure loop as a value ADC window compare or comparator Reed contact EOL R EOL R single or dual EOL Long cable: resistance shift + transient crossings Decision windows (no numbers here) Use ranges: include tolerance + line resistance budget low high Normal Alarm Open (fault) Short (fault) How to make it robust 1) budget window gaps 2) add hysteresis at thresholds 3) log window-flip counts under noise
Figure F3. EOL supervision is a windowing problem: define non-overlapping ranges for Normal / Alarm / Open / Short, then validate with open/short injection and log “window flips” under cable noise.
Cite this figure: Figure F3 — “Four-state EOL windows: Normal/Alarm/Open/Short mapped to decision regions.”

H2-5. MCU Event Logic (Interrupts, Debounce, Counters & Logs)

Hardware edge → Firmware qualify → Evidence-ready event

A reed switch “event” is only trustworthy when the firmware can prove it survived bounce, chatter, and noise-driven wakes. This chapter turns the chain into a reusable SOP: wake sourcesamplequalifycommit (counters/log)report.

Interrupt & wake source selection (avoid wake storms)

  • GPIO IRQ: prefer a trigger mode that minimizes repeated firing under near-threshold chatter. Track irq_count separately from wake_count.
  • Wake gating: if available, use LP domain (e.g., low-power comparator / simple latch) so the main MCU only wakes after a stable condition.
  • Backoff: after a valid event, enforce a short “quiet” window to suppress mechanical rebound bursts (evidence via debounce_reject_count).
irq_count wake_count backoff

Debounce algorithms (pick by failure mode)

  • Time-window: confirm state only if stable for T. Best against bounce + chatter. Risk: added latency if T is large.
  • Majority vote: N samples within a short window; accept if ≥K match. Best against sporadic noise. Risk: longer awake time.
  • Edge qualification: require minimum pulse width or minimum spacing. Best against narrow EMI spikes. Risk: miss slow/soft transitions if thresholds are marginal.

Minimum counters (field-debug essential set)

  • irq_count, wake_count (per hour/day)
  • raw_edge_count (per action window)
  • bounce_reject_count (or debounce_reject_count)
  • event_count and event_rate
  • tamper_count (if tamper input exists)
  • retry_count / tx_fail_count (wireless nodes only; still node-level)
  • reset_reason_hist (brownout / watchdog / etc.)

Log field dictionary (no cloud dependency)

  • timestamp (RTC/local), event_type (open/close/tamper/fault)
  • wake_source (GPIO/RTC/LP gate), qualified_level
  • raw_edge_count, bounce_reject_count, qualifier_mode
  • battery_mv, temp_c (if available)
  • retry_count, rssi_bucket (optional node-only evidence)
  • reset_reason (if a reset occurred near the event)
Evidence chain requirement: one physical action should produce raw_edge_count > 1, but event_count increments by 1. If wake_count grows faster than event_count, suspect chatter/noise or wrong IRQ configuration.
Figure F4 — Event & Power State Machine + Current Contribution Diagram showing firmware state machine (sleep/wake/sample/qualify/commit/report/backoff) and a current contribution model (sleep leakage, wake sampling, TX retry spikes) with counters and evidence hooks. Event State Machine & Power Evidence Model One figure supports both firmware SOP (H2-5) and battery-life root cause (H2-6) Firmware SOP (state machine) SLEEP uA baseline WAKE latch source SAMPLE N reads QUALIFY window / vote / edge COMMIT counters + log REPORT wired / wireless BACKOFF quiet window IRQ / LP gate wake_source N samples qualified update counters backoff done return Counters: irq_count · wake_count · raw_edge_count · bounce_reject_count · event_rate · tamper_count · retry_count · reset_reason_hist Average current model (evidence driven) Iavg = sleep leakage + wake sampling + TX retry Sleep leakage divider · ESD leak · LDO IQ · GPIO float Wake sampling wake storms · long qualify · noisy input TX retry retry_count ↑ · low RSSI · low-temp droop
Figure F4. Firmware event SOP and power evidence share the same backbone: a state machine with counters/logs, plus an average-current breakdown that ties sleep leakage, wake storms, and TX retries to measurable evidence.
Cite this figure: Figure F4 — “Event state machine + average-current evidence model for reed nodes.”

H2-6. Ultra-Low Power Design (Leakage, Battery Life & Root Causes)

Years of battery life without false alarms

Reed nodes look simple, but battery life is usually destroyed by unexpected leakage and unplanned wake/report activity. The only reliable method is evidence-driven budgeting: sleep leakage + wake sampling + TX retry — each tied to a waveform and a counter.

Average current breakdown (turn symptoms into a budget)

  • Sleep leakage (uA): dominates long life. Measure after full settle and across temperature.
  • Wake sampling (mA × ms): driven by wake_count and qualification duration (N, T, K).
  • TX retry spikes: driven by retry_count; worsened by low RSSI and low-temp droop.
Iavg model waveform + counters

Leakage kill list (common “battery drops fast” root causes)

  • Divider / pull resistors: too low wastes current; too high becomes noise/leakage sensitive.
  • ESD/TVS leakage: high-impedance nodes shift levels; humidity/high temp makes it worse.
  • LDO IQ: an always-on regulator can dominate sleep current.
  • GPIO float / back-power: floating inputs or protection paths cause hidden current.
  • Wake storms: noisy thresholds cause frequent wake_count growth without real events.
  • RF retries: retry_count increases create “spike trains” and fast depletion.

Evidence checklist (what must be captured)

  • Current waveform: uA sleep baseline + wake plateau + TX spike train.
  • Event statistics: event_rate, wake_count, retry_count aligned to waveform spikes.
  • Voltage & resets: battery_mv under TX and reset_reason histogram (brownout correlation).

Battery selection (node-level only)

  • Internal resistance and pulse capability: determines droop during TX spikes.
  • Low-temperature behavior: IR rises, droop worsens, brownout becomes likely even with “remaining capacity”.
  • Acceptance test: verify battery_mv and reset_reason under worst-case low-temp + retry scenario.
Root-cause discriminator: if wake_count grows much faster than event_count, suspect noise/chatter or qualification too permissive. If retry_count grows with temperature drop, suspect low-temp droop and battery IR — confirm via battery_mv and reset_reason.

H2-7. Wireless Node Considerations (Node-Side Reporting & Retry Evidence)

Misreports → wake storms → retries → fast battery drain

Wireless turns small input issues into large energy losses: extra wakes often become extra transmissions, and weak signal turns each event into a retry spike train. This chapter stays strictly node-side: only what the node can measure, limit, and prove with counters and logs.

Message policy (reduce TX count without hiding evidence)

  • Event set: open/close/tamper/fault (+ optional battery_low). Keep types stable to simplify verification.
  • Coalescing: within a short window, merge rapid toggles into “final state + burst count” to prevent TX storms.
  • Retry cap: enforce a maximum retry per event. Record the cap hit with a counter, never silently loop.
  • Commit before report: always log event_seq and counters before TX so resets do not erase evidence.
coalesce retry cap commit-first

Node-side metrics (the minimum set that explains battery life)

  • tx_retry_count (distribution, not only total)
  • packet_loss_est (e.g., ACK fail rate / success rate)
  • rssi_hist (bucketed RSSI histogram)
  • duty_cycle (TX on-time estimate or TX count per hour)
  • battery_mv_min and reset_reason_hist (detect droop-driven resets)

Anti-interference: rate limit + backoff (node-only controls)

  • Rate limit: cap report frequency; count suppressed reports as report_suppressed_count.
  • Backoff: after failures, increase wait time before next attempt to avoid continuous spike trains.
  • Storm detector: if wake_count grows faster than event_count, enter a protective mode (longer qualify, fewer TX).

Evidence chain (how to prove the root cause)

  • Weak RSSI → rssi_hist shifts low
  • Retries → tx_retry_count increases; duty_cycle rises
  • Battery droop → battery_mv_min drops during TX spikes
  • Reset loop → reset_reason_hist correlates with retry spikes
Figure F5 — Wireless drain chain + node-level tamper evidence A two-branch diagram. Left shows weak RSSI causing retries, higher duty, battery droop, resets and more retries. Right shows attack paths (cover open, strong magnet, replay/inject) mapped to measurable node evidence counters and monotonic event sequence. Wireless Evidence & Tamper Proof (Node-Level) Two branches share one center: counters + event sequence + timestamp Branch A: RF drain chain Branch B: Tamper & security Shared evidence event_seq · timestamp battery_mv_min · reset_reason counters (histograms) Weak RSSI rssi_hist shifts low TX retries tx_retry_count ↑ Duty ↑ duty_cycle ↑ Battery droop battery_mv_min ↓ Reset loop reset_reason_hist more retries after reset Cover open / tamper switch tamper_count · tamper_debounce_reject Strong magnet spoofing magnetic_anomaly_count Replay / injection attempts event_seq_gap_count · signature_fail_count timestamp continuity Node trust primitives monotonic event_seq timestamp event signature / MAC
Figure F5. Node-side evidence closes two hard problems without system creep: wireless drain loops (weak RSSI → retries → droop → reset) and tamper credibility (tamper switch, magnet spoofing, replay/inject) using counters, event_seq, and timestamps.
Cite this figure: Figure F5 — “Wireless drain chain + node-level tamper evidence with event sequence.”

H2-8. Tamper & Security (Node-Level Trust & Evidence)

Prove events are trustworthy (without platform scope creep)

Security products must explain why an “open/close/tamper” event is credible. This chapter stays node-level: physical tamper signals, magnetic spoofing evidence, and simple trust primitives that create an audit trail without relying on any cloud or panel logic.

Tamper switch (cover open / removal)

  • Debounce tamper input like any mechanical contact. Track tamper_debounce_reject to distinguish bounce from real open.
  • Commit-first: store tamper event_seq + timestamp before reporting to survive resets.
  • Evidence: tamper_count, raw_edge_count (or reject_count), and a short log sample around the event.

Magnet spoofing (strong magnet hold / manipulation)

  • Detect anomalies using node-observable inconsistencies (unexpected persistence, abnormal patterns, or multi-input mismatch if available).
  • Record anomaly evidence as magnetic_anomaly_count and tag events with anomaly flags.
  • Boundary: do not promise “perfect prevention”; provide measurable confidence and a forensic trail.

Minimal trust primitives (node-side)

  • Monotonic event_seq: increments per event. Detect missing/injected events with seq_gap_count.
  • Timestamp: allows time-order evidence even if communication is intermittent.
  • Event signature / MAC: authenticate {event_seq, timestamp, event_type, payload_hash}. Track signature_fail_count when verification fails.
event_seq timestamp signature

Evidence chain (what must be provable)

  • Tamper credibility: tamper_count aligns with tamper_switch transitions (no chatter-driven storms).
  • Magnet anomalies: anomaly flags cluster around suspicious patterns; not random noise.
  • Non-repudiation basics: event_seq continuity + timestamp ordering + signature checks.
Credibility discriminator: if the node sees many transitions but few qualified events, treat it as mechanical bounce / noise. If event_seq gaps appear or signatures fail, treat it as integrity risk. Always keep the evidence at node level.

H2-9. EMC/ESD/EFT & Cabling Reality (False Triggers in Outdoor/Long-Cable Builds)

Cable coupling → threshold crossing → false events

Many reed “false opens/closes” are not sensor defects. Long cables collect ESD/EFT energy and convert it into input threshold crossings (extra edges, extra IRQ wakes, sometimes resets). This section focuses on node-level suppression choices and verification points that produce measurable evidence.

Failure mechanisms that actually create false events

  • Common-mode injection on long cabling shifts the input reference and produces short spikes.
  • Capacitive pickup turns fast transients into a visible pulse at the input node.
  • Threshold sensitivity: a “clean” spike becomes a logic transition when hysteresis/RC is insufficient.
  • After-event instability: ESD/EFT can cause latch-up-like behavior or brownout resets (node-level evidence only).

Front-end hardening (with the real tradeoffs)

  • RC filter: attenuates narrow spikes; too large can add delay and create slow-edge re-crossings.
  • Hysteresis / Schmitt: reduces multi-crossing; must match expected cable noise amplitude.
  • TVS/ESD device: clamps peaks, but leakage can bias high-impedance inputs and Cj can reshape pulses.
  • Return path awareness: provide a short, predictable path for transient current so it does not flow through the threshold reference.

What to verify (actionable, node-side)

  • EFT injection: measure false_event_rate and irq_count_delta under defined pulse bursts.
  • ESD touch points: record reset_reason_hist_delta; watch for correlated false events immediately after hits.
  • Waveform proof: confirm the transient actually crosses the input threshold (before and after suppression).
false_event_rate irq_count_delta reset_reason_hist

Discriminator (avoid guessing)

  • If irq_count rises but qualified event_count does not, qualification is working; the entry point is still noisy.
  • If event_count rises, threshold/hysteresis/RC or leakage bias is insufficient.
  • If resets correlate with EFT/ESD, investigate droop paths and clamp-induced leakage/capacitance effects.
Figure F6 — Cable coupling → threshold crossing → false triggers Block diagram showing ESD/EFT/RF coupling into long cable, input node spike, threshold crossing, IRQ wake and false events, plus suppression elements (RC, hysteresis, TVS with leakage/Cj) and evidence counters. EMC Reality for Long Cables Coupling path → threshold crossing → measurable evidence → suppression points Sources ESD touch / discharge EFT burst pulses RF / EMI nearby switching Long cable antenna + coupling path Entry point Input node spike waveform Threshold crossing(s) RC TVS leakage / Cj What it becomes IRQ wake irq_count ↑ False event false_event_rate ↑ Reset / latch-up symptom reset_reason_hist ↑ Return path kept short & predictable (node-level)
Figure F6. A practical model for long-cable false triggers: interference couples into the cable, becomes an input spike, crosses threshold, and manifests as IRQ wakes, false events, or resets. Suppression choices (RC, hysteresis, TVS with leakage/Cj awareness) must be verified with counters.
Cite this figure: Figure F6 — “Cable coupling path and suppression points that map to node evidence counters.”

H2-10. Validation Plan (Quantify Reliability with Tolerances, Statistics & Criteria)

A copyable matrix: variables × stress × pass/fail

“Reliable” must be measurable. Validation for reed/contact nodes is a matrix across geometry, environment, power, cabling, and immunity. This chapter provides a repeatable structure: what to sweep, how to log, and how to judge false/miss rates.

Must-test dimensions (node-level)

  • Geometry: gap_mm / offset_mm / angle_deg (defines trigger boundary and drift sensitivity).
  • Environment: temp_c / humidity_pct (affects leakage, materials, and magnetic behavior).
  • Power: battery_mv_start / battery_mv_min (controls droop, resets, and false toggling at low V).
  • Cabling: cable_len_m + routing/shielding class (controls coupling strength for EFT/ESD).
  • Immunity: ESD/EFT levels (ties directly to false_event_rate and reset_reason evidence).

Pass/fail criteria (define the statistics, then pick targets)

  • false_rate: false events per time (or per injection burst) under “no real actuation”.
  • miss_rate: missed detections per N deliberate actuations across the geometry sweep.
  • low_v_stability: no uncontrolled toggling; irq_count does not explode; resets do not cluster.
  • post-ESD stability: after hits, reset_reason_hist does not show abnormal increases and event_seq remains monotonic.
false_rate miss_rate low_v_stability

Logging schema (copyable field set)

  • test_id, trials_n
  • gap_mm, offset_mm, angle_deg
  • temp_c, humidity_pct
  • battery_mv_start, battery_mv_min
  • cable_len_m, shield_class
  • esd_kv, eft_level
  • false_rate, miss_rate, irq_count_delta, reset_reason_hist_delta

Evidence closure (what a “good report” looks like)

  • Each test row links to the same evidence counters: event_count, irq_count, false_rate, reset_reason.
  • Failures are tagged with the likely dimension (geometry / environment / power / cabling / immunity), not vague notes.
  • Before/after changes (RC/TVS/hysteresis) are compared using the same test_id structure.
Figure F7 — Modular validation matrix + criteria + data fields Diagram presenting a module matrix with key dimensions (geometry, environment, power, cabling, immunity), plus pass/fail criteria and the logging schema fields required to compute false and miss rates and detect reset clustering. Validation Matrix (Copyable) Dimensions × sweeps × stresses → statistics → pass/fail Modules Geometry sweep gap_mm · offset_mm · angle_deg miss_rate over N actuations Environment sweep temp_c · humidity_pct leakage-driven bias risk Power sweep battery_mv_start · battery_mv_min low_v_stability + reset_reason Cabling sweep cable_len_m · shield_class false_rate baseline Immunity stresses ESD (kV) · EFT (level/burst) → false_rate · irq_count_delta · reset_reason_hist_delta Compare before/after RC/TVS/hysteresis changes Outputs Criteria false_rate < X miss_rate < Y low_v_stability no reset clustering Data fields test_id · trials_n gap/offset/angle temp/humidity battery_mv_min cable_len_m esd_kv · eft_level false_rate · miss_rate irq/reset deltas Run sweeps → compute statistics → judge criteria
Figure F7. A modular validation matrix that avoids giant tables while staying copyable: define sweeps (geometry/environment/power/cabling), add immunity stresses (ESD/EFT), log fixed fields, compute false/miss rates, and apply pass/fail criteria.
Cite this figure: Figure F7 — “Validation matrix modules + criteria + logging schema for reed/contact nodes.”

H2-11. Field Debug Playbook (Symptom → Evidence → Isolate → Fix)

Use the same evidence chain every time

This SOP is node-side only: contact → threshold/debounce → event → counters/logs. Each symptom starts with two minimum measurements (waveform/current/counters), then uses discriminators to split the root cause into Mechanical, Electrical/EMC, Firmware, or RF/Wireless.

Always capture these two first

  • M1: Input waveform at the pin (does it cross threshold, how many times, spike width/shape?)
  • M2: One counter pair: irq_count_delta vs event_count_delta (same time window)

If wireless: add tx_retry_count + rssi_hist. If battery-powered: add battery_mv_min + reset_reason_hist.

Minimum tool set (field-friendly)

  • Scope probe (input pin + ground reference)
  • Current logger / DMM (sleep uA + TX spike mA)
  • Serial log / local dump (counters + reset_reason)
Symptom 1

Intermittent false alarms (random open/close events with no real motion)

Evidence (first 2 measurements)

  • E1: Compare irq_count_delta vs event_count_delta in the same window.
  • E2: Scope the input pin: look for spike-driven threshold crossings vs contact bounce.

Isolate (discriminators)

  • Mechanical: bounce-like multi-edges during real actuation; bounce_count rises.
  • Electrical/EMC: spikes occur without actuation; often cable-length / touch / switching correlated.
  • Firmware: irq rises but events do not (qualification rejects); or events rise due to weak thresholds.
  • RF/Wireless: false events trigger TX storms; tx_retry_count jumps and battery dips.

Fix (first actions + concrete MPN examples)

  • Raise noise immunity at the threshold: add/upgrade a Schmitt buffer.
    MPN examples: SN74LVC1G17 (TI, single Schmitt buffer), 74LVC1G17GW (Nexperia).
  • Clamp fast transients carefully (avoid leakage bias on high-impedance nodes):
    MPN examples: PESD5V0S1UL (Nexperia, low-leakage ESD), ESD9B5.0ST5G (onsemi).
  • Harden the cable entry with series impedance / ferrite:
    MPN examples: BLM18AG102SN1 (Murata ferrite bead), ACM2012-900-2P (TDK common-mode choke, if using twisted pair).
Symptom 2

Door is closed but still shows “open” (persistent wrong state)

Evidence (first 2 measurements)

  • E1: Measure gap/offset/angle relative to the trigger boundary (is it at a cliff?).
  • E2: Observe static input level vs threshold over time (humidity/temperature drift indicates leakage bias).

Isolate (discriminators)

  • Mechanical boundary: tiny door movement flips state; sensitivity is too close to edge.
  • Leakage bias: input sits near threshold and drifts with temp/humidity; ESD device Cj/leakage is suspect.
  • Wiring: only one door/loop affected; resistive window/connection quality differs.

Fix (first actions + concrete MPN examples)

  • Increase mechanical margin: reposition magnet/switch so “closed” is far from the switching cliff (leave geometry headroom).
  • Stabilize threshold with a comparator + hysteresis (when a raw MCU GPIO is too sensitive):
    MPN examples: TLV3691 (TI, nano-power comparator), MCP6541 (Microchip comparator).
  • Replace high-leakage protection parts on the input (bias problems look like “stuck open/closed”):
    MPN examples: PESD5V0S1UL (Nexperia), TPD1E10B06 (TI ESD diode).
Symptom 3

Battery life far below expectation (months instead of years)

Evidence (first 2 measurements)

  • E1: Measure sleep current (uA-level). Confirm it stays low over minutes, not only instantly.
  • E2: Capture event/wake/TX evidence: wake_count, tx_retry_count, duty_cycle, battery_mv_min.

Isolate (discriminators)

  • Leakage dominant: sleep current is high; suspect ESD leakage, LDO IQ, divider resistors, floating GPIO.
  • Event storm dominant: sleep is low, but wake_count is high; input noise or mechanical bounce.
  • Retry storm dominant: tx_retry_count high + RSSI low; each event costs multiple transmissions.

Fix (first actions + concrete MPN examples)

  • Cut baseline power with a true low-IQ regulator (or bypass if topology allows):
    MPN examples: TPS782 (TI low-IQ LDO family), MCP1700 (Microchip low-IQ LDO).
  • Stop droop-driven resets using a supervisor / brownout strategy and (if needed) a load switch:
    MPN examples: TPS3839 (TI voltage supervisor), TPS22910A (TI load switch).
  • Protect the battery against fault/short paths with an eFuse / power switch (node-side only):
    MPN examples: TPS25940 (TI eFuse), TPS2553 (TI current-limited switch).
Symptom 4

Only one long cable / one door fails (others are stable)

Evidence (first 2 measurements)

  • E1: Compare the “bad” line vs a “good” line: cable_len, routing class, shielding, near-noise sources.
  • E2: Under the same environment, compare false_event_rate and input spike amplitude/width.

Isolate (discriminators)

  • Follows the cable when swapped → coupling/entry path issue.
  • Follows the node when swapped → front-end margin/leakage/threshold issue.
  • Only after certain actions (relay switch nearby, motor start) → conducted/EMI coupling.

Fix (first actions + concrete MPN examples)

  • Add entry impedance (series resistor + ferrite) and verify spike reduction:
    MPN examples: BLM18AG102SN1 (Murata bead), ACM2012-900-2P (TDK CMC).
  • Use a resistor network for consistent thresholds (reduces tolerance drift across builds):
    MPN examples: YC164-JR-07 series (Yageo resistor network family), EXB-38V series (Panasonic array family).
  • Re-evaluate TVS choice for leakage/Cj at this node (swap and compare with same test_id):
    MPN examples: PESD5V0S1UL (Nexperia), TPD1E10B06 (TI).
Symptom 5

After ESD / thunderstorm, it starts toggling (unstable behavior appears after stress)

Evidence (first 2 measurements)

  • E1: Check reset_reason_hist_delta (did resets start clustering after the event?).
  • E2: Check static input bias and leakage symptoms (level drift, new sensitivity, slow re-crossings).

Isolate (discriminators)

  • Reset clustering + battery dips → droop/rail integrity issue.
  • No resets but toggles → threshold/hysteresis margin degraded or leakage increased after stress.
  • Only long lines affected → coupling path stronger than design margin.

Fix (first actions + concrete MPN examples)

  • Replace / upgrade the ESD device on the input and re-run the same EFT/ESD test:
    MPN examples: PESD5V0S1UL (Nexperia), ESD9B5.0ST5G (onsemi), TPD1E10B06 (TI).
  • Improve rail robustness using a supervisor and a controlled power path:
    MPN examples: TPS3839 (TI supervisor), TPS22910A (TI load switch), TPS25940 (TI eFuse).
  • Strengthen thresholding (if GPIO-only is too fragile):
    MPN examples: TLV3691 (TI nano-power comparator), SN74LVC1G17 (TI Schmitt buffer).
Decision tree

Use the tree to avoid guesswork: start from the symptom, capture two minimum evidence items, then isolate into Mechanical / Electrical-EMC / Firmware / RF-Wireless, and apply a first fix with a measurable re-test.

Figure F8 — Field debug decision tree (Symptom → Evidence → Isolate → Fix) Four-column decision tree with symptom blocks, evidence blocks, isolate buckets, and fix blocks (including example MPN classes). Text is short; blocks and arrows are prominent for mobile readability. Field Debug Root-Cause Tree Symptom → 2 Evidence → Isolate bucket → First Fix (re-test with counters) Symptoms First 2 Evidence Isolate First Fix False alarms Closed = open Battery short Only one line After ESD/EFT Waveform @ pin threshold crossings? spike vs bounce Counters (same window) irq_count vs event_count reset_reason, battery_mv_min Wireless evidence tx_retry_count rssi_hist, duty_cycle Mechanical bounce / margin Electrical / EMC spike injection Firmware qualify / logs RF / Wireless retries / RSSI Fix: threshold Schmitt / comparator SN74LVC1G17 / TLV3691 Fix: clamp & entry low-leak ESD + ferrite PESD5V0S1UL / BLM18AG102 Fix: power low-IQ LDO + supervisor MCP1700 / TPS3839 Fix: RF behavior retry cap + backoff record tx_retry/rssi
Figure F8. A field-friendly decision tree that forces evidence first: capture waveform + counter deltas, then isolate into mechanical/electrical/firmware/RF buckets, apply one first fix, and re-test using the same counters.
Cite this figure: Figure F8 — “Field debug root-cause tree for reed/contact nodes with evidence-driven fixes.”
MPN note

MPNs above are examples to make BOM discussions concrete (availability/ratings/package must match your design). The key is to validate changes with the same test_id and compare false_rate, miss_rate, irq_count_delta, and reset_reason_hist_delta.

Request a Quote

Accepted Formats

pdf, csv, xls, xlsx, zip

Attachment

Drag & drop files here or use the button below.

H2-12. FAQs (Evidence-based; node-side only)

Reed switch is closed, but it occasionally toggles—bounce or EMI first?

Usually EMI if you see narrow spikes; bounce if you see multiple slow crossings during a real closure. Measure: (1) input-pin waveform vs the Schmitt/comparator threshold, (2) irq_count_delta vs event_count_delta in the same 10–60 s window. First fix: add hysteresis (e.g., SN74LVC1G17) or a series bead (BLM18AG102SN1). See H2-3/H2-9.

Maps: H2-3Maps: H2-9
Will a long debounce time miss fast open/close events? How to pick the time window?

Yes—an overly long debounce window can miss fast open/close pulses. Measure: (1) the shortest legitimate contact-open time in your use case (P99), (2) qualify_reject_count (or equivalent) and miss_rate from validation runs. First fix: use edge qualification or a shorter window plus hysteresis instead of only RC. See H2-3/H2-5.

Maps: H2-3Maps: H2-5
NO or NC for security sensors—what exposes open-wire/short faults faster?

For fail-safe intrusion detection, NC is often preferred because a cut wire tends to look like an alarm/open circuit, but only if your loop supervision is designed for it. Measure: (1) loop resistance windows (normal/alarm/open/short), (2) open/short injection test confusion rate. First fix: implement single/dual EOL windows at the node. See H2-2/H2-4.

Maps: H2-2Maps: H2-4
With long cables and false alarms, add RC first or switch to Schmitt/comparator?

Start with evidence: if spikes are narrow and high, RC may not catch them; if edges are slow and hovering near threshold, RC helps. Measure: (1) spike width vs your RC time constant, (2) false_event_rate under EFT/long-cable conditions. First fix: add Schmitt/comparator hysteresis (TLV3691 class) plus modest RC, then retest. See H2-3/H2-9.

Maps: H2-3Maps: H2-9
How to set EOL resistance windows to separate open/short/alarm/normal reliably?

Pick windows by stacking tolerances: EOL resistors, cable resistance, contact resistance, ADC error, and temperature drift. Measure: (1) ADC code distributions for each state across temp, (2) worst-case min/max loop resistance per state. First fix: widen guard bands and add a ‘fault’ dead-zone between windows to reduce overlap. See H2-4.

Maps: H2-4
Battery drains fast—check LDO IQ first or a wake-up storm? What two evidences?

Separate baseline leakage from wake storms. Measure: (1) true sleep current over minutes (uA-level), (2) wake_count + tx_retry_count (or irq_count) per hour. If sleep is high, suspect LDO IQ/leaky ESD (PESD5V0S1UL class); if wakes are high, throttle events and cap retries. See H2-6/H2-7.

Maps: H2-6Maps: H2-7
More misses at low temperature—magnet gap issue or battery internal resistance causing threshold drift?

Low-temperature misses can be geometry margin or supply droop. Measure: (1) gap/offset at cold soak vs the trigger boundary, (2) battery_mv_min during TX/wake and the input threshold stability. First fix: move the magnet to increase margin first; then harden power with a low-IQ LDO (MCP1700 class) and brownout logging. See H2-2/H2-6.

Maps: H2-2Maps: H2-6
How to detect “strong-magnet spoofing” on the node side with lightweight evidence?

At node level, you can’t ‘prove intent’, but you can flag anomalies. Measure: (1) magnetic anomaly counter (sustained closed state with abnormal edge statistics), (2) tamper switch events and monotonic event_seq continuity. First fix: add a cover-tamper switch and sign events with a monotonically increasing counter stored in NVM/SE. See H2-8.

Maps: H2-8
Only one door false-triggers—installation offset or cable coupling? How to tell in one pass?

Use a swap test to isolate fast. Measure: (1) swap the cable or node and see if the failure follows, (2) compare (gap/angle) stats vs input spike stats on the bad door. First fix: if it follows the cable, add entry impedance and low-leakage ESD; if it follows geometry, re-mount for margin. See H2-2/H2-9/H2-11.

Maps: H2-2Maps: H2-9Maps: H2-11
After ESD it starts toggling—is the input clamp damaged or MCU reset/config?

After ESD, decide ‘reset’ vs ‘threshold drift’. Measure: (1) reset_reason_hist_delta and battery_mv_min, (2) post-event static input bias (near-threshold drift implies leakage damage). First fix: replace/upgrade the input ESD diode and add hysteresis; if resets cluster, add a supervisor (TPS3839 class) and improve hold-up. See H2-9/H2-11.

Maps: H2-9Maps: H2-11
Same hardware but different wireless protocol/report strategy gives very different battery life—why?

Protocol/strategy changes airtime and retries, which can dominate average current. Measure: (1) tx_retry_count distribution + rssi_hist, (2) duty_cycle and energy per event (current waveform integration). First fix: cap retries, add exponential backoff, and batch non-urgent reports; validate with the same counters before/after. See H2-7/H2-6.

Maps: H2-7Maps: H2-6
How to run a fast production test to baseline magnet gap margin and false-alarm rate?

For production, test margin and false/miss rates with a minimal matrix. Measure: (1) gap sweep (e.g., 3–5 points) at nominal temp, (2) false_rate/miss_rate with a standard jig motion profile plus an EFT spot check for long-wire SKUs. First fix: define pass/fail windows and record test_id, gap_mm, false_rate, miss_rate. See H2-10.

Maps: H2-10