Você está na página 1de 20

SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

ABSTRACT
Forgetting to put off the electrical device while not in use, keeping the device on while
not necessary, therefore resulting in wastage of electrical energy has become common in our day
to day life. Not much attention is paid towards such silly mistakes, but these little wastages can
form a formidable amount of overall energy wastage if we consider the same mistake happening
in every work place, house, educational institute, public place etc. So the aim of this project is to
develop a system that monitors a place/ room or an area in a large room, for the presence of
human activity. If no human presence is detected, a pre-determined set of electrical devices, if
‘on’ are ‘put off’ thus saving electrical energy. The system consists of a camera that takes
pictures of the space being monitored, periodically. The ‘Raspberry Pi’ forms the computational
unit, comparing successive images. A particular algorithm is used for the purpose. Human
presence in the room results in difference between successive images. Should there be no
difference in the successive images, then the Raspberry Pi checks the states of the devices, if
they are on then it sends control signals to the relay circuits to put off the running devices.

Dept. of ECE Page 1


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

INTRODUCTION
Electricity and electrical devices are integral part of our life. They are used everywhere
today. We cannot imagine a life without electricity, but with the usage of electricity comes its
wastages. People are often careless when it comes to electricity. Forgetting to put off the
electrical devices while not in use, absent minded leaving the room keeping devices on, not
switching off the devices while not necessary etc are the few things that happen with everyone
in our day to day life. These result in wastage of electrical energy. We usually do not pay much
attention towards such silly mistakes. We ignore it as a small wastage, but if we consider the
same mistake happening in every work place, school. College, public place etc. then we can
understand that a massive amount of electrical energy is lost in this way.

Lighting automation is not a new thing for us. The existing systems are operated
manually and it is a tedious job to switch on/off the light every time students enter/leave the
classroom. The available products in the market are costly and are not accurate. Even the usage
of IR sensors has a problem associated with it. Infrared sensors can keep count of a number of
people entering /leaving the room but are unable to detect if the room is occupied or not and even
infrared radiations are harmful. Although there are a lot of products available in the market
which will turn on/off lights based on the human presence or absence respectively. But the
problem is that available technology requires a very big infrastructure (For example existing
switchboards have to be replaced with new ones).But we will use the existing switchboards and
CCTV cameras, which are preinstalled in most of the educational institutions. Based on the
survey conducted in the campus, we realized that there is a great need for the automatic system
for switching on/off of mains based on human presence/absence. Almost every campus needs
such a device as it is an issue which is commonly found in every campus. So that everyone can
utilize this innovation without much replacement in the existing infrastructure. So we want to
develop an accurate and cost effective device which will accurately detect a person and take a
proper decision of turning on/off of light, which is going to be completely automatic. Our paper
presents a simple and powerful concept wherein, We are using image processing technique to
detect the face and based on the result whether to turn on/off the power supply to the classroom .

Dept. of ECE Page 2


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

When the raspberry pi boots up the script which includes the path of the proposed
algorithm starts executing and starts detecting the face of objects by comparing the reference
image and the current image captured by the camera. If there is any face detected then the
algorithm sends raspberry pi a message that there is someone present in the classroom and it has
to turn on the initialized GPIO pin which in turn triggers the relay and turns on the main power
supply. If there is no face detected then the GPIO pin is not turned on and so is the main power
supply provided to the classroom.

Image processing is the analysis and manipulation of a digitized image, especially in


order to improve its quality Face detection is a computer technology being used in a variety of
applications that identifies human faces in digital images. Face detection also refers to the
psychological process by which humans locate and attend to faces in a visual scene. Face
detection can be regarded as a specific case of object-class detection. In object-class detection,
the task is to find the locations and sizes of all objects in an image that belong to a given class.
Examples include upper torsos, pedestrians, and cars. Face-detection algorithms focus on the
detection of frontal human faces. It is analogous to image detection in which the image of a
person is matched bit by bit. Image matches with the image stores in database. Any facial feature
changes in the database will invalidate the matching process. A reliable face-detection approach
based on the genetic algorithm and the eigen-face technique Firstly, the possible human eye
regions are detected by testing all the valley regions in the gray-level image. Then the genetic
algorithm is used to generate all the possible face regions which include the eyebrows, the iris,
the nostril and the mouth corners. Each possible face candidate is normalized to reduce both the
lightning effect, which is caused by uneven illumination; and the shirring effect, which is due to
head movement. The fitness value of each candidate is measured based on its projection on the
eigen-faces. After a number of iterations, all the face candidates with a high fitness value are
selected for further verification. At this stage, the face symmetry is measured and the existence
of the different facial features is verified for each face candidate.

Dept. of ECE Page 3


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

Problem statement
Forgetting to put off the electrical device while not in use. keeping the device on while
not necessary, therefore resulting in wastage of electrical energy has become common in our day
to day life. Not much attention is paid towards such silly mistakes, but these little wastages can
form a formidable amount of overall energy wastage if we consider the same mistake happening
in every work place, house, educational institute, public place etc.

Dept. of ECE Page 4


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

OBJECTIVE
A smart solution to the above problem is to save these wastages at every work place,
educational institute, public place etc. by the help of a system that monitors that wastage. Here
we have designed a prototype of a system that can do the task of monitoring a room for
electricity wastage. The system monitors a place/room or an area in a large room, for the
presence of human activity. If human presence is found, it continues to monitor the room like
before. If no human presence is detected, then, it checks a pre-determined set of electrical
devices. If those devices are ‘ON’ then the system takes necessary actions to ‘put off’ those
devices. Therefore wastage of electrical energy is prevented. The system consists of a camera
that captures pictures of the space being monitoring, periodically. The Raspberry Pi- class B
model forms the computational unit. It is a credit card sized computer used for computation
purposes. It compares successive images. A particular algorithm is used for the purpose. The
Raspberry Pi programming is done by using ‘python’ programming language. The human
presence in the room is detected by doing image processing on the captured image, by image
processing we detect the faces in the image. If face is detected that means human is present in the
room and if no face is detected that means no one present in the room then raspberry pi checks
the states of the devices, if they are on then it sends control signals to the relay circuits to put off
the running devices. The control signals given by the Raspberry Pi are of 5V. An appropriate
relay circuit is used.

Dept. of ECE Page 5


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

LITERATURE SURVEY
There is always a need to identify the major components required for the product. Our
product mainly focuses on the automation. Based on the survey conducted, we thought of using
Raspberry pi which triggers relay based on the face of a human. Future add-ons to the product
can make it as a complete independent working model. We have compared our system with
different automation systems. The paper titled “Using Raspberry Pi and GSM Survey on Home
Automation” gives an idea of Home automation using Raspberry Pi, GSM modem to send and
receive messages, relay to control switching of home appliances, LCD as display unit and ADC
to convert analog voltage input to digital (binary coded decimal) value. In this work GSM
modem is connected to Raspberry Pi for the communication between user and controller and
RS232 is used in the system for serial communication between the microcontroller and outside
world. As this system uses GSM modem to send a message to the controller the process is slower
and also it depends on the network available, if the network is low then it takes more time and
also it requires a human intervention to send or to read message and even the system is costlier.
But in the proposed method the time for execution and cost of the system is less and even the
system is fully automatic in controlling the power supply it doesn’t need any human intervention.
In future, lighting automation will be more smart and fast. It would be extended to the large scale
environment.

An extensive literature survey has been carried out on different techniques that have been
implemented for the lighting system till date. Automated lighting system with visitor counters.
This System needs no manual operation for switching ON / OFF when a person enters or exits
from a room. The IR Sensors with the IR transmitter and receiver are placed at the entrance of
the room doors in such a way that the sensor senses a person entering / exiting the room. This
can also be done by using a laser. sensors can sense objects / people to a limited range i.e. one
sensor might not cover a full room and also it requires lot of additional wiring in case of wired
sensors.

Dept. of ECE Page 6


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

And for image processing the author Mr. Ashwin K Kashyap and etl. Describes the
working of face recognition using raspberry pi module by using the python language. In this
project the saved faces are detected using OPEN CV simulation. This system uses the HAAR
algorithm for execution and the author K.Shiva Prasad describes the working of the technique for
real time human face detection and tracking using a modified version of the algorithm by using
the raspberry pi module along with USB camera. In this project Simulation results of this
developed algorithm shows the Real time human face detection and tracking

Object Detection using Haar feature-based cascade classifiers is an effective object


detection method proposed by Paul Viola and Michael Jones in their paper, "Rapid Object
Detection using a Boosted Cascade of Simple Features" in 2001. It is a machine learning based
approach where a cascade function is trained from a lot of positive and negative images. It is
then used to detect objects in other images.

Dept. of ECE Page 7


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

Methodology
Block Diagram:

 Camera captures the image.

 Through image processing face detection is done to sense the presence of human in the
room. (We use Haar-cascade detection in OpenCV for face detection)

 If no face detected that means is no one is present in the room so raspberry pi sends low
signal to switching circuit, which turns off the devices.

 If face is detected the devices are turned on.

 Temperature sensor used to control speed of fan based on temperature of the room.

 LDR sensor to control the intensity of light.

Dept. of ECE Page 8


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

Working:

Flow Chart:

Dept. of ECE Page 9


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

The camera is used to capture images of the room being monitored. These images are sent to
the raspberry pi for computation purpose. The Raspberry Pi waits for ten continuous image
frames to be constant before assuming that there is no person in the room to put off the devices.
At the same time the Raspberry Pi monitors the state of the devices. When no person is found in
the room, it sends the 5V control signal to the relay switching circuit to put off those running
devices. The relay circuit is interfaced to the Raspberry Pi using a buffer in order to save the
Raspberry Pi from any possible damages. An Opto – coupler can be used to replace the currently
used relay circuit for higher safety.
 Import the required modules and packages.
 Get images from camera within a short time interval.
 Image processing for face detection.
 If the face detected make the GPIO pin high.
 If no face detected make GPIO pin Low to turn off the devices

Dept. of ECE Page 10


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

HARDWARE AND SOFTWARE REQUIREMENTS

• RASPBERRY PI 3B

• CAMERA

• RELAY

• TEMPERATURE SENSOR

• LDR

• PYTHON

Raspberry pi 3B:

Dept. of ECE Page 11


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

The Raspberry pi is a single computer board with credit card size, that can be used for many
tasks that your computer does, like games, word processing, spreadsheets and also to play HD
video. It was established by the Raspberry pi foundation from the UK.

Raspberry Pi Technology
The raspberry pi comes in two models, they are model A and model B. The main difference
between model A and model B is USB port. Model A board will consume less power and that
does not include an Ethernet port. But, the model B board includes an Ethernet port and designed
in china. The raspberry pi comes with a set of open source technologies, i.e. communication and
multimedia web technologies.In the year 2014, the foundation of the raspberry pi board launched
the computer module, that packages a model B raspberry pi board into module for use as a part
of embedded systems, to encourage their use.

Specification:

Broadcom BCM2837 64bit ARMv7 Quad Core Processor powered Single Board Computer
running at 1.2GHz 1GB RAM BCM43143 WiFi on board Bluetooth Low Energy (BLE) on
board 40pin extended GPIO 4 x USB 2 ports 4 pole Stereo output and Composite video port Full
size HDMI CSI camera port for connecting the Raspberry Pi camera DSI display port for
connecting the Raspberry Pi touch screen display Micro SD port for loading your operating
system and storing data Upgraded switched Micro USB power source (now supports up to 2.4
Amps) Expected to have the same form factor has the Pi 2 Model B, however the LEDs will
change position

Dept. of ECE Page 12


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

Required components and software for setup :


 Raspberry pi 3b

 16 GB micro SD card 10x speed grade

 Micro SD card reader

 5v,2A power supply

 Raspbian os from the site https://www.raspberrypi.org/downloads/raspbian/

 Etcher windows software

 Putty software

 VNC viewer

Dept. of ECE Page 13


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

Camera :

A camera is an optical instrument for recording or capturing images, which may be stored
locally, transmitted to another location, or both. The images may be individual still photographs
or sequences of images constituting videos or movies. The camera is a remote sensing device as
it senses subjects without any contact. Still images stored in digital form are called "image files,"
while moving images similarly stored are called "video files." In the deprecated paradigm
of photographic film for image storage, still images are simply called "photographs," and moving
images are called "films." The still image camera is the main instrument in the art
of photography and captured images may be reproduced later as a part of the process of
photography, digital imaging, photographic printing. The similar artistic fields in the moving
image camera domain are film, videography, and cinematography.

The camera chip consists arrays of sensors, which can convert the light into electrical charges.
A digital camera has lens/lenses which are used to focus the light that is to be projected and
created. This light is made to focus on an image sensor which converts the light signals into
electric signals.

Dept. of ECE Page 14


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

Temperature sensor:

The core functionality of the DS18B20 is its direct-to-digital temperature sensor. The resolution
of the temperature sensor is user-configurable to 9, 10, 11, or 12 bits, corresponding to
increments of 0.5°C, 0.25°C, 0.125°C, and 0.0625°C, respectively. The default resolution at
power-up is 12-bit. The DS18B20 powers up in a low-power idle state. To initiate a temperature
measurement and A-to-D conversion, the master must issue a Convert T [44h] command.
Following the conversion, the resulting thermal data is stored in the 2-byte temperature register
in the scratchpad memory and the DS18B20 returns to its idle state. If the DS18B20 is powered
by an external supply, the master can issue “read time slots” (see the 1-Wire Bus System section)
after the Convert T command and the DS18B20 will respond by transmitting 0 while the
temperature conversion is in progress and 1 when the conversion is done. If the DS18B20 is
powered with parasite power, this notification technique cannot be used since the bus must be
pulled high by a strong pullup during the entire temperature conversion. The bus requirements
for parasite power are explained in detail in the Powering the DS18B20 section.
The DS18B20 output temperature data is calibrated in degrees Celsius; for Fahrenheit
applications, a lookup table or conversion routine must be used. The temperature data is stored as
a 16-bit sign-extended two’s complement number in the temperature register (see Figure 2). The
sign bits (S) indicate if the temperature is positive or negative: for positive numbers S = 0 and for
negative numbers S = 1. If the DS18B20 is configured for 12-bit resolution, all bits in the

Dept. of ECE Page 15


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

temperature register will contain valid data. For 11-bit resolution, bit 0 is undefined. For 10-bit
resolution, bits 1 and 0 are undefined, and for 9-bit resolution bits 2, 1, and 0 are undefined.
Table 1 gives examples of digital output data and the corresponding temperature reading for 12-
bit resolution conversions.

LDR sensor:

A Light Dependent Resistor (LDR) is also called a photo resistor or a cadmium sulfide (CdS)
cell. It is also called a photoconductor. It is basically a photocell that works on the principle of
photoconductivity. The passive component is basically a resistor whose resistance value
decreases when the intensity of light decreases. This optoelectronic device is mostly used in
light varying sensor circuit, and light and dark activated switching circuits. Some of its
applications include camera light meters, street lights, clock radios, light beam alarms, reflective
smoke alarms, and outdoor clocks.

The snake like track shown below is the Cadmium Sulphide (CdS) film which also passes
through the sides. On the top and bottom are metal films which are connected to the terminal
leads. It is designed in such a way as to provide maximum possible contact area with the two
metal films. The structure is housed in a clear plastic or resin case, to provide free access to

Dept. of ECE Page 16


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

external light. As explained above, the main component for the construction of LDR is cadmium
sulphide (CdS), which is used as the photoconductor and contains no or very few electrons when
not illuminated. In the absence of light it is designed to have a high resistance inthe range of
megaohms. As soon as light falls on the sensor, the electrons are liberated and the conductivity
of the material increases. When the light intensity exceeds a certain frequency, the photons
absorbed by the semiconductor give band electrons the energy required to jump into the
conduction band. This causes the free electrons or holes to conduct electricity and thus dropping
the resistance dramatically (< 1 Kiloohm).

Dept. of ECE Page 17


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

Expected Outcome
 Avoiding unnecessary wastage of electricity.
 Reduced power consumption.
 Automation of devices.
 Overall reduction in electricity bill.

Dept. of ECE Page 18


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

Time schedule

Date Task

19/01/2019 Procurement of component and testing

02/02/2019 Interfacing all the components to the raspberry


pi\

16/02/2019 Working on face detection libraries in openCV

02/03/2019 Developing the python code

16/03/2019 Final model

30/03/2019 Report

Dept. of ECE Page 19


SMART ROOM FOR POWER SAVING USING IMAGE PROCESSING

References
 An Intelligent Energy-saving Service System ‘Jiun-Ren Ding, Jung-Chih Wang, Jr-Sheng
Su, Chi-Wei Huang, and Jenn-Lien Chu Department of Digital Home Systems
Technology, Home Networking Technology Center, Industrial Technology Research
Institute, Tainan, Taiwan (R.O.C.)

 www. Raspberrypi.org

 Digital image processing: Refel C Goanzalez and Richard E. Woods

 ‘A method of automatic people counting used in air-conditioning energy-saving ‘Qing Ye


College of Information Engineering North China University of Technology Beijing,
China yeqing_mail@163.com

Dept. of ECE Page 20

Você também pode gostar