Finalminiprojectdoc
Finalminiprojectdoc
CERTIFICATE
This is to certify that the work which is being presented in the B. Tech. Mini Project Report entitled
“Smoke Detector With Auto Exhaust And Dialer” being submitted by 21681A0472 (VASARLA
REKHA) , 21681A0460(POREDDY VYSHNAVI) , 22685A0415 (YENAGANDULA NARESH),
21681A0479(KOTHAPELLY RAHUL TEJA) impartial fulfillment of the requirements for the
award of the Bachelor of Technology in “Electronics & Communication Engineering” and
submitted to the Department of Electronics & Communication Engineering of Christu Jyothi
Institute of Technology and Science, Jangaon.
This is to certify that the above statement made by the candidate is correct to the
best of my knowledge
Mission
The mission of the institution is to create, deliver and refine knowledge. Being a rural
technical institute, our mission is to.
Enhance our position to one of the best technical institutions and to measure our performance
against the highest defined standards.
Provide highest quality learning environment to our students for their greater well-being so as
to equip them with highest technical and professional ethics.
Produce engineering graduates fully equipped to meet the ever-growing needs of industry and
society.
PRINCIPAL
I
CHRISTU JYOTHI INSTITUTE OF TECHNOLOGY & SCIENCE
(Affiliated to JNTU, Hyderabad)
Colombonagar, Yeshwanthapur, Jangaon TS 506167
Dept. Electronics & Communication Engineering
(Accredited by National Board of Accreditation)
Department Vision:
To be an established centre of excellence in Electronics and Communication Engineering
facilitating youth towards professional, Leader ship and industrial needs
Department Mission:
1 Impart theoretical and practical technical education of high standard with quality
resources and collaborations.
2 Organize trainings and activities towards overall personality development in time with
industrial need.
3 Promote innovation towards sustainable solutions with multi discipline team work with
ethics.
HOD
II
CHRISTU JYOTHI INSTITUTE OF TECHNOLOGY & SCIENCE
(Accredited by NBA and Affiliated to JNTU, Hyderabad)
Colombonagar, Yeshwanthapur, Jangaon Dist.506167, Telangana.
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING
2023-2024
DECLARATION
We hereby declare that the project entitled--" Smoke Detector With Auto Exhaust And Dialer ",
which us being submitted as Mini Project in Electronics and Communication Engineering to
Christu Jyothi Institute of Technology & Science, is an authentic record of our genuine work done
under the guidance of K Amarendar M.Tech , Assistant Professor of ECE Dept.
PROJECT MEMBERS
VASARLA REKHA - 21681A0472
POREDDY VYSHNAVI - 21681A0460
YENAGANDULA NARESH - 22685A0415
KOTHAPELLY RAHUL TEJA - 21681A0479
III
ACKNOWLEDGMENT
We here by express our sincere gratitude to the Management of Christu Jyothi Institute
of Technology & Science for their kind encouragement bestowed up on us to do this Mini project.
We earnestly take the responsibility to acknowledge the following distinguished
personalities who graciously allowed our project work successfully.
We express our sincere thanks to our director Rev.Fr. D. Vijaya Paul Reddy, Principal Mr. Dr. S.
Chandrashekhar Reddy for his encouragement, which has motivated us to strive hard to excel in
our discipline of engineering.
We are greatly indebted to the professor and Head of the Department Mr. Allanki Sanyasi
Rao, Associate Professor for his motivation and guidance through the course of this project work.
He has been responsible for providing us with lot of splendid opportunities, which has shaped our
career. His advice ideas and constant support has engaged us on and helped us get through in
difficult time.
We express our profound sense of appreciation and gratitude to our guide Mr. Allanki
Sanyasi Rao , Associate Professor for providing generous assistance, and spending many hours of
valuable time with us. This excellent guidance has made the timely completion of this mini project.
Last but not the least, we express our gratitude to the Teaching and Non-Teaching Staff of
the Department of Electronics and communication for their needy and continuous support in
technical assistance.
IV
ABSTRACT
In the current generation fire accidents and LPG leakages are increasing in many sectors due
to several issues, It may cause lot of property damages and leads to death. This is happening because
of improper guidance about the issue and for not recognising the issue earlierly and it takes few
minutes to call fire department.
In order to overcome all the issues mentioned above, here we are designed and implemented an
intelligent "smoke detection system integrated with automatic exhauster and dialer". It helps us to
intimate through ringing alarm and automatic call to fire, emergency department by sensing smoke.
So that we can preplan and avoid the fire accidents without any loss.
V
CONTENTS
VI
CHAPTER TOPIC PAGE
NUMBER NUMBER
ABSTRACT
1 INTRODUCTION 1-4
1.1 Project outline: 1
1.2 Project objective 1
1.3 Literature Review 2-4
2 EMBEDDED SYSTEMS 5-7
2.1. Introduction To Embedded Systems 5-6
2.2. Characteristic Of Embedded System 6
2.3. Applications Of Embedded Systems 6-7
3 MICROCONTROLLERS 8-9
3.1. Microcontroller Versus Microprocessor 6 8
3.2. Microcontrollers For Embedded System 9
4 HARDWARE COMPONENTS 10-37
4.1 Arduino Uno Microcontroller 10-16
4.1.1 Arduino Uno Board 12-14
4.1.2 Pin Diagram Of Arduino Uno 15-16
4.2 Liquid Crystal Display 16-18
4.2.1 Introduction To Lcd 17
4.2.2 Uses Of Lcd 16 17
4.2.3 Pin Diagram Of Lcd 17-18
4.2.4 Features Of Lcd 18
4.3 I2C 18-20
4.3.1 Introduction 18-19
4.3.2 Features 19
4.3.3 Applications 19-20
4.3.4 Advantages&Limitations 20
4.4 GSM Module 20-22
4.4.1 Introduction 20-21
4.4.2 Specifications 21
4.4.3 Features 21
4.4.4 Operation 22
4.4.5 Application 22
4.5 Smoke Sensor 23-24
4.5.1 Introduction 23
4.5.2 Features 23-24
4.6 Adapter 24-25
4.6.1 Features&Specifications 24-25
4.7 Buzzer 26-28
VII
4.7.1 Types Of Buzzer 26
4.7.2 Key Features And Characteristics 26-27
LIST OF DIAGRAMS
CHAPTER PAGE
NUMBER FIGURE NUMBER
ACRONYMS
VIII
EEPROM Electrically Erasable Programmable Read-Only Memory
GPS Global Positioning System
GPRS General Packet Radio Service
GSM Global System for Mobile Communications
I2C Inter-Integrated Circuit
IC Integrated Circuit
LCD Liquid Crystal Display
LED Light Emitting Diode
LTE Long-Term Evolution
PCB Printed Circuit Board
RAM Random Access Memory
ROM Read-Only Memory
TCP/IP Transmission Control Protocol/Internet Protocol
UART Universal Asynchronous Receiver-Transmitter
USB Universal Serial Bus
IX
Smoke Detector with Auto Exhaust and Dialer
CHAPTER-1
Introduction
1.1 Project outline
This innovative smoke detector integrates an automatic exhaust system to promptly ventilate smoke and
a built-in dialer to immediately alert emergency services, ensuring maximum safety and quick response
in case of a fire.
1.2 Project Objectives
Design and integrate an automatic exhaust mechanism to ventilate the area when smoke is detected.
Ensure the exhaust system activates promptly upon smoke detection to mitigate smoke accumulation and
potential hazards.
Implement sensors to monitor air quality and deactivate the exhaust system when normal air quality
is restored.
Dialer System:
Create a dialer system that automatically contacts emergency services or predefined contacts (e.g.,
homeowners, building managers) when smoke is detected.
Ensure the dialer system can send notifications via multiple channels (e.g., phone calls, text
messages, emails).
Integrate location tracking and relevant information in notifications for quicker emergency response.
Power Supply and Backup:
Ensure the system has a reliable power source, including a backup power supply (e.g., batteries) in
case of power outages.
User Interface and Alerts:
Design a user-friendly interface for system monitoring and control.
Include visual and audible alerts for smoke detection and system malfunctions.
Testing and Calibration:
Conduct thorough testing and calibration of the smoke detector, exhaust system, and dialer to ensure
accurate and reliable operation.
Perform regular maintenance checks to maintain system performance.
Compliance and Safety:
Ensure the system meets relevant safety standards and regulations.
Incorporate safety features such as fail-safes and redundancies to prevent system failures.
Integration and Scalability:
Design the system to be easily integrated with existing home or building automation systems.
Ensure the system is scalable to cover larger areas or multiple zones within a building.
Documentation and Training:
Provide comprehensive documentation for installation, operation, and maintenance.
Offer training for users to understand the system's functionality and emergency procedures.
Cost-effectiveness:
Optimize the design to be cost-effective without compromising on safety and reliability"
1.3 LITERATURE REVIEW
Smoke detectors are critical components in fire safety, providing early warning of fire hazards.
Integrating automatic exhaust systems and dialer functionality into smoke detectors enhances their
effectiveness by actively mitigating smoke and alerting authorities promptly. This review explores the
advancements, technologies, and applications of smoke detectors with automatic exhaust and dialer systems.
Historical Context and Evolution
1 Early Smoke Detectors: The first smoke detectors were developed in the early 20th century, primarily
using ionization and photoelectric sensors. Ionization detectors respond quickly to flaming fires, while
photoelectric detectors are more responsive to smoldering fires.
2 Advancements: Over the decades, smoke detectors have evolved to include more sophisticated sensing
technologies, improved sensitivity, and better integration with other safety systems.
Components and Technologies
1 Sensing Technologies:
Ionization Sensors: Detect smoke particles by ionizing air and measuring electrical current changes.
Photoelectric Sensors: Use a light beam to detect smoke particles scattering light.
Dual-Sensor Detectors: Combine both ionization and photoelectric sensors to provide comprehensive
detection.
2 Automatic Exhaust Systems:
Design and Functionality: Automatic exhaust systems are designed to remove smoke from an area to
improve visibility and air quality. These systems can be integrated into smoke detectors to activate upon
smoke detection.
Types: Exhaust systems can include fans, ducts, and air purifiers, each tailored to specific environments and
smoke types.
3 Dialer Systems:
Automatic Dialers: Upon detecting smoke, these systems automatically call emergency services, alert
building occupants, or notify designated contacts.
Communication Technologies: Dialer systems use landline, cellular, or internet-based communications to
ensure messages are sent promptly and reliably.
Integration and Synergy
1 System Integration:
Smart Home Integration: Modern smoke detectors can be integrated with smart home systems, allowing for
remote monitoring and control.
Building Management Systems: In commercial and industrial settings, smoke detectors with exhaust and
dialer capabilities can be integrated into larger building management systems for centralized control.
2 Synergy Between Components:
Collaborative Functioning: The combination of smoke detection, exhaust, and dialer systems creates a multi-
layered approach to fire safety, ensuring not only detection but also active smoke management and
immediate alerting.
Case Studies and Applications
1 Residential:
Smart Homes: Examples of smoke detectors integrated with smart home systems, providing not only fire
safety but also overall home security and automation.
2 Commercial:
Office Buildings: Deployment in office buildings where early detection and smoke management are crucial
for occupant safety and business continuity.
3 Industrial:
Manufacturing Plants: Usage in environments with high fire risk, where immediate exhaust and notification
are critical to preventing large-scale damage.
Challenges and Future Directions
1 Technical Challenges:
False Alarms: Minimizing false alarms while maintaining sensitivity.
Power Supply: Ensuring reliable power supply for integrated systems.
2 Regulatory and Compliance Issues:
Standards and Certification: Adhering to safety standards and obtaining necessary certifications for
integrated systems.
3 Future Trends:
Artificial Intelligence: Utilizing AI for more accurate detection and response.
systems.
Sustainability: Developing eco-friendly systems with reduced environmental impact
The integration of automatic exhaust systems and dialers into smoke detectors represents a
significant advancement in fire safety technology. By providing comprehensive detection.
Active smoke management, and prompt notification, these systems enhance the overall safety of
residential, commercial, and industrial environments. Continued research and development in this field are
essential to address current challenges and leverage emerging technologies for even greater effectiveness.
CHAPTER - 2
EMBEDDED SYSTEMS
2.1. INTRODUCTION TO EMBEDDED SYSTEMS
We are living in the Embedded World. You are surrounded with many embedded products and your daily
life largely depends on the proper functioning of these gadgets. Television, Radio, CD player of your living
room, Washing Machine or Microwave Oven in your kitchen, Card readers, Access Controllers, Palm
devices of your work space enable you to do many of your tasks very effectively. Apart from all these, many
controllers embedded in your car take care of car operations between the bumpers and most of the times you
tend to ignore all these controllers.
CHAPTER - 3
MICROCONTROLLERS
3.1. MICROCONTROLLER VERSUS MICROPROCESSOR
What is the difference between a Microprocessor and Microcontroller? By microprocessor is meant
the general purpose Microprocessors such as Intel's X86 family (8086, 80286, 80386, 80486, and the
Pentium) or Motorola's 680X0 family (68000, 68010, 68020, 68030, 68040, etc). These microprocessors
contain no RAM, no ROM, and no I/O ports on the chip itself. For this reason, they are commonly referred
to as general-purpose Microprocessors.
A system designer using a general-purpose microprocessor such as the Pentium or the 68040 must
add RAM, ROM, I/O ports, and timers externally to make them functional. Although the addition of
external RAM, ROM, and I/O ports makes these systems bulkier and much more expensive, they have the
advantage of versatility such that the designer can decide on the amount of RAM, ROM and I/O ports
needed to fit the task at hand. This is not the case with Microcontrollers.
A Microcontroller has a CPU (a microprocessor) in addition to a fixed amount of RAM, ROM, I/O
ports, and a timer all on a single chip. In other words, the processor, the RAM, ROM, I/O ports and the
timer are all embedded together on one chip; therefore, the designer cannot add any external memory, I/O
ports, or timer to it. The fixed amount of on-chip ROM, RAM, and number of I/O ports in Microcontrollers
makes them ideal for many applications in which cost and space are critical.
In many applications, for example a TV remote control, there is no need for the computing power of a 486
or even an 8086 microprocessor. These applications most often require some I/O operations to read signals
and turn on and off certain bits.
In the Literature discussing microprocessors, we often see the term Embedded System.
Microprocessors and Microcontrollers are widely used in embedded system products. An embedded system
product uses a microprocessor (or Microcontroller) to do one task only. A printer is an example of embedded
system since the processor inside it performs one task only; namely getting the data and printing it. Contrast
this with a Pentium based PC. A PC can be used for any number of applications such as word processor,
print-server, bank teller terminal, Video game, network server, or Internet terminal. Software for a variety of
applications can be loaded and run. Of course the reason a pc can perform myriad tasks is that it has RAM
memory and an operating system that loads the application software into RAM memory and lets the CPU
run it. In this robot as the fire sensor senses the fire, it senses the signal to microcontroller. In an Embedded
system, there is only one application software that is typically burned into ROM. An x86 PC contains or is
connected to various embedded products such as keyboard, printer, modem, disk controller, sound card, CD-
ROM drives, mouse, and so on. Each one of these peripherals has a Microcontroller inside it that performs
only one task.
CHAPTER-4
HARDWARE COMPONENTS
The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, a
USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support
the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC
adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver
chip. Instead, it features the Atmega8U2 programmed as a USB-to-serial converter. "Uno" means "One" in
Italian and is named to mark the upcoming release of Arduino 1.0. The Uno and version 1.0 will be the
reference versions of Arduino, moving forward. The Uno is the latest in a series of USB Arduino boards,
and the reference model for the Arduino platform; for a comparison with previous versions, see the index
of Arduino boards.
The Arduino Uno can be powered via the USB connection or with an external power supply. The
powersource is selected automatically.External (non-USB) power can come either from an AC-to-DC
adapter (wall-wart) or battery. The adaptercan be connected by plugging a 2.1mm center-positive plug into
the board's power jack. Leads from abattery can be inserted in the Gnd and Vin pin headers of the POWER
connector.The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V,
however, the 5Vpin may supply less than five volts and the board may be unstable. If using more than 12V,
the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts
The power pins are as follows:·
VIN. The input voltage to the Arduino board when it's using an external power source (as opposed to5
volts from the USB connection or other regulated power source). You can supply voltage throughthis
pin, or, if supplying voltage via the power jack, access it through this pin.·
5V. The regulated power supply used to power the microcontroller and other components on the board.
This can come either from VIN via an on-board regulator, or be supplied by USB or another regulated
5V supply.
3.3V.A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
GND. Ground pins.
Memory:
The Atmega328 has 32 KB of flash memory for storing code (of which 0,5 KB is used for the bootloader);
Ithas also 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM
library).
Input and Output:
Each of the 14 digital pins on the Uno can be used as an input or output, using pinMode(),
digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a
maximum of 40 mA andhas an internal pull-up resistor (disconnected by default) of 20-50 kOhms. In
addition, some pins havespecialized functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins are
connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip .
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value,
arising or falling edge, or a change in value. See the attach Interrupt() function for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog Write() function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication, which
although provided by the underlying hardware, is not currently included in the Arduino language.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is
on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 different
values). By default they measure from ground to 5 volts, though is it possible to change the upper end of
their range using the AREF pin and the analog Reference() function. Additionally, some pins have
specialized functionality:
I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire library. There are a
couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analog Reference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to
shields which block the one on the board.
Communication:
The Arduino Uno has a number of facilities for communicating with a computer, another Arduino ,or other
microcontrollers. The ATmega328 provides UART TTL (5V) serial communication, which is available on
digital pins 0 (RX) and 1 (TX). An ATmega8U2 on the board channels this serial communication over
USB and appears as a virtual com port to software on the computer. The '8U2 firmware uses the standard
USBCOM drivers, and no external driver is needed. However, on Windows, an *.inf file is required. The
Arduino software includes a serial monitor which allows simple textual data to be sent to and from the
Arduino board. The RX and TX LEDs on the board will flash when data is being transmitted via the USB-
toserialchip and USB connection to the computer (but not for serial communication on pins 0 and 1). A
SoftwareSerial library allows for serial communication on any of the Uno's digital pins. The ATmega328
also support I2C (TWI) and SPI communication. The Arduino software includes a Wire library to simplify
use of the I2C bus.
4.1.1 Arduino Uno Board:
The Arduino Uno is a microcontroller board based on the ATmega328. It has 14 digital input/output pins (of
which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a
power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller;
simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get
started.
Figure 4.1.1: Arduino Uno board
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip.
Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial
converters.
The Arduino Uno can be powered via the USB connection or with an external power supply. The
power source is selected automatically. External (non-USB) power can come either from an AC-to-DC
adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into
the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER
connector. The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V,
however, the 5V pin may supply less than five volts and the board may be unstable. If using more than
12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.
1. USB Interface:
Arduino board can be powered by using the USB cable from your computer. All you need to do is connect
the USB cable to the USB connection
2. External power supply:
Arduino boards can be powered directly from the AC mains power supply by connecting it to the power
supply (Barrel Jack)
3. Voltage Regulator:
The function of the voltage regulator is to control the voltage given to the Arduino board and stabilize the
DC voltages used by the processor and other elements.
4. Crystal Oscillator:
The crystal oscillator helps Arduino in dealing with time issues. How does Arduino calculate time? The
answer is, by using the crystal oscillator. The number printed on top of the Arduino crystal is 16.000H9H.
It tells us that the frequency is 16,000,000 Hertz or 16 MHz.
5-17.Arduino Reset:
It can reset your Arduino board, i.e., start your program from the beginning. It can reset the UNO board in
two ways. First, by using the reset button (17) on the board. Second, you can connect an external reset
button to the Arduino pin labelled RESET (5).
6-9.Pins (3.3, 5, GND, Vin):
3.3V (6): Supply 3.3 output volt
5V (7): Supply 5 output volt
Most of the components used with Arduino board works fine with 3.3 volt and 5 volt.
GND (8)(Ground): There are several GND pins on the Arduino, any of which can be used to ground
your circuit.
Vin (9): This pin also can be used to power the Arduino board from an external power source, like AC
mains power supply.
Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The Port
C pins are tri-stated when a reset condition becomes active, even if the clock is not running.
PC6/RESET:
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the electrical
characteristics of PC6 differ from those of the other pins of Port C.
If the RSTDISBL Fuse is unprogrammed, PC6 is used as a Reset input. A low level on this pin for longer
than the minimum pulse length will generate a Reset, even if the clock is not running. Shorter pulses are
not guaranteed to generate a Reset.
Port D (PD[7:0]):
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port D
output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs,
Port D pins that are externally pulled low will source current if the pull-up resistors are activated. The Port
D pins are tri-stated when a reset condition becomes active, even if the clock is not running.
AVCC: AVCC is the supply voltage pin for the A/D Converter, PC[3:0], and PE[3:2]. It should be
externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to
VCC through a low-pass filter. Note that PC[6:4] use digital supply voltage, VCC.
AREF: AREF is the analog reference pin for the A/D Converter.
ADC [7:6] (TQFP and VFQFN Package Only): In the TQFP and VFQFN package, ADC[7:6] serve as
analog inputs to the A/D converter. These pins are powered from the analog supply and serve as 10-bit
ADC channels.
4.2 LIQUID CRYSTAL DISPLAY
4.2.1 Introduction To Lcd
A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or
monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of a column of liquid
crystal molecules suspended between two transparent electrodes, and two polarizing filters, the axes of
polarity of which are perpendicular to each other.
Without the liquid crystals between them, light passing through one would be blocked by the other.
The liquid crystal twists the polarization of light entering one filter to allow it to pass through the other.
A program must interact with the outside world using input and output devices that communicate directly
with a human being. One of the most common devices attached to an controller is an LCD display. Some
of the most common LCDs connected to the controllers are 16X1, 16x2 and 20x2 displays. This means 16
characters per line by 1 line 16 characters per line by 2 lines and 20 characters per line by 2 lines,
respectively.
Many microcontroller devices use ‘smart LCD’ displays to output visual information. LCD displays
designed around LCD NT-C1611 module, are inexpensive, easy to use, and it is even possible to produce a
readout using the 5X7 dots plus cursor of the display.
They have a standard ASCII set of characters and mathematical symbols. For an 8-bit data bus, the
display requires a +5V supply plus 10 I/O lines (RS,RW,D7, D6,D5,D4,D3,D2,D1,D0).
For a 4-bit data bus it only requires the supply lines plus 6 extra lines(RS,RW,D7,D6,D5,D4)
When the LCD display is not enabled, data lines are tri-state and they do not interfere with the operation of
the microcontroller.
Pin1 (Ground/Source Pin): This is a GND pin of display, used to connect the GND terminal of the
microcontroller unit or power source.
Pin2 (VCC/Source Pin): This is the voltage supply pin of the display, used to connect the supply pin of
the power source.
Pin3 (V0/VEE/Control Pin): This pin regulates the difference of the display, used to connect a changeable
POT that can supply 0 to 5V.
Pin4 (Register Select/Control Pin): This pin toggles among command or data register, used to connect a
microcontroller unit pin and obtains either 0 or 1(0 = data mode, and 1 = command mode).
Pin5 (Read/Write/Control Pin): This pin toggles the display among the read or writes operation, and it is
connected to a microcontroller unit pin to get either 0 or 1 (0 = Write Operation, and 1 = Read
Operation).
Pin 6 (Enable/Control Pin): This pin should be held high to execute Read/Write process, and it is
connected to the microcontroller unit & constantly held high.
Pins 7-14 (Data Pins): These pins are used to send data to the display. These pins are connected in two-
wire modes like 4-wire mode and 8-wire mode. In 4-wire mode, only four pins are connected to the
microcontroller unit like 0 to 3, whereas in 8-wire mode, 8-pins are connected to microcontroller unit like
0 to 7.
Pin15 (+ve pin of the LED): This pin is connected to +5V
Pin 16 (-ve pin of the LED): This pin is connected to GND.
It allows you to connect several peripheral devices, such as sensors, displays, motor drives, and so on, with
only a few wires. Giving you lots of flexibility and speeding up your prototyping, without an abundancy of
wires.
Keep reading to learn about how it works, how it is implanted into different standards, as we as how to use
the wire library to build your own I2C devices
Communication with ICs: Many integrated circuits (ICs) support I2C for configuration and control,
such as ADCs, DACs, temperature sensors, and real-time clocks.
4.3.4 Advantages:
Simplicity: Uses only two wires for communication.
Flexibility: Supports multiple devices and allows for easy addition or removal of slaves without
reconfiguring the entire system.
Widely Adopted: Standardized protocol with broad industry support.
4.3.4 Limitations:
Speed: Relatively slow compared to other serial protocols like SPI.
Distance: Limited by capacitance and noise immunity, making it suitable primarily for short-distance
communication within a single PCB or between closely spaced devices.
Overall, I2C is a versatile and widely used protocol in embedded systems and consumer electronics
due to its simplicity, flexibility, and robustness for connecting peripherals.
4.4 GSM MODULE
4.4.1 Introduction
module in a SMT type and designed with a very powerful single-chip processor integrating AMR926EJ-S
core, allowing you to benefit from small dimensions and cost-effective solutions.
4.4.2 Specification
Dual-Band 900/ 1800 MHz
GPRS multi-slot class 10/8GPRS mobile station class B
Compliant to GSM phase 2/2+
Dimensions: 24*24*3 mm
Weight: 3.4g
Control via AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced AT Commands)
Supply voltage range : 5V
Low power consumption: 1.5mA (sleep mode)
Operation temperature: -40°C to +85 °
4.4.3 Features:
1. GSM/GPRS Connectivity:
o GSM (Global System for Mobile Communications): Standard for 2G mobile networks,
allowing voice calls and SMS.
o GPRS (General Packet Radio Service): Packet-switched data service over GSM networks
for internet connectivity.
2. SIM Interface:
o Supports a standard SIM card for authentication and network access.
3. Serial Communication:
o Communicates with a host microcontroller or computer via a serial UART interface (typically
TTL level).
4. AT Commands:
o Controlled via AT commands, a standard set of instructions for configuring and controlling
the modem.
5. Integrated TCP/IP Stack:
o Allows for internet connectivity and data transfer over GPRS.
6. Digital and Analog I/O:
o Typically includes GPIO pins and ADC inputs for interfacing with sensors and actuators.
7. Power Supply:
o Operates on a wide range of voltages (often 5V or 3.3V).
4.4.4 Operation:
Initialization: Upon power-up or reset, the SIM900 module initializes and searches for a GSM
network.
Network Registration: The module registers with the network using the SIM card's credentials
(IMSI, ICCID).
Data Transmission: Supports SMS (Short Message Service), voice calls, and GPRS data
transmission.
AT Command Interface: Communication with the module is primarily through AT commands sent
over the UART interface. These commands configure settings, initiate calls, send SMS, etc.
4.4.5 Applications:
IoT Applications: Used in IoT projects for remote monitoring and control using GSM/GPRS
networks.
M2M Communication: Machine-to-Machine communication for transmitting data from sensors or
devices to a central server.
Remote Monitoring: Monitoring of equipment and systems in remote locations where wired internet
connectivity is unavailable or impractical.
Vehicle Tracking: Integrated into GPS-based vehicle tracking systems for real-time location
monitoring.
Limitations:
2G Technology: Limited to 2G networks, which may not be available in some regions or may be
phased out in favor of newer technologies like 3G, 4G, or 5G.
Data Rate: Relatively slower data rates compared to newer mobile technologies like LTE.
Considerations:
Power Consumption: Careful consideration of power consumption is necessary for battery-operated
applications.
Antenna: Proper antenna selection and placement are critical for optimal performance and network
connectivity.
The SIM900 module remains popular due to its affordability, ease of integration, and widespread support for
GSM/GPRS networks, making it a versatile choice for embedded systems requiring wireless communication
capabilities.
The MQ2 sensor is one of the most widely used in the MQ sensor series. It is a MOS (Metal Oxide
Semiconductor) sensor. Metal oxide sensors are also known as Chemiresistors because sensing is based on
the change in resistance of the sensing material when exposed to gasses.
The MQ2 gas sensor operates on 5V DC and consumes approximately 800mW. It can
detect LPG, Smoke, Alcohol, Propane, Hydrogen, Methane and Carbon Monoxide concentrations
ranging from 200 to 10000 ppm.
1. Detection Capability: It can detect smoke, as well as gases like LPG, propane, methane, alcohol,
hydrogen, and carbon monoxide.
2. Working Principle: The sensor operates on the principle of detecting changes in conductivity when
gases come into contact with its sensitive layer, which typically consists of a tin dioxide (SnO2)
semiconductor.
3. Response Time: The response time of the sensor varies depending on the concentration of the gas
but is generally quick enough for early detection purposes.
4. Calibration: MQ-series sensors usually require some level of calibration and conditioning before use
to ensure accurate readings.
5. Interface: It typically interfaces with microcontrollers like Arduino, Raspberry Pi, or directly with
analog-to-digital converters (ADCs) for processing and analysis.
A 12V 2A (amp) adapter is a power supply device designed to provide electrical power to devices that
require a 12-volt direct current (DC) input, with a maximum current draw of up to 2 amps. Here are the key
features and aspects of such an adapter:
4.6.1 Features and Specifications:
1.Voltage Output: Provides a stable output voltage of 12 volts DC. This is suitable for powering a wide
range of electronic devices that operate on 12V DC input, such as routers, LED strips, CCTV cameras, and
various electronic gadgets.
2. Current Capacity: Capable of supplying a maximum current of 2 amps (2A). This means it can deliver up
to 2 amps of current without exceeding its rated capacity. Devices that require less than 2A will safely
operate with this adapter.
3. Connector Type: Typically comes with a DC barrel connector, which is a common standard for such
adapters. The connector size (inner and outer diameter) can vary, so it's important to ensure compatibility
with the device you intend to power.
4. Safety Features:
- Overcurrent Protection: Designed to protect against excessive current draw, which could potentially
damage the adapter or the connected device.
- Overvoltage Protection: Ensures that the output voltage does not exceed 12V DC, protecting the device
from voltage spikes.
- Short Circuit Protection: Automatically shuts off power output in case of a short circuit, preventing
damage to the adapter and connected devices.
5. Efficiency: Generally designed to be energy-efficient, converting AC (alternating current) from the mains
power supply to stable DC output with minimal loss and heat generation.
6. Compatibility: Suitable for a wide range of electronic devices and applications that specify a 12V DC
input and draw up to 2A of current. Common applications include:
- Powering LED lighting setups, such as LED strips or bulbs.
- Powering networking equipment like routers, switches, and modems.
- Providing power to CCTV cameras and security systems.
- Powering small electronics projects and DIY gadgets.
Example Usage:
- Home and Office: Use it to power LED lighting strips under cabinets or behind TVs, providing decorative
or functional lighting.
- Electronics Projects: Ideal for powering Arduino or Raspberry Pi projects that require a stable 12V supply.
- Security Systems: Powering CCTV cameras and DVRs in a surveillance setup.
Considerations:
Compatibility: Ensure the adapter's output voltage (12V) and current capacity (2A) match the
requirements of your device.
Connector Size: Verify the DC connector size and polarity to ensure it matches the device you are
connecting it to. Incorrect polarity can damage your device.
Quality and Safety: Opt for adapters from reputable manufacturers to ensure reliability and safety
features like overcurrent and overvoltage protection.
In summary, a 12V 2A adapter is a versatile power supply solution for various electronics and DIY
projects requiring a stable 12V DC power source with moderate current requirement
4.7 BUZZER
Electronic component that generates sound through the transmission of electrical signals. Its primary
function is to provide an audible alert or notification and typically operates within a voltage range of 5V to
12V.
Frequency and Sound Output: Choose a buzzer with a suitable frequency and loudness level
depending on the application's requirements.
Power Consumption: Consider the power consumption of the buzzer, especially in battery-operated
devices.
Durability: Ensure the buzzer is durable and can withstand environmental conditions if used in outdoor
or harsh environments.
Control Interface: Understand how the buzzer is activated and controlled (e.g., voltage level, digital
signal) to integrate it effectively into your circuit or system.
Buzzers are versatile and essential components in electronics, providing an effective means of
auditory communication in a wide range of devices and applications.
4.7.3 Specifications
The specifications of the buzzer include the following.
Color is black
The frequency range is 3,300Hz
Operating Temperature ranges from – 20° C to +60°C
Operating voltage ranges from 3V to 24V DC
The sound pressure level is 85dBA or 10cm
The supply current is below 15mA
4.7.4 Advantages
The advantages of a buzzer include the following.
Simply Compatible
Frequency Response is Good
Size is small
Energy Consumption is less
The Range of Voltage usage is Large
Sound Pressure is high
4.7.4 Disadvantages
The disadvantages of the buzzer include the following.
Controlling is a little hard
Generates Annoying Sound
Training is necessary to know how to repair the condition without just turning off.
4.7.5 Applications
Considerations:
Load Ratings: Ensure the relay can handle the voltage and current ratings of your load without
exceeding its specifications.
Relay Lifetime: Consider the expected number of operations (cycles) the relay can handle over its
lifetime, which is typically specified in millions of operations.
Protection: Use flyback diodes (for inductive loads) and snubber circuits (for switching noise
suppression) as needed to protect the relay and ensure reliable operation.
4.8.2 Features
Normal Voltage is 5V DC
Normal Current is 70mA
AC load current Max is 10A at 250VAC or 125V AC
DC load current Max is 10A at 30V DC or 28V DC
It includes 5-pins & designed with plastic material
Operating time is 10msec
Release time is 5msec
Maximum switching is 300 operating per minute.
4.8.3 Working
The relay uses the current supply for opening or closing switch contacts. Usually, this can be done through a
coil to magnetize the switch contacts & drags them jointly once activated. A spring drives them separately
once the coil is not strengthened.
By using this system, there are mainly two benefits, the first one is, the required current for activating the
relay is less as compared to the current used by relay contacts for switching. The other benefit is, both the
contacts & the coil are isolated galvanically, which means there is no electrical connection among them.
Wiring:
Control Side: Connect the 5V control signal to the relay coil terminals (typically labeled as Coil+ and
Coil-).
Load Side: Connect the high-voltage or high-current load to the relay contacts (Common, Normally
Open (NO), and Normally Closed (NC) terminals).
5V relays are widely used in electronics and DIY projects due to their compatibility with
microcontroller and low-voltage control logic levels, providing reliable switching of higher voltage or
current loads in various applications.
4.8.4 Advantages
The advantages of the relay module include the following.
4.9 EXHAUSTER-12V
An exhaust fan or exhauster that operates on 12V DC (Direct Current) is a common choice for ventilation
and cooling purposes, especially in environments where AC power may not be readily available or where
low-voltage operation is preferred. Here's a detailed overview of a 12V DC exhauster:
o Size: Available in various sizes and configurations, from small fans suitable for personal use to
larger fans for industrial applications.
o Airflow Capacity: Measured in Cubic Feet per Minute (CFM) or Cubic Meters per Hour (m³/h),
indicating the amount of air the fan can move per unit of time.
3. Construction:
o Materials: Typically constructed with durable materials such as plastic or metal, depending on the
application (e.g., corrosion resistance for outdoor use).
o Blades: Designed for efficient airflow and low noise operation.
4. Mounting Options:
o Mounting Holes: Often equipped with mounting holes for easy installation on walls, ceilings, or
panels.
o Bracket or Frame: Some models come with integrated mounting brackets or frames for secure
installation.
5. Power Consumption:
o Current Draw: Consumes power according to its size and airflow capacity. Larger fans generally
consume more power.
6. Noise Level:
o Decibel Rating: Specifies the noise level produced by the fan during operation. Quieter fans are
preferred for applications where noise is a concern.
4.9.2 Applications:
Ventilation Systems: Used to exhaust stale air and introduce fresh air in enclosed spaces such as
bathrooms, kitchens, attics, and industrial buildings.
Cooling: Helps to dissipate heat from electronic equipment, cabinets, and enclosures.
HVAC (Heating, Ventilation, and Air Conditioning): Integrated into HVAC systems for improved
air circulation and temperature control.
Renewable Energy: Suitable for use in off-grid or solar-powered setups due to their 12V DC
operation.
Installation Tips:
Power Supply: Ensure the power supply matches the fan's voltage rating (12V DC) and provides
adequate current capacity.
Airflow Direction: Install the fan to ensure proper airflow direction for effective ventilation or
cooling.
Maintenance: Periodically clean the fan blades and housing to maintain optimal performance and
airflow efficiency.
Considerations:
Environment: Choose a fan that is suitable for the environment where it will be installed (e.g.,
indoor vs. outdoor, humidity levels).
Durability: Consider the fan's durability and lifespan, especially if it will be exposed to harsh
conditions or continuous operation.
A 12V DC exhauster offers versatility and efficiency for various ventilation and cooling applications,
providing reliable performance with low-voltage power sources.
4.10 CONNECTING WIRES
Connecting wires properly is crucial for ensuring reliable electrical connections in various applications. Here
are some key tips and considerations for connecting wires:
4.10.1 Tools and Materials:
1. Wire Strippers: Use wire strippers to remove insulation from the ends of wires cleanly and without
damaging the conductors.
2. Wire Cutters: Cut wires to the required length using wire cutters. This ensures neat connections and
prevents excess wire from protruding.
3. Soldering Iron and Solder: For more secure and durable connections, especially for low-voltage and
sensitive applications, soldering is recommended. A soldering iron and solder are essential tools for this
method.
4. Crimping Tools: Use crimping tools for creating mechanical connections with terminals or connectors.
This method is commonly used in automotive and industrial applications.
5. Heat Shrink Tubing: Optionally, use heat shrink tubing to insulate and protect soldered or crimped
connections. Heat shrink tubing shrinks when heated, providing a tight seal around the connection.
Steps for Proper Wire Connection:
1. Prepare the Wires:
o Strip the insulation carefully from the ends of the wires using wire strippers. The exposed
conductor should be just enough to make a secure connection without excess.
2. Twist Strands:
o If you're soldering, twist the individual strands of the wire together to prevent fraying and ensure
a solid connection.
3. Choose the Connection Method:
o Soldering: Heat the soldering iron and apply solder to the joint. Ensure the solder flows evenly
and covers the exposed wires for a secure bond.
o Crimping: Insert the stripped wire into the terminal or connector, then crimp securely using the
appropriate tool. Check for a tight connection.
4. Insulate the Connection:
o If soldering, slide a piece of heat shrink tubing over the soldered joint before soldering. After
soldering, move the tubing over the joint and heat it with a heat gun or lighter to shrink it tightly
around the connection.
o For crimped connections, ensure any insulation provided by the connector or terminal is properly
seated and covers exposed conductors.
5. Test the Connection:
o After completing the connection, test it for continuity and secureness. Ensure there are no loose
connections or exposed conductors that could lead to short circuits or electrical hazards.
By following these steps and tips, you can effectively connect wires for various electrical and electronic
projects, ensuring safety, reliability, and longevity of your connections.
Flexibility: Allow for easy and quick adjustments in circuit connections during prototyping and testing
phases without the need for soldering.
Breadboarding: Ideal for connecting components on breadboards to create and test circuits. They help
in quickly iterating designs and testing hypotheses.
Temporary Connections: Useful for troubleshooting and debugging by quickly connecting or bypassing
components to isolate issues.
Color Coding: Often available in different colors (such as red, black, blue, green) for organizing and
visually distinguishing different signal paths or connections.
4.11.3 Advantages:
Time-Saving: Eliminates the need for soldering and desoldering when making temporary connections or
testing different configurations.
Reusable: Can be reused multiple times, making them cost-effective and environmentally friendly
compared to single-use solutions.
Versatility: Suitable for a wide range of electronics projects, from simple hobbyist circuits to complex
prototypes in engineering and development.
Considerations:
Length: Choose the appropriate length to comfortably span the distance between components on your
breadboard or circuit board.
Connector Type: Ensure the jumper cables have connectors (male headers, female headers, alligator
clips) that match the components or test points you are connecting.
Quality: Opt for quality cables with well-insulated connectors to prevent short circuits and ensure
reliable connections.
Handle with Care: Avoid bending or pulling the cables excessively to prevent damage to the connectors
or wires.
Organize: Keep your workspace tidy by organizing jumper cables by color or length for easier
identification and access.
Labeling: Consider labeling cables or using color-coded systems to easily identify connections in
complex circuits.
Jumper cables are indispensable tools in electronics prototyping and testing, offering flexibility and
convenience in quickly establishing connections and experimenting with circuit designs.
7. Signal Traces: Design signal traces with appropriate spacing and thickness to minimize interference and
ensure signal integrity across the board.
8. Silkscreen Layer: Use the silkscreen layer effectively to provide component outlines, reference
designators, and other essential information for assembly and maintenance.
9. Environmental Considerations: Depending on the application, consider factors like temperature
resistance, moisture protection, and material choice (FR4 is common for general-purpose PCBs).
10. Documentation: Provide comprehensive documentation including schematics, bill of materials (BOM),
and assembly instructions to aid users in understanding and utilizing the PCB.
4.12.1 Advantages of using General Purpose PCB
Low cost.
Perfect for Prototyping and testing small circuits.
Perfect for all who are starting with Electronics.
Short Design Time
You can change the circuit at any time
Disadvantages of using General Purpose PCB
Cannot be used for Mass Production.
Difficult to Repair or Troubleshoot.
Soldering skills required.
Difficult to use for complex circuits.
4.13 1000ΜF CAPACITORS
This capacitor has a capacitance of 1000 µF, which is 10 times greater than the 100 µF capacitor.
It is used in applications where larger capacitance values are needed, such as for energy storage,
filtering in power supplies, and smoothing voltage spikes.
It's effective in reducing ripple voltage in power supplies and stabilizing voltage levels in circuits that
require steady DC voltages.
Due to its higher capacitance, it is typically larger in physical size compared to smaller capacitors.
CHAPTER-5
WORKING
A smoke detector with an automatic exhaust system and dialer combines several technologies to
enhance fire safety. Here's an overview of how such a system works:
Smoke Detector:
Detection: The smoke detector senses smoke particles in the air using either an ionization sensor (for
detecting smaller particles, typically from flaming fires) or a photoelectric sensor (for detecting larger
particles, typically from smoldering fires). Some advanced models use a combination of both.
Alarm Activation: When smoke is detected, the smoke detector triggers an audible alarm to alert
occupants.
Automatic Exhaust System:
Activation: Upon detecting smoke, the smoke detector sends a signal to the exhaust system.
Exhaust Fans: The exhaust system typically includes fans or ventilators that are automatically activated to
remove smoke from the area. This helps to clear the air, making it easier for occupants to see and breathe,
and also helps to prevent smoke inhalation.
Air Quality Monitoring: Some systems may include sensors to monitor air quality continuously and
adjust the exhaust system operation as needed.
Dialer System:
Signal Transmission: When the smoke detector is triggered, it sends a signal to the dialer system.
CHAPTER-6
SOFTWARE
6.1 Introduction of Arduino Ide
Information (Mac).
Test Connection (Optional): To make sure everything is set up correctly, you can upload a simple
sketch to your Arduino Nano. Open the "Blink" example sketch (File -> Examples -> 01.Basics ->
Blink). This sketch will make the onboard LED on pin 13 blink on and off. Click the "Upload" button
(the right arrow icon) in the Arduino IDE toolbar. If the upload is successful, you should see the LED on
your Arduino Nano blinking.
Start Programming: Now you're ready to start writing your own Arduino sketches! You can find
plenty of tutorials and examples online to help you get started with different projects and components
CHAPTER-7
RESULT
A smoke detector with auto exhaust and dialer automatically detects smoke or fire, sounds a local
alarm, and activates peripheral equipment like an auto dialer. It can notify authorities or designated contacts,
ensuring quick response. Some models also support auto flooding systems and power-off features1. These
systems are essential for enhancing safety in homes, offices, and industrial settings
CHAPTER-8
ADVANTAGES & APPLICATIONS
8.1 Advantages:
1. Early Detection: Quickly identifies smoke or fire, allowing for prompt action.
2. Automatic Notification: Alerts authorities or designated contacts automatically.
3. Enhanced Safety: Reduces response time, potentially saving lives and property.
4. Remote Monitoring: Allows for monitoring from a distance, ensuring safety even when not on-site.
5. Integration: Can be integrated with other safety systems like auto flooding.
8.2 Applications
1. Residential Buildings: Ensures safety in homes.
2. Commercial Properties: Protects offices, warehouses, and other commercial spaces.
3. Industrial Settings: Enhances safety in factories and industrial plants.
4. Automotive Diagnostics: Detects leaks in vehicle exhaust systems.
5. Healthcare Facilities: Critical for patient safety in hospitals.
CHAPTER-9
CONCLUSION & FUTURE SCOPE
9.1 Conclusion:
Smoke detectors with auto exhaust and dialer systems represent a leap forward in fire safety
technology. By integrating early detection, automatic notification, and exhaust management, these systems
ensure a rapid and comprehensive response to fire emergencies. Their ability to alert both occupants and
emergency services drastically reduces response times, potentially saving lives and mitigating property
damage. These systems are particularly valuable in environments where immediate action is critical, such as
residential buildings, commercial properties, and industrial settings.
Despite their advantages, these systems come with certain drawbacks, including higher costs and the
need for regular maintenance. False alarms can also pose challenges, though advancements in sensor
technology and AI may address these issues in the future. Overall, smoke detectors with auto exhaust and
dialer systems provide a robust solution for enhancing fire safety and protection.
CHAPTER-10
SOURCE CODE
#define smokeSensor 4
#define buzzer 13
#define relay 5
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line
display
int gasReading = 0;
#define rxPin 2
#define txPin 3
int flag = 0;
void okcheck() {
do {
rcr = sim900.read();
Serial.println("at ok");
void gsminit() {
sim900.write("AT\r\n");
okcheck();
sim900.write("ATE0\r\n");
okcheck();
sim900.write("AT+CMGF=1\r\n");
//okcheck();
void lcd_cl() {
delay(500);
lcd.clear();
lcd.setCursor(0, 0);
sim900.print("AT+CMGF=1\r");
delay(1000);
delay(1000);
sim900.print(text);
delay(100);
sim900.write(0x1A);
delay(1000);
void setup() {
lcd.init();
lcd.clear();
sim900.begin(9600);
Serial.begin(9600);
lcd.backlight();
lcd.setCursor(0, 0);
lcd.setCursor(2, 1);
lcd.print("ALERT SYSTEM");
delay(2000);
lcd.clear();
pinMode(smokeSensor, INPUT);
pinMode(buzzer, OUTPUT);
pinMode(relay, OUTPUT);
digitalWrite(buzzer, LOW);
digitalWrite(relay, HIGH);
lcd_cl();
lcd.print("Initializing GSM");
lcd.setCursor(2, 1);
lcd.print("module");
gsminit();
lcd_cl();
lcd.print("Initialized GSM");
lcd.setCursor(2, 1);
lcd.print("module");
delay(1000);
lcd_cl();
lcd.print("Registerednumber");
lcd.setCursor(2, 1);
lcd.print(PHONE);
sendSms("reg");
delay(5000);
Serial.print("init done");
Serial.print(flag);
void loop() {
gasReading = digitalRead(smokeSensor);
if (gasReading == 0) {
digitalWrite(buzzer, HIGH);
digitalWrite(relay, LOW);
if (flag == 1) {
lcd_cl();
lcd.print("Alert !!!");
lcd.setCursor(0, 1);
lcd.print("Smoke Detected");
sendSms("Alert !!! \n Smoke detected Exhaust Fan Turned ON.\n Please leave the
room.");
flag = 0;
delay(5000);
make_call();
} else {
digitalWrite(buzzer, LOW);
digitalWrite(relay, HIGH);
if (flag == 0) {
lcd_cl();
lcd.print("No Smoke");
lcd.setCursor(0,1);
lcd.print("Detected");
sendSms("No Smoke");
flag = 1;
void make_call() {
Serial.println("calling");
delay(500);
lcd.clear();
lcd.print("Calling...");
sim900.println("ATD+919182821656;");
okcheck();
delay(500);
sim900.println("ATD+919182821656;");
okcheck();
lcd.clear();
lcd.print("Call Ended");
sim900.println("ATH"); //hang up
Serial.println("call ended");
delay(500);