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

CONTACTLESS VOLTAGE TESTER/INDICATOR CIRCUIT

                           CONTACTLESS VOLTAGE TESTER/INDICATOR CIRCUIT                           The contactless voltage tester circuit is which indicates the presence of voltage without touching the voltage line.This is done with help of the transistors.Thus it indicates the voltage folw in the circuit. COMPONENTS REQUIRED:                                       1)BC547 transistor-2                    2)RESISTORS-1 MEGA OHM,100/10K OHM,200 OHM   ...

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