LM339 PCB Design Guide: Footprint, Pinout, and Alternatives
Industry-standard quad comparator with ground-sensing inputs and open-collector outputs.
The LM339 is the industry-standard quad differential comparator, in production since 1979 and still one of the cheapest ways to put four comparators on a board. It runs from a single 2 to 30 V supply (36 V absolute maximum) and draws 0.8 mA typical for all four comparators. The input common-mode range includes ground, so it compares signals right down to 0 V on a single supply, and the open-collector outputs level shift to whatever logic rail you pull them up to, or tie together for wired-AND logic. TI's current family datasheet (SLCS006Z, revised May 2025) covers it alongside the LM139, LM239, and LM2901 grades and the newer B-versions.
Pick it for ground sensing, wide supplies, level shifting, and cost; do not pick it for speed or precision. Response time is 1.3 µs typical with 5 mV of overdrive, input offset is 5 mV max at 25 °C (9 mV over temperature), the output only sinks so every rising edge is as slow as your pullup RC, and the plain LM339 grade is specified for 0 to 70 °C only. When any of that hurts, the fix is usually in the same family: LM339A for offset, LM2901 for temperature range, or TI's LM339B as the modern drop-in with better numbers across the board.
Most LM339 board bugs are not the comparator failing; they are one of five design mistakes: forgetting that an open-collector output needs a pullup, feeding a slow or noisy signal to a comparator with no hysteresis, letting inputs leave the ground-referenced common-mode window, running the commercial grade past its junction-temperature spec or quoting the B-version's numbers for it, and layout that couples the output back into the inverting input. Each is covered below.
What breaks boards
No pullup means no logic high: the output only sinks
The output is an open-collector transistor that pulls low; the high state is high-impedance until you add an external pullup to your logic rail. Budget the sink current: VOL is 150 mV typ / 400 mV max at 4 mA (700 mV max over temperature), guaranteed sink capability is 6 mA min (16 mA typ), and absolute-maximum output current is 20 mA. Size the pullup so low-state current stays at a few milliamps, and remember the rising edge is set by the pullup-resistance-times-load-capacitance RC, so a weak pullup buys you a slow edge.
No internal hysteresis: slow or noisy inputs make the output chatter
Response time is 1.3 µs typical with a 100 mV step and only 5 mV of overdrive, and 0.3 µs with a TTL-level step, but both figures assume the input crosses the threshold decisively. A slowly ramping or noisy signal recrosses the threshold repeatedly and the output bursts back and forth. Add hysteresis with positive feedback from the output to the noninverting input. And a comparison is only trustworthy once overdrive exceeds the input offset voltage: 5 mV max at 25 °C, 9 mV max over the full temperature range. For tighter thresholds, spec the LM339A.
The common-mode range includes ground but stops 1.5 V below VCC
Inputs are valid from 0 V to VCC − 1.5 V at 25 °C, and only to VCC − 2 V over temperature, so the window that includes ground excludes the top of the rail; on a 5 V supply that means nothing above 3 V over temperature without dividing it down first. Neither input may go more than 0.3 V below ground; AC-coupled and inductive sources violate this routinely, so clamp them. One input can rise above VCC, up to 30 V, without damage, provided the other input stays inside the valid range.
Plain LM339 is a 0 to 70 °C part, and that is junction temperature
The LM339 grade is specified for 0 to 70 °C junction temperature, not ambient, so self-heating in a warm enclosure can take you out of spec well below 70 °C outside air. For automotive or outdoor boards the same die is sold as LM2901 (−40 to 125 °C) or LM139 (−55 to 125 °C). And read the right column: SLCS006Z covers twelve part numbers, and the headline improvements — 38 V rating, 0.37 mV offset, 2 kV ESD — belong to the LM339B/LM2901B B-versions, not the plain LM339 on your board.
Layout: keep the output away from the inverting input, and bypass VCC
The classic self-oscillation mechanism is coupling from the output back into the inverting input. TI's layout guidance is explicit: do not route output and inverting-input traces in parallel unless a VCC or ground trace runs between them, and place any series input resistors right at the pins. Bypass the supply pin locally, because supply glitches shift the input common-mode window and corrupt comparisons near threshold. On a single-supply board, do not put a capacitor between the GND pin and system ground; the bypass belongs on VCC.
Key specifications
| Parameter | Value | Source |
|---|---|---|
| Supply voltage range | 2 V min to 30 V max recommended (VCC, non-V devices); absolute maximum 36 V | SLCS006Z Rev Z, Section 6.5 Recommended Operating Conditions, Non-B Versions + Section 6.2 Absolute Maximum Ratings for Non-B Versions |
| Operating temperature | 0 to 70 degC junction temperature (LM339x grade; LM2901x covers -40 to 125 degC, LM139x -55 to 125 degC) | SLCS006Z Rev Z, Section 6.5 Recommended Operating Conditions, Non-B Versions |
| Supply current (four comparators) | 0.8 mA typ / 2 mA max (ICC, VO = 2.5V, no load, VCC = 5V, TA = 25 degC) | SLCS006Z Rev Z, Section 6.10 Electrical Characteristics for LMx39 and LMx39A, ICC row (LM239/LM339 column) |
| Input offset voltage | 2 mV typ / 5 mV max at 25 degC; 9 mV max over full range (VCC = 5V to 30V, VIC = VICR min, VO = 1.4V; full range for LM339/LM339A is 0 degC to 70 degC) | SLCS006Z Rev Z, Section 6.10 Electrical Characteristics for LMx39 and LMx39A, VIO row (LM239/LM339 column) + footnote 2 |
| Common-mode input range | 0 to VCC - 1.5 V at 25 degC; 0 to VCC - 2 V over full range. Gotcha: input voltage must not go negative by more than 0.3V, though one input can exceed VCC (up to 30V) without damage if the other stays in range | SLCS006Z Rev Z, Section 6.10 Electrical Characteristics for LMx39 and LMx39A, VICR row + footnote 3 |
| Response time | 1.3 us typ (100mV input step with 5mV overdrive); 0.3 us typ (TTL-level input step); RL connected to 5V through 5.1 kOhm, CL = 15pF, VCC = 5V, TA = 25 degC | SLCS006Z Rev Z, Section 6.14 Switching Characteristics for LMx39 and LMx39A |
| Output low voltage / sink current | VOL 150 mV typ / 400 mV max at 25 degC (VID = -1V, IOL = 4mA), 700 mV max over full range; IOL 6 mA min / 16 mA typ (VID = -1V, VOL = 1.5V, 25 degC); absolute maximum output current 20 mA. Output sinks only - external pullup required for a logic high | SLCS006Z Rev Z, Section 6.10 Electrical Characteristics for LMx39 and LMx39A, VOL and IOL rows + Section 6.2 Absolute Maximum Ratings for Non-B Versions, IO row |
Verified against the manufacturer datasheet on 2026-07-10. Confirm the current revision before production use.
Alternatives
- LM339A: the tighter offset grade of the same part: VIO 1 mV typ / 3 mV max at 25 °C versus 2 mV / 5 mV for the plain LM339. The cheap fix when your thresholds are tighter than 5 mV.
- LM2901: the same quad comparator specified for −40 to 125 °C instead of 0 to 70 °C. The default pick for automotive and outdoor boards.
- LM339B: TI's next-generation drop-in replacement: 38 V maximum rating, 0.37 mV low input offset, 2 kV ESD (HBM), and an extended −40 to 85 °C range. Little reason to prefer the original in a new design.
- LM393: the dual version when only two comparators are needed; the datasheet's own cross-reference points new designs at the LM393B or LM2903B.
Common questions
- Why does my LM339 output never go high?
- Because there is no pullup. The LM339 output is an open-collector transistor that only sinks current; the high state is high-impedance. Add a pullup from the output to your logic rail. Once it is there, expect VOL of 150 mV typical (400 mV max) at 4 mA of sink current, and keep output current under the 20 mA absolute maximum.
- Can the LM339 run from a single 5 V or 3.3 V supply?
- Yes. The recommended supply range is 2 to 30 V (36 V absolute maximum) on a single rail, and the input common-mode range includes ground. Watch the top of the window: inputs are only valid to VCC − 1.5 V at 25 °C and VCC − 2 V over temperature, so on a 3.3 V rail the usable input range tops out around 1.3 V over temperature.
- What is the difference between the LM339, LM139, LM2901, and LM339B?
- Mostly temperature grade: the LM339 is specified for 0 to 70 °C junction temperature, the LM2901 for −40 to 125 °C, and the LM139 for −55 to 125 °C. The LM339A tightens the max offset from 5 mV to 3 mV at 25 °C, and the LM339B is the next-generation drop-in with a 38 V maximum rating, 0.37 mV offset, and 2 kV ESD (HBM).
- How fast is the LM339?
- Response time is 1.3 µs typical with a 100 mV input step and 5 mV of overdrive, improving to 0.3 µs typical with a TTL-level step (measured with a 5.1 kΩ pullup to 5 V and 15 pF of load). It is a general-purpose comparator, not a fast one, and rising edges are further limited by your pullup RC because the output itself only pulls down.