Arduino-Powered Fire Fighter Robot: A Step-by-Step Guide

Hello everyone, welcome back to Techatronic. You might be familiar with the concept of a fire-fighting vehicle. Today, we’re introducing an innovative advancement – the Firefighter Robot. This robot is a machine designed to operate autonomously, hence earning its title as a robot. Our creation is programmed to approach fires and initiate firefighting operations. The Firefighter Robot boasts impressive capabilities and can serve as an efficient alternative to traditional vehicles in firefighting scenarios.

In contemporary times, when fire accidents occur in power plants, buildings, and similar settings, the amount of time and human effort required for mitigation is considerable. Consequently, there exists a significant risk of substantial harm to individuals involved.

Introduction

A fire-fighting robot serves the purpose of fire control. This autonomous robot possesses the ability to detect fires independently and manage them by deploying water. Equipped with specific sensors, it identifies fires and navigates towards them for extinguishment. The design of the fire-fighting robot resembles that of a Bluetooth-controlled RC car. It integrates three sensors: one frontal sensor to detect obstacles ahead and two additional sensors placed at the front corners to detect fire. Upon sensing a fire, the robot maneuvers towards the detected site. This specialized robot is outfitted with four wheels, three sensors, a water tank, a nozzle, and a computer system that aids in decision-making, programmed using Arduino code.

Until the date of this post, the robot remains a compact version with limited functionalities. Upon activation, the robot’s primary function is to move forward until it detects any source of fire. Once any of the robot’s sensors detect a flame, it will redirect itself toward the fire and utilize the water nozzle, integrated into the Arduino-controlled firefighting robot, to extinguish the specific area. Although both the firefighting robot and line follower robot share similar sensors, their operations differ significantly based on the situation.

Construction

I’ll be sharing comprehensive details to construct a Firefighter robot using Arduino. I’ll provide a complete list of required components, the circuit code, and step-by-step instructions for assembly. By following these steps, assembling the robot becomes a straightforward process. Additionally, if you’re interested in acquiring some basic knowledge, you can find learning resources on our website.

Components Required

  • Arduino Uno
  • flame IR Sensor
  • Robot Chassis
  • 12v Battery
  • Wires
  • Nozzle for water
  • Water pump 5v
  • Single channel relay

Circuit Diagram

Make all the connection as the given in the circuit diagram.

After completing the Connection next step is to write the code and program for our project.

Code


#include

Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos = 0;

void setup() {
// put your setup code here, to run once:
myservo.attach(11);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
Serial.begin(9600);
digitalWrite(6, HIGH);
}

void loop() {
// put your main code here, to run repeatedly:

int a = analogRead(A0);
int b = analogRead(A1);
int c = analogRead(A2);
Serial.print(a);
Serial.print(” “);
Serial.print(b);
Serial.print(” “);
Serial.print(c);
Serial.println(” “);
delay(50);

if (a<=250)

{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);

digitalWrite(6, LOW);

for (pos = 60; pos <= 120; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable ‘pos’ delay(15); // waits 15 ms for the servo to reach the position } for (pos = 120; pos >= 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos <= 120; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable ‘pos’ delay(15); // waits 15 ms for the servo to reach the position } for (pos = 120; pos >= 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos <= 120; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable ‘pos’ delay(15); // waits 15 ms for the servo to reach the position } for (pos = 120; pos >= 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15 ms for the servo to reach the position
}
//delay(200);

}

else if(b<=450)

{

digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);

digitalWrite(6, LOW);
for (pos = 60; pos <= 120; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable ‘pos’ delay(15); // waits 15 ms for the servo to reach the position } for (pos = 120; pos >= 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos <= 120; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable ‘pos’ delay(15); // waits 15 ms for the servo to reach the position } for (pos = 120; pos >= 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos <= 120; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable ‘pos’ delay(15); // waits 15 ms for the servo to reach the position } for (pos = 120; pos >= 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15 ms for the servo to reach the position
}

}
else if(c<=250)

{

digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);

digitalWrite(6, LOW);
for (pos = 60; pos <= 120; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable ‘pos’ delay(15); // waits 15 ms for the servo to reach the position } for (pos = 120; pos >= 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos <= 120; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable ‘pos’ delay(15); // waits 15 ms for the servo to reach the position } for (pos = 120; pos >= 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos <= 120; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable ‘pos’ delay(15); // waits 15 ms for the servo to reach the position } for (pos = 120; pos >= 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15 ms for the servo to reach the position
}

}

else if(a>=251 && a<=700) { digitalWrite(6, HIGH); digitalWrite(2, LOW); digitalWrite(3,HIGH); digitalWrite(4, HIGH); digitalWrite(5, LOW); delay(500); digitalWrite(6, HIGH); digitalWrite(2, HIGH); digitalWrite(3, LOW); digitalWrite(4, HIGH); digitalWrite(5, LOW); delay(500); } else if(b>=251 && b<=800) { digitalWrite(2, LOW); digitalWrite(3,HIGH); digitalWrite(4, HIGH); digitalWrite(5, LOW); digitalWrite(6, HIGH); } else if(c>=251 && c<=800)

{

digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);

digitalWrite(6, HIGH);
delay(500);
digitalWrite(6, HIGH);

digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(500);

}

else

{
digitalWrite(6, HIGH);

digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);

}

}

Working

In explaining the operation of the Firefighter Robot, we begin by outlining the algorithm to provide a fundamental understanding of the robot’s functionality.

We utilize three IR flame sensors that continuously scan for signs of fire or flames. These sensors detect warmth and heat emitted by any source and are programmed to identify flames in their vicinity. Constantly active, all three sensors actively search for any indication of fire. Upon detection by any of the sensors, the robot initiates a turn and proceeds toward the fire.

How does it function? The flame sensors detect the presence of fire and transmit this information to the Arduino, serving as the central processing unit of the robot. The Arduino processes the received data and triggers appropriate actions based on the conditions. It commands the motors to move in the required direction—left, right, or forward—depending on which sensor detects the fire.

Upon reaching the vicinity of the fire, the robot halts and begins the process of extinguishing it by applying water until the fire is brought under control.


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