IntermediateDebounce~15 min

Debounce

A chattering sensor drives everyone crazy. Filter it: the Clean signal only changes after the raw input has been stable for 200 ms in either direction.

Your goal

  • Short pulses or dropouts on Noisy (under 200 ms) must NOT change Clean.
  • If Noisy stays ON for 200 ms, Clean turns ON and stays on through brief dropouts.
  • If Noisy stays OFF for 200 ms, Clean turns OFF.
Stuck? Show hints (3)
  1. Two timers watching opposite states: Rung 1: NO Noisy β†’ TON T1. Rung 2: NC Noisy β†’ TON T2.
  2. Any chatter resets whichever timer was running only a STABLE signal lets one finish.
  3. Then latch the result: Rung 3: NO T1.DN β†’ OTL Clean. Rung 4: NO T2.DN β†’ OTU Clean.

Pattern from Contact & Coil's classic ladder logic series.

I/O for this exercise

Inputs
NoisyRaw (chattering) sensor
Outputs
CleanDebounced signal
Timers
T1 Β· 200msON-delay (signal high)
T2 Β· 200msOFF-delay (signal low)
Loading the editor…