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 comparator integrated circuit (IC) designed to compare two input voltages and output a digital signal based on the comparison. It features two independent voltage comparators in a single package, making it versatile and efficient for a wide range of applications. The LM393 operates with a wide supply voltage range and is known for its low power consumption.

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

  • Voltage level detection
  • Signal conditioning
  • Zero-crossing detection
  • Pulse-width modulation (PWM) circuits
  • Analog-to-digital signal conversion
  • Overvoltage or undervoltage protection systems
  • Control systems in industrial and consumer electronics

Technical Specifications

The LM393 is a robust and reliable component with the following key technical details:

Parameter Value
Supply Voltage (Vcc) 2V to 36V
Input Offset Voltage ±5mV (typical)
Input Bias Current 25nA (typical)
Output Current (Sink) 16mA (maximum)
Response Time 1.3µs (typical, for 5mV overdrive)
Operating Temperature Range -40°C to +85°C
Package Types DIP-8, SOIC-8, TSSOP-8

Pin Configuration and Descriptions

The LM393 is typically available in an 8-pin package. Below is the pinout and description:

Pin Number Pin Name Description
1 Output 1 Output of comparator 1
2 Inverting Input 1 Inverting input of comparator 1
3 Non-Inverting Input 1 Non-inverting input of comparator 1
4 GND Ground (0V reference)
5 Non-Inverting Input 2 Non-inverting input of comparator 2
6 Inverting Input 2 Inverting input of comparator 2
7 Output 2 Output of comparator 2
8 Vcc Positive power supply

Usage Instructions

The LM393 is straightforward to use in a circuit. Below are the steps and considerations for its proper usage:

How to Use the LM393 in a Circuit

  1. Power Supply: Connect the Vcc pin (Pin 8) to a positive voltage source (2V to 36V) and the GND pin (Pin 4) to ground.
  2. Input Connections:
    • Connect the voltage to be compared to the non-inverting input (Pin 3 or Pin 5).
    • Connect the reference voltage to the inverting input (Pin 2 or Pin 6).
  3. Output: The output (Pin 1 or Pin 7) will be low (close to GND) if the inverting input voltage is higher than the non-inverting input voltage. Otherwise, the output will be high (close to Vcc).
  4. Pull-Up Resistor: The LM393 has an open-collector output, so a pull-up resistor is required on the output pin to ensure proper operation. Typical values range from 1kΩ to 10kΩ, depending on the application.

Important Considerations and Best Practices

  • Input Voltage Range: Ensure that the input voltages do not exceed the supply voltage range to avoid damage to the IC.
  • Bypass Capacitor: Place a decoupling capacitor (e.g., 0.1µF) close to the Vcc pin to reduce noise and improve stability.
  • Output Loading: Avoid excessive loading on the output pin to maintain proper operation and response time.
  • Hysteresis: To prevent output oscillations in noisy environments, consider adding hysteresis by using a feedback resistor between the output and the non-inverting input.

Example: Using LM393 with Arduino UNO

The LM393 can be used with an Arduino UNO for voltage level detection. Below is an example circuit and code:

Circuit Description

  • Connect the LM393's Vcc to the Arduino's 5V pin and GND to the Arduino's GND.
  • Connect the non-inverting input (Pin 3) to the voltage to be monitored.
  • Connect a reference voltage (e.g., from a potentiometer) to the inverting input (Pin 2).
  • Use a 10kΩ pull-up resistor on the output (Pin 1) and connect it to an Arduino digital input pin.

Arduino Code

// LM393 Comparator Example with Arduino UNO
// This code reads the output of the LM393 and turns on an LED if the monitored
// voltage exceeds the reference voltage.

const int lm393OutputPin = 2; // LM393 output connected to digital pin 2
const int ledPin = 13;        // Onboard LED pin

void setup() {
  pinMode(lm393OutputPin, INPUT); // Set LM393 output pin as input
  pinMode(ledPin, OUTPUT);        // Set LED pin as output
}

void loop() {
  int comparatorState = digitalRead(lm393OutputPin); // Read LM393 output

  if (comparatorState == HIGH) {
    digitalWrite(ledPin, HIGH); // Turn on LED if output is HIGH
  } else {
    digitalWrite(ledPin, LOW);  // Turn off LED if output is LOW
  }
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Output Signal:

    • Ensure the pull-up resistor is connected to the output pin.
    • Verify that the input voltages are within the specified range.
    • Check the power supply connections.
  2. Output Oscillations:

    • Add hysteresis by connecting a feedback resistor between the output and the non-inverting input.
    • Use a decoupling capacitor near the Vcc pin to reduce noise.
  3. Slow Response Time:

    • Minimize capacitive loading on the output pin.
    • Use a smaller pull-up resistor value to improve response speed.
  4. Overheating:

    • Ensure the supply voltage does not exceed the maximum rating (36V).
    • Avoid excessive current draw from the output pin.

FAQs

Q: Can the LM393 be used for AC signal comparison?
A: Yes, the LM393 can compare AC signals, but you may need to bias the inputs appropriately to keep the signals within the input voltage range.

Q: What is the purpose of the pull-up resistor on the output?
A: The LM393 has an open-collector output, which requires a pull-up resistor to define the output voltage level when the output transistor is off.

Q: Can I use the LM393 with a single power supply?
A: Yes, the LM393 is designed to operate with a single supply voltage. Ensure the input signals are within the common-mode voltage range.

This concludes the LM393 documentation.