Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino-Controlled Fire-Extinguishing Robot with Bluetooth Interface

View and Edit Project In Cirkit DesignerImage of Arduino-Controlled Fire-Extinguishing Robot with Bluetooth Interface

Circuit Documentation

Summary of the Circuit

This circuit is designed to control a 4-wheeled robot with the capability to move in different directions (forward, backward, left, and right) based on serial commands. It also features a fire detection system using flame sensors and can activate a water pump as a fire extinguishing mechanism. The brain of the robot is an Arduino UNO microcontroller, which processes the input commands and sensor data to control the motors and the extinguisher. The motors are driven by an L298N DC motor driver, and the system is powered by a 4.5V battery pack. A PNP transistor is used to control the power to the piezo buzzer and water pump, which are activated when fire is detected.

Component List

Wiring Details

Gearmotor DC Wheels (Left and Right)

Sensor SHT113 Flame

5v Mini Water Pump

Rocker Switch

Battery AAx3 4.5V

PNP Transistor (ECB)

Resistor (220 Ohms)

L298N DC Motor Driver

HC-06 Bluetooth Module

Arduino UNO

Piezo Buzzer

Documented Code

/*
 * 4-Wheeled Robot Control and Fire Extinguishing
 *
 * This Arduino sketch controls a 4-wheeled robot. The robot can move forward,
 * backward, left, and right based on serial commands. Additionally, it can
 * detect fire using a sensor and activate a mechanism to extinguish the fire.
 */

int A_IN1 = 2;
int A_IN2 = 3;
int B_IN3 = 4;
int B_IN4 = 5;
int A_PWM = 9;
int B_PWM = 10;
int fireSensor = A0; // Analog pin for fire sensor
int extinguisher = 6; // Digital pin for fire extinguisher
int spd = 200;
char sms;

void setup() {
  Serial.begin(9600);
  pinMode(A_IN1, OUTPUT);
  pinMode(A_IN2, OUTPUT);
  pinMode(B_IN3, OUTPUT);
  pinMode(B_IN4, OUTPUT);
  pinMode(A_PWM, OUTPUT);
  pinMode(B_PWM, OUTPUT);
  pinMode(fireSensor, INPUT);
  pinMode(extinguisher, OUTPUT);
}

void loop() {
  if (Serial.available()) {
    sms = Serial.read();
  }
  analogWrite(A_PWM, spd);
  analogWrite(B_PWM, spd);
  if (sms == 'S') {
    Stop();
  }
  if (sms == 'F') {
    Forward();
  }
  if (sms == 'B') {
    Backward();
  }
  if (sms == 'R') {
    Right();
  }
  if (sms == 'L') {
    Left();
  }
  if (sms >= '0' && sms <= '9') {
    spd = map(sms - '0', 0, 9, 0, 255);
  }
  if (analogRead(fireSensor) > 500) { // Fire detected
    activateExtinguisher();
  }
}

void Forward() {
  digitalWrite(A_IN1, HIGH);
  digitalWrite(A_IN2, LOW);
  digitalWrite(B_IN3, HIGH);
  digitalWrite(B_IN4, LOW);
}

void Backward() {
  digitalWrite(A_IN1, LOW);
  digitalWrite(A_IN2, HIGH);
  digitalWrite(B_IN3, LOW);
  digitalWrite(B_IN4, HIGH);
}

void Right() {
  digitalWrite(A_IN1, LOW);
  digitalWrite(A_IN2, LOW);
  digitalWrite(B_IN3, HIGH);
  digitalWrite(B_IN4, LOW);
}

void Left() {
  digitalWrite(A_IN1, HIGH);
  digitalWrite(A_IN2, LOW);
  digitalWrite(B_IN3, LOW);
  digitalWrite(B_IN4, LOW);
}

void Stop() {
  digitalWrite(A_IN1, LOW);
  digitalWrite(A_IN2, LOW);
  digitalWrite(B_IN3, LOW);
  digitalWrite(B_IN4, LOW);
}

void activateExtinguisher() {
  digitalWrite(extinguisher, HIGH);
  delay(5000); // Keep extinguisher on for 5 seconds
  digitalWrite(extinguisher, LOW);
}

This code is responsible for controlling the robot's movements and handling the fire detection and extinguishing process. It sets up the necessary pins as inputs or outputs, reads serial commands to control the robot's movements, and activates the extinguisher when a fire is detected.