Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use LM393: Examples, Pinouts, and Specs

Image of LM393
Cirkit Designer LogoDesign with LM393 in Cirkit Designer

Introduction

The LM393 is a dual independent precision voltage comparator, designed to operate from a single power supply over a wide range of voltages. It is capable of comparing two voltage inputs and providing a digital output to indicate which input is higher. This component is widely used in various applications such as sensor interfacing, voltage level detection, and threshold monitoring.

Explore Projects Built with LM393

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP8266 NodeMCU with LM393 Comparator Interface
Image of LM393: A project utilizing LM393 in a practical application
This circuit features an ESP8266 NodeMCU microcontroller connected to an LM393 comparator. The NodeMCU's D3 pin is interfaced with the LM393's D0 output, suggesting that the microcontroller is configured to read a digital signal resulting from a comparison operation. The circuit is likely used for detecting a threshold voltage level or a specific condition that the LM393 is set up to monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 with SIMCOM A7672s IoT Sensor Data Logger
Image of LM393 to LilygoSIM7000: A project utilizing LM393 in a practical application
This circuit integrates an ESP32 with SIMCOM A7672s module with an LM393 comparator for sensor data acquisition. The ESP32 is programmed to read a digital signal from the LM393's D0 output, corresponding to a threshold detection, and then sends this data to the Blynk Cloud using the SIMCOM A7672s module for remote monitoring. The LM393 is powered by the ESP32's 3.3V supply, and both share a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered LM393-Based Voltage Comparator Circuit with MOSFET Control
Image of cut off charger: A project utilizing LM393 in a practical application
This circuit is a power regulation and control system that uses an LM393 comparator to monitor voltage levels and control a MOSFET (IRFZ44N) for switching. It is powered by a 12V battery and a USB power source, and includes various resistors and capacitors for filtering and stabilization.
Cirkit Designer LogoOpen Project in Cirkit Designer
Solar-Powered Battery Charging and Monitoring System with TP4056 and 7-Segment Voltmeter
Image of CKT: A project utilizing LM393 in a practical application
This circuit is a solar-powered battery charging and monitoring system. It uses a TP4056 module to charge a Li-ion 18650 battery from solar cells and a DC generator, with multiple LEDs and a voltmeter to indicate the charging status and battery voltage. The circuit also includes transistors and resistors to control the LEDs and a bridge rectifier for AC to DC conversion.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with LM393

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of LM393: A project utilizing LM393 in a practical application
ESP8266 NodeMCU with LM393 Comparator Interface
This circuit features an ESP8266 NodeMCU microcontroller connected to an LM393 comparator. The NodeMCU's D3 pin is interfaced with the LM393's D0 output, suggesting that the microcontroller is configured to read a digital signal resulting from a comparison operation. The circuit is likely used for detecting a threshold voltage level or a specific condition that the LM393 is set up to monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of LM393 to LilygoSIM7000: A project utilizing LM393 in a practical application
ESP32 with SIMCOM A7672s IoT Sensor Data Logger
This circuit integrates an ESP32 with SIMCOM A7672s module with an LM393 comparator for sensor data acquisition. The ESP32 is programmed to read a digital signal from the LM393's D0 output, corresponding to a threshold detection, and then sends this data to the Blynk Cloud using the SIMCOM A7672s module for remote monitoring. The LM393 is powered by the ESP32's 3.3V supply, and both share a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of cut off charger: A project utilizing LM393 in a practical application
Battery-Powered LM393-Based Voltage Comparator Circuit with MOSFET Control
This circuit is a power regulation and control system that uses an LM393 comparator to monitor voltage levels and control a MOSFET (IRFZ44N) for switching. It is powered by a 12V battery and a USB power source, and includes various resistors and capacitors for filtering and stabilization.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of CKT: A project utilizing LM393 in a practical application
Solar-Powered Battery Charging and Monitoring System with TP4056 and 7-Segment Voltmeter
This circuit is a solar-powered battery charging and monitoring system. It uses a TP4056 module to charge a Li-ion 18650 battery from solar cells and a DC generator, with multiple LEDs and a voltmeter to indicate the charging status and battery voltage. The circuit also includes transistors and resistors to control the LEDs and a bridge rectifier for AC to DC conversion.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Battery chargers
  • Voltage level monitoring
  • Automotive sensors
  • Motor control
  • Logic voltage translation
  • Window comparators

Technical Specifications

Key Technical Details

  • Supply Voltage Range: 2.0V to 36V, or ±1.0V to ±18V (dual supplies)
  • Input Bias Current: 25 nA (typical)
  • Input Offset Current: ±5 nA (typical)
  • Differential Input Voltage Range: Equal to the supply voltage
  • Output Voltage Compatible with TTL, DTL, ECL, MOS, and CMOS logic systems

Pin Configuration and Descriptions

Pin Number Name Description
1 OUT1 Output of comparator 1
2 IN1- Inverting input of comparator 1
3 IN1+ Non-inverting input of comparator 1
4 GND Ground (0V) reference
5 IN2+ Non-inverting input of comparator 2
6 IN2- Inverting input of comparator 2
7 OUT2 Output of comparator 2
8 Vcc Supply voltage

Usage Instructions

How to Use the LM393 in a Circuit

  1. Power Supply Connection: Connect the Vcc pin to a positive supply voltage within the specified range and the GND pin to the system ground.

  2. Input Signal Connection: Apply the two voltages to be compared to the inverting (IN-) and non-inverting (IN+) inputs of the comparator.

  3. Output Connection: The output can be connected to a digital logic input, or used to drive a transistor or relay with the appropriate external components.

  4. Pull-up Resistor: The LM393 has an open-collector output, which requires an external pull-up resistor to the positive supply voltage to function correctly.

Important Considerations and Best Practices

  • Ensure that the power supply voltage does not exceed the maximum rating of the IC.
  • Avoid applying voltages to the input pins that exceed the supply voltage range.
  • Use bypass capacitors close to the power supply pins to filter out noise.
  • When interfacing with microcontrollers, ensure that the output voltage levels are compatible.

Example Circuit and Arduino Code

The following example demonstrates how to use the LM393 to compare a variable voltage with a fixed reference voltage and provide an output to an Arduino UNO.

// Define the Arduino pin connected to the LM393 output
const int comparatorOutputPin = 2;

void setup() {
  // Set the comparator output pin as an input
  pinMode(comparatorOutputPin, INPUT);
  // Begin serial communication at 9600 baud rate
  Serial.begin(9600);
}

void loop() {
  // Read the digital state of the comparator output
  int comparatorState = digitalRead(comparatorOutputPin);
  
  // Print the comparator state to the Serial Monitor
  Serial.println(comparatorState);
  delay(500); // Wait for half a second
}

Troubleshooting and FAQs

Common Issues Users Might Face

  • No Output Signal: Ensure that the pull-up resistor is correctly connected and that the input voltages are within the specified range.
  • Erratic Output: Place a bypass capacitor near the power supply pins to stabilize the operation.

Solutions and Tips for Troubleshooting

  • Check Power Supply: Verify that the supply voltage is within the specified range and is stable.
  • Inspect Connections: Ensure that all pins are properly soldered and connected.
  • Pull-up Resistor: Confirm that the pull-up resistor value is appropriate for the supply voltage and load.

FAQs

Q: Can the LM393 operate with a single supply voltage? A: Yes, the LM393 is designed to operate with a single supply voltage.

Q: What is the purpose of the pull-up resistor on the output? A: The pull-up resistor is required to provide a high level on the output when the open-collector output is in the off state.

Q: Can the LM393 outputs be connected directly to a microcontroller? A: Yes, but ensure that the microcontroller's input voltage levels are compatible with the LM393's output levels.