

The LM393 Comparator Module is a versatile electronic component designed to compare two input voltages and output a digital signal indicating which input is higher. It is based on the LM393 dual comparator IC, which operates with low power consumption and provides reliable performance. This module is widely used in applications such as voltage level detection, signal conditioning, and control systems. It is also commonly integrated into Arduino-based projects for tasks like sensor interfacing and threshold detection.
The module is manufactured by Generic and has the manufacturer part ID FC-37 Rain Sensor Module. While it is often used in conjunction with rain sensors, its functionality extends to a variety of other applications.








Below are the key technical details of the LM393 Comparator Module:
The LM393 Comparator Module typically has a 4-pin interface. The pin configuration is as follows:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (3.3V to 5V DC). |
| 2 | GND | Ground connection. |
| 3 | DO (Digital Out) | Digital output signal. Outputs HIGH or LOW based on the comparison result. |
| 4 | AO (Analog Out) | Analog output signal. Provides the raw voltage from the sensor (if applicable). |
VCC pin to a 3.3V or 5V DC power source and the GND pin to the ground of your circuit.DO pin, depending on whether the input voltage exceeds the reference voltage.AO), you can use it to monitor the raw input voltage.Below is an example of how to connect and use the LM393 Comparator Module with an Arduino UNO:
VCC pin of the module to the 5V pin on the Arduino.GND pin of the module to the GND pin on the Arduino.DO pin of the module to digital pin 2 on the Arduino.// LM393 Comparator Module Example with Arduino UNO
// This code reads the digital output (DO) from the module and prints the status
// to the Serial Monitor. The onboard LED on pin 13 will also indicate the status.
const int comparatorPin = 2; // Digital pin connected to DO pin of the module
const int ledPin = 13; // Onboard LED pin
void setup() {
pinMode(comparatorPin, INPUT); // Set comparator pin as input
pinMode(ledPin, OUTPUT); // Set LED pin as output
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int comparatorState = digitalRead(comparatorPin); // Read the digital output
// Print the comparator state to the Serial Monitor
if (comparatorState == HIGH) {
Serial.println("Input voltage is HIGH (above threshold).");
digitalWrite(ledPin, HIGH); // Turn on LED
} else {
Serial.println("Input voltage is LOW (below threshold).");
digitalWrite(ledPin, LOW); // Turn off LED
}
delay(500); // Wait for 500ms before the next reading
}
No Output Signal:
Output LED Not Working:
DO pin is connected to the correct input pin on your microcontroller.Unstable Output:
Analog Output Not Functioning:
AO pin is connected to an analog input pin on your microcontroller.Q1: Can the LM393 Comparator Module work with a 3.3V microcontroller?
Yes, the module can operate at 3.3V, making it compatible with 3.3V microcontrollers like the ESP32 or Raspberry Pi Pico.
Q2: How do I adjust the sensitivity of the module?
The sensitivity can be adjusted by turning the onboard potentiometer. This changes the reference voltage used for comparison.
Q3: Can I use the module for AC voltage detection?
No, the module is designed for DC voltage comparison. For AC voltage detection, additional circuitry is required.
Q4: What is the maximum input voltage the module can handle?
The input voltage range is 0V to Vcc (typically 3.3V or 5V). Exceeding this range may damage the module.
By following this documentation, you can effectively integrate the LM393 Comparator Module into your projects and troubleshoot common issues with ease.