Project showcase
Home Safety Bot

Home Safety Bot © GPL3+

A line follower bot which can detect gas leaks and high temperature in a typical household and raise an alarm.

  • 249 views
  • 0 comments
  • 4 respects

Components and supplies

Necessary tools and machines

Apps and online services

About this project

The Home Safety Bot was an IEEE Envision Project by a group of 5 of us and 3 senior mentors

The number of deaths and injuries occurring at common households presents an alarming reality which has not been dealt with in all these years.It is with far more regret that we note that these deaths/injuries could have been prevented by appropriate alarms and warning mechanisms. The kitchen is by far the most dangerous room.The number of deaths due to accidental gas explosions reached 3525 in 2014. Another rising problem is one due to house fires which could be caused due to short-circuits, gas leaks, etc.

Our robot intends to help in this regard by raising an alarm when the threshold value obtained by the sensors is exceeded.

We believe further advancements can be made by adding IoT capabilities and adding sensors for other common household hazards.

Code

Code implemented for the botArduino
int enA = 10;
int in1 = 9;
int in2 = 8;
// motor two
int enB = 5;
int in3 = 7;
int in4 = 6;
int sensorvalue2,sensorvalue1,tempsensor,gassensor;
#define rs A0
#define ls A1
#define temp A2
#define gas A3
#define sp 100
void setup()
{
  // set all the motor control pins to outputs
  pinMode(enA, OUTPUT);
  pinMode(enB, OUTPUT);
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);
  Serial.begin(115200);
   pinMode(12,OUTPUT);
}
void loop()
{
  // this function will run the motors in both directions at a fixed speed
  // turn on motor A
  sensorvalue2 = analogRead(rs);
  sensorvalue1 = analogRead(ls);
  tempsensor=analogRead(temp);
  float c=((tempsensor/1024.0)*500);
  gassensor=analogRead(gas);
   if(sensorvalue2<100 && sensorvalue1<100) 
   {
     delay(30); 
  digitalWrite(in2, HIGH);
  digitalWrite(in1, LOW);
  // set speed to 200 out of possible range 0~255
  analogWrite(enA, sp);
  // turn on motor B
  digitalWrite(in4, HIGH);
  digitalWrite(in3, LOW);
  // set speed to 200 out of possible range 0~255
  analogWrite(enB, sp);
  
   }
   else if(sensorvalue2>100 && sensorvalue1 <100)
   {
    delay(30);
     digitalWrite(in2, HIGH);
  digitalWrite(in1, LOW);
  // set speed to 200 out of possible range 0~255
  analogWrite(enA, 0);
  // turn on motor B
  digitalWrite(in4, HIGH);
  digitalWrite(in3, LOW);
  // set speed to 200 out of possible range 0~255
  analogWrite(enB, sp);
  
   }
    else if(sensorvalue1>100 && sensorvalue2 <100)
   {
    delay(30);
     digitalWrite(in2, HIGH);
  digitalWrite(in1, LOW);
  // set speed to 200 out of possible range 0~255
  analogWrite(enA,sp);
  // turn on motor B
  digitalWrite(in4, HIGH);
  digitalWrite(in3, LOW);
  // set speed to 200 out of possible range 0~255
  analogWrite(enB, 0);
 
   }
    else 
   {
    delay(30);
     digitalWrite(in2, HIGH);
  digitalWrite(in1, LOW);
  // set speed to 200 out of possible range 0~255
  analogWrite(enA, 0);
  // turn on motor B
  digitalWrite(in4, HIGH);
  digitalWrite(in3, LOW);
  // set speed to 200 out of possible range 0~255
  analogWrite(enB, 0); 
   }
   Serial.print("Temperature-");
   Serial.println(c);
   Serial.print("Gas sensor-");
   Serial.println(gassensor);
   if(c>=40)
   {
    tone(12,500,10);
    delay(100);
   }
   else if(c<40)
   {
    noTone(12);
   }
   if(gassensor>=250)
   {
    tone(12,500,10);
   }
   else if(gassensor<250)
   {
     noTone(12);
   }
   }

Comments

Similar projects you might like

SaferWork 4.0: Industrial IoT for Safety

Project tutorial by Gustavo Bertoli

  • 780 views
  • 0 comments
  • 2 respects

Safe Home Smart Home: Safety Device For Every Family Member

Project tutorial by Patel Darshil

  • 4,587 views
  • 0 comments
  • 11 respects

Furby Turns into a Writer's Animatronics Bot

Project showcase by Roni Bandini

  • 1,735 views
  • 1 comment
  • 12 respects

BLE Bot 9000

Project tutorial by 5 developers

  • 25,525 views
  • 7 comments
  • 75 respects

3D Controller Bot

Project tutorial by 4 developers

  • 13,461 views
  • 1 comment
  • 44 respects

GO-4 Smart Home Arduino Bot

Project in progress by AhmedAzouz

  • 5,525 views
  • 0 comments
  • 34 respects
Add projectSign up / Login