DIY Arduino Based Fire Fighting Robot Project

According to National Crime Records Bureau (NCRB), it is estimated that more than 1.2 lakh deaths have been caused because of fire accidents in India from 2010-2014. Even though there are a lot of precautions taken for Fire accidents, these natural/man-made disasters do occur now and then. In the event of a fire breakout, to rescue people and to put out the fire we are forced to use human resources which are not safe. With the advancement of technology especially in Robotics it is very much possible to replace humans with robots for fighting the fire. This would improve the efficiency of firefighters and would also prevent them from risking human lives. Today we are going to build a Fire Fighting Robot using Arduino, which will automatically sense the fire and start the water pump

In this project, we will learn how to build a simple robot using Arduino that could move towards the fire and pump out water around it to put down the fire. It is a very simple robot that would teach us the underlying concept of robotics; you would be able to build more sophisticated robots once you understand the following basics. So let’s get started...

 

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:

The main brain of this project is the Arduino, but in-order to sense fire we use the Fire sensor module (flame sensor) that is shown below.

Fire or flame sensor module

As you can see these sensors have an IR Receiver (Photodiode) which is used to detect the fire. How is this possible? When fire burns it emits a small amount of Infra-red light, this light will be received by the IR receiver on the sensor module. Then we use an Op-Amp to check for change in voltage across the IR Receiver, so that if a fire is detected the output  pin (DO) will give 0V(LOW) and if the is no fire the output pin will be 5V(HIGH).

So, we place three such sensors in three directions of the robot to sense on which direction the fire is burning.

Flame sensor setup on fire fighting robot chasis

We detect the direction of the fire we can use the motors to move near the fire by driving our motors through the L293D module. When near a fire we have to put it out using water. Using a small container we can carry water, a 5V pump is also placed in the container and the whole container is placed on top of a servo motor so that we can control the direction in which the water has to be sprayed. Let’s proceed with the connections now

 

Circuit Diagram:

The complete circuit diagram for this Fire Fighting Robot is given below

DIY Arduino based Fire Fighting Robot circuit diagram

You can either connect all the shown connections for uploading the program to check the working or you can assemble the bot completely and then proceed with the connections. Both ways the connections are very simple and you should be able to get it right.

Based on the robotic chassis that you are using you might not be able to use the same type of container that I am using. In that case use your own creativity to set up the pumping system. However the code will remain same. I used a small aluminium can (cool drinks can) to set the pump inside it and poured water inside it. I then assembled the whole can on top of a servo motor to control the direction of water. My robot looks something like this after assembly.

DIY Arduino based Fire Fighting Robot Hardware setup

Water tank with water pump motor for fire fighting robotAttaching servo motor for water direction control

As you can see, I have fixed the servo fin to the bottom of the container using got glue and have fixed the servo motor with chassis using nuts and bolts.  We can simply place the container on top of the motor and trigger the pump inside it to pump water outside through the tube. The whole container can then be rotated using the servo to control the direction of the water.

 

Programming your Arduino:

Once you are ready with your hardware, you can upload the Arduino code for some action. The complete program is given at the end of this page. However I have further explained few important bits and pieces here.

 As we know the fire sensor will output a HIGH when there is fire and will output a LOW when there is fire. So we have to keep checking these sensor if any fire has occurred. If no fire is there we ask the motors to remain stop by making all the pins high as shown 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);
    }

 

Similarly, if there is any fire we can ask the robot to move in that direction by rotating the respective motor. Once it reaches the fire the left and right sensor will not detect the fire as it would be standing straight ahead of the fire. Now we use the variable named “fire” that would execute the function to put off 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();
     }

   

Inside the put_off_fire() we just have to stop the robot by making all the pins high. Then turn on the pump to push water outside the container, while this is done we can also use the servo motor to rotate the container so that the water is split all over uniformly. This is done using the code below

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 recommended to check the output of the robot in steps rather than running it all together for the first time. You can build the robot upto the servo motor and check if it is able to follow the fire successfully. Then you can check if the pump and the servo motor are working properly. Once everything is working as expected you can run the program below and enjoy the complete working of the fire fighter robot.

DIY Arduino based Fire Fighting Robot working

The complete working of the robot can be found at the video given below. The maximum distance to which the fire can be detected depends on the size of the fire, for a small matchstick the distance is relatively less. You can also use the potentiometers on top of the modules to control the sensitivity of the robot. I have used a power bank to power the robot you can use a battery or even power it with a 12V battery.

 

Hope you understood the project and would enjoy building something similar. If you have any problems in getting this build, use the comment section below to post your quires or use the forums for technical help.

 

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: 

Comments (90)

  • harish's picture
    harish

    i want video with explanation, step-by-step implementation of hardware, block diagram of the project and also study materials for the project of fire fighting robot using arduino uno. please help me............. for the final year project submission...

    Dec 25, 2017
  • AISHA's picture
    AISHA

    All the required information is already given here by the author. Why don't you start building your final year project?

    Dec 26, 2017
  • Jothisree's picture
    Jothisree

    Can you tell me how the water can is connected...and wat is tat plastic thing below the can!!!
    and how is the water controlled with the servo motor

    Jan 10, 2018
  • AISHA's picture
    AISHA

    He has used a 5V pump to pump the water out of the can. The whole can is mounter on top of a servo motor. The pump is placed inside the can (that is the white plastic thing)

    Jan 11, 2018
  • Jothisree's picture
    Jothisree

    Thank You @AISHA :)

    Jan 17, 2018
  • Mudasir's picture
    Mudasir

    Can you kindly tell me how to select water pump in Proteus and what is the component placed above flame sensors in the circuit diagram (round and have a digital meter on it),
    Thanks

    Jan 16, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    The component above the sensor is a servo motor. Proteus does not have a pump. The one that is used here was drawn (using the draw options Proteus) to just show you how the connections are done

    Jan 16, 2018
  • Mudasir Jamil's picture
    Mudasir Jamil

    Thank you Aswinth Raj

    Jan 17, 2018
  • Alanna Potter's picture
    Alanna Potter

    I'm assisting my son who is in middle school on a science project, and we are at a standstill and hoping you can assist us. I've came across your video and it seemed relatively close to what we hope to accomplish. We are trying to make a voice/(phrase) command volcano that erupts so far we found instructions to make the classic science fair volcano but have run into difficulty coding and assembling to make it erupt on command. How would you make the fire fighting bot shoot water on voice/phrase command. Can you please help us?

    Feb 26, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    Hi alanna,

    I assume you have used a pump inside your volcano which when activated would pump some water(Lava) outside the volcano. Now to turn on this pump using voice command is no easy task and would surely be an overkill for a science fair. 

    However if you want to do it, you can follow this tutorial below where a Light is turned on using Voice command, you just have to replace the light with your pump

    https://circuitdigest.com/microcontroller-projects/iot-based-voice-contr...

    A more easy way would be to turn on the pump for the sound of a clap (or any large noise). This would be a lot more easy. The circuit for same is shared below. Instead of controlling led you can control your pump

    https://circuitdigest.com/electronic-circuits/simple-led-music-light

    Hope this would help you to assist your young champ. If you need more help please use the forums 

     

    Feb 26, 2018
  • Mostafa's picture
    Mostafa

    I want to make the same project but make the robot avoid obstacles using ultrasonic sensor ans use only one fire sensor

    Jan 18, 2018
  • Sajeshmohanan's picture
    Sajeshmohanan

    Hello
    What is circle above the three sensor

    Jan 29, 2018
  • soumya srivastava's picture
    soumya srivastava

    THANKS

    Jan 30, 2018
  • Naveen Kumar's picture
    Naveen Kumar

    Will this fire sensor also detects the smoke. If no , how can we do the same project to fight against smoke also.

    Jan 31, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    No this sensor does not detect smoke. To detect smoke you can use the MQ sensor

    Jan 31, 2018
  • Rashmi 's picture
    Rashmi

    This project is interesting.i want to know why we use Arduino uno instead of any other kit here and will it work similar if i replace arduino with any other ic cheap set?

    Feb 02, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    Yes, you can use any MCU in place of arduino. But if you are a very beginner its good to start with Arduino itself

    Feb 05, 2018
  • Usama's picture
    Usama

    can u give me circuit diagram also ?How can we connect ultrasonic sensor with this

    Feb 02, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    Circuit diagram is given above. Yes you can also connect a US sensor to avoid obstacles if you are intrested

    Feb 05, 2018
  • akash's picture
    akash

    hi,your project is amazing but my L293d motor driver module is having only 7 plugs how is your having 14 plugs?
    i have also checked for L293d ic it is having 16 plugs

    Feb 04, 2018
  • Sandeep S P's picture
    Sandeep S P

    How to connect the breadboard can you explain

    Feb 07, 2018
  • tec's picture
    tec

    May i know how many flame sensors and servo motor SG90 needed for this project?

    Feb 08, 2018
  • Yanna's picture
    Yanna

    can I use a fan instead of a water pump and still use the same code and connection?

    Feb 08, 2018
  • MorFin's picture
    MorFin

    arduinonun solundaki kırmızı(red) tahtanın üstündeki siyah(black) cisim nedir? ve arduinonun altındaki yeşil (green) şey nedir? URGENT!!!!

    Feb 08, 2018
  • Rachna's picture
    Rachna

    What should I do if water pump is not working when connected to 6 number pin of arduino.but it is working when it is connected between +5V and ground. I guess the pump is not receiving enough voltage when connected to arduino.Is there any solution to solve this problem. Please reply as soon as possible.

    Feb 10, 2018
  • Tricia Mae's picture
    Tricia Mae

    Can I use l298n motor drive instead of l293d?

    Feb 17, 2018
  • Laurice Dicksen's picture
    Laurice Dicksen

    in the concept of the project there is an op amp said back there, so does the op amp needed ? if needed what ic number will i use ? because im so confused thank you.

    Feb 24, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    No Op-Amp is used here. Why are you confused? Just follow the circuit diagram and build the project

    Feb 26, 2018
  • Ezee Khushairi's picture
    Ezee Khushairi

    can you provide your materials picture? Because im new in coding and wiring things. So im afraid i buy the wrong items but have similar name

    Feb 28, 2018
  • Har's picture
    Har

    Hi.. I have connected all the components as mentioned above. But I have a problem in moving the chasis and pumping out the water. Can you please help asap??

    Mar 01, 2018
  • AISHA's picture
    AISHA

    What problem are you facing? did you get any errors? What help do you need?

    Mar 01, 2018
  • SHIMITH's picture
    SHIMITH

    I connect the enther circuit and upload the program to adruino that not in working

    Mar 01, 2018
  • yy's picture
    yy

    HI, the l293D used is an IC or motor driver?

    Mar 03, 2018
  • Maria Mercedes's picture
    Maria Mercedes

    Did you experience any problems regarding connecting of the servo motor? Ours keeps on moving even though there is no flame. The flame sensors however, lights up when there is a flame but both the motor and the servo is not working. Hoping for your kind reply asap. Thank you.

    Mar 03, 2018
  • Charlie K's picture
    Charlie K

    Hi,

    I am having the same issue that Maria reported, robot does not stop at flame and no action from servo motor. Is there a fix?

    From Maria...Maria Mercedes
    reply
    Did you experience any problems regarding connecting of the servo motor? Ours keeps on moving even though there is no flame. The flame sensors however, lights up when there is a flame but both the motor and the servo is not working. Hoping for your kind reply asap. Thank you.

    Mar 15, 2018
  • AISHA's picture
    AISHA

    The reason for you robot to move when there is no fire is because the flame sensors will react to IR rays. IF there is excess sunlight inside the room, the sensor would read the IR rays from sun and assume it to be fire.

    IF your motors and servo are not working, the problem should be on the hardware. Try running a small servo sweep program (example program in arduino) and check if the motors are functional 

    Mar 16, 2018
  • sujay bhat's picture
    sujay bhat

    in the connection circuit you have provided, you have not shown the connection between arduino and bred board, please help

    Mar 04, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    The perfboard that you find in the project is just optional. Just follow the circuit diagram and make the conections

    Mar 05, 2018
  • OMKAR patil's picture
    OMKAR patil

    It is not working .....I connect properly all the components also upload code in arduino...Bt it is not working....Plzz held me for getting output

    Mar 05, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    What problem are you getting? explain the problem and only then I will be able to help you

    Mar 05, 2018
  • Omkar patil's picture
    Omkar patil

    Sir... I connect all components shown in diagram .....I give 9v power supply to ardino .... Upload the code you given...Bt the problem is that the ardino not get power to motor drive and fire sensor......Its not work .....I give 9v power supply to ardino bt the fire sensor also off

    Mar 09, 2018
  • surekha's picture
    surekha

    the power i give in is either enough to run the servo motor and sensors or the wheels..not both at the same time. what can be done to increase the input power. if one works the other stops

    Mar 06, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    How are you powering your Arduino?

    Are you using the same servo, pump and motor?

    Try powering the Arduino through phone charger (1A).

    If you are tyring with 9V battery then it wont work

    Mar 07, 2018
  • linto's picture
    linto

    My the gear motor and water pump is 12v .is it possible to connect it into the arduino board directly?

    Mar 09, 2018
  • raviteja's picture
    raviteja

    Can u please tell me where is the connection of servo motor

    Mar 10, 2018
  • sidharth's picture
    sidharth

    hii ......i am building a similar project...wen im connecting the 9G servo motor and the pump together with the arduino, the servo does'nt sweep properly, instead it gets stuck to one position. the pump which i used is a 6V one. Any solutions for that ?????

    Mar 10, 2018
  • DAPHNE's picture
    DAPHNE

    I want video with explanation, step-by-step procedure of the project and also study materials for the project of fire fighting robot using arduino uno. Please can you make this as soon as possible

    Mar 10, 2018
  • krupa's picture
    krupa

    sir please send flowchart to my mail

    Mar 10, 2018
  • tabassum's picture
    tabassum

    In the circuit the pump is nt given any power so how it will work how to give that 5v to the pump?

    Mar 11, 2018
  • John's picture
    John

    Hi there,
    Can i use the motorshield L293d? what supposed to be the pin out? will the sketch program for Arduino change? Need reply ASAP . Thank you for a great project!

    Mar 17, 2018
  • John's picture
    John

    how much power will this project needs?

    Mar 18, 2018
  • Akib's picture
    Akib

    How can we increase the range of sensors??

    Mar 19, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    You can vary the potentiometer on the sensor module to increase the range. Also if the room does not have heavy sunlight it will work much better

    Mar 22, 2018
  • Archita's picture
    Archita

    Me and my friend are working on this fire fighting robot and are unable to run the code, as the bot is not working.

    Mar 22, 2018
  • Mayank Vyas's picture
    Mayank Vyas

    HI,
    i'v been working on the same since days. The sensors and the servomotor (below the can) seems working good. The LM and RM are not responding any how, is there any other way i can run my L&R motor except L293D? The 5v water pump is not receiving enough voltage form the arduino uno board. Please help.
    Thank you.

    Mar 23, 2018
  • Haris's picture
    Haris

    Hi i need full programming and technical report and wiring and exact connections of arduino and all please send it to my mail at harismanzoor.33@gmail.com
    regards,
    Haris Manzoor

    Mar 24, 2018
  • Chandan's picture
    Chandan

    How much power supply u used ,u mentioned only 12v u didn't shown it in video.and I use 4wd chassis I have to use 4wd motor driver ,how to connect it . otherwise can it possible to connect another back wheels common with front is it works?

    Mar 25, 2018
  • Omkar patil's picture
    Omkar patil

    How to define the distance between fire sensor and flame....what should I do for When fire detect an bot forward towords fire and stop in specific distance.....

    Mar 27, 2018
  • Kyle Lorenz's picture
    Kyle Lorenz

    Hi! What could be the problem if the wheels don't work when there is a fire? Also, the servo motor works right away when the arduino is connected to the laptop? Please reply ASAP, thank you very much!!

    Mar 28, 2018
  • Faisal's picture
    Faisal

    In the components there was a breadboard and the fire fighter robot was maken by the breadboard. Then where is the connection of breadboard ? Is it possible to make the robot without breadboard help me please??

    Mar 31, 2018
  • Faisal Islam's picture
    Faisal Islam

    In the components there was a breadboard. The robot was also maken by breadboard. But in the circuit diagram there is no breadboard. Is there any need of using breadboard?

    Mar 31, 2018
  • uneeb shaikh's picture
    uneeb shaikh

    left and right motors are not working ??

    Apr 01, 2018
  • Madhuri's picture
    Madhuri

    Water pump of 5v as only two wire red and black those are connected to 5v and ground....thn water will be pumped continuously...so how will the water pump knows Wen it has to pump

    Apr 01, 2018
  • Shrinidhi 's picture
    Shrinidhi

    Hello sir..I have used 2 DC motors for chessy board for the motion of the fire brigade.Is there any variations we have to do? or the program you have given??

    Apr 07, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    Are the motors connected with L293D motor driver? If yes then there are not corrections required 

    Apr 10, 2018
  • Rajan's picture
    Rajan

    please sir help me . my project is not working properly . when i connect audiuno to laptop, it will automatically rotating wheels and micro server. please send me its proper circuit diagram and program. i am very thankfull if you helping me.

    Apr 08, 2018
  • Mohamed wael 's picture
    Mohamed wael

    i will replace the tip by much stronger nozzle , so what will i modify in the code to increase the range of the sensor ?
    i want larger distance when the robot sense the fire move a bit and start the pump and the servo motor

    Apr 10, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    Yes mohamed you can try that. Also make sure the room does not have direct sunlight. Because that will also affect the range

    Apr 15, 2018
  • Shivam Sharma's picture
    Shivam Sharma

    When I connect the pump, pump is not working but all robot does. Pump and servo motor are not working at same time. Help me.

    Apr 14, 2018
  • Syed Hassan Aarish Jafri's picture
    Syed Hassan Aar...

    My servo motor is not working for left and right sensor . For middle sensor its working fine . Can anyone give me any aolution ?

    Apr 15, 2018
  • BADIGINENI MUKESH KUMAR's picture
    BADIGINENI MUKE...

    Could you please give me exactly what type of .module used either post photos of that module or purchase link.

    Apr 16, 2018
  • Michael's picture
    Michael

    i need full arduino code please
    Thank you :)

    Apr 17, 2018
  • EJ's picture
    EJ

    Hi There, It is my first time getting hands on this type of project it is really awesome and interesting.
    I am working in a school project and since I do not have any experience at all I would like your expertise help to guide me through. I do have the robot car already just need help to connect the fire sensor and make them work.

    Apr 18, 2018
  • Mudasir 's picture
    Mudasir

    I have uploaded the code and connection all the connections properly but the robot in not working properly, I have made following connections:
    1. a 12v battery to supply enough current to the motors (i am using 4 tires chasing) through L239D.
    2. Through this battery I have supplied voltages to arduino at "Vin" port.
    3. L239D is also directly connected to 12V Battery (at 12v Dc terminal of L239D and ground obviously).
    4. I have taken 5v from arduino 5v port and have supplied it to flame sensor (using a 5 channel flame sensor module) , servo motor and the water pump according to the diagram with the arduino.
    I am facing the following issues:-
    1. Robot is continuously moving forward(3 secs move, 3 secs stop then repeat)
    2. Servo Motor is continuously rotating according to the code irrespective of flame detection.
    3. Flame sensor is sensing the flame properly but pump is not spraying water (never).
    Kindly guide me how to resolve the issues.
    Thank you

    Apr 20, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    Hi Mudasir,

    Your connections are all correct. It should have worked properly. Was there direct sunlight inside the room in which you were testing? 

    I suggest you to debug by yourself, it can be easily done by adding some Seril.println() lines inside the program to figure out why the bot is responding badly. Hope you get it working.

    Apr 20, 2018
  • Ahmed's picture
    Ahmed

    Can i uase L293d IC ?

    Apr 20, 2018
  • EJ's picture
    EJ

    Hi B.Aswinth Raj,
    I would like to ask for your help in where can I buy the correct L293D motor Driver module for this project. i have tried but there are a lot of options and no one looks like the one shown in the diagram.
    Sorry for being so naive but it is the first project and I am helping my daughter to build this project that is due in a week have not tested yet either due to I am missing L293D motor Driver module to connect the final wires. do you happen to have a link where I can see a all the project step by step? the diagram its self explanatory but I am running out of time :(

    Apr 23, 2018
  • Hiro_Hamada's picture
    Hiro_Hamada

    I think you should elaborate the problem on the forum. That way you can get quick results. Also post some picture so as to help you

    Apr 24, 2018
  • EJ's picture
    EJ

    Hi, is there anybody else that knows what is the correct L293D motor driver module to buy. I want the same exact one that is shown in the project.If you do, do you know where I can buy it ? Please respond to me as soon as possible.

    Apr 24, 2018
  • Hiro_Hamada's picture
    Hiro_Hamada

    All module will work the same. Just make sure you do the connections right. Don't worry about getting the same module 

    Apr 24, 2018
  • Mudasir Jamil's picture
    Mudasir Jamil

    Hi, thanks for the response
    I have eliminated the previous issue
    Now situation is like this
    Robot is moving and stopping for a couple of seconds
    Pump is working when wheels stops and synchronous motor is rotating according to pump
    But the issue i am facing is :
    It looks like arduino is giving command to pump.to spray water irrespective of flame sensor
    I have disconnected the flame sensor still it is working the same
    Can you kindly go through or match the code with ur working code so that if there is a bracket missing or something else, kindly guide me
    Thanks

    Apr 24, 2018
  • EJ's picture
    EJ

    Hi, Thank you Hiro_Hamada for your help.

    Apr 27, 2018
  • Michael's picture
    Michael

    If i change l293d to l298n ..did have the same function ?

    Apr 27, 2018
  • EJ's picture
    EJ

    Hi Everyone,

    I need help to get the right code to make the robot work properly. have used below code but is not working. what should I delete or add to below 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();

         }

    }

     

    I am not using water pump ...only wants the robot to follow fire when sensor detects fire please anybody can help the project is due this Monday 30th

    Apr 28, 2018
  • Vikky's picture
    Vikky

    When it detect flame, servo motor works but due to high current capacity of pump it does not work with arduino .. plz help me to run it ... Rest is working fine..

    May 05, 2018
  • Muhammad Riaz's picture
    Muhammad Riaz

    kindly sir, can you tell me, how you learn about the codding, which is used in this project, and which software is use for this codding.

    May 11, 2018
  • andicahyo's picture
    andicahyo

    Hi sir, please help me, when i try, the robot move forward 3 sec and stop 3 sec and continous

    May 25, 2018
  • B.Aswinth Raj's picture
    B.Aswinth Raj

    This means that the left and right flame sensors are not picking up any heat signals. Make sure they are wired correctly and also check for the sensitivity level by varying the pot on the sensor 

    May 28, 2018
  • andicahyo's picture
    andicahyo

    ok sir thankyou for the answer, the trouble is on the sensor, sensor right and left same model, but sensor forward is different. sensor forward when read fire the output 5v but sensor right and left when read fire = 0v hmmm...so i modified the program...and the robot now can working

    May 29, 2018

Leave a comment