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.

  • 3,411 views
  • 3 comments
  • 18 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

Bluetooth Controlled Bot (Using Adafruit L293D Motor Driver)

Project showcase by Chandran N

  • 2,620 views
  • 0 comments
  • 14 respects

Trash Built BT Line Drawing Bot - My Bot

Project tutorial by jegatheesan

  • 838 views
  • 0 comments
  • 7 respects

Obstacle Avoidance Bot Using IR Sensors

Project tutorial by Chandran N

  • 3,921 views
  • 0 comments
  • 11 respects

Telegram Bot with ESP8266

Project tutorial by Shebin Jose Jacob

  • 38,834 views
  • 44 comments
  • 75 respects

SaferWork 4.0: Industrial IoT for Safety

Project tutorial by Gustavo Bertoli

  • 1,461 views
  • 0 comments
  • 3 respects

Safe Home Smart Home: Safety Device For Every Family Member

Project tutorial by Patel Darshil

  • 5,414 views
  • 0 comments
  • 13 respects
Add projectSign up / Login