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

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...

Top 5 Expensive Cars in the World

5) Bugatti Veyron The Bugatti Veyron is a mid Engine sports car designed and developed by Volkswagen group and manufactured in Molsheim , France . The Top speed of the Bugatti Veyron is 407 km/h and it has 7 Speed direct Shift Automatic Transmission. The Designer of Bugatti Veyron is Jozef Kaban. The Price of Bugatti Veyron is approximately $1.7 million (Rs 12 crore). 4) Aston Martin Valkyrie The Aston Martin Valkyrie is manufactured by Aston Martin and it is the limited production of hybrid electric sports car. The maximum speed of Aston Martin Valkyrie is 402 km/h and it has a 7 speed Ricardo dual clutch transmission. The designer of Aston Martin Valkyrie is Adrian Newey. The price of Aston Martin Valkyrie is approximately $3.2 million (Rs 22 crore). 3) Lamborghini Veneno Roadstar The Lamborghini Veneno Roadstar is manufactured by Lamborghini and only 9 units of Lamborghini Veneno Roadstar were and 8 of them were sold and 1 remained at the facto...

Ice Bergs Melt due to Carbon dioxide

Ice Bergs Melt due to Carbon dioxide What is CO2?                                  CO2 which is expanded has Carbon dioxide . The CO2 in atmosphere is 0.04 and present in Earth Atmosphere. The CO2 is basically an Green House Gas which plays in important role in Maintaining Earth Average Temperature of 57 degrees Fahrenheit . The CO2 is basically an heat trapping effective green house gas. It does not trap all gas molecule on IR radiations and it also remits the IR radiations during night where other else earth average temperature will be 0 degrees Fahrenheit . Any how not only CO2 all green house gases plays an important role in it. How CO2 produced?                              CO2 is given naturally by respiration and deforestation and Main r...