Arduino Based Fire Fighting Robot

Arduino

ByB.Aswinth Raj 103

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

  • harish's picture
    harish
    Dec 25, 2017

    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...

  • AISHA's picture
    AISHA
    Dec 26, 2017

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

  • Jothisree's picture
    Jothisree
    Jan 10, 2018

    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

  • AISHA's picture
    AISHA
    Jan 11, 2018

    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)

  • Jothisree's picture
    Jothisree
    Jan 17, 2018

    Thank You @AISHA :)

  • Mudasir's picture
    Mudasir
    Jan 16, 2018

    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

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

    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

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

    Thank you Aswinth Raj

  • Alanna Potter's picture
    Alanna Potter
    Feb 26, 2018

    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?

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

    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 

     

  • Mostafa's picture
    Mostafa
    Jan 18, 2018

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

  • Sajeshmohanan's picture
    Sajeshmohanan
    Jan 29, 2018

    Hello
    What is circle above the three sensor

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

    THANKS

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

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

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

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

  • Rashmi 's picture
    Rashmi
    Feb 02, 2018

    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?

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

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

  • Usama's picture
    Usama
    Feb 02, 2018

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

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

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

  • akash's picture
    akash
    Feb 04, 2018

    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

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

    How to connect the breadboard can you explain

  • tec's picture
    tec
    Feb 08, 2018

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

  • Yanna's picture
    Yanna
    Feb 08, 2018

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

  • MorFin's picture
    MorFin
    Feb 08, 2018

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

  • Rachna's picture
    Rachna
    Feb 10, 2018

    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.

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

    Can I use l298n motor drive instead of l293d?

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

    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.

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

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

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

    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

  • Har's picture
    Har
    Mar 01, 2018

    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??

  • AISHA's picture
    AISHA
    Mar 01, 2018

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

  • SHIMITH's picture
    SHIMITH
    Mar 01, 2018

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

  • yy's picture
    yy
    Mar 03, 2018

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

  • Nuttertutt's picture
    Nuttertutt
    Jul 19, 2018

    My dc motor won't move and my water pump isn't working

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

    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.

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

    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.

  • AISHA's picture
    AISHA
    Mar 16, 2018

    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 

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

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

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

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

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

    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

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

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

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

    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

  • surekha's picture
    surekha
    Mar 06, 2018

    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

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

    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

  • linto's picture
    linto
    Mar 09, 2018

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

  • raviteja's picture
    raviteja
    Mar 10, 2018

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

  • sidharth's picture
    sidharth
    Mar 10, 2018

    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 ?????

  • DAPHNE's picture
    DAPHNE
    Mar 10, 2018

    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

  • krupa's picture
    krupa
    Mar 10, 2018

    sir please send flowchart to my mail

  • tabassum's picture
    tabassum
    Mar 11, 2018

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

  • John's picture
    John
    Mar 17, 2018

    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!

  • John's picture
    John
    Mar 18, 2018

    how much power will this project needs?

  • Akib's picture
    Akib
    Mar 19, 2018

    How can we increase the range of sensors??

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

    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

  • Archita's picture
    Archita
    Mar 22, 2018

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

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

    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.

  • Haris's picture
    Haris
    Mar 24, 2018

    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

  • Chandan's picture
    Chandan
    Mar 25, 2018

    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?

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

    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.....

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

    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!!

  • Faisal's picture
    Faisal
    Mar 31, 2018

    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??

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

    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?

  • uneeb shaikh's picture
    uneeb shaikh
    Apr 01, 2018

    left and right motors are not working ??

  • Madhuri's picture
    Madhuri
    Apr 01, 2018

    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

  • Shrinidhi 's picture
    Shrinidhi
    Apr 07, 2018

    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??

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

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

  • Rajan's picture
    Rajan
    Apr 08, 2018

    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.

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

    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

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

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

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

    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.

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

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

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

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

  • Michael's picture
    Michael
    Apr 17, 2018

    i need full arduino code please
    Thank you :)

  • EJ's picture
    EJ
    Apr 18, 2018

    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.

  • Mudasir 's picture
    Mudasir
    Apr 20, 2018

    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

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

    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.

  • Ahmed's picture
    Ahmed
    Apr 20, 2018

    Can i uase L293d IC ?

  • EJ's picture
    EJ
    Apr 23, 2018

    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 :(

  • Hiro_Hamada's picture
    Hiro_Hamada
    Apr 24, 2018

    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

  • EJ's picture
    EJ
    Apr 24, 2018

    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.

  • Hiro_Hamada's picture
    Hiro_Hamada
    Apr 24, 2018

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

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

    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

  • Nuttertutt's picture
    Nuttertutt
    Jul 20, 2018

    How did you make the water pump work? mine isn't working

  • EJ's picture
    EJ
    Apr 27, 2018

    Hi, Thank you Hiro_Hamada for your help.

  • Michael's picture
    Michael
    Apr 27, 2018

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

  • EJ's picture
    EJ
    Apr 28, 2018

    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

  • Vikky's picture
    Vikky
    May 05, 2018

    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..

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

    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.

  • andicahyo's picture
    andicahyo
    May 25, 2018

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

Pages

Log in or register to post Comment