Stufin
Home Quick Cart Profile

IR Proximity Sensor with SMD UNO Compatible with Arduino

Buy Now

Component Name

IR Proximity Sensor with SMD UNO Compatible with Arduino

Overview

The IR Proximity Sensor with SMD UNO is a compact, surface-mount device (SMD) compatible with Arduino boards, designed to detect proximity or distance of objects using infrared (IR) light. This sensor module is ideal for various applications, including robotics, automation, obstacle detection, and gesture recognition.

Functionality

The IR Proximity Sensor operates by emitting IR light from its built-in LED and detecting the reflected light using a photodiode. The sensor then converts the detected signal into a digital output, indicating the presence or absence of an object within a specific range. The sensor's output can be directly connected to a microcontroller, such as an Arduino, for further processing and decision-making.

Key Features

  • Infrared Proximity Detection: The sensor detects objects within a range of 2-30 cm (0.7-11.8 in) using IR light, providing a reliable and accurate proximity measurement.
  • SMD UNO Compatibility: The sensor module is compatible with Arduino boards, including the popular Arduino UNO, making it easy to integrate into a wide range of projects.
  • Digital Output: The sensor provides a digital output, which can be directly connected to a microcontroller, eliminating the need for analog-to-digital conversion.
  • Low Power Consumption: The sensor operates at a low voltage (3.3-5V) and consumes minimal power, making it suitable for battery-powered applications.
  • Compact Size: The SMD design ensures a compact footprint, allowing for easy integration into tight spaces and minimizing board real estate.
  • Easy to Use: The sensor module comes with a simple and intuitive interface, making it accessible to both beginners and experienced users.
  • Robust and Durable: The sensor is built with high-quality components and is designed to withstand various environmental conditions, ensuring reliable performance over an extended period.
  • Multi-Platform Compatibility: The sensor is compatible with a wide range of microcontrollers and development boards, including Arduino, Raspberry Pi, and ESP32/ESP8266.

Specifications

Supply Voltage

3.3-5V

Operating Current

10-20 mA

Proximity Detection Range

2-30 cm (0.7-11.8 in)

Output Type

Digital

Interface

3-pin header (VCC, GND, OUT)

Dimension

15 x 10 x 4 mm (0.6 x 0.4 x 0.2 in)

Weight

1 g (0.04 oz)

Applications

Obstacle detection and avoidance

Gesture recognition and control

Proximity sensing and tracking

Robotics and automation

Home appliances and gadgets

Industrial automation and control systems

Conclusion

The IR Proximity Sensor with SMD UNO is a versatile and reliable component for detecting proximity or distance of objects using infrared light. Its compact design, low power consumption, and digital output make it an ideal choice for a wide range of applications, from robotics and automation to gesture recognition and control.

Pin Configuration

  • IR Proximity Sensor with SMD UNO Compatible with Arduino Pinout Guide
  • The IR Proximity Sensor with SMD UNO is a compact and versatile sensor module designed for use with Arduino boards. This documentation provides a detailed explanation of each pin on the module, helping users to understand how to connect and utilize the sensor effectively.
  • Pinout Description:
  • The IR Proximity Sensor module has a total of 5 pins, labeled as follows:
  • 1. VCC:
  • Function: Power Supply
  • Description: This pin is used to provide power to the sensor module. Connect it to the 5V pin on your Arduino board.
  • Connection: Connect to 5V pin on Arduino
  • 2. GND:
  • Function: Ground
  • Description: This pin is used to provide a ground connection to the sensor module. Connect it to the GND pin on your Arduino board.
  • Connection: Connect to GND pin on Arduino
  • 3. OUT:
  • Function: Output Signal
  • Description: This pin provides a digital output signal indicating the presence or absence of an object within the sensor's detection range.
  • Connection: Connect to any digital input pin on Arduino (e.g., D2, D3, D4, etc.)
  • 4. Vs:
  • Function: Voltage Stabilization
  • Description: This pin is used to provide a stable voltage reference to the sensor module. Typically, this pin is connected to the VCC pin.
  • Connection: Connect to VCC pin on Arduino
  • 5. EN:
  • Function: Enable Pin
  • Description: This pin is used to enable or disable the sensor module. When connected to a logic high (VCC), the sensor is enabled. When connected to a logic low (GND), the sensor is disabled.
  • Connection: Connect to a digital output pin on Arduino (e.g., D5, D6, D7, etc.) or tie to VCC or GND for permanent enable/disable
  • Connection Structure:
  • To connect the IR Proximity Sensor module to an Arduino board, follow this step-by-step guide:
  • 1. Connect the VCC pin on the sensor module to the 5V pin on your Arduino board.
  • 2. Connect the GND pin on the sensor module to the GND pin on your Arduino board.
  • 3. Connect the OUT pin on the sensor module to any digital input pin on your Arduino board (e.g., D2, D3, D4, etc.).
  • 4. Connect the Vs pin on the sensor module to the VCC pin on your Arduino board.
  • 5. Connect the EN pin on the sensor module to a digital output pin on your Arduino board (e.g., D5, D6, D7, etc.) or tie to VCC or GND for permanent enable/disable.
  • Example Code:
  • Here's an example Arduino code snippet to get you started with using the IR Proximity Sensor module:
  • ```cpp
  • const int sensorPin = 2; // OUT pin connected to digital pin 2
  • const int enablePin = 5; // EN pin connected to digital pin 5
  • void setup() {
  • pinMode(sensorPin, INPUT);
  • pinMode(enablePin, OUTPUT);
  • digitalWrite(enablePin, HIGH); // Enable the sensor
  • }
  • void loop() {
  • int sensorState = digitalRead(sensorPin);
  • if (sensorState == HIGH) {
  • Serial.println("Object detected!");
  • } else {
  • Serial.println("No object detected.");
  • }
  • delay(100);
  • }
  • ```
  • In this example, the sensor is enabled and connected to digital pin 2. The Arduino board reads the sensor state and prints a message to the serial monitor when an object is detected or not detected.

Code Examples

IR Proximity Sensor with SMD UNO Compatible with Arduino
Overview
The IR Proximity Sensor with SMD UNO is a highly sensitive infrared proximity sensor module designed to detect objects or people within a short range. It is compatible with Arduino boards and can be used in a variety of applications, including robotics, automation, and interactive projects.
Technical Specifications
Operating Voltage: 5V
 Current Consumption: 10mA
 Operating Temperature: -20C to 85C
 Detection Range: Up to 20cm
 Output: Digital signal (High/Low)
 SMD (Surface Mount Device) package
Pinout
The IR Proximity Sensor module has the following pins:
VCC: Power supply (5V)
 GND: Ground
 OUT: Digital output signal
Arduino Code Examples
### Example 1: Basic Object Detection
In this example, we will use the IR Proximity Sensor to detect objects within its range and trigger an LED to turn on.
```arduino
const int ledPin = 13;  // Choose a digital pin for the LED
const int sensorPin = 2; // Choose a digital pin for the IR sensor
void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(sensorPin, INPUT);
}
void loop() {
  int sensorState = digitalRead(sensorPin);
  if (sensorState == HIGH) {
    digitalWrite(ledPin, HIGH); // Turn on the LED if an object is detected
  } else {
    digitalWrite(ledPin, LOW); // Turn off the LED if no object is detected
  }
  delay(50);
}
```
### Example 2: Object Proximity Measurement
In this example, we will use the IR Proximity Sensor to measure the distance of an object from the sensor and display the result on the serial monitor.
```arduino
const int sensorPin = A0; // Choose an analog pin for the IR sensor
void setup() {
  Serial.begin(9600);
}
void loop() {
  int sensorValue = analogRead(sensorPin);
  int distance = map(sensorValue, 0, 1023, 20, 0); // Convert analog value to distance (cm)
  Serial.print("Object distance: ");
  Serial.print(distance);
  Serial.println(" cm");
  delay(50);
}
```
### Example 3: Autonomous Robot Obstacle Avoidance
In this example, we will use the IR Proximity Sensor to detect obstacles in front of an autonomous robot and change its direction to avoid them.
```arduino
const int leftMotorForward = 2;
const int leftMotorBackward = 3;
const int rightMotorForward = 4;
const int rightMotorBackward = 5;
const int sensorPin = 6; // Choose a digital pin for the IR sensor
void setup() {
  pinMode(leftMotorForward, OUTPUT);
  pinMode(leftMotorBackward, OUTPUT);
  pinMode(rightMotorForward, OUTPUT);
  pinMode(rightMotorBackward, OUTPUT);
  pinMode(sensorPin, INPUT);
}
void loop() {
  int sensorState = digitalRead(sensorPin);
  if (sensorState == HIGH) {
    // Obstacle detected, change direction
    digitalWrite(leftMotorForward, LOW);
    digitalWrite(rightMotorForward, LOW);
    digitalWrite(leftMotorBackward, HIGH);
    digitalWrite(rightMotorBackward, HIGH);
  } else {
    // No obstacle, move forward
    digitalWrite(leftMotorForward, HIGH);
    digitalWrite(rightMotorForward, HIGH);
    digitalWrite(leftMotorBackward, LOW);
    digitalWrite(rightMotorBackward, LOW);
  }
  delay(50);
}
```
Note: These examples are for illustration purposes only and may require modifications to work with your specific project setup.