Monday, June 6, 2016

Temperature sensor robot with arduino

Temperature sensor  robot

This robot sense where the heat is more and goes near it  when the temperature crosses the default temperature  it stops and plays a siren/buzzes . I have given it 30 degrees Celsius as the default temperature  .Where ever it senses heat /fire it goes there . This can be used by the fire fighters.

Tools needed -

  • Arduino board
  • bread board 
  • lm35
  • wires
  • buzzer
  • A motor driver circuit 
  • 12v battery


You can make the robot in your own design

The temperature sensor looks likes this

We can use IC L293D  for the motor driver

these are the connections for the L293D

The program for the robot is -


int ml=5;
int mr=4;
int sl=A0;
int sr=A1;
int buzz=3;
int ldata;
int rdata;
int temp=27 ;


void setup() {
 Serial.begin (9600);
 pinMode(ml,OUTPUT);
 pinMode(mr,OUTPUT);
 pinMode(buzz,OUTPUT);
}


void loop() 
{
   int lsense=analogRead(sl)*5/10;
   int rsense=analogRead(sr)*5/10;
   Serial.println(rsense);
   Serial.println(lsense);

   delay(1000);
 if (temp>=lsense && temp>=rsense){
  digitalWrite(ml,HIGH);
  digitalWrite(mr,HIGH);
  digitalWrite(buzz,LOW);  
}

else if (temp < lsense && temp >= rsense){
  digitalWrite(ml,HIGH);
  digitalWrite(mr,LOW);
  digitalWrite(buzz,LOW);  
}
else if (temp >= lsense && temp < rsense){
    digitalWrite(ml,LOW);
    digitalWrite(mr,HIGH);
    digitalWrite(buzz,LOW);    
}
else if (temp < lsense && temp < rsense){
  digitalWrite(ml,LOW);
  digitalWrite(mr,LOW);
  digitalWrite(buzz,HIGH); 
}
}

No comments:

Post a Comment

Popular Posts