Sitemap

Arduino IR Module Tutorial

3 min readJun 29, 2022

--

Press enter or click to view image in full size
Arduino IR Module Tutorial leobotics

In this tutorial we are going to explain how an IR (Infrared) Module operates and how to interface it with Arduino Uno.

IR Module (Infrared Sensor Module)

This is a multipurpose infrared sensor which can be used for obstacle sensing, color detection(between basic contrasting colors), fire detection, line sensing, etc. and also as an encoder sensor. The sensor provides a digital output.

The sensor outputs a logic one(+5V) at the digital output when an object is placed in front of the sensor and a logic zero(0V), when there is no object in front of the sensor. An on board LED is used to indicate the presence of an object.

This digital output can be directly connected to an Arduino, Raspberry Pi, AVR, PIC, 8051 or any other microcontroller to read the sensor output.

IR sensors are highly susceptible to ambient light and the IR sensor on this sensor is suitably covered to reduce effect of ambient light on the sensor.

Get Leobotics’s stories in your inbox

Join Medium for free to get updates from this writer.

For maximum, range the on board potentiometer should be used to calibrate the sensor. To set the potentiometer, use a screw driver and turn the potentiometer\ till the output LED just turns off.

Features:-

  • Can be used for obstacle sensing, color detection(between basic contrasting colors), fire detection, line sensing, etc and also as an encoder sensor
  • Input Voltage: 5V DC
  • Comes with an easy to use digital output
  • Can be used for wireless communication and sensing IR remote signals Sensor comes with ambient light protection.
  • The sensor a hole of 3mm diameter for easy mounting.

Pinout:

Infrared Sensor Module
  • +5V VCC
  • GND
  • D0 or OUT (Digital Output)

Circuit Diagram

Press enter or click to view image in full size
Circuit Diagram — Infrared Sensor Module with Arduino and LED

Arduino interfacing with IR Proximity sensor is very simple like interfacing of Switch with the Arduino. The obstacle sensor gives logic 0 as output when there is no obstacle in front of it, and when obstacle is placed in front of it, it will give logic high output i.e. +5V. We need to read these logic changes on the Arduino. using digitalRead() Command. In my design I have connected its output to Pin 2 of Arduino You can use any other IO line as per your requirement.

Code

Testing

  • Place the object in front of IR proximity sensor and observe the change in LED connected to Pin 13 (on board LED).
  • When you remove object you will see it gets turned off.

For more information visit: leobotics.in

--

--

Leobotics
Leobotics

We help engineers to understand the basic concepts of IoT, Robotics and Embedded Systems.