You are on page 1of 35

lOMoARcPSD|28145601

Thesis Project Final-1

Electrical engineering (Addis Ababa University)

Studocu is not sponsored or endorsed by any college or university


Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)
lOMoARcPSD|28145601

WACHEMO UNIVERSITY
COLLEGE OF ENGINEERING AND TECHNOLOGY
SCHOOL OF ELECTRICAL AND COMPUTER ENGINEERING
BSc Thesis Report

Title <AUTOMATIC ROOM LIGHT AND TEMPERATURE


CONTROL BY USING MICROCONTROLLER=
In Partial Fulfillment for the Award of BSc Degree

Submitted To

Department of Electrical and Computer Engineering


(Power Stream)
Submitted by

1. Jemal Musa WCU/R/ET- 433/08


2. Abdiljelil Fedlu WCU/R/ET- 004/08
3. Reyan Abdulrehman WCU/R/ET- 642/08
4. Yosef Fantaye WCU/R/ET- 875/08

JANUARY 2021, HOSSANA

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Declaration

We hereby declare that the work which is being presented in the project entitled <Automatic room light
and temperature control= submitted to Wachemo University in partial fulfillment of the requirements for
the degree of B.Sc.in electrical engineering and is the result of our own thesis project carried out.

Prepared by:

Name of Group Members ID Number Signature

1) Jemal Musa WCU/R/ET 433/08 -------------


2) Abduljelil Fedlu WCU/R/ET 004/08 -------------
3) Reyan Abdulrehmen WCU/R/ET 642/08 -------------
4) Yosef Fantaye WCU/R/ET 875/08 -------------

This is to declare that the above statement made by the candidate is correct and true to the best of our
knowledge.

Approved by:

Advisor Name Date (DD//MM//YY) Signature

Mr. Chemdi / / / ------------------

Page | i

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Acknowledgement

There are plenty of persons to be thanked before we start this project that helped us in bringing it all
together. Firstly, we are grateful for almighty GOD who is the beginning and the end for all this. Next, we
would like to express our deepest gratitude for the department of electrical and computer engineering to give
us this opportunity to solve our communities’ and learning compound problem that is related to our field
and Mr. Chemdi who helped us by advising and for his unlimited support by giving us different ideas and
important guides as well as work related materials for doing our project. Finally, are pleased to give the
credit for all the people who are involved through the study and our beloved friends for their active
participation in this project.

Page | ii

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Abstract
Now a day there is massive wastage of energy and time when less responsible persons do not control
electrical appliances properly and obviously it is difficult for disabled ones, elders and children to control
the home appliances. To overcome all of those problems automatic room light and temperature control using
Micro controller PIC 16f877A is proposed. The proposed system controls the home appliances such as room
light, heater, fan and also counting number of persons automatically with in the room very precisely. In this
scheme temperature sensor (LM35), light sensor (LDR) and motion sensor (PIR) can be used for measuring
(sensing) ambient room temperature, light and motion of a person respectively. The controlled parameters
measured by these sensing elements are given as an input to the microcontroller, since the microcontroller
supervises the operation of overall system. The analogue input received is quantized in to a digital signal in
microcontroller. The signal is further processed by the controller to yield its corresponding sensor value.
This value displayed on the LCD panel. Simultaneously the various parameters are switched ON/OFF
depending on the given input. This system provides automatic control of light based on the availability of
the user and light intensity of the room. What is more, it provides automatic temperature control by
switching ON/OFF the fan and heater in accordance to the room temperature. A DC fan and heaters are
connected to microcontroller via motor driver and relay respectively as an output. The LCD screen displays
ambient room temperature in Celsius. The microcontroller control the DC fan and heaters according to
temperature range set by the user at the programing stage. As a result the system proposed in this project is
cost effective, power saving as well as an approach to minimization of human work.

Page | iii

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Table of Contents
Declaration ...................................................................................................................................................................... i
Acknowledgement .......................................................................................................................................................... ii
Abstract ......................................................................................................................................................................... iii
List of Figures ............................................................................................................................................................... vi
List of Table ................................................................................................................................................................. vii
List of Abbreviations ....................................................................................................................................................viii
CHAPTER ONE ............................................................................................................................................................ 1
INTRODUCTION .......................................................................................................................................................... 1
1.1 Background of The Project ................................................................................................................................... 1
1.2 Statement of Problem ........................................................................................................................................... 1
1.3 Objectives ............................................................................................................................................................. 2
1.3.1 General Objectives ........................................................................................................................................ 2
1.3.2 Specific Objectives ........................................................................................................................................ 2
1.4 Significance of The Project .................................................................................................................................. 2
1.5 Scope of The Project ............................................................................................................................................ 2
CHAPTER TWO ........................................................................................................................................................... 3
LITERATURE REVIEW ............................................................................................................................................... 3
CHAPTER THREE ........................................................................................................................................................ 4
METHODOLOGY AND MATERIAL USED ............................................................................................................... 4
3.1 Project Development Methodology ...................................................................................................................... 4
3.2 Block Diagram ..................................................................................................................................................... 4
3.3 Block Diagram Description .................................................................................................................................. 5
3.3.1 Lighting System............................................................................................................................................. 5
3.3.2 Heating and Air Conditioning System ........................................................................................................... 5
3.3.3 Microcontroller .............................................................................................................................................. 6
3.3.4 Light Sensor .................................................................................................................................................. 6
3.3.5 Temperature Sensor ....................................................................................................................................... 6
3.3.6 PIR Sensor ..................................................................................................................................................... 6
3.3.7 LCD Display.................................................................................................................................................. 6
3.3.8 Heater ............................................................................................................................................................ 6

Page | iv

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

3.4 Flow Chart ............................................................................................................................................................ 6


3.5 Circuit Description of Each Component ............................................................................................................... 8
3.5.1 Microcontroller .............................................................................................................................................. 8
3.5.2 PIC16F877A Microcontroller ........................................................................................................................ 9
3.5.3 PIN Description of PIC16F877A ................................................................................................................... 9
3.5.4 Power Supply Unit....................................................................................................................................... 10
3.5.5 Reset Signal ................................................................................................................................................. 10
3.5.6 16x4 LCD Module ....................................................................................................................................... 11
3.5.9 L293D Motor Driver ................................................................................................................................... 12
3.5.10 LM35 ......................................................................................................................................................... 13
3.5.11 Relay ......................................................................................................................................................... 13
3.6 Interfacing of PIC16F877A With Other Component .......................................................................................... 14
3.6.1 LCD Interface With PIC16F877A ............................................................................................................... 14
3.6.2 Interfacing of DC Fan, Motor and LM35 Temperature................................................................................ 14
3.6.3 Interfacing Lamp, LDR and Relay With PIC16F877A ................................................................................ 15
3.7 The Overall System Circuit of Automated Room Light and Temperature Control ............................................. 16
CHAPTER FOUR ........................................................................................................................................................ 17
RESULT AND DISCUSSION ..................................................................................................................................... 17
CHAPTER FIVE .......................................................................................................................................................... 21
CONCLUSION AND RECOMMENDATION ............................................................................................................ 21
5.1 Conclusion .......................................................................................................................................................... 21
5.2 Recommendation ................................................................................................................................................ 21
REFERENCE ............................................................................................................................................................... 23
APPENDIX .................................................................................................................................................................. 24

Page | v

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

List of Figures
Figure 1 : Methodology of Project.................................................................................................................................. 4
Figure 2 : Block Diagram ............................................................................................................................................... 5
Figure 3 : Microcontroller ............................................................................................................................................. 6
Figure 4 : Flow Chart for Person Counter ...................................................................................................................... 7
Figure 5 : Flow Chart of Temperature Controller ........................................................................................................... 7
Figure 6 : Flow Chart of Lamp Controller ...................................................................................................................... 8
Figure 7 : PIN Diagram PIC16F877A ............................................................................................................................ 9
Figure 8 : Reset of Microcontroller .............................................................................................................................. 11
Figure 9 : LCD Display ................................................................................................................................................ 11
Figure 10 : L239D Motor Driver IC ............................................................................................................................. 12
Figure 11 : LM35 ........................................................................................................................................................ 13
Figure 12 : Relay .......................................................................................................................................................... 13
Figure 13 : LCD Interfacing ......................................................................................................................................... 14
Figure 14 : Fan and LM35 Interfacing.......................................................................................................................... 15
Figure 15 : Lamp and LD Interfacing ........................................................................................................................... 16
Figure 16 : Overall System Circuit ............................................................................................................................... 16
Figure 17 : When Heater 1 and Heater 2 ON ................................................................................................................ 18
Figure 18 : When Heater 1 ON ..................................................................................................................................... 18
Figure 19 : When Fan and Heaters OFF ....................................................................................................................... 19
Figure 20 : When Fan ON ............................................................................................................................................ 19
Figure 21 : When Lamp ON ......................................................................................................................................... 20
Figure 22 : When Lamp OFF ....................................................................................................................................... 20

Page | vi

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

List of Table
Table 1: LCD PIN Numbers, their Name and Corresponding Functions ...................................................................... 11
Table 2: Fan and Heater State....................................................................................................................................... 17
Table 3 : Light ON/OFF State ...................................................................................................................................... 20

Page | vii

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

List of Abbreviations

CPU Central Processing Unit

DC Direct Current

EN Enable

EPROM Erasable Programmable Read Only Memory

GSM Global System for Mobile Communication

IC Integrated Circuit

I/O Input / Output

LCD Liquid Crystal Display

LDR Light Dependent Resistor

LED Light Emitting Diode

MCLR Master Clear Reset

MCU Microcontroller Unit

RAM Random Access Memory

ROM Read Only Memory

R/W Read/Write

PIC Peripheral Interface Control

PIR Passive Infrared Ray

Page | viii

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

CHAPTER ONE

INTRODUCTION

1.1 Background of the Project

These days, implementation of automation technology is very popular in the world. Automation is the
process of controlling system and information to decrease the need of human being participation. Home
automation is one of the most wonderful advancement of technology. It represents the idea of smart home
which means the controlling of home appliances in an integrated system. This offers home owners more
convenient facilities with automatic control of devices and appliances. It may include the control of lighting,
heating, air conditioning, ventilation and other appliances [1].

Microcontroller has become well known in automation system. A microcontroller is a small computer on a
single chip containing a processor core, memory, and programmable input/output peripherals [2]. For smart
home environment several sensors, detectors for temperature, smoke, fire, light and other communication
devices can be employed by which the system can be controlled and activated. This sensors use the input
signal to aware the owner of any interloping done by an illegal way or control home appliances such as
lightings, air conditioner. But the implementation of a unified connectivity between devices and the main
controller in cost effective way very decisive [3].

1.2 Statement of Problem

Some of the problems which motivated us to do this project is mainly because the wastage of energy or
power in everyday experience when we forget to turn OFF the appliances and temperature variation is
difficult to control using air conditioner via manual switch as well as some of the materials are damaged.
This development, will ultimately save a lot of time specially when people do not have to come back for
simple things such as to turn ON/OFF at their homes at once they set out for their respective work or
appointment. To address the problem, the automatic room temperature control that can control the
temperature automatically is proposed. The advantages of such a system are less energy usage, and it
provides more convenience to the consumers.

Page | 1

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

1.3 Objectives

1.3.1 General Objectives

The main goal of this project is to design automated room light and temperature control.

1.3.2 Specific Objectives

The specific objectives of this project are:

 To interface the temperature sensor with microcontroller


 To interface the light sensor(LDR) with microcontroller
 To interface the motion sensor(PIR)
 To design the circuit using Proteus software
 To simulate the designed circuit by interfacing with a code written in mikroC software

1.4 Significance of the Project


The proposed system in this project can be useful to eliminate the need of physical presence in any location
for tasks involving control of home appliances and most importantly to save the losses of power through
unnecessary conditions. In addition, the comfort of being able to take control of devices from one particular
location has become important as it saves more time and effort. It is very essential for disabled and elder
person who can’t control the home appliances. And also can be useful to keep an expensive drug and
electronic devices under normal temperature in drug store and shops .

1.5 Scope of the Project

The scopes of this project are switching ON/OFF the lamp depends on the light intensity of the room and
existence of a person in the room, increase or decrease the speed of fan and also the heater heats the room
based on temperature of the room.

Page | 2

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

CHAPTER TWO
LITERATURE REVIEW

Many projects were done to control home appliances automatically using different approach. Jain, S. 2014,
the implementation of home automation system using Bluetooth was designed. It uses a host controller
implemented on a PC which is connected to a microcontroller based sensor and device controllers. The
researcher built a new protocol on top of the Bluetooth software stack, called a home automation protocol
(HAP) to make communication between devices possible. The system allows more than one devices
controller to be connected to the host controller. This system can also be accessed remotely through GPRS.
The researchers use a cellphone equipped with Bluetooth connectivity as a host controller and GSM modem
that provides internet connectivity. Home devices are fitted with communication adapters so that they can
communicate with host controller phone via Bluetooth. Despite, the advantage of Bluetooth based on
automation such as is low cost, easy to implement and quick to set up there are however different
disadvantages such as low communication range of about 100m, high power consumption [1].

Elshafee and Hamed, 2012, Arduino and Ethernet based home automation was developed. The mobile
devices can be either wired to the central controller through USB cable or communicates with it wirelessly
within the scope of the home. Arduino contains the web server application that communicates through the
HTTP protocol with web based android application. The system is highly flexible, scalable and expandable.
However, the advantage of using Arduino based home automation the use of Ethernet with the technology
has posed different challenges such as low speed, low data transmission rate and the use of wired
communication technology[2].

Madhuri et al, 2013. Smart house monitor and manager based on Zigbee were designed. Zigbee wireless
network is used to connect all sensors and actuators. Simple smart sockets which can control remotely via
Zigbee were designed. Although, Zigbee network cannot send data over long distance, low data
transmission rate and its installation is very expensive [3]. The problems listed in above literatures solved by
the system proposed in this project since it is low cost, high efficiency and low power consumption.

Page | 3

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

CHAPTER THREE
METHODOLOGY AND MATERIAL USED

3.1 Project Development Methodology

This project starts by discussing several possible topics with peer group members. After the topic has been
selected additional discussion were done in order to understand the concept and objective of the project.
Then review of literature and back ground of related project were studied by referring various sources such
as journals, articles, reference books, internet, and lecture notes. All the information related to components
used in this project was searched and most suitable would be selected.

Figure 1 : Methodology of Project

3.2 Block Diagram

The block diagram of automated control of room light and temperature includes several parts such as: PIC
16f877A, motion sensor, temperature sensor (LM35), light sensor (LDR), temperature control system (fan
and heater), LCD display and light control system as shown in the figure below.

Page | 4

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Figure 2 : Block Diagram

3.3 Block Diagram Description


3.3.1 Lighting System

The system involves light sensor, lamp, PIR sensor and microcontroller for control purpose. Lights are
automatically switched ON/OFF based on the availability of the user and light intensity of the room. When a
person enters the room, the motion is sensed by PIR sensor and this sends input to the microcontroller and
LCD screen displays the number of people inside the room. Then lighting system senses the amount of
ambient light in a room and switch ON/OFF the lamp. But if there is no person enters to the room the lamp
should be switched OFF. The light sensor is connected as an input to the microcontroller and lamp is
connected as an output. As a result, this mode of automation offers significant power savings.

3.3.2 Heating and Air Conditioning System

This system provides a temperature control that serves to provide the switching ON/OFF of the fan and
heater in accordance to the room temperature. It uses temperature sensor to sense the temperature of the
room that is connected to the microcontroller as an input. A DC fan and heaters are connected to
microcontroller via motor driver and relay respectively as an output. The LCD screen displays ambient
room temperature in Celsius. The microcontroller control the DC fan and heaters according to temperature
range set by the user at the programing stage. This mode employed to minimize energy wastage, and
provide efficient energy consumption.

Page | 5

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

3.3.3 Microcontroller
A microcontroller is acting as a brain in this system. It is highly integrated chip where all the peripherals
like CPU, timers, counters, RAM, ROM, registers, input/output port, clock circuit are built in. So, it is
combination of microprocessor and peripherals. It is small, powerful and used in embedded application for
specific tasks. In this project, one PIC16f877A microcontroller is used.

Figure 3 : Microcontroller

3.3.4 Light Sensor

A LDR (light dependent resistor) is used to measure ambient room light intensity and give its output as an
input to microcontroller. As the incident light intensity level decrease the resistance value of LDR increases
and vice-versa. This photo detector is ideal for lighting automation .

3.3.5 Temperature Sensor

The IC LM 35 is used as an accurate temperature sensor for measuring the temperature of room and its
output is taken as an input to the microcontroller.
3.3.6 PIR Sensor
A passive infrared sensor is an electronic device that senses infrared radiation for the purpose of detecting
the motion of human being about its surrounding. But in this project push button is used instead of PIR
because it is not available in Proteus software.
3.3.7 LCD Display
Liquid crystal display is a basic electronic display screen used to display the ambient room temperature,
light intensity and the number of person inside the room.
3.3.8 Heater
The heater heats the room when the room temperature is below some specific value.
3.4 Flow Chart
The flow chart of our system is divided in to three parts:

Counter: This shows how the microcontroller counts the number of people entering and leaving the room.

Page | 6

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Figure 4 : Flow Chart for Person Counter

Temperature Controller: This shows how the microcontroller measures the temperature from LM35
and control the room temperature.

Figure 5 : Flow Chart of Temperature Controller

Page | 7

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Lamp Controller: This shows how microcontroller measures amount of light intensity and control the
room lamp.

Figure 6 : Flow Chart of Lamp Controller

3.5 Circuit Description of Each Component


3.5.1 Microcontroller

A microcontroller is highly integrated single chip, which consists of on chip CPU (central processing unit),
RAM (Random Access Memory), EPROM/PROM/ROM (Erasable Programmable Read Only Memory),
input/output serial and parallel, timers, interrupt controller. It can be viewed as asset of digital logic circuits
integrated on a single silicon chip used for only specific applications.

Page | 8

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

3.5.2 PIC16F877A Microcontroller

It provides the following standard features: 14Kbytes or 8k 14 bit –flash, 368 bytes of RAM, 33 I/O lines,
three 16 bit timers or counters, 15 interrupt architecture of which two of them are external interrupts, a full
duplex serial port, on chip oscillator and clock circuitry.

Figure 7 : PIN Diagram PIC16F877A [4]

3.5.3 PIN Description of PIC16F877A


The PIC16f877A micro controller is A40 pin IC. The 11th and 32th pins of the controller are VDD pin and
a 5V DC supplies are given to these pins. The 12th and 31st pins of the controller are VSS pin and are
grounded. A 20MHZ crystal oscillator is connected to 13th and 14th pins of the PIC16f877A
microcontroller and two 20pf capacitors are connected to ground from 13th and 14th pins. The 1st pin is a
reset pin.
RA0-RA5: RA is a bidirectional port it can be configured as an input or an output. The number following
RA is the bit number (0 to 5). So, there is one 5 bit bidirectional port where each bit can be configured as
input or output.

Page | 9

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

RB0-RB7: RB is a second bidirectional port it behaves exactly the same way as RA except there are 8 bits
involved.
RC0-RC7 & RD0-RD7: RC & RD are bidirectional ports having 8 bits wide pins.
RE0-RE2: 3bit wide bidirectional port.
VSS and VDD: These are power supply pins. VDD is the positive supply and VSS is the negative supply or
0V. The maximum supply voltage that can be used is 6V and the minimum is 2V.
OSC1/CLK IN and OSC2/CLKOUT: these pins are used to connect an external clock as a result the
microcontroller has some kind of timing.
MCLR: This pin is used to erase the memory locations inside the PIC. In normal use it is connected to the
positive supply.
INT: This is an input pin which can be monitored. If the pin goes high, we can cause the program to restart,
stop or any other single function we desire
TOCK1: This is another clock input which operates an internal timer. It operates in isolation to the main
clock.
3.5.4 Power Supply Unit

Even though the PIC16f877A operates at different supply voltage, the circuit uses a chip integrated three
terminal regulators.

3.5.5 Reset Signal

In order that the microcontroller can operate properly, a logic one VCC must be applied on the reset pin. It
explains the connection pin resistor 10k –VCC. The push button connecting the reset pin MCLR to GND is
not necessary. However, it is almost always provided because it enables microcontroller save return to
normal operating conditions if something goes wrong. By pushing this button, 0V is brought to the pin, the
microcontroller is reset and program execution starts from the beginning. The 10k resistor is there to allow
0V to be applied to the MCLR pin via the push button without shorting the 5V DC rail to ground.

Page | 10

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Figure 8 : Reset of Microcontroller

3.5.6 16x4 LCD Module

It is very common type of LCD module that is used in PIC 16f877A based embedded projects. It consists of
4 rows and 16 columns of 5x6 or 5x8 LCD dot matrices.

Figure 9 : LCD Display

The pin numbers, their names and corresponding functions are shown in the table below.

Table 1: LCD PIN Numbers, Their Name and Corresponding Functions

Pin No. Name Function


1 VSS This pin must be connected to the ground
2 VDD Positive supply voltage pin (5V DC)
3 VEE Contrast adjustment
4 RS Register selection
5 R/W Read or write
6 EN Enable
7 DB0 Data
8 DB1 Data
9 DB2 Data
10 DB3 Data
11 DB4 Data

Page | 11

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

12 DB5 Data
13 DB6 Data
14 DB7 Data
15 LED+ Back light LED+
16 LED- Back light LED-

VEE pin is used for adjusting the contrast of LCD display and the contrast can be adjusted by varying the
voltage at this pin this is done by connecting the center terminal of POT to the VCC (5V), other end to the
ground and connecting the center terminal of POT to the VEE pin.
R/W pin is used to for selecting either read or write modes. High level at this pin enables read mode and
low level at this mode enables write mode
EN pin is used for enabling. The module a high to low transition at this pin will enable the module.
DB0 to DB7 are the data pins. The data to be displayed and the command instructions are placed on these
pins.
3.5.8 DC Motor
A DC motor is mechanically commutated electric motor driven by DC current. The advantages of using this
type of motor over AC motor are:

 Have higher controller efficiency


 Have better over load and peak voltage characteristics
 Widely used because its speed torque characteristics can be varied to almost any useful form

3.5.9 L293D Motor Driver

It is a quadruple H-bridge motor driver, as the name suggests it used to drive the DC motors. This IC works
based on the concept of H-bridge. H-bridge is a circuit which allows the voltage in either direction to
control the motor direction. There are 4input pins for L293D. Motors directions depends on the logic inputs
applied at this pins.EN1 and EN2 must be high to drive the two DC motors.

Figure 10 : L239D Motor Driver IC

Page | 12

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

3.5.10 LM35

Temperature sensor has three input pins. Middle one is output and the other two pins are ground and VCC.
The LM35 is an integrated circuit sensor that can be used to measure temperature. The output voltage of this
sensor is proportional to the temperature in centigrade. The output voltage of the LM35 will vary at a rate of
10mv per degree Celsius. Usually the range of LM35 temperature sensor is from -55deg C to +150deg C. to
measure this full range of temperatures i.e. from negative range to positive range, we need to connect an
external resistor between the data pin and negative supply of VCC. Any way, we are not going to consider
the negative temperature range in this project. So under normal operating conditions we can measure the
temperature in the range from 0deg C to +150deg C.

Figure 11 : LM35

3.5.11 Relay

It is an electrically operated switch that uses an electromagnet to mechanically operate a switch. Relays are
used where it is necessary to control a circuit by a low power signal (with complete electrical isolation
between control and controlled circuits), or where several circuits must be controlled by one signal.

Figure 12 : Relay

Page | 13

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

3.6 Interfacing of PIC16F877A With Other Component

3.6.1 LCD Interface With PIC16F877A

In this project the LCD module is connected with the microcontroller in four line mode as shown in figure
below. The four data pins, the register selector pin and enable pin are connected to PORTD of the
microcontroller.

Figure 13 : LCD Interfacing

3.6.2 Interfacing of DC Fan, Motor and LM35 Temperature


Temperature sensor (LM35) has three input pins, VCC, ground. Middle one is output and other two pins are
ground and VCC. The output pin is connected to RA0/AN0 analog input of the microcontroller. This analog
value is converted to the digital value by the microcontroller using successive approximation method
internally. When the temperature is greater than the threshold value microcontroller sends a command to the
controller to switch the motor. The circuit is shown below

Page | 14

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Figure 14 : Fan and LM35 Interfacing

3.6.3 Interfacing Lamp, LDR and Relay With PIC16F877A

The lamp needs 220V AC voltage supply whereas the maximum voltage output of microcontroller is 5V.
Therefore it is impossible to connect the lamp directly with the micro controller. Thus in this project relay is
used to give the supply voltage to the lamp. Relays are devices which allow low power circuits to switch
ON/OFF a relatively high current or voltage. The relay consists of a coil and a switch. When the coil is
energized the switch closes and contacting the two contacts together. ULN2803 transistor is used as driver
for I/O lines, drivers output connected to relay modules. The LDR output connected to pin RA1 /AN1
analog input of the microcontroller.

Page | 15

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Figure 15 : Lamp and LDR Interfacing

3.7 The Overall System Circuit of Automated Room Light and Temperature Control
LM041L

AUTOMATED ROOM LIGHT AND TEMPERATURE CONTROL


DISPLAY U3(VS)

MICROCONTROLLER
U1
TEMPERATUTRE SENSOR 13 33
OSC1/CLKIN RB0/INT
14 34
OSC2/CLKOUT RB1
35
U2 RB2
VDD
VSS

VEE
1 2 36

RW
RS

D0
D1
D2
D3
D4
D5
D6
D7
RA0/AN0 RB3/PGM

E
3 37
RA1/AN1 RB4 U3
4 38 16 8
RA2/AN2/VREF-/CVREF RB5
1
2
3

4
5
6

7
8
9
10
11
12
13
14
5 39
8.0 RA3/AN3/VREF+ RB6/PGC
6 40 2 3
RA4/T0CKI/C1OUT RB7/PGD IN1 VSS VS OUT1

kRPM
+88.8
7 7 6
RA5/AN4/SS/C2OUT IN2 OUT2
2 15 1
VOUT RC0/T1OSO/T1CKI EN1
8 16
RE0/AN5/RD RC1/T1OSI/CCP2
9 17
RE1/AN6/WR RC2/CCP1
10 18 9
RE2/AN7/CS RC3/SCK/SCL EN2
3 LM35 23 10 11
RC4/SDI/SDA IN3 OUT3
1 24 15 14 FAN
MCLR/Vpp/THV RC5/SDO IN4 GND GND OUT4
25 RL2(NO)
RC6/TX/CK
26
RC7/RX/DT
L293D
19
RD0/PSP0
20
RD1/PSP1
R1 RD2/PSP2
21
10k 22
RD3/PSP3
27
RD4/PSP4
RD5/PSP5
28 D3 RL2
29 10A01 12V
RD6/PSP6
30
RD7/PSP7
PIC16F877A
1

LDR1 (COM)
Q2 L2
R4

HEATER1
TORCH_LDR
2N1711
12V
10k
2
INPUT PART

OUTPUT PART
SWITCH
R2 R3 RL3(NO)
10k
10k

D2 RL3
RL1 DIODE 12V

D1 12V

DIODE
R6 Q3
HEATER2

L3
2N1711
12V
10k
ENTRANCE EXIT R5 Q1
2N1711 L1
LAMP

10k 12V

Figure 16: Overall System Circuit

Page | 16

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

CHAPTER FOUR

RESULT AND DISCUSSION

The result of this project was demonstrated by simulation of the designed system using Proteus 8
professional software supported by the intended program written in programming language to meet its target
value. This input was varied its value accordingly in range of 5V to match the corresponding sensor value.
The analogue input received was quantized in to digital signal in microcontroller. The signal was further
processed by the controller to yield its corresponding sensor value. This value was displayed on the LCD
panel. Simultaneously, the various parameters were switched ON/OFF depending on the given input. Hence
the result of analysis was summarized as in the table below.

Table 2: Fan and Heater State

Temperature(c) Heater 1 Heater 2 Fan (speed) LCD display


Less than 10 ON ON OFF Display value
10-20 ON OFF OFF Display value
20-25 OFF OFF OFF Display value
25-30 OFF OFF ON(low speed ) Display value
30-35 OFF OFF ON(medium speed) Display value
Greater than 35 OFF OFF ON(full speed) Display value

As shown in the table above when the room temperature is less than 10 degree Celsius both heater 1 and
heater 2 heats the room.

Page | 17

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Figure 17 : When Heater 1 and Heater 2 ON

When the room temperature is between 10 and 20 degree Celsius only heater one heats the room.

Figure 18 : When Heater 1 ON

When the room temperature is between 20 and 25 degree Celsius both heaters and fan are OFF.

Page | 18

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Figure 19 : When Fan and Heaters OFF

When room temperature is greater than 25 degree Celsius the fan is ON.

Figure 20 : When Fan ON

If there is a person in the room the counter value is greater than zero, then we will get the following result as
shown in the table below.

Page | 19

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Table 3 : Light ON/OFF State

Amount of light (%) Lamp


Less than 80 ON
Greater than 80 OFF

Figure 21 : When Lamp ON

Figure 22 : When Lamp OFF

Page | 20

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

CHAPTER FIVE
CONCLUSION AND RECOMMENDATION

5.1 Conclusion
From the result of tests that have been done in this project it can be conclude that the fan, lamp and heaters
are worked properly. The lamps can turn ON automatically when the person enter in to the room and the
light intensity is below 80% and the lamp can also turn OFF automatically if either of the above two
condition is not satisfied. In addition it can also conclude that the two heaters are turn ON automatically
when the temperature is less than 10 degree Celsius and one of the heater is turn OFF when the temperature
is between 10 up to 20 degree Celsius. Then the fan can also turn ON automatically when a temperature is
greater than 25 degree Celsius and the fan speed also be adjusted. Fan rotation speed is divided in to three
namely slow, medium and fast. Beside the fan have been automatically turn OFF when the temperature of
the room is less than 25 degree Celsius. This project is suitable for the avoidance of being physically present
to control home appliance. The results obtained from the measurement have shown that the system
performance is reliable and accurate. The system has successfully overcome quite a few shortcomings of the
existing systems by reducing the power consumption at the same time providing a flexible and precise form
of the room temperature. The expected results have been obtained from the simulation by Proteus software.
The light, heater and fan control system algorithm provides high efficiency, low noise and low power
consumption.

5.2 Recommendation
A future extension of the work has been proposed in this section which can attribute more conveniences in
automation system. This project can be modified by integrating with a security system, when someone is
trying to access without owner’s permission it will either inform some message to the owner or combined
with some sound. Also this system can be modified by replacing manual switch control system with remote
control system when a person is inside a room and light intensity is lesser but if the person inside the room
wants to switch OFF the lamp.

Page | 21

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Finally, we have been understood that this project is common and important for our community and the
compound in order to save energy as the country and regions are suffering of it. So our main suggestion here
is to apply the study on the ground because it is very cheap regarding installation and very crucial when
saving energy.

Page | 22

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

REFERENCE

1. 1. Jain, S., Vaibhav, A. and Goyal, L. Raspberry Pi based interactive home automation system through E-mail. In
Optimization, Reliabilty, and Information Technology (ICROIT), 2014 International Conference on (pp. 277-280). IEEE.
2. [Online] February 2014.

2. Interfacing PIC microcontrollers: Embedded design by interactive simulation. Newnes. . 2. Bates, M.P.,. 2013. .

3. Measurement and instrumentation principles. . 3. Morris, A.S.,. 2001. .

4. Design and implementation of a WIFI based home automation system. World academy of science, engineering and
technology, 68, pp.2177-2180. . 4. ElShafee, A. and Hamed, K.A.,. 2012. .

5. A home automation system design using hardware descriptive tools. International Journal of Engineering Research
& Technology, 2(7), pp.385-393 . 5. Madhuri, K., Sai, B.L. and Sirisha, B.S.,. 2013. .

6. Electric motor drives, modeling analysis and control. PHI Learning Pvt. Ltd., New Delhi. . 6. Krishnan Bharat, R.,.
2008. .

Page | 23

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Appendix

C-Language Coding

Page | 24

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)


lOMoARcPSD|28145601

Page | 25

Downloaded by Firaa'ol Gizaachoo (firaagizachoo@gmail.com)

You might also like