Varun walimbe
Published © GPL3+

Firefighting Robot Car

This Robotic car can detect if there is flame nearby and can extinguish it autonomously.

IntermediateShowcase (no instructions)4 hours7,878
Firefighting Robot Car

Things used in this project

Hardware components

Arduino Pro Mini 328 - 5V/16MHz
SparkFun Arduino Pro Mini 328 - 5V/16MHz
Brain of the Project
×1
1-Channel Signal Relay 1A SPDT I²C Mini Module
ControlEverything.com 1-Channel Signal Relay 1A SPDT I²C Mini Module
×1
Breadboard (generic)
Breadboard (generic)
×2
Dual H-Bridge motor drivers L298
SparkFun Dual H-Bridge motor drivers L298
Motor driver to drive two motors
×1
water pump Motor
×1
Geared DC Motor, 12 V
Geared DC Motor, 12 V
×2
Light Pipe, 15.9 mm
Light Pipe, 15.9 mm
will be used by motor to throw motor
×1
Panel, Chassis Cover
Panel, Chassis Cover
×1
wheels
×4
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Tape, Double Sided
Tape, Double Sided
Scissor, Electrician
Scissor, Electrician
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Code

Firefighting Robot Car.ino

Arduino
int P = 2;
int fp= 8;
int M1 =3;
int M2 =4;
int M3 =5;
int M4=6;
int ENA =9;
int ENB =10;
int Tp=11;
int Ep=12;
int detect;

void forward()
{
  digitalWrite(M1,LOW);
  digitalWrite(M2,HIGH);
  digitalWrite(M3,LOW);
  digitalWrite(M4,HIGH);
  analogWrite(ENA , 255);
  analogWrite(ENB , 255);
}

void backward()
{
  digitalWrite(M1,HIGH);
  digitalWrite(M2,LOW);
  digitalWrite(M3,HIGH);
  digitalWrite(M4,LOW);
  analogWrite(ENA , 255);
  analogWrite(ENB , 255);
}

void Right()
{ 
  digitalWrite(M1,HIGH);
  digitalWrite(M2,LOW);
  digitalWrite(M3,LOW);
  digitalWrite(M4,LOW);
  analogWrite(ENA , 255);
  analogWrite(ENB , 0);
}

void Left()
{
  digitalWrite(M1,LOW);
  digitalWrite(M2,LOW);
  digitalWrite(M3,LOW);
  digitalWrite(M4,HIGH);
  analogWrite(ENA , 0);
  analogWrite(ENB , 255);
}

void pause()
{
  digitalWrite(M1,LOW);
  digitalWrite(M2,LOW);
  digitalWrite(M3,LOW);
  digitalWrite(M4,LOW);
  analogWrite(ENA , 0);
  analogWrite(ENB , 0);
}

void Random()
{
  forward();
  delay(2000);
  Right();
  delay(2500);
  backward();
  delay(1000);
  Left();
  delay(2500);
  pause();
}

void setup() 
{
  Serial.begin(9600);
  pinMode(P, OUTPUT);
  pinMode(Ep, INPUT);
  pinMode(Tp,OUTPUT);
  pinMode(M1, OUTPUT);
  pinMode(M2, OUTPUT);
  pinMode(M3, OUTPUT);
  pinMode(M4, OUTPUT);
  pinMode(ENA,OUTPUT);
  pinMode(ENB,OUTPUT);
}

void loop() 
{
  detect= digitalRead(fp);
  Serial.print("Alert:");
  Serial.println(detect);
  
  if(detect==HIGH)
  {
    pause();
    delay(3000);
    digitalWrite(P, LOW);
    delay(2500);
    digitalWrite(P,HIGH);
    delay(1500);
    backward();
    delay(2000);
    pause();
    delay(1000);
    Left();
    delay(1700);
  }
  else
  {
    digitalWrite(P, HIGH);
    delay(2000);
    backward();
    delay(2000);
    pause();
  }
}

Credits

Varun walimbe

Varun walimbe

15 projects • 69 followers
I like to innovate and make different types of Robots and systems that thrive to make human lives easier :)

Comments