Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use LM393: Examples, Pinouts, and Specs

Image of LM393Design with LM393 in Cirkit Designer

Introduction

The LM393 is a versatile dual voltage comparator that contains two independent precision voltage comparators. It is designed to operate from a single power supply over a wide range of voltages, making it a popular choice for various applications. Common uses include threshold detection, overvoltage protection, and waveform shaping. Its ability to compare two input voltages and provide a digital output makes it suitable for creating simple analog-to-digital interfaces.

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 ESP8266 NodeMCU with LM393 Comparator Interface: 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.

Open Project in Cirkit Designer
Image of ESP32 with SIMCOM A7672s IoT Sensor Data Logger: 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.

Open Project in Cirkit Designer

Technical Specifications

Key Technical Details

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 Positive supply voltage

Usage Instructions

How to Use the LM393 in a Circuit

  1. Power Supply: Connect the VCC pin to a positive supply voltage within the range of 2.0V to 36V and the GND pin to the ground of the circuit.
  2. Input Signals: Apply the analog signals to be compared to the IN+ and IN- pins of the respective comparator.
  3. Output Connection: Connect the OUT pin to a digital input of a microcontroller or to an LED with a current-limiting resistor to visualize the comparator's output.

Important Considerations and Best Practices

Example Connection with 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 state of the comparator output
  int comparatorState = digitalRead(comparatorOutputPin);
  // Print the state to the Serial Monitor
  Serial.println(comparatorState);
  // A short delay before the next reading
  delay(500);
}

Troubleshooting and FAQs

Common Issues

Solutions and Tips for Troubleshooting

FAQs

Q: Can the LM393 operate with different voltages on each comparator? A: No, both comparators share the same power supply pins and thus operate at the same voltage.

Q: Is it necessary to use both comparators in the LM393? A: No, you can use one comparator without affecting the functionality of the other.

Q: Can the LM393 outputs drive LEDs directly? A: Yes, but ensure to use a current-limiting resistor to protect the LED and the LM393 output stage.

Q: What is the purpose of the LM393's open-collector output? A: The open-collector output allows for voltage level shifting and the ability to connect multiple outputs together for a wired-AND configuration.

Please note that the LM393 is not an Arduino-manufactured component, but it is commonly used with Arduino and other microcontroller platforms. The part ID WPSE347 is a generic identifier and may not correspond to a specific manufacturer's part number. Always refer to the datasheet of the specific LM393 you are using for the most accurate information.