A pull up or pull down gives a floating node a definite level and is standard insurance against drift. This page covers the role, the resistor math and the traps.
When a digital input floats its level is undefined and noise prone, so a pull up defaults it high and a pull down low, ensuring determinism. Open drain or OC outputs have no high drive and must be pulled up to output high. A button often uses pull up: pressed pulls low, released is pulled high. Idle buses also pull up to hold logic 1. Without it the node drifts and the system glitches.
Too small a pull up wastes power and overloads the driver; too large is slow and noise prone. Rule of thumb: TTL pull up about 1 to 10 k, CMOS 10 to 100 k since input current is tiny. By rise time R under C load times t over ln 2, and fast buses want small. I2C has specs like 4.7 k at 5 V; buttons commonly 10 k. OC pull up must be small enough to rise in time without overcurrent.
| Case | Resistor | Note |
|---|---|---|
| TTL up | 1 to 10 k | avoid over I |
| CMOS up | 10 to 100 k | save power |
| Button | 10 k | default level |
| I2C | 4.7k at 5V | spec |
| OC gate | small enough | rise in time |
| Wrong | 1M or 100 | slow or hot |
Pull up or down sets the floating node; open drain must pull up. TTL about 1 to 10 k, CMOS 10 to 100 k; too large is slow and noise prone, too small runs hot. Do not forget the open drain pull up, do not exceed the next stage voltage, and match the button default to the program logic.
The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Digital interface per GB/T 4728; control to GB/T 5226.1 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.