# LM339 quad comparator: four channels, single supply

> Four comparators in one chip for multi-sensor line followers and threshold detection: supply, current, response and the pull-up each output needs.

Canonical: https://roboticsengineering.in/components/lm339-quad-comparator/ | Published: 2026-11-03 | Updated: 2026-11-03

**The LM339 is a quad comparator: four independent voltage comparators in one 14-pin chip, running from a single supply with an input range that includes ground, and a newer LM339B rated up to 38 V at 200 µA per comparator with a 1 µs response.** It is the four-channel version of the [LM393](https://roboticsengineering.in/components/lm393-dual-comparator/), useful for a multi-sensor line follower or a window detector. Figures are from the Texas Instruments LM339 and LM2901 datasheet.

## Key specifications

| Comparators | 4 |
| --- | --- |
| Supply rating (B) | up to 38 V |
| Current (B) | 200 µA per comparator |
| Offset (B) | 0.37 mV typ |
| Response time (B) | 1 µs |
| Input range | includes ground |

## What the datasheet promises

| Item | LM339B (new B version) |
| --- | --- |
| Comparators per package | 4, independent |
| Maximum supply rating | Up to 38 V |
| Supply current | 200 µA per comparator |
| Input offset voltage | 0.37 mV typical |
| Input bias current | 3.5 nA |
| Response time | 1 µs |
| Input common-mode range | Includes ground |
| Differential input range | Equal to the maximum-rated supply, ±38 V |
| Output | Compatible with TTL, MOS and CMOS; low saturation voltage |
| ESD | 2 kV HBM |
| Package | SOIC-14, among others |

The datasheet also lists the older LM139, LM239, LM339 and LM2901 parts with different limits, and points to the TL331B for a single comparator and the LM393B for a dual, so match the suffix on your chip. As with the LM393, the output is an open-collector stage and needs a pull-up resistor.

## Using it on a robot

- Give every output a pull-up to the logic supply, and share the ground with the controller.
- Feed each channel from an IR or light sensor and a threshold from a potentiometer or divider.
- Add a little hysteresis with a feedback resistor if the output chatters near the threshold.
- For the analog value rather than yes or no, read the sensor with an [ADS1115](https://roboticsengineering.in/components/ads1115-adc/).

## Sources and further reading

- [Texas Instruments LM339B, LM2901B, LM339, LM239, LM139, LM2901 quad comparators datasheet](https://www.ti.com/lit/ds/symlink/lm339.pdf) — the supply, current, offset, bias, response time and output figures above.

Last reviewed: November 2026. Limits are for the B version in the Texas Instruments datasheet; older versions and other makers differ. No price is quoted because it has not been checked.
