

The LM239 is a quad comparator integrated circuit manufactured by Texas Instruments. It contains four independent voltage comparators, each capable of comparing two input voltages and outputting a digital signal to indicate which input is higher. This component is widely used in signal conditioning, level detection, and analog-to-digital conversion applications. Its robust design and low power consumption make it suitable for a variety of industrial, automotive, and consumer electronics applications.








| Parameter | Value |
|---|---|
| Supply Voltage (Vcc) | 2V to 36V (single supply) or ±1V to ±18V |
| Input Offset Voltage | 2mV (typical) |
| Input Bias Current | 25nA (typical) |
| Output Sink Current | 6mA (typical) |
| Response Time | 1.3µs (typical, with 5mV overdrive) |
| Operating Temperature Range | -40°C to +85°C |
| Package Types | SOIC, PDIP, TSSOP |
The LM239 is typically available in a 14-pin dual in-line package (DIP) or surface-mount package. Below is the pinout and description:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | OUTPUT1 | Output of Comparator 1 |
| 2 | INPUT1- | Inverting Input of Comparator 1 |
| 3 | INPUT1+ | Non-Inverting Input of Comparator 1 |
| 4 | VCC- (GND) | Negative Power Supply (Ground) |
| 5 | INPUT2+ | Non-Inverting Input of Comparator 2 |
| 6 | INPUT2- | Inverting Input of Comparator 2 |
| 7 | OUTPUT2 | Output of Comparator 2 |
| 8 | OUTPUT3 | Output of Comparator 3 |
| 9 | INPUT3- | Inverting Input of Comparator 3 |
| 10 | INPUT3+ | Non-Inverting Input of Comparator 3 |
| 11 | VCC+ | Positive Power Supply |
| 12 | INPUT4+ | Non-Inverting Input of Comparator 4 |
| 13 | INPUT4- | Inverting Input of Comparator 4 |
| 14 | OUTPUT4 | Output of Comparator 4 |
The LM239 can be used with an Arduino UNO for applications such as voltage level detection. Below is an example circuit and code for detecting whether an input voltage exceeds a threshold.
const int comparatorOutputPin = 2; // LM239 OUTPUT1 connected to Arduino pin 2
const int ledPin = 13; // Onboard LED for indication
void setup() {
pinMode(comparatorOutputPin, INPUT); // Set comparator output as input
pinMode(ledPin, OUTPUT); // Set LED pin as output
}
void loop() {
int comparatorState = digitalRead(comparatorOutputPin);
// Read the state of the comparator output
if (comparatorState == HIGH) {
digitalWrite(ledPin, HIGH); // Turn on LED if input voltage > reference
} else {
digitalWrite(ledPin, LOW); // Turn off LED otherwise
}
}
No Output Signal:
Erratic Behavior:
Slow Response Time:
Incorrect Output Voltage Levels:
Q1: Can the LM239 be used with a single power supply?
A1: Yes, the LM239 supports single-supply operation with a voltage range of 2V to 36V.
Q2: What is the purpose of the pull-up resistor on the output?
A2: The LM239 has an open-collector output, which requires a pull-up resistor to generate a valid high-level output voltage.
Q3: Can the LM239 handle AC signals?
A3: Yes, the LM239 can compare AC signals, but ensure the input voltages remain within the common-mode voltage range.
Q4: What is the maximum output current?
A4: The LM239 can sink up to 6mA of current at the output. Avoid exceeding this limit to prevent damage.