Varma
Varma
BACHELOR OF TECHNOLOGY
in
ELECTRONICS AND COMMUNICATION ENGINEERING
By
1
SAGI RAMA KRISHNAM RAJU ENGINEERING COLLEGE
(Autonomous)
China Amiram, Bhimavaram
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
CERTIFICATE
This is to certify that the Summer Internship Report titled “ARDUINO BASED
SMART STREET LIGHT CONTROLLING SYSTEM” is the Bonafide work done by Mr.
2
Acknowledgement
I take immense pleasure in thanking Dr. N. Udaya Kumar, Professor & Head
of the Department ECE , and Dr. K. R. Satyanarayana, Dean Training &
Placement Cell, SRKR Engineering College, Bhimavaram for having
permitted me to carry out this project work .
3
4
CONTENTS
1 Abstract 6
3 7
Mention the tools and applications
4 Detail description of the sub models 8-17
7 Result 26
8 Conclusion 27
In conclusion, this project provides an efficient and effective way to ensure safety
in different environments and can potentially prevent accidents or disasters. The
system's simplicity, reliability, and flexibility make it a valuable tool for safety
management and have significant implications for the future of safety monitoring.
6
Problem Statement and Overview
The primary issue addressed by this project is the lack of timely detection and
alert mechanisms for gas leaks in various environments. Many existing systems
are either too expensive, complicated, or lack the necessary sensitivity to detect
low concentration leaks early enough to prevent hazards. This project aims to
gas leaks, trigger alarms, display alert through lcd display and enhance safety.
The main tool used in this project is the Arduino microcontroller, chosen for its
versatility, ease of use, and wide range of compatible sensors and modules. The
project also utilizes the MQ-2 gas sensor, which is highly sensitive to various
gases, including methane, butane, LPG, and smoke. Other components include a
buzzer for auditory alerts, an LCD display for real-time monitoring, and a relay
module for controlling the gas supply valve. The system's software is developed
using the Arduino Integrated Development Environment (IDE), leveraging
libraries for sensor data processing and alert mechanisms.
7
Detailed description of the sub modules:
1. Arduino Uno microcontroller
The Arduino Uno is a popular choice for hobbyists and professionals alike due to
its versatility, ease of use, and low cost. It can be used for a wide range of projects,
from simple LED blinking programs to complex robotic systems. The open-
source nature of the Arduino platform also means that there is a large and
- Microcontroller: ATmega328P
- Operating Voltage: 5V
- SRAM: 2 KB (ATmega328P)
9
- EEPROM: 1 KB (ATmega328P)
- Weight: 25 g
10
Figure 2 LCD 16*2
An LCD display 16x2 with I2C module is a popular combination for many
Arduino projects. I2C (Inter-Integrated Circuit) is a communication protocol that
allows two or more devices to communicate with each other using only two wires,
a clock line (SCL) and a data line (SDA). This makes it easy to connect multiple
devices to a microcontroller, like the Arduino Uno, without using up a lot of pins.
11
The I2C module for the LCD display is a small circuit board that is soldered onto
the back of the LCD display. It contains a chip called PCF8574, which actsas an
I/O expander. This chip allows the Arduino to communicate with the LCDdisplay
using only two pins (A4 and A5) instead of the normal 6 or 7 pins required to
control the LCD display.
To use the LCD display 16x2 with I2C module, you will need to install the
LiquidCrystal_I2C library in the Arduino IDE. This library contains functions
that simplify the process of controlling the LCD display, such as printing text on
the screen, clearing the display, and controlling the backlight.
To initialize the LCD display, you will need to create an instance of the
LiquidCrystal_I2C object, passing in the I2C address of the PCF8574 chip on the
module (usually 0x27 or 0x3F). Then, you can use the functions provided bythe
library to control the display.
7. Supply voltage: 5V DC
9. Built-in character set supports English and Japanese text (other characters can
be programmed)
10. Comes with a 4-pin cable for easy connection to Arduino or other
microcontrollers
11. Compatible with Arduino Liquid Crystal library and other LCD libraries
The MQ-2 gas sensor has a high sensitivity and a fast response time. It can detect
gas concentrations in the range of 200 to 10000 ppm with an accuracy of
± 10%. The sensor has a long life and can operate at a temperature range of - 10°C
to 50°C and a humidity range of 5% to 95%. The MQ-2 gas sensor module has
13
two output pins, one analog and one digital. The analog pin provides a continuous
voltage output proportional to the gas concentration, while the digital pin
provides a high or low output depending on the gasconcentration. The module
also has a potentiometer to adjust the sensitivity of the sensor.
The MQ-2 gas sensor can be easily interfaced with microcontrollers like Arduino,
Raspberry Pi, and others. It can be used in various applications such asgas leak
detection, fire detection, industrial process monitoring, and environmental
monitoring.
However, the MQ-2 gas sensor has some limitations, it can detect only certain
types of gases and is sensitive to humidity and temperature changes. It is also
affected by other gases and chemicals present in the air, which can lead to false
readings. Therefore, it is important to calibrate the sensor before use and regularly
check its performance.
14
andsmoke
- Weight: 5g
- Detection range: 300 to 10,000 ppm for smoke, 100 to 10,000 ppm for
LPG,300 to 10,000 ppm for propane, and 200 to 10,000 ppm for methane
4. Buzzer
A buzzer is a type of electronic audio signalling device that produces a loud and
distinctive sound. It is commonly used as an alerting device to notify people of
events or conditions that require attention. The buzzer works by converting
electrical energy into mechanical vibrations that produce sound waves in the air.
Buzzer technology has been around for many years, and the basic design of a
buzzer has remained the same. A typical buzzer consists of a coil of wire, a
15
diaphragm, and a magnet. When a current is passed through the coil of wire, it
creates a magnetic field that attracts the diaphragm towards the magnet. As the
diaphragm moves towards the magnet, it vibrates and produces sound waves.
Figure 7 Buzzer
There are different types of buzzers available in the market, including active and
passive buzzers. An active buzzer produces sound on its own when it is connected
to a power source, whereas a passive buzzer requires an external signal to produce
sound. The sound produced by a buzzer can vary in frequency and volume
depending on the design and specifications of the buzzer. Some buzzers produce
a continuous tone, while others produce a pulsed tone. Buzzer sound frequency is
usually measured in Hertz (Hz), and the range of frequency produced by a buzzer
can vary from a few hundred Hz to several kHz. In electronic circuits, buzzers are
commonly used as alarm devices, warning signals, or to indicate the presence of
a condition. They can be found in a variety of applications, including appliances,
automobiles, medical devices, security systems, and more. With their simple
design and ease of use, buzzers are a versatile and reliable solution for audio
signalling.
16
2.7.1 Specifications of the Buzzer
Here are some common specifications of a buzzer:
1. Operating voltage: This is the voltage range in which the buzzer can operate.
It is typically given as a range, such as 5-12 volts.
2. Frequency range: This is the range of frequencies at which the buzzer can
operate and produce sound. It is typically given in Hertz (Hz) and can range from
a few hundred Hz to tens of thousands of Hz.
3. Sound pressure level (SPL): This is a measure of the loudness of the buzzer,
typically given in decibels (dB). The SPL can range from around 60 dB to over
100 dB for a standard buzzer.
4. Current draw: This is the amount of current the buzzer requires to operate and
produce sound. It is typically given in milliamps (mA) and can range from a few
milliamps to several hundred milliamps.
6. Housing material: This is the material used to construct the housing of the
buzzer. It can be plastic, metal, or other materials depending on the application.
8. Size and shape: This is the physical size and shape of the buzzer. It can vary
widely depending on the application, from small, compact buzzers to larger, more
robust models.
17
9. Design or flow of the project:
MQ2
sensor
Implementation
The implementation of this project involves connecting the various components
to the Arduino Uno board and uploading the code to the board. The first step is to
connect the DHT11 temperature and humidity sensor to the digital pin 2 ofthe
Arduino Uno board. The MQ-2 gas sensor and the flame sensor are connected to
analog pin A0 and digital pin 3 respectively. The LED and buzzer are connected
to digital pins 4 and 13 respectively.
Next, the LCD display with the I2C module is connected to the Arduino Uno
18
board. The SDA and SCL pins of the I2C module are connected to analog pins
A4 and A5 of the Arduino Uno board respectively. The VCC and GND pins of
the I2C module are connected to the 5V and GND pins of the Arduino Uno board
respectively.
After connecting all the components, the code is uploaded to the Arduino Uno
board using the Arduino IDE. The code first initializes all the components and
sets the necessary pin modes. It then reads the temperature, humidity, gas level,
and flame detection values from the sensors. The temperature and gas level values
are displayed on the first row of the LCD display, while the flame detection value
is displayed on the second row of the LCD display.
The code then checks whether the temperature is above a threshold value or
whether gas or flame is detected. If any of these conditions are met, the LED
and buzzer are turned on to alert the user. If none of these conditions are met, the
LED and buzzer are turned off.
Here are the step-by-step instructions for assembling the hardware of the project:
1. Gather all the necessary components such as Arduino Uno, LCD display 16x2
with I2C module, DHT11 temperature and humidity sensor, MQ-2 gas sensor,
flame sensor, LED, buzzer, breadboard, and jumper wires.
2. Connect the I2C module to the LCD display using the jumper wires. Connect
the SDA pin of the I2C module to the A4 pin of the Arduino and connect the SCL
19
pin of the I2C module to the A5 pin of the Arduino.
3. Connect the DHT11 sensor to the Arduino. Connect the positive pin of the
DHT11 sensor to the 5V pin of the Arduino, the negative pin to the GND pin of
the Arduino, and the data pin to the digital pin 2 of the Arduino.
4. Connect the MQ-2 gas sensor to the Arduino. Connect the VCC pin of the
sensor to the 5V pin of the Arduino, the GND pin to the GND pin of the Arduino,
and the A0 pin to the analog pin A0 of the Arduino.
5. Connect the flame sensor to the Arduino. Connect the VCC pin of the sensor
to the 5V pin of the Arduino, the GND pin to the GND pin of the Arduino, and
the digital pin 3 to the digital pin 3 of the Arduino.
6. Connect the LED to the Arduino. Connect the anode pin (longer pin) of the
LED to the digital pin 4 of the Arduino and connect the cathode pin (shorter pin)
of the LED to the GND pin of the Arduino through a 220-ohm resistor.
7. Connect the buzzer to the Arduino. Connect the positive pin of the buzzer to
the digital pin 13 of the Arduino and connect the negative pin of the buzzer to the
GND pin of the Arduino.
10. Connect the LED to the Arduino. Connect the anode pin (longer pin) of the
LED to the digital pin 4 of the Arduino and connect the cathode pin (shorter pin)
of the LED to the GND pin of the Arduino through a 220-ohm resistor.
11. Connect the buzzer to the Arduino. Connect the positive pin of the buzzer to
the digital pin 13 of the Arduino and connect the negative pin of the buzzer to the
GND pin of the Arduino.
20
12. Place all the components on the breadboard according to the connections
mentioned above.
13. Upload the code to the Arduino board using the Arduino IDE.
14. Power on the circuit and verify that the LCD is displaying the temperature,
humidity, gas level, and flame detection status.
15. Test the system by increasing the temperature, exposing the gas sensor to gas,
and bringing the flame sensor close to a flame. The LED should turn on and the
buzzer should make a sound when any of these events occur.
After assembling the hardware, testing the system is necessary to ensure that all
the components are functioning correctly. Follow the steps below to test the
system:
2. Open the Arduino IDE on your computer and upload the code to the Arduino
Uno.
3. Once the code is uploaded, open the Serial Monitor by clicking on the Serial
Monitor icon in the top right corner of the Arduino IDE.
21
4. Check if the values for temperature, humidity, gas, and flame are being displayed
correctly in the Serial Monitor.
5. Verify if the LCD is displaying the temperature, gas, and flame valuescorrectly.
6. Test the flame sensor by placing a flame near it and observe if the LED turns on and
the buzzer sounds.
7. Test the MQ-2 gas sensor by exposing it to gas and observe if the LED turns on and
the buzzer sounds.
8. Check if the LED and buzzer turn off when the gas or flame is no longer detected.
9. Test the DHT-11 sensor by blowing air on it or by changing the temperature and
humidity in the room and observing if the values displayed on the LCD and Serial Monitor
are changing.
10. Make any necessary adjustments to the hardware or software if any issues are
observed during the testing process.
Code
Arduino IDE code for the given project:
#include <LiquidCrystal_I2C.h>
void setup() {
22
Serial.begin(9600); // Start serial communication
void loop() {
tone(BUZZERPIN, 2000, 1000); // Make a sound with the buzzer for 1 second
lcd.setCursor(0, 0); // Set cursor to the first column of the first row
lcd.setCursor(0, 1); // Set cursor to the first column of the second row
23
} else {
lcd.setCursor(0, 0); // Set cursor to the first column of the first row
lcd.setCursor(0, 1); // Set cursor to the first column of the second row
Code Explanation
Sure, here's an explanation of the code without any actual code snippets:
The Arduino project is designed to monitor gas levels using an MQ-2 gas sensor. It has three
main components: an LED, a buzzer, and an LCD display. The system works as follows:
1. *Initialization*:
- It configures the pins connected to the MQ-2 gas sensor, LED, and buzzer.
- The LCD display is also initialized and its backlight is turned on.
2. *Continuous Monitoring*:
24
- In a continuous loop, the Arduino reads the gas level from the MQ-2 sensor.
- The current gas level is printed to the serial monitor for debugging and observation.
- The Arduino checks if the gas level is above a specified threshold (in this case, 200).
- The LCD display shows the gas level and a warning message indicating that there is
a gas leak.
- The LCD display shows the gas level and clears any previous warning message.
4. *Delay*:
This setup ensures that any dangerous gas levels are quickly noticed and alerted through
multiple sensory signals (visual, auditory, and text).Sure, here's an explanation of the code
without any actual code snippets:
The Arduino project is designed to monitor gas levels using an MQ-2 gas sensor. It hasthree
main components: an LED, a buzzer, and an LCD display. The system works as follows:
This setup ensures that any dangerous gas levels are quickly noticed and alerted through
multiple sensory signals (visual, auditory, and text).
25
Results
The system has been designed to detect abnormal levels of temperature, gas,and flame
in the environment and alert the user through visual and audible alarms. The system also
displays the current temperature and gas levels on the LCD.
During normal operation, the LCD displays the temperature and gas levels in real-time.
The temperature and humidity sensor readings can help the user to maintain a comfortable
environment. If the temperature exceeds 45°C, the LED will light up and the buzzer will
sound an alarm for 1 second, alerting the user to the high temperature.
If the gas sensor detects the presence of a harmful gas, the LED will light up and the buzzer
will sound an alarm for 1 second. The user can take necessary precautions such as
ventilating the room or leaving the area immediately
26
Conclusion
The expected output of this project is a fully functional gas leakage detection and
. The project uses an Arduino Uno microcontroller MQ-2 gas sensor measures gas
levels. An LCD display is used to show the measured parameters, and a LED and
buzzer are used to indicate any critical situation.
The project is easy to assemble and implement, and it can be used in various
applications such as in homes, offices, or industrial environments to ensure
safety and avoid accidents caused by gas. The project can be further improved by
adding more sensors or expanding the functionality to include automatic control of
appliances or triggering alarms or notifications.
Overall, the project demonstrates the potential of using microcontrollers and sensors
to create cost-effective and efficient monitoring systems, and it providesan excellent
opportunity for beginners and hobbyists to learn about electronics.
27