Sunteți pe pagina 1din 50

BACHELOR OF ENGINEERING DEGREE/DEGREE WITH HONOURS

IN ELECTRICAL AND ELECTRONIC ENGINEERING

Final Year Project Report

School of Engineering and Technology


University of Hertfordshire

“ENERGY EFFICIENT HOME AUTOMATION SYSTEM”

Report by - YE NAUNG KYAW


Supervisor - Mr. ONG SWEE TIONG
Date - MAY 2018
School of Engineering and Technology BEng Final Year Project Report

DECLARATION STATEMENT

I guarantee that the project is my own and is any derivative or referenced


material, Works from other people who have been published or unpublished
are has been July acknowledged.

(Refer to UPRAS / C / 6.1, Appendix I, Section 2 - Cheats Section

And plagiarism)

Full Name: Ye Naung Kyaw

Registration Number: JE 000103/17

Signed: …………………………………………………

Date: January 2018

Ye Naung Kyaw/ Energy Efficient Home Automation System 1


School of Engineering and Technology BEng Final Year Project Report

ABSTRACT

The Energy Efficient Home Automation System is a home automation system that
will reduce the daily energy usage with the aid of sensing devices, without any major
changes in the infrastructure. Home Automation let the user able to control the home
from his or her computer/ mobile device and assign actions that should happen
depending on time or other sensor readings such as light, temperature or sound from
any device in the Home Automation network.

Ye Naung Kyaw/ Energy Efficient Home Automation System 2


School of Engineering and Technology BEng Final Year Project Report

ACKNOWLEDGEMENTS

First and foremost, I want to thank Mr. Ong Swee Tiong for his guidance, patience,
and for being always ready to help us. And the teachers who involved and guide to
get the right decision of the final project.

Last but not least, I would also like to thank Mr. Adai kalavan as well as Dr. Bala
Murugan( Ex. Head of Engineering Department ) for encouraging me to pursue on
this bachelor's degree programme.

I want to thank my family and friends for always supporting and inspiring me.

Ye Naung Kyaw/ Energy Efficient Home Automation System 3


School of Engineering and Technology BEng Final Year Project Report

TABLE OF CONTENTS
Declaration statement .............................................................................................. 1
Abstract ................................................................................................ 2
Acknowledgements ................................................................................................ 3
Table of contents ................................................................................................ 4
Glossary ................................................................................................ 5
1.Introduction …………………………………………………………………….. 7
1.1Background …………………………………………………………………….. 7
1.2.Objective of the project …………………………………………………………………….. 7
2. Literature Research …………………………………………………………………….. 8
2.1. Research and discussion-1 …………………………………………………………………. 8
2.2. Research and discussion-2 …………………………………………………………………. 9
3. Description of Project Hardware …………………………………………………………….11
3.1. Flow Chart of the “Energy Efficient Home Automation System”………………………… 11
3.2. Final Completed and Submitted Project ………………………………………………… 12
3.3 Layout of the Automation control board ……………………………………………………13
3.4 Arduino Uno R-3 microcontroller board ……………………………………………………15
3.5 .PIR SENSOR …………………………………………………………………………….. 24
3.6 Photo Resistor/ LDR ……………………………………………………………………. 29
3.7.Tracing Sensor Module/ reflective sensor ………………………………………….. 30
3.8.Relay Module ……………………………………………………...……………………... 31
3.9. Schematic Diagram of the “Energy Efficient Home Automation System” ……………… 33
4. Description of Project Software …………………………………………………………… 34
4.1. Program/ Coding of the “ Energy Efficient Home Automation System” ……………… 34
4.2. Explanation of the program procedure ………………………………………………….. 39
4.3. Flow chart ……………………………………………………………………………………. 41
4.4 Lighting layout and plan view of the house …………………………………….………….. 42
5. Result Discussion …………………………………………………………………………….. 43
6. Problems Encountered during progress ………………………………………………… 46
7. Further Development, Commercial Possibility ……………………………………….. 47
8. Conclusion …………………………………………………………………………………… 48
9. References ……………………………………………………………………………………. 49

Ye Naung Kyaw/ Energy Efficient Home Automation System 4


School of Engineering and Technology BEng Final Year Project Report

LIST OF FIGURES
Fig 2-1 Journal; vol-4 issue-1 Jan 2015 ( IJESIT )……………………………………………. 8
Fig 2-2 Journal; vol-77 no-3 July 2015 ( JATIT )……………………………………………… 9
Fig 2-3 Journal; vol-77 no-3 July 2015 ( JATIT )………………………………………...…… 10
Fig 3-1 Final submission project…………………………………………………………..…… 11
Fig 3-2 Fittings layout ………………………………………………………...………………… 12
Fig 3-3 Arduino Uno R-3 board………………………………………………………………… 13
Fig 3-4 Schematic diagram of Arduino Uno R-3 board………………………………..……. 14
Fig 3-5 Work flow of PIR sensor ……………………………………………………………… 15
Fig 3-6 PIR sensor metal housing ………………………………………………….…..……. 16
Fig 3-7 PIR sensor element layout …………………………………………………………... 16
Fig 3-8 PIR sensor internal schematic diagram ………….……………………….……….. 16
Fig 3-9 Section view of PIR sensor ………………………………………………….……… 17
Fig 3-10 Lens and light array of PIR sensor ………………………………………………. 17
Fig 3-11 Light array between lens and sensor ……………………………………….…..… 18
Fig 3-12 Multiple facet-section of len cover ………………………………….…..………… 18
Fig 3-13 PIR sensor module and 3-pin connection plug …………………………………. 19
Fig 3-14 PIR sensor module with plug connected …………..…………………………… 19
Fig 3-15 Wiring diagram of PIR sensor module testing using breadboard ……………. 20
Fig 3-16 Jumper position of PIR sensor …………………………………………………… 21
Fig 3-17 Jumper position of PIR sensor …………………………………………………… 22
Fig 3-18 Regulator position of PIR sensor ………………………………………………… 22
Fig 3-19 PIR sensor module without regulator …………………………………………….. 23
Fig 3-20 Connection PIR sensor with Arduino ……………………………………………... 24
Fig 3-21 Construction of photo resistor sensor …………………………………………….. 26
Fig 3-22 Light sensor circuit example …………………………………………………….….. 27
Fig 3-23 Reflective sensor ……………………………………………………………….……. 29
Fig 3-24 Relay module …………………………………………………………………….…… 30
Fig 3-25 SIM5320E GSM module ……………………………………………………………. 31
Fig 3-26 Schematic diagram of the project …………………………………………………. 33
Fig 4-1 Automatic system program flow of the project …………………………………….. 40
Fig 4-2 Flow chart …………………………………………………………………………..… 41
Fig 4-3 Intended plan layout of the house ………………………………………………….. 42
Fig 4-4 Testing the switching of relay modules with GSM signal …………….………..… 43
Fig 4-5 Testing the Arduino board with GSM signal ……………………………………… 43
Fig 4-6 Testing the final complete project with GSM signal …………………………...… 44
Fig 4-7 Testing the relay module with sensors …………………………………...………. 44

Ye Naung Kyaw/ Energy Efficient Home Automation System 5


School of Engineering and Technology BEng Final Year Project Report

GLOSSARY

GSM – Global System for Mobile Communication

LDR – Light Dependent Resistor

PIR – Passive InfraRed Sensor

LED - Light Emitting Diodes

NO - Normally Open

NC - Normally Closed

COM – Common

OTP - One Time Programmable

ROM - Read-only Memory

RAM - Random-access Memory

USB - Universal Serial Bus

GND – Ground

VCC – Voltage at the Common Collector

DC – Direct Current

AC – Alternative Current

Ye Naung Kyaw/ Energy Efficient Home Automation System 6


School of Engineering and Technology BEng Final Year Project Report

1.Introduction
1.1Background

Energy is the most required and essential in daily life of these modernise days. Energy
exists in different types and which we use in different way in our daily life cycle. Energy
consumption is one of the living costs. We can reduce our household expense if we can
reduce the energy consumption.

In this project, will discuss about home energy consumption and reduce the energy usage;
according to the title of “ Energy Efficient Home Automation System” .

Among the systems, will use “ Arduino” for the home automation; to control the home
appliances. Arduino which is open source, easy market availability and cheap in price; these
are the reasons to choose the “ Arduino” for this project.

1.2.Objective of the project

Objective of this project is to design and implement the Energy Efficient Home
Automation System. And Implementing the home with energy saving factor.

The system is expected to reduce energy usage in daily life cycle with automation.
The following aspects are determined the feasibility of the project to be considered;

• Allowable project cost should be around S$300


• Financially and technically feasibility
• Easy and finger tip user friendly project
• Suitable for further commercial and industrial application with the combination
of magnetic contactor

Ye Naung Kyaw/ Energy Efficient Home Automation System 7


School of Engineering and Technology BEng Final Year Project Report

2. Literature Research
2.1. Research and discussion-1

Fig 2-1. Journal; Vol-4, Issue-1, January 2015 ( IJESIT )

First of all, there is the discussion of “ International journal of engineering science


and innovative technology” from Department of Electronics and Communication
Engineering, Sree Buddha College of Engineering for Women, Kerala, India.[refer to
reference-1]

Ye Naung Kyaw/ Energy Efficient Home Automation System 8


School of Engineering and Technology BEng Final Year Project Report

The same idea and agreed with journal description of using GSM remote control and
will use the concept of GSM module, microcontroller and relays (which is switching
the home apparatus) for this project. GSM module is the easiest and longest
distance remote control for this modernise day.

2.2. Research and discussion-2

Fig 2-2. Journal; Vol-77, No-3, July 2015 ( JATIT )

Secondly, there is the discussion of using the android cell phone for the GSM remote
control from “BLUETOOTH BASED WIRELESS HOME AUTOMATION SYSTEM
USING FPGA, Journal of Theoretical and Applied Information Technology 31st July
2015. Vol.77. No.3 ”. [ refer to reference-2] .

Ye Naung Kyaw/ Energy Efficient Home Automation System 9


School of Engineering and Technology BEng Final Year Project Report

Fig 2-3. Journal; Vol-77, No-3, July 2015 ( JATIT )

Strongly agreed with that and use android cell phone for the remote controller which
is using the residents who stays in the house involved in this project. By using cell
phone, will get finger tip access remote control to switch the home apparatus.

Ye Naung Kyaw/ Energy Efficient Home Automation System 10


School of Engineering and Technology BEng Final Year Project Report

3. Description of Project Hardware


3.1. Final Completed and Submitted Project

Fig 3-1. Final submission project of the “ Energy Efficient Home Automation System”

Ye Naung Kyaw/ Energy Efficient Home Automation System 11


School of Engineering and Technology BEng Final Year Project Report

3.2 Layout of the Automation control board

Relay Module ( 2nos of relay module x 1pcs Circuitry switches


and 4nos of relay module x 1pcs ) which for individual circuit
supply the power to individual apparatus

GSM Module Arduino Uno R-3 Module Power supply for microcontroller board

Fig 3-2. Fitting layout of Arduino Uno, Relay module, GSM module and Circuitry switches

In this project, the following hardwares are used to complete functional project of “ Energy
Efficient Home Automation System”.

1.PIR Sensor,

2.Photo Resistor Sensor,

3.Reflective/ Tracing Sensor Module,

Ye Naung Kyaw/ Energy Efficient Home Automation System 12


School of Engineering and Technology BEng Final Year Project Report

4.Arduino Uno R-3 Microcontroller,

5.Relay Module and

6.Light bulbs.

3.3 Arduino Uno R-3 microcontroller board

Fig 3-3. Arduino Uno R-3 microcontroller board ( using ATmega328 )

Arduino Uno is ATmega328P used microcontroller board. There is 6


analogue inputs, 14 digital input/output pins (6 of the pins can be used as
PWM outputs), a 16 MHz quartz crystal, a power jack, a USB connection, a
reset button and an ICSP header. It include everything which are required for
the microcontroller; power supply with battery or AC-DC adapter or USB
cable to get started.

Ye Naung Kyaw/ Energy Efficient Home Automation System 13


School of Engineering and Technology BEng Final Year Project Report

Fig 3-4. Schematic diagram of the Arduino Uno R-3 microcontroller board

Ye Naung Kyaw/ Energy Efficient Home Automation System 14


School of Engineering and Technology BEng Final Year Project Report

3.4 .PIR SENSOR

Function
More complex than other sensors. There are several variables that affect the
input and output of the sensor.
There are two slots in the sensor, using special materials to make each slot
sensitive to IR. The lens used here does not have much effect, so we see that
the two slots can "see" a distance (basically the sensitivity of the sensor). When
the sensor is idle, the two slots detect the same amount of infrared radiation, the
amount of radiation from the room or the wall or the outside. When a warm body
such as a human or an animal passes, half of the PIR sensor is intercepted,
which results in a positive difference between the two halves. When the warm
body leaves the sensing area, the opposite occurs, causing a negative
differential change in the sensor. These change pulses are detected during the
period of movement and non-movement. [refer to reference-3]

Fig 3-5. Work flow of PIR sensor

The sensor is mounted in a sealed metal canister to increase noise/ temperature/


humidity immunity. There is a window made of infrared transmissive material
(usually coated silicon because this is very easy) to protect the sensing element.
Behind the window are two balance sensors.

Ye Naung Kyaw/ Energy Efficient Home Automation System 15


School of Engineering and Technology BEng Final Year Project Report

Fig 3-6. PIR sensor metal housing [ image from Murata datasheet ]

Fig 3-7. PIR sensor element layout [Image from RE200B datasheet]

Above diagrams showing the element window, the two pieces of sensing material

Fig 3-8. PIR sensor internal schematic diagram [Image from RE200B datasheet]

Above images shown the internal schematic. Very low-noise JFET is inside (a
type of transistor) and the extremely high impedance of the sensor is buffered
into what is perceived by a low-cost chip such as the BIS0001.

Ye Naung Kyaw/ Energy Efficient Home Automation System 16


School of Engineering and Technology BEng Final Year Project Report

Lenses
PIR sensors are generic and the most part vary only in price and sensitivity. This
is a good manufacturing idea: Circuitry and the PIR sensor is fixed and costs a
few dollars. The lens; can change the breadth, sensing pattern, range, very
easily and costs only a few cents.
In the diagram up top, the lens made of plastic, that the detection area is just two
rectangles. Normally to have a detection area that is much larger. To do that, we
use a simple lens those found in a camera: these condenses a large area (such
as a landscape) into a small one (on film or a CCD sensor). For reasons that will
be apparent soon, to make the PIR lenses thin, small and mouldable from cheap
plastic, even though it may add distortion. For this reason the sensors are
actually Fresnel lenses:

Fig 3-9. Section view of PIR sensor lens [Image from Sensors Magazine]

The Fresnel lens condenses light, providing a larger range of IR to the sensor.

Fig 3-10. Lens and light array of PIR sensor [Image from BHlens.com]

Ye Naung Kyaw/ Energy Efficient Home Automation System 17


School of Engineering and Technology BEng Final Year Project Report

Fig 3-11. Light array between lens and sensors [Image from Cypress appnote 2105]

Now, there is a bigger scope. There are actually two sensors, and more
importantly, there is no need for two very large sensing area rectangles, but
multiple small area scattering. Therefore, the lens is divided into multiple parts as
Fresnel lenses for each part.

Fig 3-12.The multiple facet-sections of lens cover

The above photo shows each side of different Frenel lenses.


The sub-lenses and different facets produce a series of detection areas that are
interleaved. This is why the lens center in the above aspect is 'inconsistent' -
every other point to the different half of the PIR sensing element

Ye Naung Kyaw/ Energy Efficient Home Automation System 18


School of Engineering and Technology BEng Final Year Project Report

Connecting of PIR sensor

Fig 3-13. PIR sensor module and 3-pin connection plug

The PIR module has a 3-pin connection on the side or bottom. The pin
arrangement may differ between modules. It is usually silkscreened next to the
connection. One pin will be the signal, the other will be ground, and the last one
will become the power supply. Usually 3-5VDC power input, but sometimes up to
12V. Larger modules do not have a direct output, but only operate relays, in
which case there is a power supply, ground, and two switches.
Some relay outputs may be 'open collector' - meaning that a pull-up resistor is
required. If you do not get a variable output, be sure to connect a 10K pull-up
resistor between the power supply pin and the signal.
A simple PIR sensor prototype design method is to connect it to the breadboard,
because the connection port spacing is 0.1 inches, some PIR with a fixed
connector, there is a straight 3-pin connector for connecting the cable.

Fig 3-14. Plug connected with PIR sensor module

In the figure above, the red cable is a positive voltage supply, the black cable is
a negative ground supply, and the yellow is a signal output. Just make sure to

Ye Naung Kyaw/ Energy Efficient Home Automation System 19


School of Engineering and Technology BEng Final Year Project Report

insert the cable as shown above. If the retrograde does not damage the PIR, it
does not work.

Testing a PIR

Fig 3-15. Wiring diagram of PIR sensor module testing using breadboard

When PIR detects motion, the LED lights up and the output pin will change to
"high" to 3.3V.
After the breadboard is connected, insert the battery and wait for the PIR to
"stabilize" for 30-60 seconds. During this time, the LED may flash a little. Wait for
the LED to turn off, then move in front of it, wave your hand, etc. and see the
LED light up.

Retriggering
There are several options to re-trigger the PIR. Explore the 're-trigger' option.
Once the LED flashes, look at the back of the PIR sensor and place the jumper
in the L position as shown below.

Ye Naung Kyaw/ Energy Efficient Home Automation System 20


School of Engineering and Technology BEng Final Year Project Report

Fig 3-16. Jumper position of PIR sensors

Another way is that when connecting a PIR sensor with a breadboard, the LED
does not remain on when moving in front of it, but actually turns on and off every
second or so. This is the so-called "non-retriggering."

Now replace the jumper so that it is in the H position. If set up the test, it will
notice that the LED now stays the same throughout the move. This is the so-
called "re-trigger."

For most applications, the "re-trigger" (H-mode jumper shown below) mode is
slightly better.

Ye Naung Kyaw/ Energy Efficient Home Automation System 21


School of Engineering and Technology BEng Final Year Project Report

Fig 3-17. Jumper position of PIR sensor

If need to connect the sensor to an edge-triggered location, it must be set to


"non-retriggering" (the jumper is in position L).

Changing sensitivity

The PIR has a regulator on the back for adjusting the sensitivity. If the PIR is not
sensitive enough or sensitive, adjust it - clockwise to make it more sensitive.

Fig 3-18. Regulator position of PIR sensor

Changing Pulse Time and Timeout Length


There are two "timeouts" associated with PIR sensors. One is the "Tx" timeout:
how long the LED is lighted after detecting movement - this is easily adjusted on
the Adafruit PIR because there is a potentiometer.
The second is the "Ti" timeout, which is how long the LED is guaranteed to be off
when there is no movement. This one is not easy to change, but it is reasonable
if you use the iron.
First of all, let us look again at the BISS data sheet

Ye Naung Kyaw/ Energy Efficient Home Automation System 22


School of Engineering and Technology BEng Final Year Project Report

On the Adafruit PIR sensor, there is a trimmer potentiometer labeled TIME. This
is a 1 megohm adjustable resistor that is added to the 10K series
resistor.And C6 is 0.01uF so

Tx = 24576 x (10K + R time) x 0.01uF


If the Rtime potentiometer is turned all the way down counter-clockwise (to 0
ohms) then

Tx = 24576 x (10K) x 0.01uF = 2.5 seconds (approx)


If the Rtime potentiometer is turned all the way up clockwise to 1 Megaohm then

Tx = 24576 x (1010K) x 0.01uF = 250 seconds (approx)


If RTime is in the middle, it takes about 120 seconds (two minutes), so it can be
adjusted as needed. For example, if you want someone to turn the fan on for at
least 1 minute, set the Rtime potentiometer to about 1/4.

For older/other PIR sensors

If there is a PIR sensor with no potentiometer adjustment elsewhere, the


adjustment resistor can be found by:

Fig 3-19. PIR sensor module without regulator

It is not too difficult to determine R10 and R9. Unfortunately, this PIR sensor was
mislabelled (it looks like they have changed R9 R17). Track the pins by looking
at the BISS001 datasheet and find out what they are - R10 is connected to pin 3,
and R9 is connected to pin 7. The capacitors are a bit hard to determine, but
they can be "reverse engineered" so that they Time and solve the sensor!

Ye Naung Kyaw/ Energy Efficient Home Automation System 23


School of Engineering and Technology BEng Final Year Project Report

For example:
Tx is = 24576 * R10 * C6 = ~1.2 seconds
R10 = 4.7K and C6 = 10nF
Likewise,
Ti = 24 * R9 * C7 = ~1.2 seconds
R9 = 470K and C7 = 0.1uF
It can change timing by swapping different resistors or capacitors.

Using a PIR w/Arduino


Read the PIR sensor, Connecting the PIR sensor to the microcontroller is very
simple. The PIR is used as a digital output, so all we need to do is monitor the
pin toggle high (detect) or low (not detected).
It is very likely that if want to reposition it, so be sure to place the jumper in the H
position!
Use a 5V power supply to power the PIR and ground to ground. Then connect
the output to the digital pin. In this example, we will use pin 2.

Fig 3-20. Connection PIR sensor with Arduino

The code is very simple, basically just tracking whether pin 2's input is high or
low. It also tracks the status of the pins to print out messages when the motion
starts and stops.

3.5 .Photo resistor

Also known as light-sensitive resistor (LDR), the most commonly used light-sensitive
device to indicate the presence or absence of light. And used to measure light
intensity. It has a very high resistance in the dark, up to 1 MΩ, but drops sharply
when exposed to light until it reaches several ohms depending on the light intensity.
The sensitivity of the LDR varies with the wavelength of the applied light and is a
non-linear device. Used in many applications but sometimes abandoned by other
devices such as photodiodes and phototransistors. Made of lead or cadmium, and

Ye Naung Kyaw/ Energy Efficient Home Automation System 24


School of Engineering and Technology BEng Final Year Project Report

some countries have already banned LDR for environmental safety issues. [refer to
reference-4]

Light dependent resistor definition


The photoresistor is a photoresistor whose resistance decreases with increasing light
intensity.

Types of photo resistors and working mechanisms


According to the materials used, photoresistors can be divided into two types;
internal and external. The use of an undoped material such as silicon or germanium
is referred to as intrinsic light resistance. Photons that fall on the device excite
electrons from the valence band to the conduction band, and the process creates
more free electrons in the material, which is a smaller resistance and can conduct
current. The use of doped materials with impurities is called an external
photoresistor, also called a dopant. It creates a new energy band above the existing
valence band, consisting of electrons. Due to the smaller energy gap, these
electrons require less energy to switch to the conduction band. The result is a device
that is sensitive to light of different wavelengths. In any case, both types exhibit a
decrease in resistance when illuminated. The higher the light intensity, the greater
the drop in resistance. Therefore, the resistance of LDRs is a reversed, non-linear
function of light intensity.

Wavelength dependency
The sensitivity of the photoresistor may vary depending on the wavelength of the
light. If the wavelength exceeds a certain range, the resistance of the device is not
affected at all. This means that the sensitivity of LDR is not suitable for this light
wavelength range. Different materials have unique spectral response curves with
different wavelengths and sensitivities. The extrinsic LDR is designed for light of
longer wavelengths and has an infrared (IR) tendency. When operating in the
infrared range, care must be taken to avoid heat build-up, which may affect the
measurement by changing the resistance of the device due to thermal effects. The
figure shows the spectral response of photodetectors made of different materials.
The operating temperature is represented by K and written in parentheses.

Sensitivity
LDR has lower sensitivity than phototransistors and photodiodes. Phototransistors
and photodiodes use light to control the flow of holes and electrons on the PN

Ye Naung Kyaw/ Energy Efficient Home Automation System 25


School of Engineering and Technology BEng Final Year Project Report

junction, as well as true semiconductor devices. LDR is a passive component and


lacks a PN junction. If the light intensity remains constant, the resistance may still
change significantly due to temperature changes, so they are also sensitive to
temperature changes. This property makes LDR unsuitable for accurate light
intensity measurement.

Latency
There is a time delay between the illumination and the resistance change. This is
called the resistance recovery rate. When light is applied after it is completely dark, it
takes about 10 milliseconds to completely eliminate the resistance. After completely
removing the light, the resistance takes 1 second to return to the initial value. This is
why LDR cannot be used for fast fluctuations in the light that needs to be recorded or
used to drive the control device, but in other devices, such as audio compressors,
where the function of the photoresistor is a smooth response.

Fig. 3-21 Construction of photo resistor sensor

Construction and properties of Photo resistors


Similar characteristics have been found since the discovery of the photoconductivity
of selenium. In the 1930s and 40s, with the development of photoconductors made
of silicon and germanium, PbS, PbSe and PbTe were studied. Modern LDR uses
lead sulphide, lead selenide, indium antimonide, and most commonly cadmium
selenide and cadmium sulfide. The popular type is cadmium sulfide, commonly
denoted as CdS photoresistor. Cadmium sulfide LDR was made using a mixture of
inert binder material and highly purified cadmium sulfide powder. The mixture is then
pressed and sintered. The electrodes were vacuum evaporated onto one side of the
surface to form a staggered comb and connect the connection leads. To prevent
surface contamination, the disc is packaged in clear plastic or in a glass envelope.
The spectral response curve of cadmium sulfide matches the spectral response
curve of the human eye. The peak sensitivity wavelength is in the visible part of the
spectrum, approximately 560-600 nm. RoHS laws prohibit the use of equipment
containing lead or cadmium in some countries.

Ye Naung Kyaw/ Energy Efficient Home Automation System 26


School of Engineering and Technology BEng Final Year Project Report

Typical applications for photoresistors


Most often used as a light sensor. Can use them as long as there need to detect the
presence and absence of light and measure the light intensity. Photographic lighting
meters and night lighting are examples of this. The line-following robot is a light-
sensitive resistor application that uses a light source and two or more LDRs to
determine the required changes of course. In audio compressors, the function of
LDRs is to introduce delay responses because their response to light is not
instantaneous.

Fig 3-22. Light sensor circuit example


Light sensor
When a basic photosensor is needed, an LDR circuit such as the one in the figure
can be used. When the intensity of light reaching the LDR resistor is sufficient, the
LED lights up. The 10K varistor is used to set the LED on threshold. If the LDR lamp
is below the threshold intensity, the LED will remain off. In practice, the LED will be
replaced with a relay or the output can be connected to a microcontroller or other
device. If a dark sensor is needed, the LED will light up in the absence of light and
the LDR and the two 10K resistors should be swapped.

Audio compressors
The audio compressor is a device that reduces the gain of the audio amplifier when
the signal amplitude is higher than a set value. This is done to amplify soft sounds
while preventing loud sounds from being cut. Some compressors use LDRs and
small light bulbs (LEDs or electroluminescent panels) connected to the signal source
to produce changes in signal gain. This technique is considered by some to add
smoother characteristics to the signal because the response time of light and
resistance softens the attack and release. The response time delay for these
applications is approximately 0.1 seconds.

Light dependent resistor symbol


The symbols shown below are used to describe photosensitive resistors or
photoresistors that conform to IEC standards. The resistance symbol will circle with
the arrow outside the circle.

Ye Naung Kyaw/ Energy Efficient Home Automation System 27


School of Engineering and Technology BEng Final Year Project Report

photoresistor symbol
IEC standard
Detail about Keyes Photoresistor Sensor
The light resistance module is used to indicate whether there is light. This module
can also be used to measure light intensity. The module can easily sense the light
level inside the Arduino controller. Photoresistors can also be seen in our daily life.
They are mainly used for smart switches and bring some convenience to our student
Live. However, they are also used in our daily electronic design. Well, for better use,
we have the right modules that are easy to use and efficient.

Specifications
Brand - Keyes
Model - KY-018
Operating voltage - DC 5 V
Compatibility - Arduino
Color - Black
Material - FR4
Length - 26mm
Width - 5mm

Main Features:
● Dark current, dark resistance: The photo-resistor under a certain applied voltage.
When the flowing current is called dark current, it does not irradiate light. The ratio of
applied voltage and dark current is used as dark resistance.
● Sensitivity: Sensitivity is the relative change of the resistance value (photoresist)
value of the resistance value (dark resistor) when the light is irradiated by the
photoresistor.
● Volt-ampere characteristic curve: The voltage characteristic curve is used to
describe the relationship between the resistance of the applied voltage and the
photosensitive photocurrent. On the photosensitive device, the photocurrent of the
applied voltage increases.
●Temperature coefficient: Photoresistance of photoelectric effect influenced by
temperature, low sensitivity of photosensitivity at low temperature part of
photosensitive resistor.
● Rated power: The rated power of the photoresistor allows power consumption to
be reduced when the temperature is increased in some circuits.

Pins Map
• S : Analog Output
• Mid : Supply ( 5V )
• - : Ground

Ye Naung Kyaw/ Energy Efficient Home Automation System 28


School of Engineering and Technology BEng Final Year Project Report

3.6.Tracing Sensor Module/ reflective sensor

The TCRT5000 and TCRT5000L are reflective sensors that contain an infrared
emitter and phototransistor in a leaded package. The lead package blocks visible
light. The package includes two mounting clips. The TCRT5000L is the long-term
leading version.

The sensor detects whether the light reflection or absorption area is in front of it. It
shows which of the two areas it passes through the digital output, as shown in the
following figure. The sensor's sensitivity (minimum range) can be adjusted by the
controller. This behaviour can be used to automatically follow a line of the robot.

Fig 3-23 Reflective sensor

Specifications
• Package type: leaded
• Detection type: phototransistor
• Dimensions(LxWxH in mm):10.2x5.8x7
• Max operating distance: 2.5 mm
• Operating range within>20%relativecollector current: 0.2 mm to 15 mm
• Typical output current under test: IC = 1 mA
• Daylight blocking filter
• Emitter wavelength: 950 nm
• Lead (Pb)-free soldering released
• Compliant to RoHS directive 2002/95/EC and in accordance to WEEE
2002/96/EC

Applications
Position sensor for shaft encoder

Detection of reflective material such as paper, IBM cards, magnetic tapes etc.

Limit switch for mechanical motions in VCR

General purpose - wherever the space is limited

Ye Naung Kyaw/ Energy Efficient Home Automation System 29


School of Engineering and Technology BEng Final Year Project Report

Connections Arduino:

Sensor signal = [Pin 10]

Sensor +V = [Pin 5V]

Sensor GND = [Pin GND]

3.7.Relay Module

The 4-channel/2-channel digital relay module provides 4-channel/2-channel input


and output for maximum connection. DC 30V 10A or AC 250V 10A equipment
control lights and motors, etc. When using Arduino to do interactive projects, many
high-current or high-voltage equipment can not be directly controlled using Arduino
digital IO ports (such as solenoid valves, lights, motors, etc.) Consider using a relay
solution to solve it.

Fig 3-24 Relay modules ( 4-channel and 2-channel )

Ye Naung Kyaw/ Energy Efficient Home Automation System 30


School of Engineering and Technology BEng Final Year Project Report

Specifications

*Board four weeks with four screw holes, hole diameter 3.1mm, easy to install and
fixed.
*Relay selection of quality loose music relays, SPDT. A common terminal, a normally
open, one normally closed terminal.
*Optocoupler isolation, and good anti-jamming.
*Low pull, high release. Energisation status indicator light, release status LED is off.
*VCC for the system power, JD_VCC for the relay power.
*Default hair 5V relay, plug the jumper cap to wiring.
*Relay Maximum output: DC 30V/10A, AC 250V/10A
*VCC: positive power supply system
*GND: System power supply negative
*IN1 - IN4/ IN1 – IN2 : relay control ports

3.8 SIM5320E GSM Module

Description
The SIM5320E is a GSM / GPRS / GPS module. It can send/receive messages,
make/receive calls, and transmit data - all essential basic telephone features. The
GSM module has two antenna interfaces, one for GPS and the other for GSM /
GPRS.
The GSM module supports quad-band 850MHz GSM, 900MHz EGSM, 1800MHz
DCS, 1900MHz PCS and dual-band UMTS / HSDPA 900/2100MHz WCDMA +
HSDPA frequencies. You can use any 2G/3G SIM card to connect to any global
GSM network. It has a fully integrated GPS (Qualcomm PM8015 GPS) that can be
controlled and queried through the same serial port.
Easily make/receive calls using a headset or an external 8Ω speaker + electret
microphone. Send/receive data over TCP/IP, HTTP, HTTPS, FTP. The AT command
interface can be used with 300, 600, 1200, 4800, 9600, 19200, 38400, 57600,
115200, 230K, 461K, 961K, 3.2M, 3.7M and 4.0 Mbps.
The power supply ranges from 4.6 - 5.2V. The minimum current required is 1A.
Modules smaller than 1A will not work!

Fig 3-25 SIM5320E GSM module

Ye Naung Kyaw/ Energy Efficient Home Automation System 31


School of Engineering and Technology BEng Final Year Project Report

Technical details

GPS specification

Acquisition channel: 16
GPS code: GPS L1 C/A code
Sensitivity: Tracking: -157 dBm, Cold Start: -144 dBm
First repair time: Cold start: 100s (typical), Hot start: 1s (typical)
Accuracy: about 2.5 meters

Module specifications

Input voltage: 4.6 - 5.2V


Minimum current: 1A
The default baud rate: 115200
Communication interface: TTL signal 2.85 - 5V
Operating temperature: -40 to 85°C
Size: 51 x 42 x 11 mm
Weight: 85g

Ye Naung Kyaw/ Energy Efficient Home Automation System 32


School of Engineering and Technology BEng Final Year Project Report

3.9. Schematic Diagram of the “Energy Efficient Home Automation System”

Fig 3-26. Schematic diagram of the “Energy Efficient Home Automation System” using
easyEDA software

Ye Naung Kyaw/ Energy Efficient Home Automation System 33


School of Engineering and Technology BEng Final Year Project Report

4. Description of Project Software

4.1. Program/ Coding of the “ Energy Efficient Home Automation System”


/*

* Sensor pin

* -------- -------

* GSM 5VT 2

* GSM 5VR 3

* LDR A5

* Bed 1 Switch 9

* Bed 2 Switch 10

* Bed 1 Light 11

* Bed 2 Light 12

* Kitchen In Sensor 5

* Kitchen Out Sensor 6

*/

#include<SoftwareSerial.h>

#define GSMSerial SoftwareSerial

#define rxPin 2

#define txPin 3

GSMSerial GSMDevice = GSMSerial(rxPin,txPin);

#define CountUp 5

#define CountDown 4

#define Kitchen_Light A0

#define Walk_Light A1

#define Bed1 6

#define Bed2 7

#define Living_Light A2

#define PIR_Sensor 8

#define Bed1_Switch 9

Ye Naung Kyaw/ Energy Efficient Home Automation System 34


School of Engineering and Technology BEng Final Year Project Report

#define Bed2_Switch 10

#define Bed1_Light 11

#define Bed2_Light 12

char GSM_Sender[20];

char GSM_Waste[40];

char GSM_OnOff[5];

char GSM_Intv[4];

enum State{Auto=1,AllOff}; //Define States

byte State=Auto;

byte count=0;

unsigned long Time;

void setup()

Serial.begin(9600);

GSMDevice.begin(9600);

init_Moderm(); //Initialize GSM Module

pinMode(CountUp,INPUT_PULLUP);

pinMode(CountDown,INPUT_PULLUP);

pinMode(Bed1,INPUT_PULLUP);

pinMode(Bed2,INPUT_PULLUP);

pinMode(PIR_Sensor,INPUT);

pinMode(Bed1_Switch,INPUT);

pinMode(Bed2_Switch,INPUT);

pinMode(Bed1_Light,OUTPUT);

pinMode(Bed2_Light,OUTPUT);

pinMode(Living_Light,OUTPUT);

pinMode(Walk_Light,OUTPUT);

pinMode(Kitchen_Light,OUTPUT);

void loop()

Ye Naung Kyaw/ Energy Efficient Home Automation System 35


School of Engineering and Technology BEng Final Year Project Report

switch(State)

case Auto:

Auto_Function();

break;

case AllOff:

AllOff_Function();

break;

default:

State=Auto;

break;

void init_Moderm (void)

GSMDevice.print("AT\r");

delay(300);

GSMDevice.println("AT+CMGF=1"); // set SMS mode to text

delay(300);

GSMDevice.println("AT+CNMI=2,2,0,0,0"); // set module to send SMS data to Serial1 out upon receipt

delay(300);

GSMDevice.print("ATE0\r");

delay(300);

GSMDevice.print("AT+CMGD=1,4\r");

delay(300);

void Waiting_SMS_Command (void)

if(GSMDevice.available())

int data = GSMDevice.read();

Serial.println(data);

Ye Naung Kyaw/ Energy Efficient Home Automation System 36


School of Engineering and Technology BEng Final Year Project Report

if(data=='+')

while(!GSMDevice.available()){}

data = GSMDevice.read();

Serial.println(data);

if(data=='C')

while(!GSMDevice.available()){}

data = GSMDevice.read();

Serial.println(data);

if(data=='M')

while(!GSMDevice.available()){}

data = GSMDevice.read();

Serial.println(data);

if(data=='T')

while(!GSMDevice.available()){}

data = GSMDevice.read();

Serial.println(data);

if(data==':')

GSMDevice.readBytesUntil(',',GSM_Sender,20);

GSMDevice.readBytesUntil('\n',GSM_Waste,40);

GSMDevice.readBytesUntil('.',GSM_OnOff,5);

GSMDevice.readBytesUntil(',',GSM_Intv,4);

delay(100);

for(byte i=0;i<5;i++)

Serial.println(GSM_OnOff[i]);

if(GSM_OnOff[0]=='A')

if(GSM_OnOff[1]=='u')

if(GSM_OnOff[2]=='t')

Ye Naung Kyaw/ Energy Efficient Home Automation System 37


School of Engineering and Technology BEng Final Year Project Report

if(GSM_OnOff[3]=='o')

State=Auto;

return;

if(GSM_OnOff[0]=='O')

if(GSM_OnOff[1]=='f')

if(GSM_OnOff[2]=='f')

State=AllOff;

return;

Ye Naung Kyaw/ Energy Efficient Home Automation System 38


School of Engineering and Technology BEng Final Year Project Report

4.2. Explanation of the program procedure


Program is design to control the home apparatus with two modes; semiauto and
manual.
Semi-auto
When SMS “Auto.” from the mobile cell phone to GSM module, apparatus in the
home is under control of the sensors except two bed rooms.
Living room lighting controlled by PIR sensor. Living room light will turn-on when
resident enter the house from the outside or enter the living room from the corridor.
At auto stage, there will be half dimmed lux level if there is nobody/ no movement in
the living room. Only full lux level of the light when there is somebody/ movement in
the living room.
Corridor lighting controlled by photoresistor ( including reflective sensors which
embedded in the door frame of the each bed room), meanwhile lightings of the
bedrooms are individual manual switch control. Used LDR sensor for corridor light
control, there will be light on whenever there is necessary. Means light will turn on
not only in night, but also there is dark.
Kitchen, toilet and bath room lighting will be controlled by counter units which
installed at the entrance of the kitchen and bath room. Lights will be turn-on when
somebody start enter the kitchen, and light will be turn-off only there is nobody in the
kitchen and bathe room. Means counter will counts up residents enter the kitchen
and count down when they go out from the kitchen. Light will on till there is last
person and turn off only last person go out from the room.
When SMS “ OFF.” From the mobile cell phone to GSM module, all apparatus in the
home will switch off. But bed rooms lights are still able to turn on using by manual
switches. The rest of lighting are only operable after SMS “ Auto.” again. This is the
way of switching on and off of this “ Energy Efficient Home Automation System”.
There is three switches at the main control board to switch off individual circuit for
the maintenance purpose.
Below fig- 8, shown the flow of the project automation procedure.

Ye Naung Kyaw/ Energy Efficient Home Automation System 39


School of Engineering and Technology BEng Final Year Project Report

Fig 4-1. Automatic program flow of the project

Ye Naung Kyaw/ Energy Efficient Home Automation System 40


School of Engineering and Technology BEng Final Year Project Report

4.3. Flow Chart of the “Energy Efficient Home Automation System”

Fig 4-2. Flow chart of the “Energy Efficient Home Automation System”

Ye Naung Kyaw/ Energy Efficient Home Automation System 41


School of Engineering and Technology BEng Final Year Project Report

4.4. Lighting layout and plan view of the house

Fig 4-3. Intended Layout plan of the house in this project


Circuit No.1- Living room,
Circuit No.2- Bed rooms,
Circuit No.3- Corridor,
Circuit No.4- Kitchen + Bathroom and toilet

Ye Naung Kyaw/ Energy Efficient Home Automation System 42


School of Engineering and Technology BEng Final Year Project Report

5. Result Discussion

Fig 4-4. Testing the switching of relay modules with GSM signal

Fig 4-5. Testing the Arduino board with GSM signal

Ye Naung Kyaw/ Energy Efficient Home Automation System 43


School of Engineering and Technology BEng Final Year Project Report

Fig 4-6. Testing the final project with GSM module

Fig 4-7. Testing the relay module with GSM signal together with sensors
Each and every component involved in the control of this project have tested
individually and functionally. Combine all component together and coding debugging.
This process of testing and programming is taking longest time in this project and
most of the challenge part of the project.
Finally project is functionally, but still there is another problem of sensors malfunction
of the light reflection which involved in the project and environment lighting.
There is the final functional project after many round of test run.
Assume that day time operations of the lighting is same as the normal and in this
project timing.

Ye Naung Kyaw/ Energy Efficient Home Automation System 44


School of Engineering and Technology BEng Final Year Project Report

Assume that night operating hour of the lights are from 6:30pm to 11:00pm.

Usage of the lighting lux levels are as below ( normal condition );


1.Living room lights – 24W + 24W ( total 48W)
2.Bed room lights – 24W + 24W ( total 48W)
3.Corridor lights – 24W + 24W ( total 48W)
4. Kitchen, bathe room and toilet lights – 24W + 12W + 12W ( total 48W)
There will be 192W and 4.5hours lighting usage in normal condition, means 0.864
units ( 0.864KWH ) consumed in a night. For the month of January, will consume
26.784 units use for night lighting.

Usage of lighting lux levels are as below ( in this project )


1.Living room lights – Used lighting come with motion sensor which will dimmed
most of the time and only will be full lux level when there is somebody. Assume that
resident stay in living room 2hrs in night. Hence, 48Wx2hrs + 24Wx2.5hrs =
0.156KWH
2.Bed room lights – 24W + 24W ( total 48W) x 4.5hrs = 0.216KWH
3.Corridor lights – Used lighting come with motion sensor which will dimmed most of
the time and only will be full lux level when there is somebody. Assume that resident
use corridor 2 hrs during night, hence; 48Wx2hrs + 24Wx2.5hrs = 0.156KWH
4. Kitchen, bathe room and toilet lights – Used lighting come with motion sensor
which will dimmed most of the time and only will be full lux level when there is
somebody. Assume that resident use corridor 2 hrs during night, hence; 48Wx2hrs +
24Wx2.5hrs = 0.156KWH
There will be total unit consumption 0.684 units ( 0.684KWH ) from 6:30pm to
11:00pm. For the month of January, will consume 21.204 units use for night lighting.
Compare to the normal ( 26.784 units ) and proposed project lighting usage (21.204
units ) in January, there will be 21% saving unit consumption for the night lighting.

Ye Naung Kyaw/ Energy Efficient Home Automation System 45


School of Engineering and Technology BEng Final Year Project Report

6. Problems Encountered during progress


Not familiar with Arduino accessary and bought different type of GSM module and
unable to function the project. Took time to resolve this issue.
Take time to do the coding for the microcontroller and have to test one by one of the
appliances involved in the project.
Willing to be nice presentable project and efforting the hard ware project frame is
take time and have to buy many small items such as pvc casing, screw, wire, wire
connector, pvc tape, hot glue gun, and etc.
Solution to avoid these above problem is to do the project on paper first, and
secondly list out the items to collect from which source.

Ye Naung Kyaw/ Energy Efficient Home Automation System 46


School of Engineering and Technology BEng Final Year Project Report

7. Further Development, Commercial Possibility


Project can be use in commercial if combine with magnetic contactor. Combination
with magnetic contactor which can carry higher current than the relay in this project.
This combination can use to control the all apparatus in the house including air-con,
washing machine and fan, and don’t have to worry about carrying overcurrent by
control circuit.
Not only in the house, but also applicable in commercial building as well as in
industrial application with some modification and combinations.

Ye Naung Kyaw/ Energy Efficient Home Automation System 47


School of Engineering and Technology BEng Final Year Project Report

8. Conclusion
Project cost around S$350 dollar(including the frame) which is S$50 more than
allowable cost, but useful function for the daily life to save energy. Spend S$350 and
saved S$123.597 ( different units/ saving units 26.784 - 21.204 = 5.58units x current
EMA unit rate 22.15cent/unit = S$123.597 ) for month of January, means it is
“financially feasible”.
Since easy and finger tip application for the home lighting control, it’s consider
“technically feasible”.

For the other apparatus like air-con, fan, washing machine, heater, kitchen
apparatus and pumping system, require higher ampere rate of switching device such
as magnetic contactor for safety reason. Current provision of relay units are only for
lighting circuits.
After combination with magnetic contractor, this project enable to use in commercial
and industrial application.
Further more upgrading of the sensors and some component, this system can
replace some of automation system in heave industrial application.
Most of all, project achieved the objective and complete successfully.

Ye Naung Kyaw/ Energy Efficient Home Automation System 48


School of Engineering and Technology BEng Final Year Project Report

9. References
1. ( [reference-1]’Energy Efficient Smart Home Automation System”, International Journal of
Engineering Science and Innovative Technology (IJESIT) Volume 4, Issue 1, January 2015;
Department of Electronics and Communication Engineering, Sree Buddha College of
Engineering for Women, Kerala, India )

2 ( [reference-2] “BLUETOOTH BASED WIRELESS HOME AUTOMATION SYSTEM


USING FPGA”’ Journal of Theoretical and Applied Information Technology, Department of
ECE, K L University )

3 https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/how-pirs-
work

4 http://www.resistorguide.com/photoresistor/

5 https://www.greenelectronicstore.com/modules/235-ky-033-tracing

Ye Naung Kyaw/ Energy Efficient Home Automation System 49

S-ar putea să vă placă și