Iot Report
Iot Report
Belgaum,Karnataka
SUBMITTED BY:
VIGNESH K S
1CR23MC118
INTERNAL GUIDE:
CERTIFICATE
This is to certify that Vignesh K S bearing 1CR23MC118 has satisfactorily completed the
IOT Mini Project – 22MCAL37 entitled “Fire Fighting Robot using Arduino” in the
academic year 2024-25 as prescribed by VTU for III Semester of Master of Computer
Applications.
ACKNOWLEDGEMENT
I would like to express my sincere gratitude to Dr. Vakula Rani J, Professor in the Department of
MCA at CMR Institute of Technology, for her invaluable guidance, support, and mentorship
throughout the development of the Fire Fighting Robot using Arduino. Her expertise in the field of
computer science and dedication to academic excellence have been instrumental in shaping this project.
I am deeply thankful for her insightful feedback, encouragement, and constructive criticism, which
have contributed significantly to the refinement and success of the project. Her unwavering
commitment to fostering learning and innovation has inspired me to strive for excellence and push the
boundaries of technological advancement.
I am also grateful to the faculty and staff of CMR Institute of Technology for providing a conducive
learning environment and access to resources essential for the completion of this project. Additionally,
I extend my appreciation to my peers and colleagues for their collaboration and support throughout this
journey.
Finally, I would like to thank my family and friends for their encouragement, understanding, and
patience during the course of this project. Their unwavering support has been a source of strength and
motivation, driving me to achieve my goals and aspirations.
Thank you to everyone who has contributed to the realization of the Fire Fighting Robot using
Arduino. Your support and encouragement have been invaluable, and I am truly grateful for the
opportunity to work on this project.
Vignesh K S
1CR23MC118
TABLE OF CONTENTS
6. Testing 14-15
10. Conclusion 24
11 References 25
INTRODUCTION
The key motivation behind this project is to build a low-cost, portable, and
autonomous robot capable of enhancing safety in constrained or hazardous
environments. This includes scenarios where human intervention might be
dangerous or time-consuming. The robot employs common components such as
an Arduino Uno, motor driver (L298N), DC motors, servo motor, and relay
module, along with a 9V power source, making it an ideal educational and
prototypical application.
5
REQUIREMENT ANALYSIS
Functional Requirements:
Non-Functional Requirements:
6
Hardware Requirements:
Arduino Uno
L298N Motor Driver
Flame Sensors x3
Relay Module
Servo Motor
DC Motors x2
9V Battery
Software Requirements:
Arduino IDE
USB interface for code upload
Serial Monitor for debugging
The defined requirements ensure that the robotic car can autonomously detect
and suppress small-scale fires while remaining easy to construct, program, and
operate.
7
SOFTWARE REQUIREMENT SPECIFICATION
Objectives
To create software that enables real-time response to fire detection.
To control hardware components such as motors, sensors, servo, and
relay.
To ensure safe and efficient operation during fire suppression.
Software Architecture
Input Layer: Digital input from flame sensors.
Processing Layer: Logic and control decisions executed in Arduino
sketch.
Output Layer: Motor control via L298N, relay activation, and servo
sweeping.
Development Tools
Arduino IDE (for programming and uploading code)
Serial Monitor (for debugging and sensor output monitoring)
Standard C/C++ libraries and Servo.h for motor control
8
Performance Requirements
Flame detection and movement decision within 200ms.
Servo activation immediately after reaching target zone.
Continuous polling to ensure updated sensor feedback.
Safety Considerations
Relay should not trigger unless motors are halted.
Servo and relay cycles must be limited to prevent mechanical wear.
Software must handle sensor disconnections or out-of-range values
gracefully.
Maintainability
The code should be modular, with separate functions for sensor reading,
movement, and actuation.
Comments should describe all control logic for ease of future upgrades.
This software framework is essential to ensure the smooth, responsive, and safe
operation of the fire-fighting robot. It transforms sensor input into real-world
autonomous actions.
9
ANALYSIS AND DESIGN
The Analysis and Design phase plays a crucial role in ensuring the success of the
fire-fighting robotic car by providing a structured understanding of system
behavior and interactions before the actual implementation. This phase involves
identifying how the system components interact to fulfill the defined requirements
and establishing the flow of control and data within the system.
System Analysis
The Arduino Uno acts as the central control unit, reading sensor values and
controlling the output components accordingly. The L298N motor driver is
responsible for driving the two DC motors that power the robot’s movement. It
allows the robot to move forward, turn left or right, and stop when needed. The
robot moves in the direction of the flame and halts once it is in proximity to the
fire source.
At this point, the system activates a relay module that simulates triggering a fire
extinguishing mechanism. Simultaneously, a servo motor is activated to
perform a sweeping motion, enhancing the extinguishing coverage. After
completing the suppression routine, the system resets to its monitoring state to
detect any new sources of fire.
System Design
The design phase involves laying out the interaction between hardware
components and the logic for control flow. The system is divided into four key
subsystems:
1. Sensing Subsystem: This includes the flame sensors which continuously
10
monitor for fire presence and intensity.
2. Control Subsystem: The Arduino Uno processes input data from sensors
and determines the appropriate action.
3. Motion Subsystem: This consists of DC motors and the L298N motor
driver, which facilitate robot navigation.
4. Suppression Subsystem: Includes the relay and servo motor that activate
and execute the fire extinguishing process.
The control logic is simple yet efficient. When the left sensor detects the fire,
the robot turns left; for center detection, it moves forward; and for right
detection, it turns right. Once near the flame, it stops, activates the relay, and
initiates the servo to sweep left and right, mimicking an extinguishing spray or
fan. This logic ensures accurate targeting and maximizes suppression
effectiveness.
The system is designed to operate continuously, polling the sensors and taking
real-time actions based on inputs. The modular approach in both hardware
layout and software logic makes the system easy to debug, upgrade, and
maintain.
11
CIRCUIT DIAGRAM
12
IMPLEMENTATION AND SCREENSHOTS
13
TESTING
Component Testing
Each hardware module was first tested individually to confirm that it was
functioning properly before integrating it with the rest of the system. The flame
sensors were tested by placing a small flame (such as a lighter) at different
distances and angles. The sensor outputs were monitored using the Arduino
Serial Monitor to verify accurate detection and directional response. This
ensured that the sensor arrangement could successfully distinguish between left,
center, and right flame sources.
The DC motors were then tested using the L298N motor driver. Simple forward,
backward, left, and right commands were executed to confirm proper
movement. The relay module was tested by triggering it through the Arduino
digital pin to simulate an extinguisher being activated. The servo motor was
separately checked using a simple sweep program to ensure it could rotate as
expected within its limits.
Functional testing confirmed that the robot could accurately detect the direction
of a flame and approach it. Upon nearing the fire, the robot successfully
stopped, activated the relay, and executed the servo's sweeping motion to
simulate extinguishing the flame. Each stage was performed sequentially and
14
reliably.
One challenge observed during testing was the variability in flame detection
distance depending on ambient light conditions. Bright light could reduce
sensor sensitivity, so future improvements may include IR filtering or adaptive
thresholding in software.
Overall, testing verified that the robotic car met all functional and non-
functional requirements. The system responded quickly and performed each
task as intended, proving its utility as a fire-detection and extinguishing
prototype.
15
LEARNING OUTCOME
From a design and planning perspective, the project improved our abilities in
system analysis and architectural thinking. Breaking down the overall
objective into manageable subsystems—such as sensing, control, motion, and
suppression—allowed for clearer project milestones and better debugging.
Creating flowcharts and control logic prior to implementation ensured smoother
development and faster troubleshooting.
16
Working on this robot also highlighted the value of team collaboration and
interdisciplinary learning. The successful completion of the project required
the integration of knowledge from electronics, mechanical systems, and
programming. Effective communication and task delegation played an essential
role in achieving the desired outcome within a limited timeframe.
17
FUTURE SCOPE
The fire suppression system can also be enhanced. Instead of a relay-based fan
or extinguisher trigger, the robot can be fitted with a pressurized CO₂ or foam
dispensing module with more effective flame coverage. A feedback loop using
flame intensity readings post-suppression could confirm whether the fire has
been extinguished, leading to more intelligent and resource-efficient
suppression.
18
Furthermore, the robot could be redesigned using metallic or fire-resistant
materials to allow it to operate safely in high-temperature zones. With proper
shielding and heat management, the robot could potentially approach more
hazardous fire conditions without damage.
19
SOURCE CODE
#include <Servo.h>
// Pin configuration
const int flameSensorPins[] = {2, 3, 4}; // flameSensorPins[0] = Left, [1] =
Middle, [2] = Right
const int relayPin = 5; // Relay control pin
const int leftMotorForward = 6; // Left motor forward control pin
const int leftMotorBackward = 7; // Left motor backward control pin
const int rightMotorForward = 8; // Right motor forward control pin
const int rightMotorBackward = 9; // Right motor backward control pin
const int servoPin = 10; // Servo motor control pin
// Variables
unsigned long relayOnDuration = 3000; // Relay on duration in milliseconds
(5 seconds)
unsigned long lastFlameTime = 0;
bool fireDetected = false;
int flamePosition = -1; // 0 = left, 1 = middle, 2 = right
void setup() {
for (int i = 0; i < 3; i++) {
pinMode(flameSensorPins[i], INPUT);
}
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, LOW);
pinMode(leftMotorForward, OUTPUT);
pinMode(leftMotorBackward, OUTPUT);
pinMode(rightMotorForward, OUTPUT);
pinMode(rightMotorBackward, OUTPUT);
fireExtinguishServo.attach(servoPin);
fireExtinguishServo.write(90);
stopMotors();
20
Serial.begin(9600);
}
void loop() {
fireDetected = false;
flamePosition = -1;
// Check sensors
for (int i = 0; i < 3; i++) {
if (digitalRead(flameSensorPins[i]) == LOW) { // Flame detected
flamePosition = i;
fireDetected = true;
break;
}
}
if (fireDetected) {
Serial.print("Flame detected at position: ");
if (flamePosition == 0) Serial.println("LEFT");
else if (flamePosition == 1) Serial.println("MIDDLE");
else if (flamePosition == 2) Serial.println("RIGHT");
stopMotors();
21
if (digitalRead(relayPin) == LOW && millis() - lastFlameTime >=
relayOnDuration) {
Serial.println("Turning off relay...");
digitalWrite(relayPin, HIGH);
}
delay(100);
}
void moveForward() {
digitalWrite(leftMotorForward, HIGH);
digitalWrite(leftMotorBackward, LOW);
digitalWrite(rightMotorForward, HIGH);
digitalWrite(rightMotorBackward, LOW);
}
void moveBackward() {
digitalWrite(leftMotorForward, LOW);
digitalWrite(leftMotorBackward, HIGH);
digitalWrite(rightMotorForward, LOW);
digitalWrite(rightMotorBackward, HIGH);
}
void turnLeft() {
digitalWrite(leftMotorForward, LOW);
digitalWrite(leftMotorBackward, HIGH);
digitalWrite(rightMotorForward, HIGH);
digitalWrite(rightMotorBackward, LOW);
}
void turnRight() {
digitalWrite(leftMotorForward, HIGH);
digitalWrite(leftMotorBackward, LOW);
digitalWrite(rightMotorForward, LOW);
digitalWrite(rightMotorBackward, HIGH);
}
void stopMotors() {
digitalWrite(leftMotorForward, LOW);
digitalWrite(leftMotorBackward, LOW);
digitalWrite(rightMotorForward, LOW);
digitalWrite(rightMotorBackward, LOW);
}
22
void extinguishFire() {
Serial.println("Swinging servo...");
for (int i = 0; i < 5; i++) {
fireExtinguishServo.write(180);
delay(200);
fireExtinguishServo.write(0);
delay(200);
}
fireExtinguishServo.write(90);
}
23
CONCLUSION
The fire-fighting robotic car project successfully demonstrates how embedded
systems and automation can be harnessed to develop a functional, autonomous
solution for fire detection and suppression. Through careful integration of
sensors, actuators, microcontrollers, and control logic, the robot is capable of
identifying the direction of a flame, navigating toward it, and activating a
suppression mechanism upon reaching the source.
24
REFERENCES
- Arduino Official Guide
https://www.arduino.cc/en/Guide/HomePage
25