Digital signals rely on a high low window to reject noise, and small margin flips on slight upset. This page gives the noise margin idea and on site suppression.
Noise margin is the noise the receiver tolerates. High margin NMH is VIH min minus VOH min, low margin NML is VOL max minus VIL max. For TTL 5 V, VOH min 2.4 and VIH min 2.0 give NMH 0.4 V; VOL max 0.4 and VIL max 0.8 give NML 0.4 V, about 0.4 V of noise immunity. CMOS has a wider window, near 45 percent each side of VDD over 2, beating TTL. Small margin flips easily.
To improve immunity: shorten traces to pick up less, keep parallel lines away from noise sources, surround sensitive lines with ground, decouple the supply, use differential signals like RS485 for long lines instead of single ended, add Schmitt trigger inputs to ignore glitches, and lower impedance with pull ups. Shield and terminate buses against reflection. Supply ripple eats the margin, so steady the supply first.
| Item | TTL 5V | Action |
|---|---|---|
| NMH | about 0.4 V | steady supply |
| NML | about 0.4 V | lower Z |
| CMOS win | wider | prefer |
| Long line | picks noise | diff/shield |
| Glitch | false trig | Schmitt |
| Supply | ripple eats | decouple |
Noise margin is the receiver immunity, about 0.4 V for TTL and wider for CMOS. Improve it with short traces, shielded ground, decoupled steady supply, differential and terminated long lines, and Schmitt inputs. Steady the supply first or ripple eats the margin.
The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Immunity design per GB/T 5226.1; EMC to GB/T 17626 and IEC 60204-1. Always check the device datasheet and the product design file for ratings and derating.
Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.