IR Sensor Interfacing With 8051

In this tutorial we are going to see IR Sensor Interfacing with 8051.

Prerequisites

Before start this tutorial we should know below topics. If you know already, please go further.

Components Required

  • 8051 Development Board
  • IR Sensor
  • LCD Module (To print the Sensor output)

Introduction

Infrared is light that has a wavelength longer than visible red light. The ranges of infrared include near infrared, mid infrared and far infrared, spanning wavelengths from about 710 nanometers (near infrared) to 100 micrometers (far infrared).

All objects emit light according to their temperature–this is called “black body radiation.” The hotter the object, the shorter wavelength of light it emits. The Earth emits infrared light at a peak of about nine to 10 micrometers–and so do warm-blooded animals like humans. This light can be used to detect motion or warmth.

IR Sensor

Infrared Obstacle Sensor Module has builtin IR transmitter and IR receiver that sends out IR energy and looks for reflected IR energy to detect presence of any obstacle in front of the sensor module. The module has on board potentiometer that lets user adjust detection range. The sensor has very good and stable response even in ambient light or in complete darkness.

Specifications

  • Operating Voltage: 3.0V – 5.0V
  • Detection range: 2cm – 30cm (Adjustable using potentiometer)
  • Current Consumption:at 3.3V : ~23 mA,at 5.0V: ~43 mA
  • Active output level: Outputs Low logic level when obstacle is detected
  • On board Obstacle Detection LED indicator

Working Principle of IR Obstacle Sensor

An IR sensor consists of an IR LED and an IR Photodiode; together they are called as Photo–Coupler or Opto–Coupler. As said before,the Infrared Obstacle Sensor has builtin IR transmitter and IR receiver. Infrared Transmitter is a light emitting diode (LED) which emits infrared radiations. Hence, they are called IR LED’s. Even though an IR LED looks like a normal LED, the radiation emitted by it is invisible to the human eye.

Infrared receivers are also called as infrared sensors as they detect the radiation from an IR transmitter. IR receivers come in the form of photodiodes and phototransistors. Infrared Photodiodes are different from normal photo diodes as they detect only infrared radiation. When the IR transmitter emits radiation, it reaches the object and some of the radiation reflects back to the IR receiver. Based on the intensity of the reception by the IR receiver, the output of the sensor is defined.

IR Sensor Interfacing with 8051

Connection

IR Sensor

  • Vcc – 5v
  • Gnd – Ground
  • Vout – P1.0

LCD

  • RS – P2.0
  • RW – P2.1
  • EN – P2.2
  • Data Lines – P3.0 – P3.7

IR Sensor Interfacing with 8051

Source Code

If it is detecting any object in front of this sensor, LCD will display “Obstacle Detected”.

If you want to sense more distance you can use below IR sensor. You can also adjust the distance using this. This is an Infrared Transmitter and receiver which together make up a photoelectric sensor. The sensor has a long detection distance, and has less interference by visible light because it uses modulated Infrared light. This sensor has a screwdriver adjustment to set the detected distance, then gives a digital output when it senses something within that range. This sensor does not return a distance VALUE.

Download our new Android app. You can learn all Embedded Tutorials from your Android Phone easily.

Click Here to Download App!