Skip to main content

INFRARED SENSOR WORKING TUTORIAl WITH ARDUINO

 INFRARED SENSOR WORKING TUTORIAl WITH ARDUINO

INFRARED SENSOR:

                                      The infrared sensor are the obstacle detection sensor with detects the object in front of it and it consists of the ir transmitter and the ir receiver in it.The infrared sensor consists of the trimmed capacitor in it so the detection of object can be controlled with it.It has the 5v input and Gnd in it and has the output pin it when obstacle detected the votage comes through it.Let's see the working tutorial of it with aurdino.

COMPONENTS REQUIRED:

                                   1)INFRARED SENSOR
                                   2)ARDUINO UNO
                                   3)CONNECTING WIRES
                                   4)A PC

CONNECTION DIAGRAM:




WORKING:

1)Connect Infrared sensor +vcc to 5v of Arduino and the gnd  of Infrared sensor to Gnd pin of Arduino.

2)Output pin of the Infrared sensor to the 2 pin of the Arduino and just copy the code give below.

3)And go to the Arduino to and paste the code.

4)Compile the Code and upload it.



SOURCE CODE:


int obstaclePin = 2;  //NBSL COMMERCIAL
int hasObstacle = HIGH;


void setup() {
  pinMode(obstaclePin, INPUT);
  Serial.begin(9600); 
}
void loop() {
  hasObstacle = digitalRead(obstaclePin);
  if (hasObstacle == LOW)
  {
    Serial.println("Nothing Ahead!!");//If obstacle detected
    delay(200);
  }
  else
  {
    Serial.println("Obstacle"); //No obstacle
  }
  delay(200);
}


Tutorial for this is given below;

        

Comments

Post a Comment

Popular posts from this blog

SOIL MOISTURE SENSOR USING ARDUINO WITH CONNECTION AND CODE

SOIL MOISTURE SENSOR USING ARDUINO WITH CONNECTION AND CODE Soil moisture sensor is the sensing element which determine the volumetric amount of water in the soil .The sensor sense the amount of water by passing an minute voltage at its terminal .Then when the water presence is detected it send an minute voltage to the amplifying circuit and it is further amplified and send to the Arduino. Components Required:                       1) Arduino                       2) Soil Moisture sensor                       3) Led                       4) Connecting wires...

India Space Research

INDIAN SPACE RESEARCH                                      The Technology is developing day by day and new innovations are coming out day by day. Many things are runs with help of satellites for example TV receiver, Weather Forecasting, Global positioning systems(GPS), Defense purposes. Thus Aerospace development is very important for an country. INDIA , places 5 th place in space developments. The ISRO is the Indian organization of space research Developments. What is ISRO? ISRO expands as Indian Space Research Organization, which is the Indian space Development organization. ISRO Ranks 5 th place in space research. Who founded ISRO?  Indian Space Research Organization (ISRO) was founded by Jawaharlal Nehru, who is the First Prime Minister of INDIA and Scientist Vikram Sarabhai, who is known as the father of space programs in the year 1962 as Indian National Com...

How does ant walk in straight line

How does ant walk in straight line? Normally, Ants live as big colony and it is organized. When the ant found food it takes a small piece of food and returns to its colony, while returning from the food area to its colony ant releases chemical called pheromones with the help of pheromones  other ants in their colony goes to the food area and brings the food to their colony. The pheromones evaporates at certain time of interval so other ants which carry food also releases pheromones it helps in reaching of other ants from colony to reach food. Every each set of ant consists of unique set of pheromones so it helps to find other colony and its does not allow other colony ant to enter in their colony and even it attacks them. How does old book smell good? Smell of book is basically by the paper and ink and the paper is primarily made up of wood and the wood is made up of cellulose and lignin . Over years, the book is exposed to heat, light, moisture and it bega...