

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.








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 |
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) |
Below is an example of how to connect and use the IR Sensor (Short Pins) with an Arduino UNO:
// 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
}
Sensor Not Detecting Objects
Erratic Output
Short Detection Range
Output Always HIGH or LOW
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.