Arduino Based Fire Fighting Robot

The NCRB stated that more than 120,000 fatalities in India were linked to fire mishaps from 2010 to 2014. Despite the many safety measures implemented for fires, they still happen from time to time. In the event of a fire, we must use personnel who are not in a secure location to save people and put out the fire. Because of technological progress, especially in Robotics, it is very possible to replace humans with robots in fire fighting. This has the potential to improve firefighters’ efficiency and prevent putting human lives at risk. Today we will be building a Fire Fighting Robot using Arduino that is capable of detecting fire and turning on the water pump.

Arduino Based Fire Fighting Robot

Our aim in this project is to build a simple robot using Arduino that is able to detect a fire and put it out using water. A simple robot will assist us in understanding the fundamentals of robotics, allowing us to develop more advanced robots later on. Let’s get started now…

Material Required:

  1. Arduino UNO
  2. Fire sensor or Flame sensor (3 Nos)
  3. Servo Motor (SG90)
  4. L293D motor Driver module
  5. Small Breadboard
  6. Robot chassis with motors and wheel (any type)
  7. A small can
  8. Connecting wires

Working Concept of Fire Fighting Robot:

These sensors include an IR Receiver (Photodiode) that is used to detect the existence of fire. What is the way to accomplish this? While burning, fire generates a small amount of infrared light that can be picked up by the IR receiver on the sensor module. Afterwards, an operational amplifier is employed to observe any changes in voltage from the IR Receiver. When a fire is detected, the output pin will show 0V, and when there is no fire, the output pin will display 5V.

So, we place three sensors on the robot in three varying directions in order to sense the fire’s direction.

By determining the fire’s orientation, we can employ the engines to move closer to it by regulating them with the L293D component. When near a fire, we need to put it out with water. A tiny boat is able to carry water, along with a 5V pump, installed on a servo motor for managing the water spray’s direction. It’s time to shift our focus to the connections now.

You can choose to either connect all the shown connections before uploading the program for testing, or fully assemble the robot before proceeding with the connections. The connections are simple in both scenarios and you should be able to complete it accurately.

Your ability to use the container I have may be restricted by the type of robotic chassis you possess. If that is the case, depend on your creativity to create the pumping system. However, the code will remain the same. I put the pump in a tiny aluminum container (similar to a beverage can) and topped it up with water. I went ahead and assembled the complete can onto a servo motor to control the water’s flow. After assembling it, my robot looks like this.

I’ve fastened the servo fin to the bottom of the container using hot glue and fixed the servo motor to the chassis with nuts and bolts. We can position the vessel on the engine, turn on the pump within, and push water out via the tube. The servo can effectively rotate the whole vessel in order to control the direction of the water.

Arduino Based Fire Fighting Robot Schematic

Programming your Arduino:

Once your hardware is prepared, you can load the Arduino code to initiate a specific function. The entire program can be found at the bottom of this page. Nevertheless, I have elaborated on a few key components in more detail here.

The fire sensor will signal a HIGH output in the presence of fire and a LOW output when there is no fire. We need to continuously monitor these sensors for any signs of a fire. If there is no fire, we instruct the motors to stop by setting all the pins to a high signal as demonstrated below.

    if (digitalRead(Left_S) ==1 && digitalRead(Right_S)==1 && digitalRead(Forward_S) ==1) //If Fire not detected all sensors are zero
    {
    //Do not move the robot
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, HIGH);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, HIGH);
    }

Likewise, in case of a fire, we can direct the robot to move towards it by adjusting the corresponding motor rotation. When the fire is directly in front of it, the left and right sensors will not be able to detect the fire because they are facing straight ahead towards it. Currently, we are utilizing the variable “fire” to trigger the function for extinguishing the fire.

    else if (digitalRead(Forward_S) ==0) //If Fire is straight ahead
    {
    //Move the robot forward
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, LOW);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, LOW);
    fire = true;
    }

Once the variable fire becomes true, the fire fighting robot arduino code will execute the put_off_fire function until the fire is put off. This is done using the code below.

     while (fire == true)
     {
      put_off_fire();
     }

In the put_off_fire() function, we simply need to halt the robot by setting all the pins to a high state. Next, start the pump to push the water out of the container, simultaneously using the servo motor to turn the container and distribute the water evenly. This can be achieved with the following code.

void put_off_fire()
{
     delay (500);
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, HIGH);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, HIGH);  
   digitalWrite(pump, HIGH); delay(500);
    for (pos = 50; pos <= 130; pos += 1) {
    myservo.write(pos);
    delay(10); 
  }
 for (pos = 130; pos >= 50; pos -= 1) {
    myservo.write(pos);
    delay(10);
  }
  digitalWrite(pump,LOW);
  myservo.write(90);
    fire=false;
}

Working of Fire Fighting Robot:

It is advised to examine the robot’s results in stages rather than operating it all at once during the initial trial. You can assemble the robot with the servo motor and test its ability to track the fire effectively. Next, you can verify if the pump and the servo motor are functioning correctly. Once all functions are operational, you can execute the program and experience the full functionality of the firefighter robot.

Working of Fire Fighting Robot

The video provided below shows the full operation of the robot. The size of the fire determines how far it can be detected, with smaller fires like a matchstick being detectable at shorter distances. You can also adjust the robot’s sensitivity using the potentiometers located on top of the modules. I have employed a power bank to energize the robot; alternatively, you could use a regular battery or even a 12V battery to power it up.

I hope you grasped the project and will have fun constructing something alike. If you encounter difficulties downloading this version, feel free to leave a comment below or visit the forums for assistance with technical issues.

Check out our Robotics Section to find more cool DIY Robots.

Code
/*—— Arduino Fire Fighting Robot Code—– */
#include <Servo.h>
Servo myservo;
int pos = 0;
boolean fire = false;
/*——-defining Inputs——*/
#define Left_S 9      // left sensor
#define Right_S 10      // right sensor
#define Forward_S 8 //forward sensor
/*——-defining Outputs——*/
#define LM1 2       // left motor
#define LM2 3       // left motor
#define RM1 4       // right motor
#define RM2 5       // right motor
#define pump 6
void setup()
{
  pinMode(Left_S, INPUT);
  pinMode(Right_S, INPUT);
  pinMode(Forward_S, INPUT);
  pinMode(LM1, OUTPUT);
  pinMode(LM2, OUTPUT);
  pinMode(RM1, OUTPUT);
  pinMode(RM2, OUTPUT);
  pinMode(pump, OUTPUT);
  myservo.attach(11);
  myservo.write(90);
}
void put_off_fire()
{
    delay (500);
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, HIGH);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, HIGH);
   digitalWrite(pump, HIGH); delay(500);
    for (pos = 50; pos <= 130; pos += 1) {
    myservo.write(pos);
    delay(10);
  }
  for (pos = 130; pos >= 50; pos -= 1) {
    myservo.write(pos);
    delay(10);
  }
  digitalWrite(pump,LOW);
  myservo.write(90);
  fire=false;
}
void loop()
{
   myservo.write(90); //Sweep_Servo();
    if (digitalRead(Left_S) ==1 && digitalRead(Right_S)==1 && digitalRead(Forward_S) ==1) //If Fire not detected all sensors are zero
    {
    //Do not move the robot
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, HIGH);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, HIGH);
    }
    else if (digitalRead(Forward_S) ==0) //If Fire is straight ahead
    {
    //Move the robot forward
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, LOW);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, LOW);
    fire = true;
    }
    else if (digitalRead(Left_S) ==0) //If Fire is to the left
    {
    //Move the robot left
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, LOW);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, HIGH);
    }
    else if (digitalRead(Right_S) ==0) //If Fire is to the right
    {
    //Move the robot right
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, HIGH);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, LOW);
    }
delay(300); //Slow down the speed of robot
     while (fire == true)
     {
      put_off_fire();
     }
}

Video:

Source: Arduino Based Fire Fighting Robot


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top