Report Iot
Report Iot
Introduction
Introduction:
Smoke detection is critical in fire safety, providing early alerts to prevent potential hazards. Traditional
smoke detectors are effective but often lack advanced connectivity and real-time monitoring features. This
project introduces an IoT-based smoke detector using the ESP32 microcontroller, which combines smoke
detection with smart connectivity to enhance safety.
A smoke detector using ESP32 is an innovative and affordable approach to building a smart smoke
detection system that leverages IoT capabilities. Traditional smoke detectors are standalone devices
limited to sounding an alarm when smoke is detected. By integrating the ESP32 microcontroller, which has
built-in Wi-Fi and Bluetooth capabilities, this smoke detector can be transformed into a connected device
that not only detects smoke but also provides real-time alerts to a user’s smartphone, allowing for remote
monitoring and control.
The project uses a smoke sensor, such as the MQ-2 or MQ-135, to detect smoke, combustible gases,
or changes in air quality. When smoke levels reach a predefined threshold, the ESP32 sends a signal
to trigger an alarm or send notifications through platforms like Blynk or IFTTT. This smart detector is
highly adaptable, supporting various features like data logging, remote notifications, and even integration
with smart home systems for automated responses.
In addition to enhancing home safety, this project demonstrates a practical application of IoT for real-world
problem-solving. By creating a smart smoke detector, developers and hobbyists gain hands-on experience
with sensor interfacing, wireless communication, data handling, and basic automation.
A smoke detector project using an ESP32 microcontroller serves the purpose of creating an IoT-based fire
and smoke detection system. By combining the ESP32 with a smoke sensor, such as the MQ-2 or MQ-135,
you can build a reliable and responsive smoke detector with smart capabilities like real-time alerts, mobile
notifications, and data logging. Here are some primary purposes for building this project:
1. Early Fire Detection: Detecting smoke early can prevent fires from escalating, minimizing
2. damage and protecting lives. This project will monitor air quality and detect unusual smoke or gas levels.
3. Remote Monitoring: Using ESP32's Wi-Fi capabilities, the system can send alerts to smartphones or
4. other devices, allowing remote monitoring through a mobile app or web interface.
5. Automation and Control: When combined with other smart devices, the ESP32-based smoke detector
6. could trigger automated responses (e.g., activating sprinklers, sounding an alarm, or notifying security).
1
7. Data Collection and Logging: The ESP32 can track environmental data over time, storing it in the
cloud for analysis.
8. This can help identify patterns, such as areas with higher smoke or pollution levels.
9. Educational Application: This project is excellent for learning IoT, sensor interfacing, and
data communication, offering hands-on experience with ESP32 and IoT concepts.
10. Would you like more specific details, such as circuit design, programming, or features?
2
Chapter no. 2…..System Modelling
System modeling for a smoke detector using an ESP32 involves designing a structure that
outlines the components, their interactions, and how data flows through the system. The system can be
modeled in several layers: sensor input, data processing, user interface, and connectivity.
Here’s a breakdown:
Description: A powerful microcontroller with built-in Wi-Fi and Bluetooth, ideal for IoT
applications.
The ESP32 collects data from the smoke sensor and sends alerts or data wirelessly to a mobile app
or
web interface.
Purpose: Acts as the main control unit, receiving data from the smoke sensor and processing it for
display or wireless transmission.
2)Smoke Sensor (MQ-2 or MQ-135)
Description: These sensors detect smoke, methane, LPG, and other gases. The MQ-2 is suitable
for
general smoke and gas detection, while the MQ-135 detects a broader range of gases, including
3
carbon dioxide.
Purpose: Detects smoke or gas particles and sends an analog signal to the ESP32 for processing.
3)Buzzer
Description: An electronic sound device that emits an audible alarm when activated.
Purpose: Sounds an alarm when smoke is detected, providing immediate auditory feedback.
Description: A 16x2 character LCD with an I2C module that simplifies wiring by using only two
pins (SDA and SCL) for data transfer.
Purpose: Displays real-time data, such as smoke levels, device status, or connection information,
providing a visual update on the detector's readings.
5)LED (Optional)
Description: An indicator light that provides a visual alert when smoke is detected.
Purpose: Lights up when smoke is detected, acting as an additional visual alert.
4
6)Jumper Wires
Description: Provides power to the ESP32 and other components if not using USB power.
Purpose: Keeps the circuit powered, especially if deploying the project in a location where USB
power is inconvenient.
5
9)Micro-USB Cable
Description: A cable used to program the ESP32 and provide power.
Purpose: Connects the ESP32 to your computer for programming and debugging.
Description: Passive components used to control current in the circuit, typically required for LEDs
or other sensitive components.
Purpose: Ensures proper current levels, especially for LEDs.
6
Chapter no.3……Performance Analysis
3.1)Code:
#include <MQUnifiedsensor.h>
#include <LiquidCrystal.h>
/*****************************Globals***********************************************/
MQUnifiedsensor MQ2(Board, Voltage_Resolution, ADC_Bit_Resolution, Pin, Type);
LiquidCrystal lcd(19, 23, 18, 17, 16, 15);
7
void setup() {
// Initialize the serial port
Serial.begin(115200);
// Set the math model to calculate PPM concentration and the values of constants for smoke detection
MQ2.setRegressionMethod(1); // _PPM = a*ratio^b
MQ2.init();
8
MQ2.setR0(calcR0 / 10);
Serial.println(" done!");
lcd.clear();
if (isinf(calcR0)) {
Serial.println("Warning: Connection issue, R0 is infinite (Open circuit detected). Please check wiring
and supply.");
lcd.setCursor(0, 1);
lcd.print("Check wiring!");
while(1);
}
if (calcR0 == 0) {
Serial.println("Warning: Connection issue found, R0 is zero (Analog pin shorts to ground).
Please check wiring and supply.");
lcd.setCursor(0, 1);
lcd.print("Check wiring!");
while(1);
}
lcd.clear();
}
void loop() {
MQ2.update(); // Update data, read voltage from the analog pin
9
lcd.setCursor(0, 0); // Set LCD to first row
lcd.print("Status: "); // Clear previous message
Serial.println("----------------------------");
delay(1000); // Wait before the next reading
}
10
3.3)Working model
11
Chapter no 4…….Summary
4.1)Advantages
4.2)Limitations
1. Sensitivity to Environmental Conditions:
o Some smoke sensors, such as the MQ-2 or MQ-135, can be influenced by humidity,
temperature, or other gases, leading to potential false alarms or decreased accuracy.
2. Wi-Fi Dependence:
o The ESP32-based detector’s remote alert feature depends on Wi-Fi connectivity. In
environments with poor Wi-Fi coverage, connectivity issues may prevent timely alerts.
3. Limited Battery Life:
o While power-efficient modes help, battery-powered ESP32 setups may still require
frequent recharging or battery replacements, especially when Wi-Fi is in constant use.
4. Complexity in Calibration:
o Calibrating the sensor thresholds to distinguish between benign and harmful levels
of smoke can be challenging, especially for varied environmental conditions.
5. Lack of Certification:
o DIY smoke detectors may not meet regulatory standards for residential or commercial
safety systems, making them unsuitable as primary safety devices in many locations.
4.3)Applications
1. Home and Office Safety:
o Provides early smoke detection and alerts to prevent potential fire hazards in residential
12
or small office settings.
2. Industrial and Laboratory Monitoring:
o Used to monitor smoke and air quality in small-scale industrial environments, helping
prevent the buildup of hazardous gases.
3. Smart Home Integration:
o Integrates with smart home systems to control devices like fans or sprinklers if smoke is
detected, adding automation for improved safety.
4. Educational Projects and IoT Learning:
o Offers an excellent project for students and hobbyists to learn about IoT, sensor
interfacing, and real-time data processing.
5. Environmental Monitoring:
o When combined with temperature and humidity sensors, it can be used to monitor air
quality in real-time, suitable for applications like air purification systems or HVAC
monitoring.
13
Chapter no.5……Conclusion & Future Scope
Future Scope
1. Machine Learning for Improved Detection:
o Integrate machine learning algorithms to differentiate between smoke from harmful
fires and other benign sources (like cooking smoke), reducing false alarms.
2. Battery Optimization and Energy Harvesting:
o Improve power efficiency by incorporating energy-harvesting techniques (like solar
panels) or by optimizing the ESP32’s power modes further, allowing for longer battery
in off-grid scenarios.
3. Multi-Sensor Integration:
o Add other air quality sensors to detect CO2, carbon monoxide, or volatile organic
o compounds (VOCs) for a comprehensive environmental monitoring system.
4. Cloud Data Analytics:
o Utilize IoT platforms for cloud storage and data analytics, allowing users to track
o long-term smoke and air quality trends, receive predictive alerts, and visualize
o data on dashboards.
5. Integration with Smart Home Systems:
o Enable interoperability with smart home devices (e.g., Google Home, Alexa) and
link to systems like sprinklers or exhaust fans to provide automated responses in the
event of smoke detection.
6. Mobile App Customization:
o Develop a dedicated mobile app for real-time monitoring, customization of threshold levels,
and enhanced notification settings.
7. Certification for Broader Use:
o Explore options for regulatory compliance, making the system suitable as a certified
o fire safety device in residential or commercial applications.
14