Creating a DIY Fire Fighting Robot with Arduino
Fires, whether natural or man-made, pose significant threats, claiming thousands of lives each year in India alone. Despite the precautions taken, fire accidents remain a reality. Traditional firefighting methods often involve risking human lives to rescue people and extinguish fires. However, with advancements in technology, particularly in robotics, there's a promising avenue to mitigate these risks.
In this project, we'll delve into creating a simple yet effective Fire Fighting Robot using Arduino. This project aims to provide an introductory glimpse into robotics, offering a foundational understanding that can be expanded upon for more sophisticated robotic endeavors.
Materials Required:
Working Concept of Fire Fighting Robot:
The core of this project revolves around Arduino, but to detect fire, we employ flame sensors. These sensors utilize an IR Receiver (Photodiode) to detect infrared light emitted by fire. When a fire is detected, the sensor's output pin goes LOW.
To detect the direction of the fire, we place three flame sensors on the robot chassis. By analyzing the sensor outputs, the robot determines the direction of the fire and moves towards it using motor control through the L293D module.
Once near the fire, the robot utilizes a small container equipped with a 5V pump to dispense water. The container, mounted on a servo motor, allows for directional control of the water spray.
Recommended by LinkedIn
Circuit Diagram:
The circuit diagram illustrates the connections necessary for assembling the Fire Fighting Robot. It's straightforward and can be easily replicated. Depending on the chassis used, modifications may be required for the water pumping system.
Programming your Arduino:
The Arduino code provided controls the robot's behavior based on sensor inputs. It directs the robot to move towards the fire and initiate the water pump to extinguish it. The code also includes functionalities to adjust the robot's movements and water spraying direction.
/*------ 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();
}
}
Working of Fire Fighting Robot:
Before running the robot in its entirety, it's advisable to test each component individually. This ensures proper functionality and allows for troubleshooting if necessary. Once assembled, the robot can detect and approach fires, effectively extinguishing them with controlled water spraying.
Conclusion:
The Fire Fighting Robot presented here serves as a fundamental introduction to robotics and automation. While it's a modest project, it lays the groundwork for more complex robotic applications. By harnessing technology, we aim to enhance firefighting capabilities while minimizing risks to human life.
For those interested in exploring further, our Robotics Section offers a plethora of DIY robot projects to ignite your creativity.
Feel free to share your experiences or seek assistance in the comments section below or through our forums. Together, let's empower each other to make a positive impact through technology.