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

How to Use IR Sensor Module (LM393): Examples, Pinouts, and Specs

Image of IR Sensor Module (LM393)
Cirkit Designer LogoDesign with IR Sensor Module (LM393) in Cirkit Designer

Introduction

The IR Sensor Module (LM393) is an infrared-based sensor designed to detect obstacles and measure distances by emitting and receiving infrared light. It utilizes the LM393 comparator for signal processing, ensuring reliable and accurate detection. This module is widely used in robotics, automation systems, and proximity detection applications due to its simplicity and effectiveness.

Explore Projects Built with IR Sensor Module (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!
Arduino UNO Based IR and LDR Sensor Array with LED Indicators
Image of Street Light System: A project utilizing IR Sensor Module (LM393) in a practical application
This circuit features an Arduino UNO microcontroller connected to two IR sensors and an LDR (light-dependent resistor) sensor module. The IR sensors are powered by the Arduino's 3.3V output, while the LDR sensor module is powered by the 5V output. Four LEDs are individually controlled by digital pins D10 to D13 on the Arduino, and the sensors' outputs are connected to digital pins D7 to D9, which can be used to trigger actions based on sensor inputs.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO with LDR Sensor Light Detection System
Image of Prueba2: A project utilizing IR Sensor Module (LM393) in a practical application
This circuit consists of an Arduino UNO microcontroller board connected to an LDR (Light Dependent Resistor) sensor module (LM393). The LDR sensor's digital output (D0) is connected to the Arduino's digital pin D4, allowing the Arduino to detect light intensity changes. The sensor is powered by the Arduino's 5V output, and both share a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 with SIMCOM A7672s IoT Sensor Data Logger
Image of LM393 to LilygoSIM7000: A project utilizing IR Sensor Module (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
Arduino Leonardo-Based Line Following Robot with TCRT-5000 IR Sensors and L298N Motor Driver
Image of compt_neapolis_nebeul: A project utilizing IR Sensor Module (LM393) in a practical application
This circuit is a line-following robot that uses four TCRT-5000 IR sensors to detect the path and an Arduino Leonardo to process the sensor data. The Arduino controls two DC motors via an L298N motor driver module, powered by a 7.4V battery and a rocker switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with IR Sensor Module (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 Street Light System: A project utilizing IR Sensor Module (LM393) in a practical application
Arduino UNO Based IR and LDR Sensor Array with LED Indicators
This circuit features an Arduino UNO microcontroller connected to two IR sensors and an LDR (light-dependent resistor) sensor module. The IR sensors are powered by the Arduino's 3.3V output, while the LDR sensor module is powered by the 5V output. Four LEDs are individually controlled by digital pins D10 to D13 on the Arduino, and the sensors' outputs are connected to digital pins D7 to D9, which can be used to trigger actions based on sensor inputs.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Prueba2: A project utilizing IR Sensor Module (LM393) in a practical application
Arduino UNO with LDR Sensor Light Detection System
This circuit consists of an Arduino UNO microcontroller board connected to an LDR (Light Dependent Resistor) sensor module (LM393). The LDR sensor's digital output (D0) is connected to the Arduino's digital pin D4, allowing the Arduino to detect light intensity changes. The sensor is powered by the Arduino's 5V output, and both share a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of LM393 to LilygoSIM7000: A project utilizing IR Sensor Module (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 compt_neapolis_nebeul: A project utilizing IR Sensor Module (LM393) in a practical application
Arduino Leonardo-Based Line Following Robot with TCRT-5000 IR Sensors and L298N Motor Driver
This circuit is a line-following robot that uses four TCRT-5000 IR sensors to detect the path and an Arduino Leonardo to process the sensor data. The Arduino controls two DC motors via an L298N motor driver module, powered by a 7.4V battery and a rocker switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Obstacle detection in robotics
  • Line-following robots
  • Proximity sensing in automation systems
  • Object counting and detection
  • Security systems and motion detection

Technical Specifications

The IR Sensor Module (LM393) is equipped with the following technical features:

Parameter Specification
Operating Voltage 3.3V to 5V DC
Current Consumption 20mA (typical)
Detection Range 2cm to 30cm (adjustable via potentiometer)
Output Type Digital (High/Low)
Comparator Chip LM393
Infrared Wavelength 760nm to 1100nm
Dimensions ~3.1cm x 1.5cm x 0.7cm

Pin Configuration and Descriptions

The module typically has a 3-pin interface:

Pin Name Description
1 VCC Power supply pin. Connect to 3.3V or 5V DC.
2 GND Ground pin. Connect to the ground of the power supply.
3 OUT Digital output pin. Outputs HIGH (1) when no obstacle is detected, LOW (0) when an obstacle is detected.

Usage Instructions

How to Use the IR Sensor Module in a Circuit

  1. Power the Module: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to the ground.
  2. Connect the Output: Connect the OUT pin to a digital input pin of your microcontroller (e.g., Arduino UNO).
  3. Adjust the Sensitivity: Use the onboard potentiometer to adjust the detection range. Turn clockwise to increase the range and counterclockwise to decrease it.
  4. Test the Module: Place an object within the detection range and observe the OUT pin. The onboard LED will also light up when an obstacle is detected.

Important Considerations and Best Practices

  • Ambient Light Interference: Avoid using the module in environments with strong infrared sources (e.g., direct sunlight) as it may affect accuracy.
  • Distance Calibration: Always calibrate the detection range using the potentiometer for your specific application.
  • Power Supply: Ensure a stable power supply to avoid erratic behavior.
  • Mounting: Position the module so that the IR transmitter and receiver are unobstructed for optimal performance.

Example: Connecting to an Arduino UNO

Below is an example of how to connect and use the IR Sensor Module with an Arduino UNO:

Circuit Connections

  • Connect the VCC pin of the module to the 5V pin on the Arduino.
  • Connect the GND pin of the module to the GND pin on the Arduino.
  • Connect the OUT pin of the module to digital pin 2 on the Arduino.

Arduino Code

// IR Sensor Module Example Code
// This code reads the digital output of the IR sensor and prints the status
// to the Serial Monitor. The onboard LED on pin 13 will also toggle based
// on the sensor's output.

const int irSensorPin = 2;  // IR sensor output connected to digital pin 2
const int ledPin = 13;      // Onboard LED pin

void setup() {
  pinMode(irSensorPin, INPUT);  // Set IR sensor pin as input
  pinMode(ledPin, OUTPUT);      // Set LED pin as output
  Serial.begin(9600);           // Initialize serial communication
}

void loop() {
  int sensorValue = digitalRead(irSensorPin);  // Read the sensor output

  if (sensorValue == LOW) {
    // Obstacle detected
    digitalWrite(ledPin, HIGH);  // Turn on LED
    Serial.println("Obstacle detected!");
  } else {
    // No obstacle
    digitalWrite(ledPin, LOW);   // Turn off LED
    Serial.println("No obstacle.");
  }

  delay(100);  // Small delay for stability
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. The sensor is not detecting obstacles:

    • Ensure the module is powered correctly (check VCC and GND connections).
    • Adjust the potentiometer to calibrate the detection range.
    • Verify that the object is within the detection range (2cm to 30cm).
  2. False detections or erratic behavior:

    • Check for interference from ambient light or other infrared sources.
    • Use a stable power supply to avoid noise in the circuit.
  3. The onboard LED does not light up:

    • Confirm that the module is receiving power.
    • Check the OUT pin connection and ensure it is properly connected to the microcontroller.
  4. The detection range is too short:

    • Adjust the potentiometer to increase the range.
    • Ensure the object being detected has a reflective surface for better IR reflection.

FAQs

Q: Can the IR Sensor Module detect transparent objects?
A: No, the module may struggle to detect transparent or highly absorbent surfaces as they do not reflect infrared light effectively.

Q: Can I use this module with a 3.3V microcontroller?
A: Yes, the module supports an operating voltage of 3.3V to 5V, making it compatible with 3.3V systems.

Q: How do I increase the detection range beyond 30cm?
A: The detection range is hardware-limited. For longer ranges, consider using a different sensor designed for extended distances.

Q: Is the module suitable for outdoor use?
A: The module can be used outdoors, but strong sunlight or other infrared sources may interfere with its performance. Use shielding or filters if necessary.