Overview

The LM339 (LM339N) is a quad differential voltage comparator IC manufactured by Texas Instruments, STMicroelectronics, and ON Semiconductor. Containing four independent voltage comparators in a 14-pin package, it compares two analog input voltages and outputs a digital signal indicating which input is higher.

Designed to operate from a wide range of power supplies—from a single 2.0V to 36V DC supply up to split ±1.0V\pm 1.0\text{V} to ±18V\pm 18\text{V} rails—the LM339 features an input common-mode voltage range that includes Ground (0V0\text{V}). Each output is an open-collector phototransistor-style stage, allowing wired-OR connections and easy interfacing with 3.3V, 5V, or 12V logic levels using external pull-up resistors.

Quick reference

Channels4 (Quad Differential Voltage Comparator)
Supply Voltage (Single Rail)2.0 V2.0\text{ V} to 36 V36\text{ V} DC
Supply Voltage (Split Rail)±1.0 V\pm 1.0\text{ V} to ±18 V\pm 18\text{ V} DC
Output TypeOpen-Collector (Requires external pull-up resistor to target logic voltage)
Response Time1.3 μs1.3\ \mu\text{s} (Large-signal response time)
Input Offset Voltage2.0 mV2.0\text{ mV} typical (5.0 mV5.0\text{ mV} max)
Input Bias Current25 nA25\text{ nA} typical (250 nA250\text{ nA} max)
Quiescent Supply Current0.8 mA0.8\text{ mA} total for all 4 comparators
Package14-pin DIP / SOIC-14 / TSSOP-14

Pinout (DIP-14 Package)

text
             ┌───┴───┐
       OUT2 1│ 1   14│ OUT3
       OUT1 2│       │13 OUT4
        VCC 3│ LM339 │12 GND
      1IN-  4│       │11 4IN+
      1IN+  5│       │10 4IN-
      2IN-  6│       │9  3IN+
      2IN+  7│       │8  3IN-
             └───────┘
PinNameDescription
1OUT2Comparator 2 Output (Open-Collector)
2OUT1Comparator 1 Output (Open-Collector)
3VCCPositive Power Supply Input (+2V to +36V DC)
41IN-Comparator 1 Inverting Input
51IN+Comparator 1 Non-Inverting Input
62IN-Comparator 2 Inverting Input
72IN+Comparator 2 Non-Inverting Input
83IN-Comparator 3 Inverting Input
93IN+Comparator 3 Non-Inverting Input
104IN-Comparator 4 Inverting Input
114IN+Comparator 4 Non-Inverting Input
12GNDPower Supply Ground (0 V)
13OUT4Comparator 4 Output (Open-Collector)
14OUT3Comparator 3 Output (Open-Collector)

Function & Output Truth Table (Per Comparator)

ConditionOutput Stage StateOutput Voltage (With Pull-up to VpullV_{pull})
VIN+>VINV_{IN+} > V_{IN-}Open (High-Z Off)High (VpullV_{pull})
VIN+<VINV_{IN+} < V_{IN-}Sinking to GND (ON)Low (0V0\text{V})

Specifications

ParameterSymbolMinTypMaxUnitConditions
Input Common-Mode RangeVICRV_{ICR}0VCC1.5V_{CC}-1.5VIncludes GND (0V0\text{V})
Input Offset VoltageVIOV_{IO}2.05.0mVVCC=5VV_{CC} = 5\text{V}
Output Sink CurrentISINKI_{SINK}6.016.0mAVOUT1.5VV_{OUT} \le 1.5\text{V}
Saturation VoltageVSATV_{SAT}250400mVISINK=4mAI_{SINK} = 4\text{mA}
Low Power Quiescent CurrentICCI_{CC}0.82.0mAAll 4 channels

Typical Applications

Window Detector / Voltage Limit Alarm

A dual-comparator window detector signals when an input voltage VINV_{IN} falls outside a set range [VREF_LOW,VREF_HIGH][V_{REF\_LOW}, V_{REF\_HIGH}]:

text
  V_REF_HIGH ────────► [4IN-] ──┐
                                ├─► [OUT4] ──┬── [Pullup 10k to 5V] ──► Alarm Out
  V_IN ──────────────► [4IN+] ──┘            │

  V_IN ──────────────► [3IN-] ──┐            │
                                ├─► [OUT3] ──┘
  V_REF_LOW ─────────► [3IN+] ──┘

Common mistakes

  • Forgetting external pull-up resistors: Because LM339 outputs are open-collector, they cannot push current to a HIGH logic state on their own. Without an external pull-up resistor (e.g. 10 kΩ10\text{ k}\Omega to 3.3V, 5V, or 12V), the output will stay floating in High-Z state when VIN+>VINV_{IN+} > V_{IN-}.
  • Oscillation near crossover without hysteresis: Slow-moving analog input signals cause output chatter near the switching threshold due to noise. Add positive feedback (100 kΩ1 MΩ100\text{ k}\Omega \dots 1\text{ M}\Omega hysteresis resistor) between output and non-inverting input.

Notes

  • LM339 vs LM393 vs LM324: LM339 is quad comparator with open-collector outputs; LM393 is dual comparator; LM324 is quad op-amp with push-pull outputs (op-amps are slower and lack open-collector flexibility).

Assets & downloads