A firefighting robot with obstacle avoider

Hi there...
I needed help with my current firefighting robot project. If someone has the circuit diagram and code for it please provide me.
Here is my list of components:
Arduino UNO

Arduino MEGA

Servo Motors – 2

DC motors – 8

12v Battery

L298n Motor Driver – 2

Flame sensors – 3

Switch – 2

4WD Chassis – 1

Analog Joystick – 2

Relay Module – 1

LED 16x2 – 1

Arduino NANO

HC-05 Bluetooth Module – 2

Buzzer – 1

ESP Wifi Module
The robot should run autonomously.
Thank You............

There must be some source of water to cease fire.

School project?

It also has a submersible pump. In other words,I have all the hardware ready,I only need help with the code and circuit diagram.

So you do have something working since it is your current project or is it still a box full of parts?

L298N drives two 7vdc to 12vdc motors at 2A.

I have wired everything. I took the reference of circuit diagram and code. Let me attach everything.:
Code:

#include <Servo.h>  //include servo.h library

Servo myservo;

int pos = 0;

int motor_speed = 70;  

boolean fire = false;

#define Left 9      // left sensor

#define Right 10    // right sensor

#define Forward 8   //front sensor

#define LM1 2       // left motor

#define LM2 7       // left motor

#define RM1 4       // right motor

#define RM2 12       // right motor

#define pump 6

void setup() {

  pinMode(Left, INPUT);

  pinMode(Right, INPUT);

  pinMode(Forward, INPUT);

  pinMode(LM1, OUTPUT);

  pinMode(LM2, OUTPUT);

  pinMode(RM1, OUTPUT);

  pinMode(RM2, OUTPUT);

  pinMode(pump, OUTPUT);

  analogWrite(3, motor_speed);

  analogWrite(5, motor_speed);

  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) ==1 && digitalRead(Right)==1 && digitalRead(Forward) ==1) {   

    digitalWrite(LM1, HIGH);

    digitalWrite(LM2, HIGH);

    digitalWrite(RM1, HIGH);

    digitalWrite(RM2, HIGH);

    }  

    else if (digitalRead(Forward) ==0) {

    digitalWrite(LM1, HIGH);

    digitalWrite(LM2, LOW);

    digitalWrite(RM1, HIGH);

    digitalWrite(RM2, LOW);

    fire = true;

    }   

    else if (digitalRead(Left) ==0) {

    digitalWrite(LM1, HIGH);

    digitalWrite(LM2, LOW);

    digitalWrite(RM1, HIGH);

    digitalWrite(RM2, HIGH);

    }

    else if (digitalRead(Right) ==0) {

    digitalWrite(LM1, HIGH);

    digitalWrite(LM2, HIGH);

    digitalWrite(RM1, HIGH);

    digitalWrite(RM2, LOW);

}

delay(300);//change this value to increase the distance  

     while (fire == true) {

      put_off_fire();

     }

}

I have tried but the code does not work completely. I just need the proper working circuit diagram and code in which all he parts should work.
Thank You....

what you want the code to do and what the code is doing?

Did you copy the code and make changes or write it yourself ?

Brake the code up in small steps

  1. Does the robot dive forward?
  2. Does it turn ?

This look strange , you stop one LM and one RM.

Bro I have copied it from quartz components. The thing is none of the code from any website is working. If possible,plz give me a circuit diagram and code which is made by you entirely.
Thank You....

The robot should detect fire, and extinguish it. Also , the robot should have obstacle avidance functions using ultrasonic sensors. I have already given the list of components. It is a 4WD chasis so the code should be written considering the 4 motors. Plz give me a human-written code which will run. As I am new and not able to write code myself, I needed help.
Thank You...

This is just my inventory and it is none like everything should get used up

you should not expect too much from those ir modules. it will only detect fire within range of few centimeters.

You found garbage code on the internet and want everyone else to fix?

Move your topic to Jobs and Paid... or start doing your own work.

It is just a project.I dont care if it detects 5 or 2 centimeters.My only concern is that the robot should detect,however distance it may be.Just, it should be working,no matter on what scale.
And I am asking for help if anyone has already made one earlier, or is willing to make one for my help.
Thank You.....

It won't work in daylight.
If you still want to make it. I could help you.

Yes please help, I need to make it as a project, so i dont care

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.