Course Content
📘 MODULE 11 – Edge Avoiding Robot
📦 MODULE 12 – Smart Multi-Function Robot (Mega Project)
Arduino Hands-On Programming and Robotics Course

📘 MODULE 4 – IR Obstacle Detector

📖 Lesson 4.1 – What is an IR Sensor?

🎯 Learning Objectives

After completing this lesson, students will be able to:

✅ Understand what an IR Sensor is

✅ Understand the working principle of IR sensors

✅ Identify the parts of an IR Obstacle Sensor Module

✅ Understand obstacle detection

✅ Learn Digital Output (DO) operation

✅ Understand real-world applications of IR sensors


1. Introduction

Imagine a robot moving on a table.

Suddenly, a wall appears in front of it.

How can the robot detect the obstacle and avoid a collision?

Similarly:

  • Automatic doors detect people.
  • Hand sanitizers detect hands.
  • Smart dustbins detect approaching objects.
  • Robots detect obstacles.

One of the simplest sensors used for such applications is the:

IR Obstacle Sensor

IR sensors help electronic systems detect nearby objects without touching them.


2. What is an IR Sensor?

IR stands for:

Infrared

Infrared light is a type of electromagnetic radiation that is invisible to the human eye.

Although we cannot see infrared light, electronic sensors can detect it.

An IR Obstacle Sensor uses infrared light to detect nearby objects.


3. What is an IR Obstacle Sensor Module?

An IR Obstacle Sensor Module is a ready-made sensor board used to detect objects placed in front of it.

It contains:

  • IR Transmitter LED
  • IR Receiver Sensor
  • LM393 Comparator IC
  • Sensitivity Adjustment Potentiometer
  • Status LEDs

The module provides a digital output that Arduino can easily read.


4. Working Principle

The IR sensor works using:

IR Transmitter

Sends infrared light.

Object Present

Infrared light reflects from the object.

IR Receiver

Receives reflected infrared light.

Sensor Detects Object

Output changes.


5. Understanding Reflection

Think of shining a torch on a mirror.

Light hits the mirror.

Light reflects back.

The IR sensor works similarly.

Instead of visible light, it uses infrared light.


6. Main Parts of IR Sensor Module

IR Transmitter LED

Sends infrared light continuously.


IR Receiver

Receives reflected infrared light.


LM393 Comparator IC

Processes sensor signals and generates digital output.


Potentiometer

Used to adjust detection sensitivity.


Power LED

Indicates module power.


Status LED

Indicates object detection.


7. Pins of IR Sensor Module

Most IR obstacle sensor modules have three pins.

Pin Function
VCC Power Supply
GND Ground
OUT Digital Output

8. Pin Functions

VCC

Provides power to the sensor.

Connection:

 
Arduino 5V → VCC
 

GND

Ground connection.

Connection:

 
Arduino GND → GND
 

OUT

Digital output signal.

Connection:

 
Arduino Digital Pin
 

Example:

 
OUT → D2
 

9. Output Logic

Most IR sensor modules provide:

Condition Output
No Obstacle HIGH
Obstacle Detected LOW

(Some modules may behave differently.)


Example

No object in front:

 
OUT = HIGH
 

Object detected:

 
OUT = LOW
 

10. Detection Range

Typical detection distance:

 
2 cm – 30 cm
 

Depending on:

  • Sensor quality
  • Surface color
  • Object material
  • Sensitivity setting

11. Effect of Object Color

White Surface

Reflects more IR light.

Easy detection.


Black Surface

Absorbs more IR light.

Detection may be slightly reduced.


This is important in robotics applications.


12. Sensitivity Adjustment

The module contains a blue potentiometer.

Using a screwdriver:

Clockwise

May increase detection range.


Anti-Clockwise

May decrease detection range.


Always calibrate before using.


13. Real-World Applications

IR sensors are used in many automation systems.


Obstacle Avoiding Robots

Detect walls and obstacles.


Smart Dustbins

Detect approaching hands.


Automatic Water Dispensers

Detect hands for contactless operation.


Automatic Doors

Detect people approaching.


Industrial Automation

Object counting and detection.


Conveyor Systems

Product detection.


14. IR Sensor in Robotics

One of the most common uses is:

Obstacle Detection

Robot moving forward.

Obstacle detected.

Robot stops or changes direction.

This is the foundation of autonomous robots.


15. Advantages of IR Sensors

Low Cost

Affordable for beginners.


Easy to Use

Simple wiring.


Fast Response

Quick detection.


Compact Size

Suitable for small robots.


Reliable

Good for short-distance detection.


16. Limitations

Limited Range

Not suitable for long distances.


Affected by Sunlight

Strong sunlight may affect performance.


Surface Dependency

Detection depends on object color and material.


17. Common Beginner Mistakes

Mistake 1

Connecting VCC and GND incorrectly.


Mistake 2

Ignoring sensitivity adjustment.


Mistake 3

Testing under direct sunlight.


Mistake 4

Expecting long-distance detection.

IR sensors are designed for short-range applications.


18. Demonstration Activity

Step 1

Power the sensor.


Step 2

Observe Power LED.


Step 3

Move your hand in front of the sensor.


Step 4

Observe Status LED.


Step 5

Notice output changes.

This confirms the sensor is working correctly.


📊 Summary

In this lesson, we learned:

✅ What an IR Sensor is

✅ Infrared light basics

✅ IR Obstacle Sensor Module

✅ Sensor working principle

✅ Pin functions

✅ Detection logic

✅ Real-world applications

IR sensors are among the most useful sensors for robotics and automation because they allow systems to detect nearby objects without physical contact.


📖 Key Terms

IR

Infrared Radiation

IR Sensor

Sensor used for obstacle detection.

IR Transmitter

Emits infrared light.

IR Receiver

Receives reflected infrared light.

Obstacle Detection

Detecting objects without touching them.

Digital Output

HIGH or LOW signal from the sensor.


🎯 Quiz

1. What does IR stand for?

A. Internal Resistor

B. Infrared ✅

C. Input Relay

D. Intelligent Receiver


2. What is the main purpose of an IR Obstacle Sensor?

A. Measure Temperature

B. Detect Objects ✅

C. Measure Distance

D. Measure Humidity


3. Which component emits infrared light?

A. Receiver

B. Comparator

C. IR Transmitter LED ✅

D. Potentiometer


4. Which IC is commonly used on IR modules?

A. ESP32

B. LM393 ✅

C. ATmega328P

D. NE555


5. One major application of IR sensors is:

A. Obstacle Avoiding Robots ✅

B. Weather Monitoring

C. Water Testing

D. Gas Detection


🏠 Assignment

Task 1

Identify all parts of your IR sensor module.

Task 2

Draw and label the IR sensor pins.

Task 3

List five real-world applications of IR sensors.

Task 4

Explain how IR reflection helps detect objects.

Task 5

Research the difference between an IR Sensor and an Ultrasonic Sensor.

Scroll to Top