The LM393, manufactured by HeroMicro, is a classic dual, low-power voltage comparator. Its features—wide operating voltage range, low quiescent current, open-collector outputs, and an input common-mode voltage range that includes ground—make it a fundamental and critical component in applications like industrial control, automotive electronics, power supply monitoring, oscillators, and logic level shifting.
1. Key Features Overview
Based on the datasheet provided by HeroMicro (LM393.pdf), key features include:
Wide Supply Voltage Range:
Single Supply: 2V to 36V
Dual Supply: ±1V to ±18V
Ultra-Low Power Consumption: Quiescent current is independent of supply voltage, with a typical value of only 0.8mA (for both channels combined).
Excellent Input Characteristics:
Input Offset Voltage: 2mV (typical)
Input Bias/Offset Current: Very low (nA range)
Input Common-Mode Voltage Range Includes Ground (GND), making it ideal for single-supply applications.
Open-Collector Output:
The output is the collector of an internal NPN transistor and must be connected to a pull-up resistor to produce a logic HIGH.
This design allows for "Wired-AND" connections, where the outputs of multiple comparators can be directly tied together to implement logic functions.
Outputs are compatible with TTL, MOS, and CMOS logic levels.
Packages: SOP8, DIP8
2. Pin Configuration (8-Pin)

| Pin | Comp. Channel | Function |
|---|---|---|
| 1 | A | Output (1OUT) |
| 2 | A | Inverting Input (1IN-) |
| 3 | A | Non-inverting Input (1IN+) |
| 4 | - | GND |
| 5 | B | Non-inverting Input (2IN+) |
| 6 | B | Inverting Input (2IN-) |
| 7 | B | Output (2OUT) |
| 8 | - | VCC |
3. Critical Design Guidelines
(1) A Pull-Up Resistor is Mandatory
This is the single most important rule for using the LM393. Because its output is open-collector, when the internal transistor is off, the output is in a high-impedance state and cannot actively drive a HIGH level.
Solution: Connect a pull-up resistor (Rpull-up) between each output pin (Pin 1 or Pin 7) and a positive voltage rail (which can be VCC or a different logic supply like 5V or 3.3V).
Choosing Rpull-up: Typically between 1kΩ and 10kΩ. A smaller value gives a faster rise time but higher power consumption; a larger value saves power but results in a slower rise time due to load capacitance. 4.7kΩ is a common and safe choice for driving TTL/CMOS logic gates.
(2) Flexible Power Supply Options
Single-Supply Operation: The most common use case. Connect GND (Pin 4) to system ground and VCC (Pin 8) to the positive rail (e.g., 5V, 12V, 24V). Its input range that includes ground allows it to easily compare signals near 0V.
Dual-Supply Operation: Connect GND (Pin 4) to a virtual ground (or negative supply) and VCC (Pin 8) to the positive supply. Inputs can then operate from the negative rail up to (VCC - 1.5V).
Level Shifting: The open-collector output enables easy level shifting. For example, an LM393 powered from 12V can have its output pulled up to 5V, allowing it to interface directly with a 5V microcontroller.
(3) Adding Hysteresis for Noise Immunity
When comparing slow-moving or noisy signals, the comparator can rapidly oscillate around the threshold point.
Solution: Introduce positive feedback to create a hysteresis voltage (Vhys). Connect a large resistor (e.g., 100kΩ) from the output back to the non-inverting input. This creates two thresholds: one for a rising input (Vth+) and one for a falling input (Vth-). The output only switches when the input crosses Vth+ and only switches back when it falls below Vth-, effectively rejecting noise.
(4) "Wired-AND" Logic
The outputs of multiple LM393s (or other open-collector devices) can be directly connected together and share a single pull-up resistor.
Logic Function: The bus is HIGH only if all output transistors are off. If any one output transistor is on, the bus is pulled LOW. This implements a hardware "NAND" function, commonly used in multi-channel fault detection (any fault triggers an alarm).
(5) PCB Layout Considerations
Decoupling Capacitor: Place a 0.1μF ceramic decoupling capacitor close between VCC (Pin 8) and GND (Pin 4) to filter power supply noise.
Input Traces: Keep them as short as possible and away from noisy nodes like switching circuits or digital lines, especially if hysteresis is not used.
Grounding: Ensure a clean, low-impedance ground path.
4. Typical Applications
Over-Voltage/Under-Voltage Protection: Monitor supply rails and trigger protection if they go out of bounds.
Window Comparator: Use two comparators to check if a signal is within a specified upper and lower limit.
Oscillators: Combine with an RC network to create simple square or triangle wave oscillators.
Zero-Crossing Detectors: For phase detection in AC signals.
ADC Front-End: As the core comparison element in successive-approximation ADCs.
5. Summary
HeroMicro's LM393 is an indispensable building block in analog circuit design, thanks to its simplicity, reliability, low power consumption, and high flexibility. By remembering the core rule that its open-collector output requires a pull-up resistor, and by designing appropriate hysteresis and power schemes for your application, you can leverage its powerful comparison capabilities in a wide variety of circuits.


