Touch / Capacitance / Conductivity Thresholds: Discharge + T2D
← Back to:Comparators & Schmitt Triggers
This page shows how to build reliable touch, capacitance, and conductivity thresholds using discharge timing and time-to-digital measurement—not a touch-controller encyclopedia.
It focuses on what actually makes systems pass in the field: choosing the right timing primitive (t/Δt/counting window), managing leakage and EMI (wet surfaces, mains hum, long leads, ESD), and turning everything into executable selection rules and verification tests.
What this page solves (scope + decision map)
Scope box (non-overlap rules)
This page focuses on discharge/time measurement threshold sensing for touch, capacitance, conductivity, and leakage: how a changing electrode environment becomes a robust digital decision under drift, EMI, wet surfaces, and ultra-low-power constraints.
- RC discharge timing (t-crossing), charge-transfer cycles, and counting-window schemes.
- Time-to-digital decisions: single-threshold, dual-threshold Δt, and N/window averaging.
- Practical hooks: hysteresis strategy, baseline tracking, drift handling, and low-power duty-cycling.
- Mutual-capacitance touchscreen scanning algorithms and controller-specific firmware stacks.
- Comparator architecture deep dives (latched/regenerative topologies) beyond application-level needs.
- Generic standards encyclopedias (IEC/ESD/EFT) not tied to this sensing chain’s failure modes.
The 3×3 mental model (inputs → measurement → outputs)
Threshold sensing becomes reliable when the measured primitive matches what actually changes in the field. One electrode can show C↑, R↓, and leakage↑ at the same time—so decisions should be built on time-domain signatures (t-crossing, Δt, N/window) and repeatable statistics, not a single “magic” threshold.
- Capacitance change: electrode-to-ground and human coupling alters τ.
- Conductivity change: resistive path forms (wet finger, liquid film, probe contact).
- Leakage change: slow, humidity/contamination-driven DC paths and baseline drift.
- Digital trigger: “touch / no touch”, “wet / dry”, “present / absent”.
- Time (t): tcross or Δt becomes the decision variable.
- Count (N): cycles or events in a window for averaging and immunity.
Decision map (constraints → recommended primitive)
- Strong EMI / long leads: prefer N/window or multi-sample consistency over single-shot tcross.
- Wet surfaces / liquids: model as R ∥ C and use windowing (separate “touch-like” vs “conductive film”).
- Ultra-low power: use burst sensing + duty-cycling; add an always-on coarse detector only when wake latency allows.
- Need repeatable thresholds across units: prioritize Δt (dual-threshold) or ratio-like measures to cancel VDD/VTH drift.
- Need very fast response: single-threshold can work, but budget small-overdrive jitter and transient recovery.
Core idea: choose a primitive that remains distinguishable when environment + EMI + drift are worst-case, not typical.
Sensing primitives: capacitance vs conductivity vs leakage
Successful threshold sensing starts by identifying what the electrode environment really changes. “Touch” can look like capacitance increase (C↑), conductivity increase (R↓), or leakage increase (slow DC paths)—sometimes all at once. The goal is to pick a measurement primitive that produces a stable, separable time-domain signature.
A) Capacitance change (self-cap coupling)
- What changes: electrode-to-ground C, human coupling C, and parasitic C from routing/cables.
- Signature: the RC time constant shifts → tcross moves predictably with proximity/contact.
- Main trap: long leads add C and can mimic “always touched” unless baseline is tracked.
B) Conductivity change (resistive path forms)
- What changes: a resistive path to ground/return appears (wet finger, liquid film, probe contact).
- Signature: discharge accelerates or the node bias shifts; behavior often looks like R ∥ C rather than pure C.
- Practical note: avoid sustained DC bias across wet contacts; use pulsed sensing + current limiting to reduce stress.
C) Leakage change (contamination / humidity drift)
- What changes: slow DC paths appear (flux residue, moisture, dirty surfaces), often temperature/humidity sensitive.
- Signature: baseline drifts over minutes/hours; “touch” thresholds collapse unless tracking uses proper time constants.
- Main trap: treating leakage as sensitivity and only “raising the threshold” hides the root cause.
D) Quick separation in the lab (without over-explaining)
- Capacitance-like: tcross shifts with proximity and is fairly repeatable across samples in the same setup.
- Conductivity-like: transitions look “hard”; wet contact often changes both speed and baseline (R ∥ C behavior).
- Leakage-like: no clear touch event is needed; the baseline slowly walks with humidity/time and varies between boards.
Key takeaway: one electrode can mix C↑, R↓, and leakage↑, so decisions should rely on time signatures and statistics—not one threshold.
Discharge-based measurement: RC, thresholds, and time extraction
A) The core primitive: measure the threshold crossing time
A discharge-based sensor turns an electrode’s environment into a time measurement. The capacitor node decays as V(t) = V0 · exp(−t/RC). The measurement is the time when the waveform crosses the comparator threshold: V(tcross) = VTH, giving tcross = RC · ln(V0/VTH).
Practical implication: RC sets the time scale, while ln(V0/VTH) sets sensitivity to supply and threshold drift. When the crossing happens on a shallow slope, small noise produces large timing jitter.
B) Error chain: separate scale errors from bias errors
- R tolerance / tempco and parasitic C scale the time constant RC.
- VDD / V0 variation changes ln(V0/VTH) and shifts tcross.
- Timer clock error scales the measured time if the timebase is not stable.
- Input leakage / contamination paths add a slow DC discharge component and shift baselines.
- Comparator input bias and protection network leakage can offset the node trajectory.
- Residual charge (incomplete reset) produces a fixed starting bias between bursts.
Engineering takeaway: scale-like errors often look like proportional changes across different RC settings, while bias-like errors often show up as baseline drift or an offset that does not scale cleanly with RC.
C) Why jitter explodes near the threshold (without a comparator deep dive)
- Timing jitter grows when the slope is small: the crossing time is pushed around by input noise and interference.
- Late crossings are riskier: exponential discharge becomes flatter over time, so the same noise produces larger t-shift.
- Small overdrive hurts repeatability: the system becomes sensitive to threshold drift and edge uncertainty.
When single-shot tcross jitter becomes the dominant term, use averaging (N/window) or Δt methods to suppress randomness.
D) When single-shot time is not enough
- Strong EMI / long leads: switch to N/window consistency checks instead of one tcross.
- Large VDD drift or uncertain VTH: prefer Δt between two thresholds to cancel common shifts.
- Wet films / conductivity mix: treat the node as R ∥ C and use windowed decision regions.
- Ultra-low power with reliability: use burst measurements plus simple statistics (median/majority) per wake.
Time-to-digital schemes: single-threshold, dual-threshold, frequency/counting
Time-to-digital (T2D) threshold sensing can be implemented in three practical ways. Each option trades response time, stability under drift/noise, and MCU resources. The goal is to select a scheme whose dominant error terms can be averaged or cancelled at system level.
A) Single-threshold timing (t_cross)
- How it works: measure the first threshold crossing time after a known charge/discharge event.
- Best when: short leads, controlled EMI, and a strong slope at the crossing point.
- Main sensitivity: threshold drift and noise directly translate into timing uncertainty.
B) Dual-threshold timing (Δt window)
- How it works: capture two crossings (VTH1 and VTH2) and use Δt as the decision variable.
- Why it helps: common-mode drift (supply or threshold shifts) can partially cancel in Δt.
- Main trade-off: window spacing sets the balance between response time and noise immunity.
C) Frequency / counting window (N/window)
- How it works: turn the RC event into cycles/events and count N within a window for averaging.
- Why it helps: random jitter is reduced by statistics; ideal for burst sensing and low power.
- Main trade-off: needs a window length (latency) and stable enough timebase for the counter.
D) Quick selection rules (engineering level)
- Fastest response: single threshold, but ensure a steep crossing slope and clean return paths.
- Best drift resilience: dual threshold Δt, especially when supply and threshold vary in the field.
- Best noise immunity + low power: counting window with burst sampling and majority/median decisions.
- High cost of false triggers: prefer schemes that average or cancel errors (Δt or N/window).
Front-end circuits: electrodes, drive, clamps, and comparator interface
In discharge/time-based threshold sensing, the “front-end” decides whether the measured signature stays separable under long leads, wet films, leakage drift, and ESD events. Treat the electrode, cable, protection, and comparator input as a single chain: each block can add parasitic C, leakage, or injection that turns a clean time measurement into a false trigger.
A) Electrode as a component (area, reference, shield/guard)
- Area & shape: larger electrodes increase baseline C and often increase ΔC, but also slow the edge (flatter slope → higher timing jitter).
- Ground reference: the return path sets how much mains/human coupling appears as “signal” versus interference.
- Shield/guard: grounded shield reduces external pickup but adds fixed C; driven shield reduces effective parasitic-to-ground but can import driver noise if not controlled.
B) Drive path (charge/reset, current limit, series R, RC filtering)
- Charge/reset quality: stable V0 and complete reset prevent “starting bias” between bursts (a common source of baseline error).
- Current limiting / series R: reduces injection and improves survivability, but also slows transitions and can push the crossing into a low-slope region.
- RC filtering: suppresses fast spikes, but changes the measured waveform; keep the filter’s role explicit in the time signature budget.
C) Protection is not free (TVS/clamps add leakage and capacitance)
- Leakage: protection parts and contaminated surfaces can add a slow discharge path → baseline drift and “always touched” failures.
- Junction capacitance: adds parasitic C at the node → τ shifts and crossing slope reduces.
- Injection recovery: after an ESD/transient, the node may recover slowly, creating false triggers or stuck states if not time-gated.
D) Comparator interface (source impedance + input currents)
- High source impedance is fragile: input bias and leakage currents create a larger voltage/time error at the crossing.
- Protection networks matter: any added C/leak at the input directly changes tcross and its repeatability.
- Define the crossing consistently: the chosen threshold and any effective hysteresis must match the timing primitive used downstream (t, Δt, or N/window).
E) Long leads / probes (within threshold-sensing boundaries)
- Cable capacitance: increases τ and reduces slope near the threshold → more timing jitter unless Δt or averaging is used.
- Cable leakage: increases humidity sensitivity and baseline drift, especially with high impedance nodes.
- Shield termination: select grounding that reduces pickup without creating additional injected noise paths into the measurement node.
Threshold strategy: hysteresis, adaptive baseline, and windowing (application-bound)
Most false triggers and “double counting” issues come from threshold strategy, not from part selection. Robust sensing requires separating slow drift (humidity, contamination, temperature) from fast events (touch, contact, short transients), then defining thresholds and windows that stay meaningful across that separation.
A) Fixed threshold (simple, but fragile)
- Best when: the environment is controlled and baseline drift is small compared to the touch signature.
- Failure mode: slow drift gradually “consumes” the threshold margin until touch/no-touch becomes ambiguous.
- Practical rule: if the baseline moves noticeably over minutes/hours, fixed thresholds will require frequent recalibration or will false-trigger.
B) Small hysteresis (debounce, with a threshold-cost)
- What it fixes: prevents rapid toggling around the decision point under noise and slow ramps.
- What it costs: introduces an effective entry/exit gap; the gap is part of the measurement definition and reduces usable margin at low VDD.
- Use it for: edge stability and chatter control, not as a substitute for drift handling.
C) Adaptive baseline (slow track + fast decision window)
- Slow track loop: follow environmental drift with a long time constant so baseline stays centered.
- Fast decision window: detect short events without letting the baseline “learn” the touch itself.
- Operational guardrails: freeze baseline during touch/contact; resume slow adaptation after release and settling.
This separation keeps drift in the slow loop and keeps touch in the fast window, preventing threshold collapse over time.
D) Windowing (Touch vs Wet/Leak vs Noise)
- Touch-like: short, repeatable excursions that appear consistently over several bursts.
- Wet/leak-like: sustained shifts and slow changes that move the baseline over longer time scales.
- Noise-like: fast, random, or mains-correlated disturbances that fail consistency checks.
A window strategy turns these behaviors into regions rather than forcing one threshold to represent all conditions.
Noise/EMI reality: mains hum, ESD, wet surfaces, long leads
Field false triggers usually come from predictable injection mechanisms rather than from “random noise”. The fastest path to robustness is to classify the dominant disturbance (mains, ESD, wet leakage, long leads), then apply fixes in priority order: structure → electrical → time strategy.
A) The four dominant field offenders (what they look like)
- Mains pickup (50/60 Hz): periodic timing jitter and phase-dependent toggling around the threshold.
- ESD / fast transients: a large injection causes saturation and “false trigger + slow recovery” behaviors.
- Wet surfaces: the node shifts toward R ∥ C; timing can become faster or slower depending on the dominant path.
- Long leads/probes: cable C and leakage reduce slope near the crossing, amplifying jitter and drift sensitivity.
B) Mains hum: why it produces periodic false triggers
- Mechanism: the electrode/lead behaves like an antenna; high-impedance nodes translate small coupled currents into visible timing shifts.
- Signature: the error repeats with a fixed period (50/60 Hz and harmonics) and often has “phase windows” where toggling is more likely.
- Fix direction: reduce coupling at the structure level first (reference/shield/guard), then use modest RC/clamps, and finally rely on burst consistency checks.
C) ESD: why “false trigger + slow recovery” happens
- Mechanism: a transient injects charge into the input chain and/or supply rails, driving comparators/timers into abnormal states.
- Recovery: residual charge and clamp conduction/leakage can hold the node off-nominal for milliseconds to seconds.
- Mitigation order: limit injected current at the entry, provide predictable clamp paths, and add a short post-event ignore window before re-baselining.
D) Wet surfaces: R∥C behavior breaks single-threshold assumptions
- R path: a conductive film can accelerate discharge and make timing appear “more sensitive”.
- C path: added surface capacitance and flattened slopes can also slow crossings and increase jitter.
- Practical cue: wet/leak effects are often sustained and drift-like; touch events are shorter and more repeatable under burst checks.
E) Fix priority: structure → electrical → time strategy
- Structure: electrode reference, guard/shield choices, and lead management reduce the injected signal before it becomes measurement error.
- Electrical: series R/current limit, modest RC, and clamps improve survivability and spike control (but may reduce slope).
- Time strategy: burst sensing and consistency gates (Δt or N/window) suppress random and phase-dependent toggling.
Ultra-low power operation: duty-cycling, burst sensing, wake-on-touch
Always-on sensing at nA–µA levels is achieved by measuring in short bursts with a low duty cycle, not by continuously sampling. Use a two-stage structure: always-on coarse detect to decide when to wake, then MCU refinement for reliable discrimination.
A) Duty-cycling: the power budget is energy-per-measurement × rate
- Sleep dominates: average current stays near Iq when bursts are short and infrequent.
- Burst dominates: energy per burst is set by charge/reset, comparisons, and the timer/counter window.
- Response trade: longer intervals save power but increase wake latency; burst statistics are used to keep false triggers low.
B) Burst sensing: reduce random toggling with consistency gates
- Concept: measure N times quickly and decide by majority/median or “K-in-a-row” consistency.
- Benefit: sporadic noise crossings fail the gate; repeatable touch-like events pass.
- Cost: burst length adds latency; choose the shortest burst that meets false-trigger targets.
C) Wake-on-touch: always-on coarse detect + wake MCU refinement
- Stage 1 (nA–µA): a low-power comparator/Schmitt gate provides a coarse trigger with wide margins.
- Stage 2 (short µA–mA): MCU runs burst + window checks to distinguish touch vs wet/leak vs noise.
- Outcome: high-quality decisions occur only when needed, keeping long-term average power low.
D) Key pitfalls: startup, baseline updates, low-VDD drift
- Startup time: discard early samples until the threshold/timebase is stable.
- Baseline update rate: track drift slowly; freeze baseline during touch and resume after release.
- Low VDD: threshold uncertainty becomes a larger fraction of the signal; rely more on Δt or N/window stability.
E) A practical low-power run loop (portable state machine)
- Sleep at minimum Iq.
- Coarse check using always-on comparator/Schmitt.
- Burst measure (N samples) with a short window.
- Consistency decision (majority/median/K-in-a-row).
- Optional refine after MCU wake (windowing for wet/leak discrimination).
- Baseline update only when stable; then return to sleep.
Calibration & drift: humidity/temperature/aging and production variance
Touch and conductivity thresholds vary across boards and across days because the electrode and its environment drift. Robust designs treat the threshold as a parameterized baseline + margin problem, implemented as a small run-time state machine: initialize, track slowly, freeze during touch, then recover after release.
A) Drift sources (what changes and why boards differ)
- Electrode assembly: placement, air gaps, adhesives, and mechanical stack-up shift baseline C and coupling paths.
- Cover materials: glass/plastic thickness and absorption change sensitivity and humidity dependence.
- Humidity & contamination: surface conduction and leakage create slow drift and wet-state behavior (often R∥C).
- Temperature & aging: material and surface state evolve over time, moving the baseline even without user interaction.
B) Baseline strategy (init, slow track, touch-freeze, release-recover)
- Init: collect enough stable samples to establish a clean starting baseline before enabling touch decisions.
- Track: adapt slowly so environmental drift is followed without “learning” a touch event as the new baseline.
- Touch-hold: freeze baseline updates during touch/contact to prevent threshold collapse and double-counting.
- Release-recover: after release, wait for stability and then return toward the new baseline with a slow rate.
C) Production variance: parameterize the threshold (do not hard-code one number)
- Margin-based: threshold = baseline + margin (or baseline − margin), where margin is tuned per SKU/stack-up.
- Percentile-based: set margins from distributions (P95/P99 of no-touch noise) instead of a single waveform.
- Relative metrics: Δt or ratio-style decisions reduce sensitivity to absolute VDD/VTH scale changes.
D) When to use a stable reference vs relative decisions (Δt/ratio)
- Stable reference helps when an absolute trip point must hold across wide temperature/humidity ranges and large stack-up spread.
- Relative decisions help when the target is change detection (touch/presence) and absolute scaling uncertainty dominates.
- Practical hybrid: use relative detection for touch, and separate wet/leak states with windowing and baseline behavior.
E) A portable calibration parameter set (firmware/production ready)
Verification & measurement traps: how to test without lying to yourself
Touch and leakage sensing are easy to “prove” and hard to verify: probes, hands, and fixtures often change the system. Reliable validation requires controlled injection (known C, known R, known noise), consistent logging, and distribution-based criteria (P95/P99), not one impressive waveform.
A) The measurement changes the measurement (probe/hand effects)
- Probe capacitance: shifts τ and reduces slope near the crossing, masking real field behavior.
- Ground lead loops: import pickup and injection that do not exist in the final product stack.
- Human proximity: acts as an uncontrolled C and mains-coupled source; results are non-repeatable without a harness.
B) Controlled injection: emulate touch, wet films, and noise
- Switchable C steps: emulate capacitive touch (repeatable ΔC).
- Switchable R steps: emulate conductive touch and wet leakage paths.
- R∥C combinations: emulate wet surfaces realistically (timing may speed up or slow down).
- Noise injection: add controlled mains-like or pulse disturbances to verify robustness windows.
C) Minimum logging set (so days and boards are comparable)
- Counts: triggers, false triggers, and per-window outcomes.
- Latency: stimulus-to-decision time, including burst and gating.
- Internal metrics: t/Δt/N-window, baseline, margin, and state machine state.
D) Statistics that matter (no statistics course required)
- Use distributions: P50/P95/P99 reveal tail risks that single waveforms hide.
- Fix the harness: comparisons are meaningless if the injection fixture changes between runs.
- Separate modes: evaluate dry, wet, and injected-noise cases independently.
E) Acceptance triangle: false-trigger rate vs latency vs power
- False triggers: quantify per hour/day under defined injection and environmental cases.
- Latency: keep the tail (P95/P99) within the response budget, not only the average.
- Power: report average current from duty-cycle, burst length, and wake frequency.
Engineering checklist (design review + test hooks)
This checklist converts the page into an executable review and verification flow for discharge/time-based touch & conductivity thresholds. Items are grouped by priority: P0 (must-pass), P1 (robustness), P2 (optimization). Scope stays within this sensing chain only.
P0 — Must-pass items (otherwise field false triggers or production spread will dominate)
Quick test: dry + high-humidity soak; log baseline drift and t/Δt shift over time.
Pass/Fail: drift remains inside the baseline tracking window without collapsing touch margin.
Quick test: sweep VDD and temperature; verify touch/wet windows stay separated.
Pass/Fail: decision windows do not overlap under worst-case corners.
Quick test: contact discharge at electrode/connector + supply perturbation; log recovery time.
Pass/Fail: recovery time meets product budget and does not produce repeated false triggers.
Quick test: repeatable wet-film fixture or switchable R∥C injection.
Pass/Fail: wet state is classified (or safely rejected) without turning into “touch”.
- Dry drift (hours): baseline stability + false triggers/hour
- Wet film: R∥C behavior + window separation
- ESD contact: recovery time + post-event false triggers
- Mains field: periodic jitter + burst consistency gate effectiveness
- Long lead swing: cable motion + shield/guard sensitivity
P1 — Robustness items (reduce field false triggers and “mystery” behavior)
P2 — Optimization items (power, latency, and MCU resource)
Applications + IC selection logic + vendor inquiry fields
This section moves from “it works” to “how to ship”: application recipes, a selection flow that maps specs to risks, and a copy-paste vendor inquiry template. Reference part numbers are included as starting points for datasheet lookup.
A) Application recipes (within this page scope)
Measurement choice: single t or dual-threshold Δt
Threshold strategy: slow baseline track + fast decision window (freeze during touch)
EMI note: structure/guard first, then burst consistency gate
Power note: duty-cycle + short bursts, avoid continuous measuring
Measurement choice: dual-threshold Δt or counting window (distribution-friendly)
Threshold strategy: windowing (Touch vs Wet/Leak vs Noise) + release-recover
EMI note: require recovery after transients before re-baselining
Power note: always-on coarse detect + wake refinement
Measurement choice: counting window + K-in-a-row consistency gate
Threshold strategy: alarm margin + hold + stable release recovery
EMI note: long-lead motion and mains pickup are treated as explicit test cases
Power note: target false triggers/hour while meeting wake latency
B) IC selection logic (spec fields → risk mapping)
C) Vendor inquiry template (copy-paste fields)
- Threshold / hysteresis drift vs VDD and temperature (test points list)
- Input leakage (distribution) at temperature corners and after humidity exposure
- Small-overdrive behavior: timing dispersion and output stability near threshold crossings
- ESD/transient recovery: time-to-normal operation and any lock-up conditions
- Mode switching: sleep→active threshold shift and recommended startup discard window
- Recommended input protection network impact (series-R/RC/clamp leakage)
D) Reference part numbers (starting points for datasheet lookup)
These examples are provided to speed up initial evaluation and datasheet comparisons. Final selection must follow the field-to-risk mapping above and the verification plan below.
FAQs (touch / capacitance / conductivity threshold)
Short, executable answers only. Each FAQ closes a long-tail issue within this page scope: discharge/time-to-digital measurement, threshold strategy, front-end, low-power operation, and verification.