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

How to Use IR Sensor (Short Pins): Examples, Pinouts, and Specs

Image of IR Sensor (Short Pins)Design with IR Sensor (Short Pins) in Cirkit Designer

Introduction

The IR Sensor (Short Pins) is an electronic component designed to detect infrared (IR) radiation. It is widely used in proximity sensing, object detection, and line-following robots. The compact design with short pins makes it ideal for space-constrained applications, such as small robots or embedded systems. This sensor operates by emitting infrared light and detecting the reflected signal from nearby objects.

Explore Projects Built with IR Sensor (Short Pins)

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 Arduino UNO IR Sensor Motion Detector: A project utilizing IR Sensor (Short Pins) in a practical application
Arduino UNO IR Sensor Motion Detector

This circuit consists of an IR sensor connected to an Arduino UNO. The IR sensor's output is connected to digital pin D2 of the Arduino, while its power and ground pins are connected to the 5V and GND pins of the Arduino, respectively. The Arduino is programmed to read the sensor data and can be used for applications such as object detection or proximity sensing.

Open Project in Cirkit Designer
Image of ESP8266-Based IR Sensor Array with Analog Multiplexing: A project utilizing IR Sensor (Short Pins) in a practical application
ESP8266-Based IR Sensor Array with Analog Multiplexing

This circuit features two Sharp IR Sensors connected to a 16-channel analog multiplexer, which allows for multiple analog inputs to be read sequentially by a single analog pin on the WeMOS ESP8266 microcontroller. The ESP8266 controls the multiplexer selection via its digital pins (D0-D3) and reads the sensor outputs through its analog pin (A0). The 2x 18650 battery pack provides power to the entire circuit, with all components sharing a common ground and voltage supply.

Open Project in Cirkit Designer
Image of ESP32-Based Dual IR Sensor Interface: A project utilizing IR Sensor (Short Pins) in a practical application
ESP32-Based Dual IR Sensor Interface

This circuit features an ESP32 microcontroller connected to two IR sensors. The IR sensors are interfaced with the ESP32 via digital input pins D14 and D13, allowing the microcontroller to detect and process signals from the sensors. Both sensors are powered by the ESP32's 3.3V output and share a common ground connection with the microcontroller.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

The following table outlines the key technical details of the IR Sensor (Short Pins):

Parameter Value
Operating Voltage 3.3V to 5V
Operating Current 20mA (typical)
Detection Range 2cm to 30cm (adjustable)
Output Type Digital (High/Low)
Wavelength of IR Light 940nm
Dimensions Compact with short pin design

Pin Configuration

The IR Sensor (Short Pins) typically has three pins. The table below describes each pin:

Pin Name Description
1 VCC Power supply pin (3.3V to 5V)
2 GND Ground pin
3 OUT Digital output pin (High when no object is detected, Low when an object is detected)

Usage Instructions

How to Use the IR Sensor in a Circuit

  1. Power the Sensor: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to the ground of your circuit.
  2. Connect the Output: Attach the OUT pin to a digital input pin of your microcontroller or directly to an LED/buzzer for simple applications.
  3. Adjust the Sensitivity: Use the onboard potentiometer to adjust the detection range of the sensor. Turn it clockwise to increase the range and counterclockwise to decrease it.
  4. Test the Sensor: Place an object within the detection range and observe the output signal. The OUT pin will go LOW when an object is detected.

Important Considerations

Example: Connecting to an Arduino UNO

Below is an example of how to connect and use the IR Sensor (Short Pins) with an Arduino UNO:

Circuit Connections

Arduino Code

// IR Sensor Example Code for Arduino UNO
// This code reads the output of the IR sensor and turns on an LED when an object
// is detected within the sensor's range.

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 for debugging
}

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

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

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

Troubleshooting and FAQs

Common Issues and Solutions

  1. Sensor Not Detecting Objects

    • Cause: Incorrect power supply or loose connections.
    • Solution: Verify that the VCC and GND pins are properly connected and the power supply is within the specified range.
  2. Erratic Output

    • Cause: Interference from ambient IR light or unstable power supply.
    • Solution: Use the sensor in a controlled lighting environment and ensure a stable power source.
  3. Short Detection Range

    • Cause: Sensitivity not properly adjusted.
    • Solution: Adjust the potentiometer to increase the detection range.
  4. Output Always HIGH or LOW

    • Cause: Faulty sensor or incorrect wiring.
    • Solution: Check the wiring and replace the sensor if necessary.

FAQs

Q: Can the IR Sensor (Short Pins) detect transparent objects?
A: No, the sensor may struggle to detect transparent or highly reflective objects due to insufficient IR reflection.

Q: Is the sensor compatible with 3.3V systems?
A: Yes, the sensor operates within a voltage range of 3.3V to 5V, making it compatible with both 3.3V and 5V systems.

Q: How do I increase the detection range?
A: Use the onboard potentiometer to adjust the sensitivity. Turn it clockwise to increase the range.

Q: Can I use multiple IR sensors in the same circuit?
A: Yes, but ensure that the sensors are spaced apart to avoid interference from each other's IR signals.