# Has your key debounce been addressed? — Discussing the "Observer Effect" in hardware testing

**URL:** <https://forum-tuyaopen.discourse.group/t/topic/26>\
**Category:** Show & Tell\
**Created:** [July 24, 2026, 2:02am UTC](https://forum-tuyaopen.discourse.group/t/topic/26 "2026-07-24T02:02:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreams2050ai](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dreams2050ai](https://forum-tuyaopen.discourse.group/u/dreams2050ai)\
**Post date:** [July 24, 2026, 2:02am UTC](https://forum-tuyaopen.discourse.group/t/topic/26/1 "2026-07-24T02:02:47Z")

</div>

When troubleshooting on-site failures, we often encounter a baffling “ghostly phenomenon”: the product crashes or triggers falsely as soon as the customer uses it, but the moment an R&D engineer touches the oscilloscope probe or multimeter leads to the circuit, the fault instantly disappears. Remove the probe, and the problem immediately reappears.

This isn’t magic; it’s a very typical “observer effect” in electronic circuits. Recently, while troubleshooting a fault with an external switch on a module product, we fell squarely into this trap.

**1. The Failure Scene and Comparison**

The customer’s module product failed to work correctly when connected to an external **rocker switch**. The software configuration at the time was set to **edge-triggered** mode.

To troubleshoot, we conducted two sets of comparative tests:

- **Change the switch** : We replaced the rocker switch with a standard **push-button switch** and changed the software to **level-triggered** mode. The product worked perfectly.
- **Use test instruments** : We kept the rocker switch and edge-triggered mode unchanged. When we used an oscilloscope or multimeter to probe the signal, the fault mysteriously disappeared during the testing period.

**2. Why does the circuit work normally once the instrument is connected?**

Many people overlook a key fact: oscilloscope probes and multimeter leads are not absolutely ideal measurement tools. They both possess a **parasitic capacitance of tens of picofarads (pF)** to ground, along with specific input impedance.

When an external switch pin has no hardware filtering, any slight mechanical bounce generates a series of high-frequency glitches. When you probe this pin, **the parasitic capacitance of the probe unintentionally acts as a filtering capacitor** , quietly absorbing these high-frequency glitches. This leads you to see a relatively clean waveform on the oscilloscope screen, mistakenly assuming the circuit itself is fine. However, once the probe is removed, the pin is once again exposed to high-frequency noise without that protection.

**3. The Root Cause: Edge Triggering Has Zero Tolerance for “Hardware Bounce”**

Mechanical switches produce high-frequency hardware bounce ranging from 1μs to 1ms due to the physical elastic contact of internal metal contacts during closure or opening.

- **In level-triggered mode** : Software typically includes a 10~20ms debounce delay logic (i.e., after detecting a change, the software waits a moment before confirming). This mechanism naturally avoids the initial glitch area, so performance is normal when using a level-triggered push-button.
- **In edge-triggered mode** : The MCU’s interrupt controller is extremely sensitive to voltage level transitions. The dozens of microsecond-level glitches generated by a single switch press are recognized by the MCU as dozens of consecutive interrupt inputs. This causes the system’s internal interrupt counter to overflow instantly, leading to logical chaos.

**4. Real Oscilloscope Waveform Comparison**

Below are two typical waveforms captured during our reproduction and resolution of the issue:

**No Debounce Capacitor (The real state when the probe is removed)**

In edge-triggered mode, the first 10ms after pressing the switch is filled with dense, high-frequency spike noise. Every transition triggers an interrupt, which is the culprit behind the system logic crash.

 ![c8826e68406cb1f2c4b84f4892c1e56b_compress](https://canada1.discourse-cdn.com/flex048/uploads/forum_tuyaopen/original/1X/83f3835eaad900f45db224fc3fdbcc9e5403be8b.jpeg)

**With External Debounce Capacitor (Smooth RC Charging Curve)**

After adding a filtering capacitor, the high-frequency glitches are completely smoothed out, and the waveform becomes a very smooth exponential decay curve. The edge is clean, allowing the MCU to capture only a single valid edge.  
_(Oscilloscope waveform showing the disappearance of glitches and smooth transition after parallel connection of a 0.1μF capacitor)_

 ![e4ab42eff6ba45dd75b9a84191d22738_compress](https://canada1.discourse-cdn.com/flex048/uploads/forum_tuyaopen/original/1X/552a85d09a04bb7b9cbfa426fc7bb6ff6428fdd5.jpeg)

 ![WeChat Work Screenshot_17841686422160](https://canada1.discourse-cdn.com/flex048/uploads/forum_tuyaopen/original/1X/c4ffd59cc4dd7f9b04fadbd3b16b4ca1ded95c6d.jpeg)

**5. Summary: A Small Capacitor Solves a Big Problem**

Now that we know the probe’s parasitic capacitance can “save the day,” the root solution is clear: permanently integrate this capacitor into the hardware design.

We placed a **0.1μF (100nF) surface-mount ceramic capacitor in parallel** across the rocker switch terminals (i.e., from the MCU input pin to ground). This capacitor, in conjunction with the internal or external pull-up resistor, forms a low-pass RC filter. When the switch generates high-frequency mechanical bounce, the capacitor buffers the microsecond-level spike pulses through its charge/discharge effect, filtering out the noise and converting the chaotic glitches into a single, smooth level transition.

**Engineer’s Lesson Learned:**

During hardware design, whenever you encounter **edge-triggered** external inputs or interrupt pins, **it is an iron rule to reserve a debounce capacitor to ground at the pin**. Never let the parasitic capacitance of test instruments play the role of components in your formal circuit.
