Sei sulla pagina 1di 51

Smart Street Lighting

Submitted in Partial fulfillment of Requirement for the award of the Degree of

MASTER OF COMPUTER APPLICATIONS

Sriram Srinidhi

1MS15MCA80

Under the Guidance of

Ananda N Assistant

Professor

Department of Computer Applications

RAMAIAH INSTITUTE OF TECHNOLOGY


(Autonomous Institute, Affiliated to VTU)
Accredited by National Board of Accreditation & NAAC with A Grade
MSR Nagar, MSRIT Post, Bangalore-560054
www.msrit.edu
2017
ACKNOWLEDGEMENT

With deep sense of gratitude I am thankful to our beloved principal. I would like to
express my sincere gratitude to our department for providing us with good infrastructure and
the right atmosphere to carry out the project. It was really challenging to carry out the project
work within the stipulated time period, which was made possible with the help of many. I do
acknowledge the support and encouragement of all of them. I would like to thank our most
respected HOD, Dr. T V Suresh Kumar for his pillared support and encouragement. I would
like to convey my heartfelt thanks to my internal Project Guide Ananda N, Assistant
professor, Department of Computer Applications for giving me an opportunity to embark
upon this topic and for his constant encouragement and I would also like to thank Girish M a
fellow student for his enormous help in project. It gives me great pleasure to acknowledge the
contribution of all people who helped me directly or indirectly realize it. First I would like to
acknowledge the love and tremendous sacrifices that my Parents made to ensure that I always
get an excellent education. For this and much more, I am forever in their debt.

I am thankful to all my friends for their moral and material support throughout the course of my
project. Finally, I would like to thank all the teaching and non-technical staff of Department Of
Computer Applications for their assistance during various stages of my project work.

SRIRAM SRINIDHI
ABSTRACT

The huge amount of electrical power of many countries is consumed in lighting the
streets. However, vehicles pass with very low rate in specific periods of time and parts of the
streets are not occupied by vehicles over time. Smart Street Lighting is a project on intelligent
illumination control of street lights to optimize the problem of power consumption. Currently,
in the whole world, enormous electric energy is consumed by the street lights, which are
automatically turn on when it becomes dark and automatically turn off when it becomes
bright. This is the huge waste of energy in the whole world and should be changed. This
project discusses a Smart Street Lighting system, whose concept is to automatically turn on
the light when required and turn off when not required. This proposed system uses sensors to
control the street light and wireless communication to communicate with central server.
The lights are turned on in dim state by default when it is darker, the light will be
brighter if any one comes around. These lights are monitored and if any lights are not
working then notification are sent to concerned team to fix it. By this project around 40% of
energy can be saved.
Table of Contents
1. INTRODUCTION ............................................................................................................................................. 2
1.1 OVERVIEW ................................................................................................................................................. 2
1.2 FEASIBILITY STUDY................................................................................................................................. 2
1.2.1 Social Feasibility ................................................................................................................................... 2
1.2.2 Economic Feasibility ............................................................................................................................. 2
1.2.3 Operational Feasibility ........................................................................................................................... 2
1.2.4 Technical Feasibility .............................................................................................................................. 3
1.3 EXISTING SYSTEM ................................................................................................................................... 3
1.4 PROPOSED SYSTEM ................................................................................................................................. 3
2. LITERATURE SURVEY .................................................................................................................................. 5
2.1 SURVEY ON SIMILAR KIND OF SYSTEM ............................................................................................ 5
2.2 TOOLS AND TECHNOLOGIES ................................................................................................................. 5
3. HARDWARE AND SOFTWARE REQUIREMENTS ..................................................................................... 8
3.1 HARDWARE REQUIREMENTS ............................................................................................................... 8
3.2 SOFTWARE REQUIREMENTS ................................................................................................................. 9
4. SOFTWARE REQUIREMENTS SPECIFICATION ....................................................................................... 11
4.1 INTRODUCTION ...................................................................................................................................... 11
4.1.1 Purpose ................................................................................................................................................ 11
4.1.2 Document Conventions........................................................................................................................ 11
4.1.3 Intended Audience and Reading Suggestions ...................................................................................... 11
4.1.4 Product Scope ...................................................................................................................................... 11
4.1.5 References ........................................................................................................................................... 11
4.2 OVERALL DESCRIPTION ...................................................................................................................... 12
4.2.1 Product Perspective ............................................................................................................................ 12
4.2.2 Design and Implementation Constraints .............................................................................................. 12
4.2.3 User Documentation ........................................................................................................................... 12
4.2.4 Assumption and Dependencies ............................................................................................................ 12
4.3 EXTERNAL INTERFACE REQUIREMENTS ......................................................................................... 13
4.3.1 User Interfaces .................................................................................................................................... 13
4.3.2 Hardware Interfaces ............................................................................................................................ 13
4.3.3 Software Interfaces ............................................................................................................................. 14
4.3.4 Communications Interfaces ................................................................................................................. 14
4.4 SYSTEM FEATURES ............................................................................................................................... 14
4.4.1 Off state .............................................................................................................................................. 14
4.4.2 Dim state ......................................................................................................................................... 15
4.4.3 Bright state .......................................................................................................................................... 15
4.4.4 Energy efficient .................................................................................................................................. 15
4.5 OTHER NON-FUNCTIONAL REQUIREMENTS .................................................................................... 17
4.5.1 Safety Requirements .........................................................................................................................17
4.5.2 Security Requirements ......................................................................................................................17
4.5.3 Software Quality Attributes .............................................................................................................. 17
4.5.4 Hardware Quality Attributes ............................................................................................................. 17
4.5.5 Other Requirements .......................................................................................................................... 17
5. SYSTEM DESIGN DESCRIPTION ............................................................................................................... 19
5.1 INTRODUCTION ................................................................................................................................ 19
5.1.1 Purpose ............................................................................................................................................. 19
5.1.2 Scope ................................................................................................................................................19
5.1.3 Overview .......................................................................................................................................... 19
5.1.4 Constraints ........................................................................................................................................19
5.2 SYSTEM OVERVIEW ............................................................................................................................. 20
5.2.1 System Architecture .......................................................................................................................... 20
5.2.2 Architectural Alternatives ................................................................................................................. 21
5.2.3 Design Rationale ............................................................................................................................... 21
5.3 FUNCTIONAL DESIGN ..................................................................................................................... 21
5.3.1 Data Flow Diagram ............................................................................................................................ 21
5.3.2 Use Case Diagram ............................................................................................................................. 23
5.3.3 Flow Diagram .................................................................................................................................... 24
5.3.4 Activity Diagram ............................................................................................................................... 25
5.4 HUMAN INTERFACE DESIGN ........................................................................................................... 25
5.5 OTHER INTERFACES .......................................................................................................................... 25
6. IMPLEMENTATION ................................................................................................................................... 27
6.1 ARDUINO CODE .................................................................................................................................. 27
7. TESTING ..................................................................................................................................................... 29
7.1 INTRODUCTION .................................................................................................................................. 30
7.2 TESTING STRATEGIES ....................................................................................................................... 30
7.3 TEST CASES .......................................................................................................................................... 30
8. SCREENSHOTS............................................................................................................................................ 32
9. CONCLUSION .............................................................................................................................................. 36
10. FUTURE ENHANCEMENTS ..................................................................................................................... 38
11. BIBLIOGRAPHY ....................................................................................................................................... 40
12. USER MANUAL ........................................................................................................................................ 42
12.1 HARDWARE REQUIREMENTS 42
12.2 SOFTWARE REQUIREMENTS . 43
12.3 HARDWARE CONFIGURATION.. 43
12.4 HARDWARE INSTALLATION.. 44
12.5 SOFTWARE INSTALLATION... 44
SMART STREET LIGHTING 1

INTRODUCTION

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 2

1. INTRODUCTION
1.1 OVERVIEW

Nowadays every aspect of life is becoming smarter from home television to entire city so
adaptation for smarter roads is a necessity. Thats where the idea of Smart Street Lighting comes
into play. Smart Street Lighting is not only an automated process but also an energy efficient and
cost efficient approach towards smart city. In this system, information of pedestrian and vehicles
are sensed and gathered by array of sensors. All the sensors are placed on the pole and it is called
a node. Node reads the data and does the required action i.e. switch on the light at full intensity if
any pedestrian or vehicle on the road else node will glow at low intensity and in the morning it
automatically switches off. These data are sent on to a server through wireless communication
using nRF24L01.

1.2 FEASIBILITY STUDY

Preliminary investigation of the requirements defines the feasibility of a project. The main
objective of this system is to reduce power consumption of street lights. This project is extremely
feasible for who cares for energy saving.

1.2.1 Social Feasibility

This system is said to be socially feasible as it is accessible to the general public. This
system is designed mainly for the people to use the road at night with fully illuminated street with
less power consumption.

1.2.2 Economic Feasibility

This system is cost effective because the components used in this like Arduino Nano,
LDR and PIR sensors are cheaper and effective in working.

1.2.3 Operational Feasibility

The operation of the system is so feasible that the hardware need to be installed once
to the street light so that the system could perform its action efficiently and if any node is not
working or working incorrectly, then message will be sent to the concerned team by using
Amazon Web Services.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 3

1.2.4 Technical Feasibility

The hardware installation is so simple that you do not need to have any extra technical
assistant and communication between sensors is very simple. The data is stored in Dynamo
DB provided by AWS which will be monitored continuously for high performing.

1.3 EXISTING SYSTEM

According to a report by market researchers, more than 280 million streetlights are
currently in place globally, with this number expected to grow to nearly 340 million by 2025. The
costs of these street lights are staggering. Each streetlight uses 600 to 1,000 kWh/yr of energy.
Current scenario includes manual operating of street lights or automated street light which
switches ON when the night falls and turns OFF when the sun rises. It causes problems when
they are not working properly at any given time. These are not very efficient and typically operate
for up to 12 hours a day, at full intensity. Even using ambient light sensors for switching
individual street lights, the energy costs of providing this service is high. Lack of monitoring
leads to unsafe situations like road accidents and many more. Faulty lights take more than 20
days to recover the fault which leads to customer dissatisfaction as well as a safety risk until
faulty light are fixed.

1.4 PROPOSED SYSTEM


To address these issues in existing system, we are moving to an intelligent outdoor
lighting system, often referred as Smart Street Lighting. Smart Street Lighting infrastructure
includes sensors and wireless communication module to connect to a centralized server, which
can be used to monitor the nodes. By monitoring the environmental condition the node will be
turned on or turned off with a low intensity and if there is any motion then the node would glow
at a brighter intensity. By this we can optimize the energy consumption for each and every street
light.
For example, street light would be dimmed if there is no one; this reduces power
consumption which would drastically cut the cost. Faulty parts and faulty working lights would
be recorded and will be sent to central server from which we can do the necessary.
Hardware parts such as Arduino nano and sensor parts like LDR and PIR are very cheap
making the system cost efficient too. Therefore proposed system provides us a cost efficient,
energy efficient and smarter product.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 4

LITERATURE SURVEY

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 5

2. LITERATURE SURVEY

2.1 SURVEY ON SIMILAR KIND OF SYSTEM


In general, this chapter covers the literature review from different sources related to the
smart lighting system invention of others project, technology and current industrial product.
There are known systems that are similar to this project, however it would be relevant to
briefly mention about Smart Light Bulbs.
Smart Light Bulbs are the bulbs which consist of sensors which detect human presence
and turn the light on, if there is no one around then light turns off automatically. The problem
with these bulbs is it is either illuminated fully or not. Basic light is needed in night at streets so
these bulbs cant be used there. Hence, normal bulbs are put on streets which will be fully
illuminated always.
To overcome this problem, this project provides a Smart Street Lighting where the basic
dim light is always available and light is fully illuminated only when needed. Thus saves a lot of
energy.

2.2 TOOLS AND TECHNOLOGIES


Arduino Nano

Arduino Nano is a surface mount breadboard embedded version with integrated USB. It
is a smallest, complete, and breadboard friendly. It has more analog input pins and onboard +5V
AREF jumper. Physically, it is missing power jack. The Nano is automatically sense and switch
to the higher potential source of power, there is no need for the power select jumper.

Arduino IDE

The Arduino development environment contains a text editor for writing code, a message
area, a text console, a toolbar with buttons for common functions, and a series of menus. It
connects to the Arduino hardware to upload programs and communicate with them.

LDR Sensor
An LDR or light dependent resistor is also known as photo resistor, photocell and
photoconductor. It is a one type of resistor whose resistance varies depending on the amount of
light falling on its surface. When the light falls on resistor then resistance changes. These
resistors are often used in many circuits where it is required to sense the presence of light.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 6

PIR Sensor
A passive infrared sensor (PIR sensor) is an electronic sensor that measures infrared (IR)
light radiating from objects in its field of view. They are most often used in PIR-based motion
detectors.

Dynamo DB
Amazon Dynamo DB is a fast and flexible NoSQL database service for all applications
that need consistent, single-digit millisecond latency at any scale. It is a fully managed cloud
database and supports both document and key-value store models. Its flexible data model,
reliable performance, and automatic scaling of throughput capacity, makes it a great fit for
mobile, web, gaming, ad tech, IoT, and many other applications.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 7

HARDWARE AND SOFTWARE


REQUIREMENTS

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 8

3. HARDWARE AND SOFTWARE REQUIREMENTS


3.1 HARDWARE REQUIREMENTS
Arduino Nano Board.
It is the heart of the hardware, it is actually the circuit board where sensors are
connected and data will be processed in this circuit board and the message is sent to the
server.
Node

Street light where the components like Arduino Nano and sensors are attached also
called node.
LDR Sensor
Light dependent resistor (LDR) sensor is to detect whether the environment light
intensity.
PIR Sensor
Passive infrared (PIR) sensor to detect any motion on the street.
BreadBoard
It is the board with multiple pins where the pins are used for multiple and parallel
connection that is using the single Arduino board you can connect to multiple street
lights and sensors with the help of bread board.
nRF24L01

To communicate between Arduino Nano and central server through wireless


communication.
Rapsberry Pi
Raspberry pi acts as a central server for Arduino Nano, to communicate and to
connect to Amazon Web Service.

Connecting Wires

The wires are used to connect Arduino, Sensors, wireless communication device
and relay.
Single Channel Relay
Single channel relay is an electronic switch which receives signal from a
processing unit and acts accordingly.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 9

3.2 SOFTWARE REQUIREMENTS

Arduino IDE
This is the tool where the programmer is going to write the code and dump into the
Arduino Nano board so that the Arduino Nano board is going to work as the programmer
needs.
Dynamo DB
Amazon Dynamo DB is a fast and flexible NoSQL database service provided by
AWS. It is a fully managed cloud database and supports both document and key-value
store models..

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 10

SOFTWARE REQUIREMENTS
SPECIFICATION

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 11

4. SOFTWARE REQUIREMENTS SPECIFICATION

4.1 INTRODUCTION
4.1.1 Purpose

The purpose of this document is to describe the requirements for this project. The
document focuses particularly on the requirements for Smart Street Lighting which includes
enhancements to the existing system. It also describes the scope of the system, functional and
non-functional requirements for the system and system interfaces.
This SRS will be used to verify and ensure that all specifications are correct.

4.1.2 Document Conventions

The format of this SRS is simple; throughout this document the font used is Times New
Roman. All headings are in Bold and are intended. Chapter headings are in size 24, headings in
size 14 and sub headings in size 12. The rest of the document content is in size 12 without bold.
Any other words in Bold are to be considered as important terms, and have been formatted so to
grab the attention of the reader.

4.1.3 Intended Audience and Reading Suggestions

This document is primarily intended for the evaluators of the system. Other than that the
developers of the system can use this as a guideline. Any third party who needs a basic
understanding of the system may find this document helpful.

4.1.4 Product Scope

The scope of the work involves in developing a product which is used to make the street
lights smarter. The product will turn on or off the street lights by sensing the environmental light.
Further, once the lights are on; if there is any movement of objects or people on the streets the
lights will glow brighter else they will remain in the dim state. This will help to save lot of power
as there will be very less movement of people or objects in the night. The saved power can be
utilized in many better ways for the benefit and improvement of the society.

4.1.5 References

Refer to Bibliography section.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 12

4.2 OVERALL DESCRIPTION


4.2.1 Product Perspective

This product consists of nodes (Street light unit) where each node consists of Arduino
Nano, LDR sensor, PIR sensor and a Wi-Fi module. LDR sensor senses the intensity of
surrounding light; if the intensity is high, node will be switched off. If the intensity of
surrounding light is low then node will be switched on but will glow with less power and if
vehicular movement or pedestrian movement is sensed by the PIR sensor multiple nodes will
glow brighter. The Wi-Fi module will send the data to the control centre where raspberry pi will
receive the data which is used to notify that the node is not working, that node has to be checked
and this can be used for monitoring and maintenance purpose. This data will usually be 0 or 1,
where 0 represents the node which works properly and 1 which represents the node not working
and this can be used to alert the user to check street light.

4.2.2 Design and Implementation Constraints

Design constraints are, the developer must have the knowledge about the hardware
components and the working of those hardware components and also need to have the software
developing tools and idea how to build the software.
Implement constraint are the hardware need to be installed in proper place on to the street
light so that it is not easily accessible to the outsiders, And the software need to be installed in the
hardware with minimum configurations so that it works properly with that configuration without
hanging or software crash.

4.2.3 User Documentation


Refer to the user manual section

4.2.4 Assumption and Dependencies

One assumption about the product is that any object should not be blocking the sensors
which affect the communication through nRF24L01. Another assumption would be objects on
the road to be pedestrians or vehicles.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 13

4.3 EXTERNAL INTERFACE REQUIREMENTS


4.3.1 User Interfaces

Not Applicable

4.3.2 Hardware Interfaces


This project consists of many hardware devices which communicate with each other
Street light unit

Normal street light unit on which all the other components are connected.

Arduino unit
An arduino Nano device for uploading the code and a breadboard for making the
circuit.

Figure 4.1 an Arduino and breadboard

Sensor array
o LDR sensor
LDRs or Light Dependent Resistors are very useful especially in light/dark
sensor circuits. Normally the resistance of an LDR is very high, sometimes as high
as 1000 000 ohms, but when they are illuminated with light resistance drops
dramatically. When the light level is low the resistance of the LDR is high.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 14

o PIR sensor
A passive infrared sensor (PIR sensor) is an electronic sensor that
measures infrared (IR) light radiating from objects in its field of view. They are
most often used in PIR-based motion detectors.

MOSFET
The metaloxidesemiconductor field-effect transistor (MOSFET) is a type of
field-effect transistor (FET). It has an insulated gate, whose voltage determines the
conductivity of the device. This ability to change conductivity with the amount of applied
voltage can be used for amplifying or switching electronic signals.

Single Channel Relay


A relay is an electrically operated device. It has a control system and controlled
system. It is frequently used in automatic control circuit. To put it simply, it is an
automatic switch to controlling a high-current circuit with a low-current signal.

Connecting wire
Connecting wires are electrical wires which are used to connect different hardware
parts.

4.3.3 Software Interfaces

The Software Requirements specify,


Arduino IDE

4.3.4 Communications Interfaces

Communication between node (Arduino Nano with sensors) and central server is
established using wireless connection. Once connection is started it will continue until connection
is closed.

4.4 SYSTEM FEATURES


System offers multiple features like different level of brightness of street light.

4.4.1 Off state

Street light will be in off state when there is excess of environment light.
RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017
SMART STREET LIGHTING 15

4.4.2 Dim state


This state will occur when surrounding light goes down and there are no vehicular or
pedestrian movements.

4.4.3 Bright state

This state will occur when surrounding light goes down and there is a vehicular or
pedestrian movement.

4.4.4 Energy efficient


This system is energy efficient because
We know that,
1 watt = 1 Joules/second
Consider we are using 40 watt bulb
40 watt = 40 Joules/second
Therefore,
For 1 hour
40 x 3600 = 144000 Joules/second I
We know that,
1 unit = 3600000 Joules/second
For 1 hour 144000 Joules/second for 3600000 Joules/second how many
hours? Let the hour be y0 then
y0 = (3600000 x 1) / 144000
i.e. y0 = 25 hours

Approximately street light takes 1 unit per day


By implementing this system we use street light for maximum of 12 hours
i.e. 25 hours for 1 unit then for 12 hours how many units?

Let the unit be z0 then,


z0 = (12 x 1) / 25
z0 = 0.48 units ---------------------------I
We can save up to 0.52 units of current per day if we are using the street light at full intensity for
12 hours straight.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 16

Actual usage of unit will be even reduced because we would not be using the street at full
intensity for 12 hours straight, we might actually use it from 6 pm to 12 am.

i.e. For 1 hour = 144000 Joules/second


For 6 hours = 6 x 144000 = 864000 Joules/second

i.e 25 hours for 1 unit then for 6 hours how many units?

Let the unit be z1 then,


z1 = (6 x 1) / 25
z1 = 0.24 units ---------------------------II

From 12am to 6 am, lights will be dimmed and energy consumption of the light will directly
depend of itself i.e. LED lights will save the maximum energy and CFL lights save up to 50%
energy and normal halogen bulbs save up to 20% energy.

20% of energy will be save i.e. 80% will be utilized


For, 40w bulb 40 Joules/second is used 80% of 40 Joules/second is 32 Joules/second
therefore 32 Joules/second will be utilized.

For 1 hour
32 x 3600 = 115200 Joules/second

For 6 hours
6 x 115200 = 691200 Joules/second

For 115200 Joules/second 1 hour for 3600000 Joules/second how many hours?

Let y2 be the hour


y2 = (3600000 x 1) / 115200
y2 = 31.25 hours
which is approximately 31 hours for 1 unit

i.e. for 31 hours 1 unit will be utilized then for 6 hours how many units will be utilized
Let z2 be the unit of current
z2 = (6 x 1) / 31

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 17

z2 = 0.19 units ---------------------------III


Therefore adding II and III

Let z3 be the unit of current

z3 = z1 + z2
z3 = 0.24 + 0.19
-------------------------- IV
z3 = 0.43 units
Comparing I and IV with original value
On an average we can save up to
z = 1 - [ ( 0.48 + 0.43 ) / 2 ]
z = 1 - 0.45
z = 0.55 units

4.5 OTHER NON-FUNCTIONAL REQUIREMENTS


4.5.1 Safety Requirements

Heat sink has to be installed to the MOSFET as stopping 220v of AC would generate a
lot of heat.

4.5.2 Security Requirements

All the sensors and arduino has to be secure as even one missing part would corrupt the
systems flow.

4.5.3 Software Quality Attributes

The system has a very simple generic programming and is adaptable to changes.

4.5.4 Hardware Quality Attributes

The hardware has a very simple method to install, with a single controlling Arduino unit
you can connect to a street light and control it.

4.5.5 Other Requirements


Not Applicable

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 18

SYSTEM DESIGN DESCRIPTION

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 19

5. SYSTEM DESIGN DESCRIPTION


5.1 INTRODUCTION
5.1.1 Purpose

The purpose of this document is to provide an architectural design for the better
understanding of Smart Street Lighting where hardware installation and working of sensor.

5.1.2 Scope

The scope of the work involves in developing a product which is used to make the street
lights smarter. The product will turn on or off the street lights by sensing the environmental light.
Further, once the lights are on; if there is any movement of objects or people on the streets the
lights will glow brighter else they will remain in the dim state. This will help to save lot of power
as there will be very less movement of people or objects in the night. The saved power can be
utilized in many better ways for the benefit and improvement of the society.

5.1.3 Overview

This complete SDD will contain the general definition and features of the Smart Street
Lighting, design constraints, the overall system architecture and data architecture. With the help
of UML diagrams, design of the system and subsystems/modules will be explained visually in
order to help the programmer to understand all information stated in this document correctly and
easily.

5.1.4 Constraints

The hardware, software and technology used should have following


specifications Hardware installed to the Street light.
Program should be loaded on to Arduino.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 20
5.2 SYSTEM OVERVIEW

5.2.1 System Architecture

Fig 5.1 System Architecture for Smart Street Lighting

The lamp module consists of the sensors and Arduino nano board to control lights. The
data from Arduino is sent to Raspberry Pi which acts as a server here. That data is stored in
dynamo DB by Raspberry Pi. Data in database is continuously monitored and if any issues arises
it triggers notification to the concerned team to fix it.

Fig 5.2 Circuit diagram of lamp controlling


Fig 5.2 shows the circuit diagram of lamp controlling, the Arduino sends a level of light signal to
the mosfet and mosfet sends the signal to relay to release the power to lamp as per signal
received.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 21

5.2.2 Architectural Alternatives


No other architectural alternative could match the efficiency of the chosen architecture.
5.2.3 Design Rationale
Not Applicable

5.3 FUNCTIONAL DESIGN

5.3.1 Data Flow Diagram

Fig 5.3 Level Zero DFD


Fig 5.3 shows that DFD consists of a process Smart Street lighting system which gets triggered by
user, collected data will be processed and stored in database.

Fig 5.4 Level One DFD


Fig 5.4 shows that DFD consists of two processes which have been split from Smart
Street Lighting system and processes are Lamp node and Analytics, lamp node sends
analytics processed data to perform further operations.

Fig 5.5 Level Two DFD

Fig 5.5 shows that DFD contains 4 processes Sensors, Micro-controller, Operational
Analytics and In-memory Analytics, here user triggers the sensor which detects user
and sends to micro-controller where it is processed and sent to operational analytics in
which MQTT is accessed and is communicated with Amazon Web Service IoT in In-
memory Analytics which is stored in Dynamo Database.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 23

5.3.2 Use Case Diagram

Use case diagram for users specifies the primary and secondary actions need to
be performed and rights differentiated to each user type.

Fig 5.6 Use-case diagram of pedestrian

Fig 5.6 shows the use case diagram for pedestrian. When a person moves near street light
in day then the light remains off itself whereas if the person moves near street light during night
then the sensor detects the person and makes light brighter otherwise the light stays dimmer.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 24
5.3.3 Flow Diagram

Fig 5.7 Flow Diagram of different states

Fig 5.7 shows the flow diagram of different states of sensors. If LDR senses the darkness
then light is switched on, if it doesnt then the light will be in OFF state. If PIR senses the motion
of the object then the light will be brighter else it will be in dim state.

Fig 5.8 Flow Diagram of sending notification

Fig 5.8 shows the flow of sending notification if LDR sensor fails working. If darkness is
sensed and light is not switched on then notification is sent to concerned team.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 25

5.3.4 Activity Diagram

Fig 5.9 Activity diagram for user

Fig 5.9 shows the activity diagram for pedestrian. When a person moves near street light
in day then the light remains off itself whereas if the person moves near street light during night
then the sensor detects the person and makes light brighter otherwise the light stays dimmer.

5.4 HUMAN INTERFACE DESIGN


Not Applicable

5.5 OTHER INTERFACES


Not Applicable

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 26

IMPLEMENTATION

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 27

6. IMPLEMENTATION
6.1 ARDUINO CODE

#include <SPI.h>
#include <nRF24L01.h>
#include <printf.h>
#include <RF24.h>
#include <Wire.h>
#include <RF24_config.h>

RF24 radio(9,10);

char pp[6];
int j;
int lval=0;
int lval1=1
int LDR=A0;
int LDR1=A1;
int led1=3;
int dim=15;
int b=255;
int PIR=2;
int pval=0;
int c;
int relay=5;

void setup()
{
pinMode(tp,OUTPUT);
pinMode(ep,INPUT);
pinMode(led1,OUTPUT);
pinMode(relay,OUTPUT);
while(!Serial);
Serial.begin(9600);
radio.begin();
radio.setPALevel(RF24_PA_MAX);
radio.setChannel(0x76);
radio.openWritingPipe(0xF0F0F0F0E1LL);
radio.enableDynamicPayloads();
radio.powerUp();
}

void loop()
{
digitalWrite(tp,LOW);
lval=analogRead(LDR);
if(lval>200)
{
if(b>125||b!=0)
b=b-dim;
analogWrite(led1,b);
digitalWrite(relay,LOW);
lval1=analogRead(LDR1);
if(lval1<50)
{
const char text4[]="OK";
radio.write(&text4,sizeof(text4));
}
RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017
SMART STREET LIGHTING 28

else
{
const char text4[]="NOTOK";
radio.write(&text4,sizeof(text4));
}
delay(50);
}
else
{
digitalWrite(relay,HIGH);
pval=digitalRead(PIR);
if(pval==HIGH)
{
b=255;
analogWrite(led1,b);
lval1=analogRead(LDR1);
if(lval1>200)
{
const char text4[]="OK";
radio.write(&text4,sizeof(text4));
}
else
{
const char text4[]="NOTOK";
radio.write(&text4,sizeof(text4));
}

delay(50);

}
else
{
b=125;
analogWrite(led1,b);
lval1=analogRead(LDR1);
if(lval1>100)
{
const char text4[]="OK";
radio.write(&text4,sizeof(text4));
}
else
{
const char text4[]="NOTOK";
radio.write(&text4,sizeof(text4));
}
delay(50);
}
}
delay(100);
}

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 29

TESTING

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 30

7. TESTING
7.1 INTRODUCTION
Testing is a method to determine the behavior, working and performance of the
application against the intended requirement. As testing is the last phase before the final software
is delivered, it has the enormous responsibility of detecting any type of error that may be present
in the software. During testing, the program is executed with a set of test cases and the output of
the program for the test cases is evaluated to determine if the program is performing as it is
expected to perform.
Test cases constitute to asset of conditions which will determine if the system being tested
satisfies the SRS and works correctly. A test case may contain the following Meta data: test ID,
brief summary, supplied inputs, preexisting conditions, and recorded output. This process of
testing purely eradicates the minor issues like undesirable lines in the code, adds the comments as
essential places and enhances the code conferring to the standards retained by the industry.
7.2 TESTING STRATEGIES

Unit testing:
It is a level of software testing where individual units/ components of software are tested.
The purpose is to validate that each unit of the software performs as designed. A unit is the
smallest testable part of software. It usually has one or a few inputs and usually a single output.
7.3 TEST CASES
The test cases are written in the table 7.1 which shows the test scenarios and the test
results.

Test Test Test Input Test Expected Actual Remarks


Cases Scenario description Result Result

1 LDR 1 Status Environment Environment Light Light is in Pass


light light should be off state
intensity is intensity is in off state
High High i.e.
Bright

2 LDR 1 Status Environment Environment Light Light is in Pass


light light should be on state
intensity is intensity is in on state
Low Low i.e.
Dark

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 31

3 PIR Status Motion Any motion Light Light is in Pass


detection detected should be off state
during day in off state

4 PIR Status Motion not Motion is Light Light Pass


detected not detected should glows in
during night glow in dim state
dim state

5 PIR Status Motion Any motion Light Light Pass


detection detected should glows in
during night glow in bright
bright state state

6 LDR 2 Status Bulb Bulb in lamp Arduino Arduino Pass


glowing post glowing sends OK sends OK
with High with High to Pi to Pi
intensity intensity

7 LDR 2 Status Bulb Bulb in lamp Arduino Arduino Pass


glowing post glowing sends OK sends OK
with Low with Low to Pi to Pi
intensity intensity

7 LDR 2 status Bulb not Bulb in lamp Arduino Arduino Pass


glowing post not sends sends
glowing NOT OK NOT OK
to Pi to Pi
Table 7.1 Test cases for light control

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 32

SCREENSHOTS

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 33

Fig 8.1 Screenshot of the project

Fig 8.1 shows the screenshot of the code of the Smart Street Lighting

Fig 8.2 Screenshot of the project

Fig 8.2 shows the screenshot of the code of the Smart Street Lighting

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 34

Fig 8.3 Screenshot of the project

Fig 8.3 shows the screenshot of the code of the Smart Street Lighting

Fig 8.4 Screenshot of the project

Fig 8.4 shows the screenshot of the code of the Smart Street Lighting

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 35

CONCLUSION

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 36

9. CONCLUSION
Smart Street Lighting fine tune the existing technologies offering ease of maintenance
and energy savings. The proposed system is appropriate for street lighting in remote as well as
urban areas where traffic is low at times. Along with energy saving it also tackles monitoring and
maintenance problems.
This project is a cost efficient as the components used in this are cheaper but effective in
performance. It saves lots of energy by dimming the light. All the lights are monitored
continuously and if any of them are not working then notification is sent to concerned team.

In Conclusion, this project reduces power consumption and saves energy by almost 40%
compared to the existing system

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 37

10
FUTURE ENHANCEMENTS

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 38

10. FUTURE ENHANCEMENTS


Every project has scope for improvements and many enhancements can be done to make it
more reliable and more efficient.
In future, this project can be further enhanced by using appropriate sensors to differentiate
between pedestrian and vehicular movement. Based on that the lights are turned on and off (For
example, vehicle needs a light spread across long distance as it moves fast so three lights can be
illuminated if it is vehicle). For more energy saving, the halogen bulb used in this project can be
replaced with LED module. Solar energy can be used for street lights instead of electricity in this
project.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 39

11
BIBLIOGRAPHY

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 40

11. BIBLIOGRAPHY

Website Reference:

http://www.arduino.cc/
http://www.bristolwatch.com/arduino/arduino1.htm
https://aws.amazon.com/dynamodb/

Books Reference:

Michael R Blaha and James R Rumbaugh: Object oriented design and modelling with
UML, Pearson Education, 2013.
th
Ian Sommerville: Software engineering, 8 edition, Addison-Wesley. 2015.

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 41

12
USER MANUAL

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 42

12. USER MANUAL

12.1 HARDWARE REQUIREMENTS


12.1.1 Arduino NANO board

It is the heart of the hardware, it is actually the circuit board where the Electric
street light triggered data will be processed in this circuit board and the data is sent to
the central server.

Fig: 12.1 Arduino Front View

12.1.2 Bread Board

It is the board with multiple pins where the pins are used for multiple and parallel connection
that is using the single Arduino board you can connect to multiple electric door strike with the
help of bread board.

Fig 12.2 Bread Board

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 43

12.2 SOFTWARE REQUIREMENTS

Arduino IDE

This is the tool where the programmer is going to write the code and dump into the
Arduino Nano board so that the Arduino Nano board is going to work as the programmer
needs.

12.3 HARDWARE CONFIGURATION

The hardware components consists of Arduino Nano board, Bread Board, LDR
sensor, PIR sensor, MOSFET, Single channel relay, nRF24L01, Raspberry Pi and
electric bulb.

The Sensor Array, MOSFET, single channel relay, bulb and nRF24L01 are
connected as a single unit to Arduino Nano board and Raspberry Pi is treated as
communication device to server.

The connection of LDR to Arduino is simple as it includes 3 pins VCC, GND and
SIG pin for taking input, connection of PIR is similar to LDR as it also includes 3 pins
with similar functionality. Connection to nRF24L01 and Arduino includes 8 pins VCC,
GND for 3v and ground respectively, CSN is Chip Select NOT, CE is Chip Enable, SCK
is serial clock, MOSI is Master Out Slave In pin, MISO Master In Slave Out pin and IRQ
is Interrupt Request pin which is normally not connected.

The connection of single channel relay includes 3 pins VCC, GND and input to
connect to Arduino and 3 sockets NC, NO and CP where NC is Normally Closed, NO is
Normally Open and CP is connected to ground.
MOSFET connections include 3 pins Gate, Source and Drain where Gate is used to
logically control MOSFET, Source where we plug-in the positive of the 230v and Drain is
where we plug-in negative or ground.

The connections of Raspberry Pi to nRF24L01 is similar to Arduino connections

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017


SMART STREET LIGHTING 44

12.4 HARDWARE INSTALLATION


The hardware installation consists of two elements:

1. Arduino Processing Unit with sensor parts

2. Lamp unit

12.4.1 Arduino Processing unit with sensor

Arduino Processing unit consists of Arduino NANO, nRF24L01, MOSFET and


Single channel relay, sensors like LDR and PIR will be integrated with Arduino board
with the use of bread board

12.4.2 Lamp unit

Lamp unit consists of simple lamp post with working street light unit.

12.5 SOFTWARE INSTALLATION


12.5.1 SOFTWARE INSTALLATION

There is no need of any software installation required

RAMAIAH INSTITUTE OF TECHNOLOGY DEPARTMENT OF COMPUTER APPLICATIONS JUNE 2017

Potrebbero piacerti anche