You are on page 1of 3

Experiment # 3

Object Detection System based on Arduino Uno R3

Objective

To interface the IR sensor module with Arduino in order to detect distant object.

Apparatus

 IR sensor
 LCD16x 2
 Arduino UNO R3 board
 LDR
 Breadboard
 Jumper wires

Theory:
An infrared sensor is an electronic device that emits in order to sense some aspects of the
surroundings. An IR sensor can measure the heat of an object as well as detects the motion.
These types of sensors measure only infrared radiation, rather than emitting it that is called
a passive IR sensor. Usually, in the infrared spectrum, all the objects radiate some form of
thermal radiation. When IR light falls on the photodiode, the resistances and the output voltages
will change in proportion to the magnitude of the IR light received. The working principle of an
infrared sensor is similar to the object detection sensor.
Circuit Diagram:

Fig:5 : Measuring distance using IR sensor


Procedure

 Arduino IDE software is used to write and upload the program in Arduino.
 USB -B is used to connect computer& arduino board .
 5V pin of IR sensor is connected with 5V pin of Arduino UNO R3 and ground pin of IR
sensor is connected with ground pin of Arduino and out pin of IR sensor is connected
with 13 pin of Arduino UNO R3 and lcd connections with Arduino is described earlier.

Code

int IR=04;
int LED=13;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
IR=digitalRead(04);
if(IR==1);
{
digitalWrite(LED,HIGH);
Serial.print("object detected");
}
}

Observation and Calculations:

Readings by Meter Rule Readings by Sensor


4.0 3.91
6.0 6.12
8.0 8.01
10.0 10.11
12.0 12.21
14.0 13.92
16.0 16.16
18.0 18.41
Table 5: Readings for IR sensor
Graph:

Calibration Graph
Reading
20 by Meter Rule
18
16
14
12
10
8
6
4
2
0
0 2 4 6 8 10 12 14 16 18 20
Reading by Sensor

Figure 15: Calibration Graph for IR Sensor

Conclusion:
In conclusion, utilizing an infrared (IR) sensor for distance measurement proves to be an effective and
practical solution. By leveraging the principles of reflection and absorption of infrared light, the IR
sensor, when interfaced with Arduino, can accurately gauge the distance between the sensor and an
object. This distance measurement capability opens up a range of applications, from proximity sensing in
robotics to automated systems that respond to changes in object distances. The Arduino platform
facilitates the integration of IR sensors into diverse projects, offering a user-friendly and versatile solution
for distance measurement. Overall, employing an IR sensor for distance measurement enhances the
capabilities of Arduino-based projects, providing a reliable and accessible method for real-
world applications.

You might also like