You are on page 1of 89

i

Remote control home automation system


(RECHAS) using RF techniques.

AKISSEH SONE MANDELA

12T0308

JULY 2017

Dissertation submitted in partial fulfillment of the Requirements for the award of a Higher Technical
School Teacher Post Graduate Diploma (DIPET II) in ELECTRONICS

Department of ELECTRICAL AND POWER ENGINEERING


The University Of Bamenda
i

CERTIFICATION

I hereby certify that this thesis titled; REMOTE CONTROL HOME AUTOMATION
SYSTEM USING RF TECHNIQUES has been carried out by AKISSEH SONE MANDELA
with registration number 12T0308 in the Department of ELECTRICAL AND POWER
ENGINEERING and of the option ELECTRONICS of the Higher Technical Teacher Training
College (H.T.T.T.C.) Bambili, University of Bamenda.

The work is therefore approved for a contribution to scientific knowledge and literary
presentation for the award for the “Higher Technical School Teacher Post Graduate Diploma
(DIPET II)”.

Date…………………………

Head of Department

Pr. NFAH MBAKA


Eustace
Associate Professor

Signature………………………
.

Date………………………… Date…………………………

Supervisor Co-Supervisor

Pr. NFAH MBAKA Mr. TCHAHOU TCHENDJEU

Eustace Achille Eclador

Associate Professor Associate Lecturer

Signature………………...……. Signature………………………
.
ii

DECLARATION

I, Mr. AKISSEH SONE MANDELA, hereby declare that I am the sole author of this thesis. I
authorize the Higher Technical Teacher Training College (H.T.T.T.C.) Bambili to lend this thesis
to other institutions or individuals for the purpose of scholarly research.

I understand the nature of plagiarism, and I am aware of the University’s policy on this.

I certified that this dissertation reports original work by me during my University thesis, except
for the paragraphs, sentences, titles and subtitles already referenced (see References or
bibliography) on this work.

Date…………………………

Mr. AKISSEH SONE MANDELA

Signature………………………
iii

DEDICATION

This work is dedicated to my beloved parents; Mr. AKISSEH MAKOGE Ernest and Mrs.
AKISSEH MPONGESONE Felicia.
iv

ACKNOWLEDGEMENTS

Words are often inadequate to express one’s deep regards. An understanding to a piece of work
like this is never the outcome of the efforts of a single person. I take this opportunity to express
my profound sense of gratitude and respect to all those who helped me through the duration of
this thesis:

The Almighty God for the health, strength and life He gave me to accomplish this thesis. Let all
Glory be given to Him.

I express gratitude to Pr. NFAH MBAKA Eustace, Head of Department Electrical and
power Engineering HTTTC Bambili University of Bamenda and Supervisor of this work, for his
availability. Many thanks for the scientific exchanges, encouragements and multiform supports
in my teacher career.
Cordial thanks and gratitude to; Mr. TCHAHOU TCHENDJEU Achille Eclador my Co-
supervisor for valuable guidance and supervision during this thesis.
Special thanks go to: Pr. AKUME Daniel AKUME, former Director of HTTTC Bambili for the
keen attention that he paid in the practical training of the students of his institution and his
fatherly love towards me.

I am indebted to: All my lecturers in H.T.T.T.C for the wonderful work they have done to build
me up academically,

To my lovely parents, Mr. AKISSEH MAKOGE Ernest and Mrs. AKISSEH MPONGESONE
Felicia for their great support materially, financially and in prayers during this thesis.

Great thanks to my grand mum ESSONE Margaret NTUBE for her love and care. To My
Uncles; Mr. AKISSEH Peter, Mr. ESSONE Makoly, Past. NGWESSESONE Jude and my aunts;
Ma AKISSEH Mary, ESSONE Alain, ESSONE Arah, ESSONE Matabe I say I am grateful.

Not forgetting my lovely brothers; AKISSEH SONE Stanley, AKISSEH Chris, AKISSEH
NGUNDE, and lovely sisters Mrs. BESSONG AKISSEH Mabelle, ESSONE Darrel, AKISSEH
DIONE Ruth for their love, care and prayers. I use this opportunity to say thanks to Miss
DARAH E. IJANG for her love and concern, Mrs MAWO Stephany and Ortance T. for the
moral support. Mr. NGWA Valery, NGWA Jude, NGWENGAN Boris and NEBA Promise for
the technical assistance they gave to me in the accomplishment of this work. All my classmates
and friends for they have been of wonderful assistance to me in this search for knowledge.
v

ABSTRACT

Now our days the importance and demand for remote control systems is increasing in the society
since as they are used to reduce human labour, energy consumption, distance and time
consumption. My system, “Remote control home automation system (RECHAS) using RF
technique” will solve the aforementioned by subdividing the system in four sections; the remote
control, the main control unit, switching interface and automatic light switching. At the
transmission, when a button is pressed at the remote control a signal of 4 words parallel data is
generated by the PIC16F628A and sent to the HT12E which encodes and sends a serial data to
the 433MHz transmitter for propagation. At the other end, there is a 433MHz receiver to receive
the transmitted signal and send to the main control unit. The HT12D will receive the 4 word
serial data decode the signal and send a 4 word parallel data to the PIC 16F877A that will then
identify through the code the desired appliance to be switched “ON” or “OFF” by activating the
switching interface. The automatic switching is done by a LDR sensor which switches ON the
security light at night and OFF at day. There is a particular button used in controlling the security
light manually and another button to switch it to automatic mode. There is also a button to
control the opening and closing of a gate while the rest of the buttons are used in controlling
other appliances.

Keywords: Radio Frequency (RF), Light Dependent Resistor (LDR), Encoder (HT12E),
Decoder (HT12D), Microcontroller (PIC 16F877A).
vi

RESUME

De nos jours l'importance et la demande des systèmes de télécommande augmente dans la société
puisque pendant qu'elles sont employées pour réduire la consommation de travail d'humain, de
consommation d'énergie, de distance et de temps. Mon système, "“Remote control home
automation system (RECHAS) using RF technique”" résoudra le mentionné ci-dessus en
subdivisant le système dans quatre sections ; la télécommande, l'unité de commande principale,
interface de changement et commutation légère automatique. À la transmission, quand un
bouton est appuyé sur à la télécommande un signal de 4 mots, des données parallèles sont
produites par le PIC16F62Å et envoyées au HT1È qui code et envoie des données périodiques à
l'émetteur 433MHz pour la propagation. À l'autre extrémité, il y a un récepteur 433MHz pour
recevoir le signal transmis, et l'envoyer à l'unité de commande principale. Le HT12D recevra la
sériede 4 mots, les données périodiques décodent le signal et envoient à la série 4mots des
données parallèles au PIC 16F877A qui identifiera alors par le code l'appareil désiré à être "on"
ou "off" en activant l'interface de commutation. La commutation automatique est faite par
uninterrupteur de LDR qui alimente la lumière de sécurité la nuit et pendant lajournée. Il y a un
bouton particulier utilisé en commandant la lumière de sécurité manuellement et un bouton
différent pour le commuter au mode automatique. Il y a également un bouton pour commander
l'ouverture et se fermer d'une porte tandis que le reste des boutons sont utilisés en commandant
d'autres appareils.
Mots-clés :Fréquence Par radio (RF), Résistance Dépendante Légère (LDR), Encodeur
(HT12E), Décodeur (HT12D), Microcontrôleur (PIC 16F877A).
vii

TABLE OF CONTENTS

CERTIFICATION.....................................................................................................................................i
DECLARATION......................................................................................................................................ii
DEDICATION .........................................................................................................................................iii
ACKNOWLEDGEMENTS ................................................................................................................. iv
ABSTRACT ..............................................................................................................................................v
RESUME................................................................................................................................................... vi
TABLE OF CONTENTS..................................................................................................................... vii
LIST OF FIGURES .................................................................................................................................x
LIST OF TABLES ................................................................................................................................. xii
LIST OF ABREVIATIONS................................................................................................................ xiii
Chapter one....................................................................................................................................................1
General introduction......................................................................................................................................1
1.0 Introduction ......................................................................................................................................1
1.1 Background to the study. .................................................................................................................2
1.2 Problem statement. ...........................................................................................................................3
1.3 Purpose to the study..........................................................................................................................3
1.4 Objectives to the study. ....................................................................................................................4
1.4.1 General objective.......................................................................................................................4
1.4.2 Specific objective. .....................................................................................................................4
1.5 Research questions. ..........................................................................................................................4
1.6 Hypotheses to the study....................................................................................................................5
1.7 Significance to the study. .................................................................................................................5
1.8 Scope of the study. ...........................................................................................................................6
1.9 Organizational layout and overview of dissertation. ........................................................................6
1.10 Definition of terms. ........................................................................................................................7
Chapter two ...................................................................................................................................................8
Literature review ...........................................................................................................................................8
2.1 Study of related works.....................................................................................................................8
2.1.1 Electrical control of several loads from a distance using an IR based remote control system. .8
2.1.2 Radio frequency (RF) based remote control home automation system. .................................9
2.1.3 The remote industrial and home appliance control (RIHAC) system. ....................................10
2.1.4 Remote control home automation system (RECHAS) using RF techniques..........................12
viii

2.2 Study of the remote control. ...........................................................................................................13


2.2.1 History of the remote control..................................................................................................13
2.2.2 Wireless communication .........................................................................................................14
2.1.3 Radio frequency (RF) technology ...........................................................................................14
2.1.4 Modulation ..............................................................................................................................15
2.1.5 Protocol description (RF protocol) ..........................................................................................16
2.3 Study of the 433MHz Wireless Transmitter and Receiver (Tx/Rx) module. .............................17
2.2.1 The transmitter/ receiver module.............................................................................................17
2.4 Study of the HT12E Encoder and HT12D Decoder. [25] ..............................................................18
2.6 Microcontroller............................................................................................................................19
2.6.1 The different families of the PIC ...........................................................................................20
2.6.2 Identification of PIC ..........................................................................................................20
2.6.3 The PIC 16F877A Microcontroller .......................................................................................21
2.6.4 Study of the PIC16F628A .......................................................................................................25
2.7 Liquid Crystal Display (LCD) screen............................................................................................27
2.5 Study of the (Light Dependent Resistor) LDR. ..............................................................................30
2.8 Relays .............................................................................................................................................32
Chapter three ...............................................................................................................................................34
Design and simulation .................................................................................................................................34
3.0 Introduction. ....................................................................................................................................34
3.1 The general block diagram of the system. .......................................................................................34
3.2 Development software. ....................................................................................................................35
3.2.1 Software used to write the codes ...............................................................................................35
3.2.2 Simulation software (ISIS Proteus). ........................................................................................35
3.2.3 Choose of a communication medium ......................................................................................36
3.2 The remote control block.................................................................................................................37
3.2.1 The Push buttons. .....................................................................................................................37
3.2.2 The PIC16F628A.....................................................................................................................38
3.2.3 The HT12E Encoder................................................................................................................39
3.2.4 The digital RF transmitter.........................................................................................................40
3.3 The Receiver circuit. .......................................................................................................................40
3.3.1 The digital RF receiver. ............................................................................................................40
3.3.2 The Decoder (HT12D decoder)...............................................................................................41
3.3.3 The control unit (Microcontroller). ..........................................................................................42
3.3.4 The automatic light control unit. .............................................................................................43
ix

3.3.5 Switching interface. ................................................................................................................44


3.3.6 Regulated power supply. ........................................................................................................45
3.4 Circuit design of simulation. ..........................................................................................................47
3.4.1 The remote control circuit. ..................................................................................................47
3.4.2 The printed circuit and 3D visualization of the remote control...............................................48
3.4.2 Circuit diagram of the main control unit. ............................................................................48
3.4.2 The printed circuit and 3D visualization of the main control unit...........................................49
3.4.3 The switching interface. .........................................................................................................50
3.4.4 Printed circuit of switching interface.......................................................................................51
3.4.5 Simplified flow chart of transmitter and receiver code. ..........................................................52
Chapter four.................................................................................................................................................53
Results and discussions ...............................................................................................................................53
4.0 INTRODUCTION.........................................................................................................................53
4.1 Realization of the project...............................................................................................................53
4.1.1 Production of the printed circuit board (PCB).........................................................................53
4.1.2 Drilling of the PCB..................................................................................................................54
4.1.3 Mounting and soldering..........................................................................................................55
4.1.4 Testing and Trouble shooting. .................................................................................................57
4.1.5 The final system. .....................................................................................................................58
4.2 Cost estimate of the system. ...........................................................................................................60
Chapter five .................................................................................................................................................62
Summary of major findings, recommendation and conclusion ...................................................................62
5.0 Introduction. ..................................................................................................................................62
5.1 Summary of major findings...........................................................................................................62
5.2 Recommendation...........................................................................................................................63
5.3. Conclusion......................................................................................................................................63
5.4 Area for further study .....................................................................................................................64
Reference.....................................................................................................................................................65
Appendices ..................................................................................................................................................66
x

LIST OF FIGURES

Figure 2.1: block diagram Electrical control of several loads from a distance using an IR based
remote control system……………………………………………………………………………..9
Figure 2.2: Block diagram of Radio frequency (RF) based remote control home automation
system…………………………………………………………………………………………….10
Figure 2.3: Block diagram of The remote industrial and home appliance control (RIHAC)
system…………………………………………………………………………………………….11
Figure 2.4: Block diagram of Remote control home automation system (RECHAS) using RF
techniques………………………………………………………………………………………..12
Figure 2.5: 433MHz Wireless transmitter and receiver module. [23]…………………………...17
Figure 2.6: HT12E Encoder and HT12D Decoder………………………………………………19
Figure 2.7: (a) quartz oscillator circuit…………………………………………………………...23
Figure 2.8: Physical structure of PIC 16f877A…………………………………………………..24
Figure 2.9: Character LCD type HD44780 Pin diagram………………………………………...28
Figure 2.10: LCD data write wave form…………………………………………………………30
Figure 2.11: The LDR……………………………………………………………………………31
Figure 2.12: Internal structure of a relay…………………………………………………………33
Figure 3.1: The block diagram of a remote control home automation system with automatic light
switching using RF techniques…………………………………………………………………..34
Figure 3.2: Push buttons used for control………………………………………………………..37
Figure 3.3: The PIC16F628A……………………………………………………………………38
Figure 3.4: The HT12E encoder…………………………………………………………………39
Figure 3.5: RF Transmitter (433MHz) [2]………………………………………………………40
Figure 3.6: RF Receiver (433MHz) [2]………………………………………………………….41
Figure 3.7: The HT12D decoder…………………………………………………………………42
Figure 3.8: the microcontroller circuit…………………………………………………………...43
Figure 3.9: the automatic light switching………………………………………………………..43
Figure 3.10: relay circuit…………………………………………………………………………45
Figure 3.11: Block Diagram of the Power Supply…………………….....................................45
Figure 3.12: wiring diagram of the remote control………………………………………………47
Figure 3.13: printed circuit and 3D visualization of the remote control…………………………48
Figure 3.14: The circuit diagram…………………………………………………………………48
Figure 3.15: The PC and 3D visualization of the main control unit……………………………..49
Figure 3.16: Circuit diagram of switching interface……………………………………………..50
xi

Figure 3.17: PC and 3D visualization of switching interface…………………...........................51


Figure 3.18: Simplified flow chart of transmitter and receiver code…………………………….52
Figure 4.1: Production of the printed circuit board (PCB)………………………………………53
Figure 4.2: Drilling of the PCB……………………………………………………………….….54
Figure 4.3: Clean the soldered PCB…………………………………………………………….55
Figure 4.4: The soldered circuits…………………………………………………………………56
Figure 4.5: Testing and Trouble shooting………………………………………………………..57
Figure 4.6: When a command button has not yet been pressed………………………………….58
Figure 4.7: Sending commands…………………………………………………………………..59
xii

LIST OF TABLES

Table 2.1: Radio frequency Table……………………………………………………………….15


Table 2.2: Pin description for LCD………………………………………………………………22
Table 2.3: LCD Command Codes………………………………………………………………..22
Table 4.1: Cost estimate of the system……………………………………………………….60-61
xiii

LIST OF ABREVIATIONS

No Name Meaning
01 DRF Digital Radio Frequency
02 IR Infrared
03 TV Television
04 ENEO The new Energy of Cameroon
05 PIC Programmable Integrated controller
06 DVD Digital Versatile
07 CRC Cyclic Redundancy Check
08 ID Identify
09 LED Light Emitting Diode
10 DC Direct current
11 USART Universal Synchronous Asynchronous Receiver Transmitter
12 BPSK Binary Phase-Shift Keying
13 AC Alternating Current
14 RF Radio Frequency
15 ASK Amplitude shift keying
16 MOSFET Metal Oxide Semiconductor Field Effect Transistor
17 CMOS Complementary Metal Oxide Semiconductor
18 FET Field Effect Transistor
19 SPDT Single Pole Double Throw
20 DPDT Double Pole Double Throw
21 TTL Transistor- Transistor Logic
22 RISC Reduced Instruction Set Computer
23 CISC Complex Instruction Set Computers
24 ICs Integrated Circuits
25 CPU Central Processing Unit
26 AM Amplitude Modulation
27 FM Frequency Modulation
28 PLL Phase Lock Loop
29 NRZ Non Return to Zero
30 RAM Random Access Memory
31 ROM Read Only Memory
32 I/O Input/ Output
33 PCB Printed Circuit Board
34 BJT Bipolar Junction Transistor
35 NC Normally Connected
36 NO Normally Open
37 COM Common
1

Chapter one
General introduction
1.0 Introduction
A system can be defined as a way of performing task according to some predefined plan,
program and a set of rules. With the advancement of technology, the processes or systems are
becoming more and more complex. Due to this increase in complexity, for efficient analysis of
process, emphasis is given more in design considerations of the system so as to have an effective
and user friendly system.

With the advancement of technology, the number of equipments and modern household
appliances increases to make life easier and comfortable. Operating them manually is a tedious
job and again hectic sometimes. If one can control devices like TV, fan, light, air conditioner,
open-close the door, window, gate or switch on a music system with a remote from a distance
place just by pressing the button, life will become simpler. Home automation is becoming very
common these days as technology advances to reduce manual work. To switch ON or OFF the
devices one has to move to the switch board which is inconvenient even for an able person. If
all this manual work is replaced by a single remote control even the sick, aged and disabled
person can do the task like a normal person. Much related work has been reported for the same
function by different groups with different approaches. Multiple home devices switch can be
controlled with a designed system using microcontroller as the heart of the circuit with android
based mobile phone. Here the mode of controlling devices is by sending a command wirelessly
through Bluetooth [1]. IR remote control has a very wide application in the field of electronics.
IR based remote control for controlling multiple home appliances with microcontroller is also
reported for the same function [2], [3]. Another approach is by GSM based for home
automation. This is done by sending short SMS code from a mobile handset. Here it has a wider
coverage area. So to control any house hold appliances from a distance place within the network
area coverage sending a short SMS code will either ON or OFF the devices at home [4], [5]. All
these work is carried out for the same function in different ways by using different technologies.
Some use Bluetooth technology others use GSM technology or IR technology. Each technology
has its own advantages and disadvantages over the other but they all serve the common purpose
to replace manual work. The main objective of this work is to create another system to control
multiple appliances by using RF technology. One of the main advantages of RF based remote
control is that it can operate the appliances without the requirement of line of sight within its
specified range efficiently.
2

1.1 Background to the study.


Man since civilization has been looking for ways to simplify and ease the way of life. This
however led to the technological revolution which saw the creation and development of many
machines, equipments, gadgets and electronic systems to facilitate work in various fields.

Remote control for home and industrial appliances is an absolute necessity in our fast- paced
life. As a result, much importance has been given to this aspect and a range of remote controls
are prevalent today [6]. It is noticed that the importance and demand for Remote control
appliances is increasing in the market since they are used to reduce human labour, energy
saving, distant saving, and time consumption.

The remote control system helps users to remotely control appliances from everywhere around
the home or a plant. Being in the first floor and switching ON or OFF sockets, lamps, fans, air
conditioner, or television at the second floor or opening and closing the door, window or gate, be
in the office and securing the activation of mechanisms in a plant are some examples.

We can control our home appliances via internet, using a phone for long distance control (such
house are call smart house) or via remote control when the distance is not much [7].
Taking into account the poor access into internet in our community, we can’t easily control
house devices connected to internet. The use of phone come as a solution for that, but smart
houses using phones usually work by messages and those messages are costly since they have to
pass through communication operators. A great majority of Cameroonians use remote control
at home to control equipments such as TVs, video projectors, digital satellite receiver e.t.c. Some
remote control systems have been designed with using the Infra-Red (IR) technology which
requires that each time we wish to turn ON or turn OFF equipments or appliances, we need to be
near to point at it before performing our command. This limits our mobility in the house and
worries some activities. To remove this drawbacks, a remote control home automation system is
to be designed and realized using the radio frequency (RF) technique.
3

1.2 Problem statement.


As the world is getting deeper and deeper into the technological age, life on earth is becoming
more efficient and comfortable. Many things which use to be done manually are now done
automatically to reduce human labour, energy saving, distant saving, and time consumption.

Many home appliances like air heater, fan, lights and air conditioners are operated by using
different switches located in different places in the house. It becomes a tedious process and
consumes a lot of time to switch all those components separately.

Also people are normally lazy to wake up from the comfort of beds or couches to go and open
doors or windows when the need arises. As a result, as homes are getting smarter people need a
centralized control system from where they can comfortably control almost everything ranging
from water heaters, lights, switches, air conditioners, doors etc. It also becomes more difficult for
the sick and elderly people or physically handicapped to open the gate when a guest rings and
they are under the obligation to open the gate.

We want to switch ON and OFF lamps in our houses without pressing physically the switch
because we are far from it. We are just coming from a long working day, we are tired and we
want to open and close the gate. We are in bed at night and forgot to switch ON the security
lamps; we want to travel but want the security lamps switched ON at night and OFF at day.

The aforementioned problems have been partially solved with some electronics systems like the
Infra-Red (IR) remote control system which requires that each time we wish to turn ON or turn
OFF equipments or appliances; we need to be near to point at it before performing our
command. This limits our mobility in the house and worries some activities. In my system I am
implementing an extended approach to automating a house to be controlled automatically with a
remote control designed using the RF technique. The system is going to permit mobility and ease
the control of equipments and appliances in the house. Most electronic systems wish perform
such task are some time very expensive, this system will come as a relief because it can be
affordable by an average Cameroonian.

1.3 Purpose to the study.

The purpose of my study is to see how the switching ON or OFF of appliances and equipments
in our homes, industries offices which use to be done manually can now be done automatically to
reduce human labour, energy saving, distant saving, and time consumption. To also produce a
4

user friendly system wish is less expensive and can be affordable by an average Cameroonian to
enjoy.

1.4 Objectives to the study.


According to Encarta Dictionary, objectives can be defined as goals or target to be achieved,
(Encarta, 2009). In our case, we have a general objective and a specific objective which has been
subdivided in sections.

1.4.1 General objective.


The general objective of my thesis is to design and realize; a Remote control home automation
system (RECHAS) using RF techniques. The RF technology is used so as to obtain a human
friendly system with no physical disturbance.

1.4.2 Specific objective.


As specific objectives of my system, I can list the following:
 Design and realize the remote control circuit.
 Design and realize the main control unit which will receive the transmitted signals.
 Design and realize the switching interface, to switch ON or OFF the loads.
 Write and install the programme in the PIC16F877A to decode the transmitted signals
and execute the desired commands.
 Connect the loads to the control unit.
 Realize a gate control system.
 Design and realize an automatic light control system using LDR to detect day or night.
 Design schematic, then PC using ARES, produce the PCB and finally mount the
components.
 Then test the system for proper functioning as desired.

1.5 Research questions.


In the light of my problem statements, I asked myself the following questions that could help me
in developing a solution to solving the drawbacks.

 Which electronic system can be used to ease our mobility at are homes?
 How can we reduce human labour, energy waste, distance in operation and time
consumption in our homes?
 What can be done to bypass the use of internet in home automation?
 How to act by minimizing the cost of realization of a system that can work within the
range of 100m?
5

 Building an electronic system that can be affordable by an average income Cameroonian?


 What can be done to manage our security lights automatically in order to reduce energy
consumption?
 Which electronic system can be used to solve these problems without passing through
any communication operator in order to minimize cost during operations?

According to all the questions, I am implementing and extended approach to automating a


system to solve the problem using the radio frequency (RF) technique and LDR sensor.

1.6 Hypotheses to the study.


According to Oxford dictionary, a hypothesis is a supposition or proposed explanation made on
the basis of limited evidence as a starting point for further investigation (11 th Edition). As
concern this thesis the following hypothesis could be brought up.
 RF remote control system can be used to ease our mobility at our homes.
 RF remote control Home Automation systems in our homes will reduce human labour,
energy waste, distance in operation and time consumption in our homes.
 This can be used to manage our security lights automatically in order to reduce energy
consumption.
 With a remote control, a question arriving in our mind is how to manage electrically our
gate to be opened and closed from our living rooms or bedrooms directly.
 It is also to solve the problems of forgetting to switch off or on appliances at home
especially in homes where we have children who are often careless.
 The use of home automation systems is not acknowledged by most Cameroonians.

1.7 Significance to the study.

In our society today, conservation of energy is an issue of growing interest. Due to the cost of
energy and the price man pays to the environment for non-renewable energy, even ENEO
advises its users to economize energy by putting OFF lamps and appliances when they are not in
use.

The applications of this system in are homes come in handy when we have a pot on fire and a
guest rings and we are under the obligation to open the gate. We are working in our bedroom
but we want children to go to bed by switching off the TV in the living room. We want to switch
ON and OFF lamps in our houses without pressing physically the switch because we are far
6

from it. We are just coming from a long working day, we are tired and we want to open and
close the gate, and switch on lamps within a short time (Alan M. Davis, 2008). We are in bed at
night and forgot to switch on the security lamps; we want to travel but want the security lamps
switched on at night and off at day.

This electronic system is capable of controlling our homes and offices automatically with the use
of the remote control which will save time, strength and a lot of energy waste.

This piece of work can be beneficiary in the area of teaching and learning process by using it to
teach students on how signals can be transmitted and received and how they can build different
automatic systems using the radio frequency technique.

1.8 Scope of the study.


When developing a project, to show its achievements or realizations as compared to others its
scope needs to be shown. In my case, my project focuses more on the design and realization of a
remote control home automation system using RF technique. The system has four sections
namely; a remote control, the main receiver circuit, the automatic light switching and the
switching interface.

1.9 Organizational layout and overview of dissertation.


The organization of this work is takes the following procedure;
 Chapter 1: “General introduction” which defines the field of study as related to its
context determines the problem and lists the specific objectives.
 Chapter 2: “Literature review” which talks about the theory of this project and
summarizes related studies, and provides the contribution of my inquiry to the related
area of study.
 Chapter 3: “Design, simulation and materials used" provides a list of requirements.
The methods and procedures of realizing a RECHAS is exposed in detail, this permits
me to choose a suitable design circuit for my system and finally list some components
and software applications used in the process.
 Chapter 4: “Results and discussions." I t detailly presents the model and provides a
conclusive analysis to my inquiry.
 Chapter 5: “Conclusion and recommendations" summarizes my study, provides
some recommendations and suggestions and finally concludes my study.
In NOTES, a list of references, bibliography will be mentioned at the end of my study.
7

1.10 Definition of terms.

Frequency modulation: this is the form of analog angle modulation in which the baseband
information- carrying signal, typically called the message or information signal, varies the
frequency of carrier wave. [8]

Amplitude shift keying (ASK): is a form of amplitude modulation that represents digital data as
variations in the amplitude of a carrier wave. [9]

RF Module: An RF module (radio frequency module) is a (usually) small electronic device used
to transmit and/or receive radio signals between two devices. [10]

Encoder: These are electronic devices available with a choice of outputs. They generate a series
of pulses as they move. [11]

Decoder: A decoder is a combinational circuit that converts binary information from n input
lines to a maximum of 2n unique output lines. [12]

Home Automation: Home Automation includes the automatic control of lighting, heating,
ventilation and air conditioning, appliances, security locks of gates and doors and other systems
for providing convenience, comfort, energy efficiency and safety security. [13]
8

Chapter two
Literature review
In this chapter I shall be discussing on major findings and limitations about other works related
to mine, the ameliorations brought by RECHAS and the study of major components used in the
design.

2.1 Study of related works.

The control of electrical appliances has been carried out over the years by different people in
different ways. Much related work has been reported for the same function by different groups
with different approaches. Multiple home devices switch can be controlled with a designed
system using microcontroller as the heart of the circuit with android based mobile phone. Here
the mode of controlling devices is by sending a command wirelessly through Bluetooth [1].
IR remote control has a very wide application in the field of electronics. IR based remote
control for controlling multiple home appliances.[2], [3]. Another approach is by GSM based
for home automation. This is done by sending short SMS code from a mobile handset. All these
work is carried out for the same function in different ways by using different technologies. Some
use Bluetooth technology others use GSM technology or IR technology. Each technology has
its own advantages and disadvantages over the other but they all serve the common purpose to
replace manual work. The main objective of this work is to create another system to control
multiple appliances by using RF remote control technology. One of the main advantages of RF
based remote control is that it can operate the appliances without the requirement of line of sight
within its specified range efficiently.

2.1.1 Electrical control of several loads from a distance using an IR


based remote control system.

This piece of work is focused on the remote control of different lighting and socket circuits in a
domestic electrical installation. The remote control was achieved with the help of the sony infra-
red (IR) remote control system. When a button at the remote control is pressed, the signal is been
received by the IR sensor which then sends the signal to the microcontroller 16F628 which will
decode the received signal to activate the desired load.
9

Figure 2.1: block diagram Electrical control of several loads from a distance using an IR
based remote control system.

The IR based remote control home automation systems have a number disadvantages. This work
had limitations of not being able to control above 20metres. Since infrared (IR) remote
controls use light, they require line of sight to operate the destination device as signals cannot
go through opaque objects. The signal can, however, be reflected by mirrors, just like any other
light source. Infrared receivers also tend to have a more or less limited operating angle, which
mainly depends on the optical.

2.1.2 Radio frequency (RF) based remote control home


automation system.

This system operates using the RF technology through the help of the 433MHz transmitter-
receiver module. When a button is pressed at the remote control, a certain code of data from
the PIC16F84A is sent to the 433MHz transmitter which then propagates the signal to free
space. The propagated signal is received by the 433MHz receiver module and sent to the
PIC16F877A. The signal is been decoded by the PIC and sent to the switching interface to
operate the desired load. The system functions due to the help of the Manchester library. The
codes which are programmed in the PICs are written using the Manchester protocol
10

Figure 2.2: Block diagram of Radio frequency (RF) based remote control home
automation system.

This system functions normally within the range of 0-200m. The system can take up to 8
command buttons at the remote control. The limitation of this system is that, at certain period of
time you find loads going OFF and ON due to interference or unwanted signals received by the
433MHz receiver.

2.1.3 The remote industrial and home appliance control (RIHAC)


system.

This dissertation was carried out in The University of Bamenda for the award of a post
Graduate Diploma (DIPET II) in Electronics’ for July 2014. The remote Industrial and Home
appliance control (RIHAC) system. These work, helps users to control appliances in a distance
at any point of the house or plant within 0 to 100 metres. The device is able to control a
load of high power rating from remote area. Any equipment can be made to be controlled
within 0 to
100 metres through this device. When a button is pressed, a tone is generated by the PIC16F84A
and sent to the FM transmitter which then propagates the signal. The signal is been received at
11

the FM receiver and sent to the decoder which then decodes and implements with the help of a
microcontroller. This signal is transmitted to the relay through a particular frequency which
will direct the control of a specific appliance as desired by the user. In this work, we
have designed, realized a circuit which specially meet the requirements of control of the
home appliances through (frequency modulation) FM remote control device that is portable
within the periphery of a home or an Industry and is able to pass through obstacles. The
system works satisfactorily and it is also considered to be a less cost effective system.

Figure 2.3: Block diagram of The remote industrial and home appliance control (RIHAC)
system.

The problem we can have with RF remotes is the sheer number of radio signals flying
through the air at any given time. Cell phones, walkie-talkies, Wi-Fi setups and cordless phones
are all transmitting radio signals at varying frequencies. But we have RF remotes addressing the
interference issued, by transmitting at specific radio frequencies and by embedding digital
address codes in the radio signal. This helps to keep the radio receiver on the system informed
on when to respond to the signal and when to ignore it.
12

2.1.4 Remote control home automation system (RECHAS) using


RF techniques.

From the studies of the previous works on RF remote control home automation systems, I
realized that they had draw backs like; being unable to transmit for more than 100m, the system
is at times being influenced by unwanted signals and finally for IR remote control home
automation system the signal can’t go beyond 20m and they require line of sight to operate the
destination device as signals cannot go through opaque objects. To this aforementioned draw
backs, I am implementing and extended approach to automating a system to solve the problems
using the radio frequency (RF) technique and LDR sensor.

Figure 2.4: Block diagram of Remote control home automation system (RECHAS) using
RF techniques.
13

2.2 Study of the remote control.


2.2.1 History of the remote control.
This is a component of an electronic device used to operate the device wirelessly from a distance.
A remote control is a component of an electronic device most commonly a television set, DVD
player or home theatre system originally used for operating the device wirelessly from a
distance.
The first remote controls were developed mainly for military purposes during the period of the
first and Second World War. After the war, scientist went into research to try and incorporate
this system to day to day life.[14]

Zenith began playing around with the idea o f TV remote control in the early1950’s. They
developed one in 1952 called “Lazy Bones’’ which was a long cable that was attached to the TV
set. Pushing buttons on the remote activates a motor that would rotate the tuner in the set. This
type of remote was not popular for long considering that, at that time, there were very few
channels to choose from. [15]

In 1955, the Flash-Mastic was invented. A flash light was shined toward light sensitive cells in
each of the four corners of the TV. Each corner had a different function. They turned the TV on
and off, changed the channel and controlled the volume. However, people often forgot which
corner of the TV operated which control. Also, if the set was in sunlight, the sun’s rays would
affect the operations of the TV. [16]

In 1957 a group of engineer developed the Zenith “Space Command’’ a wireless remote control
using ultrasonic waves. The problem with the ultrasonic control was that clinking metal such as
dog tags could affect the TV set. High frequencies sometimes also made dogs bark. The
ultrasonic remote was used for two decades till only then that engineers discovered a better way
to operate TV’s, called the IR remote control.

On IR remote control, each button has its own command and is sent to the TV set in a series of
signals. There is a digital code for photo detector that identifies the infrared beam, and translates
the code into a command.Manufacturers use to only make remote controls that operated only one
TV set but nowadays, there exist universal remote controls that can operate any TV set.

However, with increase in technology, there has been need to control electronic devices from a
further distance, in non-directional way, in a way that a signal is not affected by an object in
front of the receiving device. This prompted the idea of mounting an RF remote control that will
work or control an appliance or circuit according to the desire. [17] [18]
14

2.2.2 Wireless communication

Wireless communication as the term implies, allows information to be exchanged between two
devices without the use of wires. In other words, wireless is a term used to describe
telecommunication in which electromagnetic waves (rather than some form of wire) carry the
signal over part or the entire communication path. A wireless keyboard sends information to the
computer without the use of a keyboard cable; a cellular telephone sends information to another
telephone without use of a telephone cable. Changing television channels, opening and closing a
garage door and transferring a file from one computer to another can all be accomplished using
wireless technology. In all such cases, information is being transmitted and received using
electromagnetic energy also referred to as electromagnetic radiation. One of the most familiar
sources of electromagnetic radiation is the sun. Other common sources include TV and radio
signals, light bulbs and microwaves. [19]

2.1.3 Radio frequency (RF) technology

Radio frequency is the region of the electromagnetic spectrum below microwave. Radio
Frequency (RF) is a rate of oscillation in the range of about 3kHz to 300GHz, which corresponds
to the frequency of radio waves, and the alternating currents which carry radio signals. In RF
communication, an RF transmitter emits the signal in the form of electromagnetic wave which is
transmitted through air. At the receiving end, an RF receiver receives the signal which is then
processed to retrieve the information it contains. [20] Some common applications of RF
technology are: Car locking systems, Computers (Mouse, Keyboards, Printers…), Emergency
response systems , Environmental control systems (Windows, Doors, Lights…), Home security,
Navigation systems, Telephone, Robot remote control, Wireless data transmissions, Digital
video/audio transmission, Digital home automation, such as remote light, Industrial remote
control and remote sensing, Remote control for household appliances and Electronic projects
15

Table 2.1: Radio frequency Table

FREQUENCY WAVELENGTH DESIGNATION ABBREVATION


3-30 Hz 104-105km Extremely low ELF
frequency
30-300 Hz 103-104km Super low frequency SLF
300-3000 Hz 100-103km Ultra low frequency ULF
3-30 kHz 10-100 km Very low frequency VLF
30-300 kHz 1-10 km Low frequency LF
300kHz-3 MHz 100m-1 km Medium frequency MF
3-30 MHz 10-100m High frequency HF
30-300 MHz 1-10m Very high frequency VHF
300 MHz-3 GHz 10cm-1m Ultra high frequency UHF
3-30 GHz 1-10cm Super high frequency SHF
30-300 GHz 1mm-1cm Extremely high EHF
frequency

2.1.4 Modulation
Moore A.W (2009)[21] Modulation refers to the act of adding the message signal to some form
of carrier. The carrier, by definition is a higher frequency signal whose phase, frequency,
amplitude or some combination thereof is varied proportionally to the message. This change can
be detected and recovered (demodulated) at the other end of the communication channel. There
are a number of ways this can be done but for simplicity we will only look at Amplitude
Modulation (AM), On-Off Keying (a variation on AM for digital transmission), Frequency
modulation (FM) and Frequency shift keying (a variation on FM for digital transmission).

 Amplitude Modulation.
In amplitude modulation, the amplitude of the carrier is changed to follow the message signal. In
this case we can see a “ripple” on the carrier; its envelope contains the message. This can be
demodulated using an extremely simple envelope detector that captures this ripple as a low
frequency response.

 On-Off Keying.
This form of modulation takes the amplitude modulation as described above to the extreme. In
this instance, we have only two states: Carrier and No Carrier. This approach lends itself nicely
16

to the transmission of digital data because the carrier can be simply switched “on” or “off”
depending on the state of the data being sent. The demodulated output is either high or low
depending on the presence of the carrier.

 Frequency Modulation.
Frequency modulation is more complicated but provides the benefit of constant output power
independent of the message being sent. With this approach, the frequency of the carrier is not
constant but varies in relation to the message. This requires a much more complicated
demodulation circuit typically implemented using a phase lock loop (PLL).

 Frequency Shift Keying.


The relationship between Frequency Shift Keying and Frequency Modulation is analogous to the
relationship between On-Off Keying and Amplitude Modulation in that only two carrier
frequencies are used, each corresponding to a digital state. In this case, the benefits of Frequency
Modulation are realized but with less complexity in the demodulation circuit.

2.1.5 Protocol description (RF protocol)


Basically, RF remote control protocols have to represent the same information as IR remote
control protocols: Device address and command. But, communication via RF demands some
additional measures. The power consumption of an RF‐transmitter is not as high as of an IR‐LED
and maximum data rates of an RF‐link are higher resulting in frames with shorter duration. As a
consequence, frames with a higher number of bits and more information content are possible
using RF while saving battery life time at the same time. This fact enables some more fancy
features for RF remote controls. Each RF remote control requires a unique ID. RF remotes use
real unique IDs meaning that each transmitter world‐wide has another ID. Therefore, the bit
length reserved for RF IDs is longer (e.g. 32 … 40 bit). Some RF protocols even implement a
counter signalizing how often a button was pressed repeatedly. For improved robustness of the
RF link CRC‐values (cyclic redundancy check) are often generated and transmitted as part of the
frame (e.g. 8 bit). The receiver may clearly identify any bit‐errors by recalculating the
CRC‐value of the received data frame and comparing it with the one generated before
transmission. [22]
17

2.3 Study of the 433MHz Wireless Transmitter and Receiver


(Tx/Rx) module.
2.2.1 The transmitter/ receiver module.
The RF module is a small electronic circuit which comes in a pair and is used to transmit,
receive, or transceive radio waves on one of a number of carrier frequencies. RF modules are
widely used in consumer applications such as garage door openers, wireless alarm systems,
industrial remote controls, smart sensor applications, weather monitoring system, RFID, wireless
mouse technology and wireless home automation systems. They are often used instead of
infrared remote controls as they have the advantage of not requiring line-of-sight operation.

The RF module, as the name suggests, operates at Radio Frequency. The corresponding
frequency range varies between 30kHz and 300GHz. In this RF system, the digital data is
represented as variations in the amplitude of carrier wave. This kind of modulation is known
as Amplitude Shift Keying (ASK).
This RF module comprises of an RF Transmitter and an RF Receiver. The transmitter/receiver
(Tx/Rx) pair operates at a frequency of 433MHz. An RF transmitter receives serial data from
the encoder and transmits it wirelessly through RF through its antenna. The transmitted data is
received by an RF receiver operating at the same frequency as that of the transmitter. From here,
the decoder then converts the serial data into a parallel data before giving to the microcontroller.
The microcontroller then controls the corresponding load through an interface.

Figure 2.5: 433MHz Wireless transmitter and receiver module. [23]


18

2.4 Study of the HT12E Encoder and HT12D Decoder. [25]

Encoder IC (HT12E) receives parallel data in the form of address bits and control bits. The
control signals from remote buttons along with 8 address bits constitute a set of 12 parallel
signals. The encoder HT12E encodes these parallel signals into serial bits. Transmission is
enabled by providing ground to pin14 which is active low. The control signals are given at pins
10 -13 of HT12E. The serial data is fed to the RF transmitter through pin17 of HT12E.

Transmitter, upon receiving serial data from encoder IC (HT12E), transmits it wirelessly to the
RF receiver. The receiver, upon receiving these signals, sends them to the decoder IC (HT12D).
The serial data is received at the data pin (DIN, pin14) of HT12D. The decoder then retrieves the
original parallel format from the received serial data.
When no signal is received at data pin of HT12D, it remains in standby mode and
consumes very less current (less than 1µA) for a voltage of 5V. When signal is received
by receiver, it is given to DIN pin (pin14) of HT12D. On reception of signal, oscillator of
HT12D gets activated. IC HT12D then decodes the serial data and checks the address bits three
times. If these bits match with the local address pins (pins 1-8) of HT12D, then it puts the
data bits on its data pins (pins 10-13) and makes the VT pin high. The corresponding output
is thus generated at the data pins of decoder IC.
A signal is sent by lowering any or all the pins 10-13 of HT12E and corresponding
signal is received at receiver’s end (at HT12D). Address bits are configured by using the
first 8 pins of both encoder and decoder ICs. To send a particular signal, address bits must
be same at encoder and decoder ICs. To summarize, on each transmission, 12 bits of
data is transmitted consisting of 8 address bits and 4 data bits. The signal is received at
receiver’s end which is then fed into decoder IC. If address bits get matched, decoder converts it
into parallel data and the corresponding data bits get lowered. The outputs from this system
(decoder in particular) are then fed into the microcontroller to control the corresponding loads.
19

Figure 2.6: HT12E Encoder and HT12D Decoder

 Applications.
 Burglar alarm.
 Smoke and fire detector alarm system.
 Garage door fire alarm system.
 Garage door controllers.
 Car door controllers.
 Other remote control systems.

2.6 Microcontroller

A Microcontroller is an embedded chip, which has a computer processor with all its support
function (clocking and reset), Memory (both program Storage and RAM), and input/output
(including bus interfaces) built into the device. These built in function is to minimize the need for
external circuits and devices to the designed in the final applications. It is also called embedded
controller.

The improvement in Microcontroller technology has made it two ten be more cost effective,
faster and more efficient to developed an application using a Microcontroller rather than discrete
logic. Creating applications for microcontrollers is completely different than any other
development job in computing and electronics. In most other applications, number of subsystems
20

and interface are available but this is not the case for the microcontroller where the following
responsibilities have to be taken. One fines in the market two big families of Microcontroller
the RISCS (Reduced Instructions Set to Computer) and the CISCS (Complex Instructions Set to
Computer). On the CISCS one has less speed of treatment, but the instructions are more
Complex, more powerful, and therefore more numerous. The PIC 16F87X is of the family of the
RISCS or component to reduced instruction set [26].

2.6.1 The different families of the PIC

The Microcontroller (PIC) is subdivided into subfamily according to the length (number of bits)
words used and the number of instructions usable for its programming one distinguishes the
following;

 The Base - Line family, which uses instructions words of 12 bits,


 the Mid - Arranges family, which use words of 14 bits (of which the 16F877X belong),
 The family High-End, which uses words of 16 bits.
 The Enhanced family ", which is the last family of PIC

2.6.2 Identification of PIC

To recognize a PIC, one uses merely its number. The first 2 digits indicate the category of the
PIC, 16 indicate a PIC Mid - Arranges. Then come sometimes a letter:

 L indicates that the PIC can function with a beach of voltage much more tolerant;
 C indicates the program memory that is EPROM or rarely one EEPROM;
 CR indicates that it is a ROM memory used.
 F indicates that it is a FLASH memory used. Then, the last figures indicate the PIC
precisely, for example 84 or 877.
 Finally you will see on the cases the suffix “XX” where XX represent the maximum clock
frequency that the PIC can support; for example 04 for a 4MHz of frequency.
 Let us note that only a FLASH memory or EEPROM can be reprogrammable, so let us not
hope to reprogram the PIC of the type CR for example. A component which one cannot
reprogram is called O.T.P (One Time programming) i.e. their programming is single.

Let us note that PICs are static components, i.e. their cock frequency can be lowered until it stop
completely without losing any data and malfunctioning, this is in opposition to the dynamic
21

components (as the microprocessors of the computer) whose clock frequency must remain
within a precise limit.

2.6.3 The PIC 16F877A Microcontroller

a) Special Microcontroller Features:


 C compiler optimized architecture:
 Optional extended instruction set designed to optimize re-entrant code
 100,000 erase/write cycle Enhanced Flash program memory typical
 1,000,000 erase/write cycle Data EEPROM memory typical
 Flash/Data EEPROM Retention: 100 years typical
 Self-programmable under software control
 Priority levels for interrupts
 8 x 8 Single-Cycle Hardware Multiplier
 Extended Watchdog Timer (WDT):
 Programmable period from 4 ms to 131s
 Single-supply 5V In-Circuit Serial Programming™ (ICSP™) via two pins
 In-Circuit Debug (ICD) via two pins
 Wide operating voltage range: 2.0V to 5.5V
 Programmable 16-level High/Low-Voltage Detection (HLVD) module:
 Supports interrupt on High/Low-Voltage Detection
 Programmable Brown-out Reset (BOR
 With software enable option
b) Power Managed Modes:

 Run: CPU on, peripherals on


 Idle: CPU off, peripherals on
 Sleep: CPU off, peripherals off
 Idle mode currents down to 5.8 μA typical
 Sleep mode current down to 0.1 μA typical
 Timer1 Oscillator: 1.8 μA, 32 kHz, 2V
 Watchdog Timer: 2.1 μA
 Two-Speed Oscillator Start-up
22

c) Peripheral Highlights:
 High-currentsink/source 25 mA/25 mA
 Three programmable external interrupts
 Four input change interrupts
 Up to 2 Capture/Compare/PWM (CCP) modules,one with Auto-Shutdown (28-pin
devices)
 Enhanced Capture/Compare/PWM (ECCP)module (40/44-pin devices only):
 One, two or four PWM outputs
 Selectable polarity
 Programmable dead time
 Auto-Shutdown and Auto-Restart
 Master Synchronous Serial Port (MSSP) module supporting 3-wire SPI™ (all 4
modes) and I2C™Master and Slave Modes
 Enhanced Addressable USART module:
 Supports RS-485, RS-232 and LIN 1.2
 RS-232 operation using internal oscillator block (no external crystal required)
 Auto-Wake-up on Start bit
 Auto-Baud Detect
 10-bit, up to 13-channel Analogue-to-Digital Converter module (A/D):
 Auto-acquisition capability
 Conversion available during Sleep
 Dual analogue comparators with input multiplexing)

d) Flexible Oscillator Structure:


 Four Crystal modes, up to 40 MHz
 4X Phase Lock Loop (available for crystal and internal oscillators)
 Two External RC modes, up to 4 MHz
 Two External Clock modes, up to 40 MHz
 Internal oscillator block:
 8 user selectable frequencies, from 31 kHz to 8 MHz
 Provides a complete range of clock speeds from 31 kHz to 32 MHz when used with
PLL
 User tunable to compensate for frequency drift
 Secondary oscillator using Timer1 @ 32 kHz
23

 Fail-Safe Clock Monitor:


 Allows for safe shutdown if peripheral clock stops
 Below is the internal structure of the microcontroller

For the microcontroller to function normally, it needs an external system of clock. One uses for
this fact quartz whose role is to create impulses of high frequencies. Its reboot strapping requires
a button RESET as indicates figure the below:

(b) Reset circuit


Figure 2.7: (a) quartz oscillator circuit
We are going to study within the framework of this project, one of the microcontrollers who
answer favorably these criteria and whose its record of use nowadays is not any more to show:
THE PIC16F877A. It can function in real-time with maximum quartz of 20MHz, i.e. it will
provide 20 million impulses per seconds. The time which passes between 2 impulses calls a
cycle of clock. The figure below shows the physical structure of a microcontroller.

Figure 2.8: Physical structure of PIC 16f877A


Survey of the main internal components of the useful PIC16F877A for our project.

The memory of the 16F877A is divided in to 3 parts:

 The programs memory

The program memory consists of 8 kilo words of 14 bits. It is in this memory that we will write
our program. The PICcarries out with instructions placed in the memory of program.
24

 EEPROM Memory

The EEPROM is non-volatile and is particularly useful for holding data variables that can be
changed but are likely to be needed for the medium to long term. The PIC 16F877A have 225
bytes of EEPROM memory.
 RAM Memory

It is that which we unceasingly will use. All the data which are stored there are lost at the time of
a power cut. The PIC 16F877A have 368 bytes of the RAM memory.

 The Stack

Contrary to the traditional microcontrollers the 16F877 has a stack which is not in the RAM but
in the programs memory. This stack is used at the time of the call to a subroutine. It contains
only eight sites, which limits to 8 the number of under programs that one can imbricate.

The 16F877A has 33 wearing of inputs/outputs as follows distributed:

 Port a: 6 analogical and numerical bits


 Port b: 8 numerical bits
 Port C: 8 numerical bits (RS232, I2C)
 Port D: 8 numerical bits
 Port E: 3 analogical and numerical bits (control of parallel port)
 Wearing of input/output

The PIC 16F877A has 5 wearing of inputs/outputs:

 Port a:It has 6 numbered pines I/O of RA0 to RA5. Bidirectional of 6 bits of dispatcher
also which can be used as analogical entry. It is configured in I/O through register
ADCON1. Its pins are parameterized in the register SORTING A.38
 Port b: Out of his principal function as wearing of inputs/outputs, one notes the pine RB0
which in configuration of entry is of type “trigger of Schmitt” when it is used in mode
interruption “INT”; the simple reading of RB0 is done in a completely traditional way, in
entry of the type TTL. The port B has 8bits I/O
 The port c: It is a port with 8bits I/O among which two pines will be used in the system
for control.
 The port d: This port functions in a way identical to the others, in its general operating
process. Register TRISD will thus comprise the 8bits direction, while the register port D
25

corresponds to pines I/O concerned. From where 8 pines I/O, in entered mode, are of the
type Schmitt Trigger.
 The port E: It comprises only 3 pines RE0 to RE2. But, contrary to the ports, the bits
non concerned of TRISE are, this time, implemented for other functions. Pins REX can
also be used as analogical pins of entries.
 The USART (universal synchronous asynchronous receiver transmitter)

The USART is one of the two modules of communication series of the PEAK or English SCI
(Serial Communication Interfaces). As its name indicates it, it can establish a synchronous or
asynchronous connection, receive and transmit data, according to the way in which it is
configured. The USART makes it possible to communicate with the rest of the world, a computer
or any other material equipped with an interface series, integrated circuits digitizers/Analogue or
Analogical/Numbering, EEPROM series…

The USART can be configured according to 3 modes:

 Asynchronous (Duplex Full)


 Synchronous Master (Duplex Half)
 Synchronous Slave (Duplex Half)

2.6.4 Study of the PIC16F628A


 High-Performance RISC CPU:

 Operating speeds from DC – 20 MHz


 Interrupt capability
 8-level deep hardware stack
 Direct, Indirect and Relative Addressing modes
 35 single-word instructions
 All instructions single cycle except branches

 Special Microcontroller Features:

 Internal and external oscillator options


 Precision internal 4 MHz oscillator factory calibrated to ±1%
 Low-power internal 48 kHz oscillator
 External Oscillator support for crystals and resonators
 Power-saving Sleep mode
26

 Programmable weak pull-ups on PORTB


 Multiplexed Master Clear/Input-pin
 Watchdog Timer with independent oscillator for reliable operation.
 Low-voltage programming
 In-Circuit Serial Programming™ (via two pins)
 Programmable code protection
 Brown-out Reset
 Power-on Reset
 Power-up Timer and Oscillator Start-up Timer
 Wide operating voltage range (2.0-5.5V)
 Industrial and extended temperature range
 High-Endurance Flash/EEPROM cell:
 100,000 write Flash endurance
 1,000,000 write EEPROM endurance
 40 year data retention

 Low-Power Features:

 Standby Current: 100 nA @ 2.0V, typical


 Operating Current:12 μA @ 32 kHz, 2.0V and 120 μA @ 1 MHz, 2.0V, typical
 Watchdog Timer Current: 1 μA @ 2.0V, typical
 Timer1 Oscillator Current: 1.2 μA @ 32 kHz, 2.0V, typical
 Dual-speed Internal Oscillator: Run-time selectable between 4 MHz and
48 kHz: 4 μs wake-up from Sleep, 3.0V, typical

 Peripheral Features:

 16 I/O pins with individual direction control


 High current sink/source for direct LED drive
 Analog comparator module with Two analog comparators Programmable on-chip voltage
reference (VREF) module.
 Selectable internal or external reference
 Comparator outputs are externally accessible.
 Timer0: 8-bit timer/counter with 8-bit programmable prescaler
27

 Timer1: 16-bit timer/counter with external crystal/clock capability.


 Timer2: 8-bit timer/counter with 8-bit period register, prescalar and post scalar Capture,
Compare, PWM module:
 16-bit Capture/Compare
 10-bit PWM
 Addressable Universal Synchronous/Asynchronous
Receiver/Transmitter USART/SCI

 PORTA and TRISA Registers

PORTA is an 8-bit wide latch. RA4 is a Schmitt Trigger input and an open drain output. Port RA4

is multiplexed with the T0CKI clock input. RA5(1) is a Schmitt Trigger


input only and has no output drivers. All other RA port pins have Schmitt Trigger input levels
and full CMOS output drivers. All pins have data direction bits (TRIS registers) which can
configure these pins as input or output.

 PORTB and TRISB Registers

PORTB is an 8-bit wide bidirectional port. The corresponding data direction register is TRISB. A
‘1’ in the TRISB register puts the corresponding output driver in a High-impedance mode. A ‘0’
in the TRISB register puts the contents of the output latch on the selected pin(s).

2.7 Liquid Crystal Display (LCD) screen

The most commonly used LCDs found in the market today are 1 line, and 2 line or 4 line LCDS
which have only 1 controller and support at most of 80 characters, whereas LCDs supporting
more than 80 characters make use of 2HD44780 controllers.

Most LCDs with 1 controller have 14 pins and LCDs with 2 controllers has 16 pins (two pins are
extra in both for back-light LED connections). The pin description is shown in the table below
28

Figure 2.9: Character LCD type HD44780 Pin diagram

The LCD used here has 14 pins. The function of each pin is given below:

 VSS, VDD, and VEE: While VSS and VDD provide +5V and ground, respectively,
VEEis used for controlling LCD contrast.
 RS, REGISTER SELECT: There are two very important registers inside the LCD. The
RS pin is used for their selection as follows .If RS = 0 , then instruction command code
register is selected , allowing the user to send the command such as clear display, clear
cursor, etc. If RS = 1 the data register is selected, allowing the user to send data to be
displayed on the LCD.
 R/W, READ/WRITE: R/W input allows the user to write information to the LCD or
read information from it. R/W =1 when reading; R/W = 0 when writing.
 E, ENABLE: The enable pin is used by the LCD to latch information presented to its
data pins. When data is supplied to data pins, a high – to – low pulse must be applied to
this pin in order for the LCD to latch in the data present at the data pins. This pulse must
be a minimum of 450 ns wide.
 D0 – D7: The 8 – bit data pins, D0 – D7, are used to send information to the LCD or read
the contents of the LCD's internal registers. To display letters and numbers, we send
ASCII codes for the letters A- Z, a-z, and 0-9 to these pins while making RS = 1.

There are also instruction commands codes that can be send to the LCD to clear the display or
force to cursor to the home position or blink the cursor.

We also use RS=0 to check the busy flag bit to see if the LCD is ready to receive information.
The busy flag is D7 and can be read when R/W=1.RS=0, as follows: if R/W=1 and RS=0.When

D7=1 (busy flag=1), the LCD is busy taking care of internal operations and will not accept any
new information. When D7= 0, the LCD is ready to receive new information.
29

Table 2.2: Pin description for LCD


PIN SYMBOL I/O DESCRIPTION
1 Vss --- Ground
2 VDD --- +5 power supply
3 VEE --- Power supply to control contrast
4 RS I RS=0 for command register, RS=1 for data register
5 R/W I R/W+0 for write, R/W+1 for read
6 E I/O Enable
7 DBO I/O The 8-bit data bus
8 DB1 I/O The 8-bit data bus
9 DB2 I/O The 8-bit data bus
10 DB3 I/O The 8-bit data bus
11 DB4 I/O The 8-bit data bus
12 DB5 I/O The 8-bit data bus
13 DB6 I/O The 8-bit data bus
14 DB7 I/O The 8-bit data bus

Table 2.3: LCD Command Codes


CODE (HEX) COMMAND TO LCD INSTRUCTION REGISTER
1 Clear display screen
2 Return home
4 Decrement cursor (shift cursor to left)
6 Increment cursor (shift cursor to right)
5 Shift display left
7 Shift display left
8 Display off, cursor off
A Display off, cursor on
C Display on, cursor off
E Display on
F Display on, cursor blinking
10 Shift cursor position to left
14 Shift cursor position to right
18 Shift the entire display to the left
1C Shift the entire display to the right
80 Force cursor to beginning of first line
C0 Fore cursor to beginning of second line
38 2 Lines and 5×7 matrix

WORKING: The interface used by LCD is a parallel bus, allowing simple and fast
reading/writing of data to and from the LCD.
30

Figure 2.10: LCD data write wave form


This waveform above will write an ASCII Byte out to the LCD's screen. The ASCII code to be
displayed is eight bits long and is sent to the LCD either four or eight bits at a time. If four bit
mode is used, two "nibbles" of data (Sent high four bits and then low four bits with an "Enable"
Clock pulse with each nibble) are sent to make up a full eight bit transfer. The "Enable" Clock is
used to initiate the data transfer within the LCD.

Sending parallel data as either four or eight bits are the two primary modes of operation. While
there are secondary considerations and modes, deciding how to send the data to the LCD is most
critical decision to be made for an LCD interface application.

The last aspect of the LCD to discuss is how to specify a contrast voltage to the Display. We
have used a potentiometer wired as a voltage divider. This will provide an easily variable voltage
between Ground and VDD, which will be used to specify the contrast (or "darkness") of the
characters on the LCD screen. [27]

2.5 Study of the (Light Dependent Resistor) LDR.

A light dependant resistor also know as a LDR, photoresistor, photoconductor or photocell, is a


resistor whose resistance increases or decreases depending on the amount of light intensity.
LDRs (Light Dependant Resistors) are a very useful tool in a light/dark circuits. A LDRs can have
a variety of resistance and functions. For example it can be used to turn on a light when the
LDR is in darkness or to turn off a light when the LDR is in light. It can also work the other
way round so when the LDR is in light it turns on the circuit and when it’s in darkness the
resistance increase and disrupts the circuit.
31

Figure 2.11: The LDR.

 Functional description of the LDR.

The way an LDR works is that they are made of many semi-conductive materials with high
resistance. The reason they have a high resistance is that are very few electrons that are free
and able to move because they are held in a crystal lattice and are unable to move. When light
falls on the semi conductive material it absorbs the light photons and the energy is transferred
to the electrons, which allow them to break free from the crystal lattice and conduct electricity
and lower the resistance of the LDR.

 Analog Applications
 Camera Exposure Control.
 Auto Slide Focus - dual cell.
 Photocopy Machines - density of toner Colorimetric Test Equipment Densitometer.
 Electronic Scales - dual cell.
 Automatic Gain Control – modulated light source.
 Automated Rear View Mirror

 Digital Applications

 Automatic Headlight Dimmer.


 Night Light Control.
 Oil Burner Flame Out.
 Street Light Control.
 Absence / Presence (beam breaker) Position Sensor
32

2.8 Relays

A relay is an electrically operated switch. Current flowing through the coil of the relay creates a
magnetic field which attracts a lever and changes the switch contacts. The coil current can on or
off so relays have two switch positions and they are double throw switches. Relays allow
one circuit to switch a second circuit which can be completely separate from the first.

Relays are usually SPDT or DPDT but they can have many more sets of switch contacts. In our
projects the relays have a coil, which works on 12v dc power supply and provide DPDT action as
an output. The coil of the relay passes a relatively large current, typically 30mA for a 12V relay
Most chips cannot provide this current and a transistor is usually used to amplify the small
IC current to the larger value required for the relay coil. The maximum output current for the
popular 555 timer IC is 200mA.so these devices can supply relay coils directly without
amplifications.

Relay coils produce brief high voltage “spikes”, when they are switched OFF and this can
destroy transistor and ICs in the circuits to prevent the image protection diode is connected
across the relay coil. Solid state relays is used which has a Darlington transistor. These relays
would be ideal for applications where many relays are needed and power requirements are low.
Due to their small size, a large number of relays could be mounted on single printed circuit
board. The current required to operate these relays is significantly less than for mechanical
relay types also these devices may be less expensive than mechanical relays.

a) Choosing a relay:

When choosing a relay we need to consider the following features.

 Physical size and pin arrangement.


 Coil voltage.
 Coil resistances
 Switch ratings
 Switch contact arrangement.
b) Advantages of relays

 Relays can switch AC and DC, transistors can only switch DC.
 Relays can switch high voltages, transistors cannot.
 Relays are a better choice for switching large current (>5A).
33

 Relays can switch many contacts at once


c) Disadvantages of relays

 Relays are bulkier than transistors for switching small current.


 Relays cannot switch rapidly, transistors can switch many times per seconds
 Relays use more power due to the current following through their coil.
 Relays require more current than many chips can provide, so a low power
transistormay be needed to switch the current for the relay‘s coil.

Figure 2.12: Internal structure of a relay

 NC: - Normally Connected


 NO: - Normally Open
 COM: - Common
34

Chapter three
Design and simulation

3.0 Introduction.
In this part of my work, I will be explaining in details how I conceived, developed, designed and
implanted my system. I used a methodology best suited for an electronic design. I have
categorized the whole system into different individual modules. These modules (block diagrams)
will be helpful in understanding the concept and working of the integrated systems.

3.1 The general block diagram of the system.


The figure below represents the block diagram of my system. It is a simple illustration of how I
have implanted the electrical part of my system and the various parts involved in it.

Figure 3.1: The block diagram of a remote control home automation system with automatic
light switching using RF techniques.
35

3.2 Development software.


3.2.1 Software used to write the codes
In other to make a perfect choice on the programming language to be exploit, I took into in to
consideration the following aspects;
 The availability of the different documents to be exploited.
 The easy understanding of the programming language.
 The availability of the software to be use.
 Our individual and collective skills to the programming of this language.
Taking into account the above criteria, I decided to use mikro-C basic
Programming language which is flexible in its instruction set manipulation as compared to the
assembly language or other programming language. This language was created in 1972, intended
as a middle level language for writing for different computers

3.2.2 Simulation software (ISIS Proteus).


Many CAD users dismiss schematic capture as a necessary evil in the process of creating PCB
layout but we have always disputed this point of view. With PCB layout now offering
automation of both component placement and track routing, getting the design into the
computer can often be the most time consuming element of the exercise. And if you use
circuit simulation to develop your ideas, you are going to spend even more time working on the
schematic.

ISIS has been created with this in mind. It has evolved over twelve years research and
development and has been proven by thousands of users worldwide. The strength of its
architecture has allowed us to integrate first conventional graph based simulation and now -
with PROTEUS VSM - interactive circuit simulation into the design environment. For the first
time ever it is possible to draw a complete circuit for a micro-controller based system and
then test it interactively, all from within the same piece of software. Meanwhile, ISIS retains a
host of features aimed at the PCB designer, so that the same design can be exported for
production with ARES or other PCB layout software.

For the educational user and engineering author, ISIS also excels at producing attractive
schematics like you see in the magazines. It provides total control of drawing appearance
in terms of line widths, fill styles, colours and fonts. In addition, a system of templates allows
36

you to define a ‘house style’ and to copy the appearance of one drawing to another.
 How to Use this Documentation

Whereas the manual contains background information and tutorials, the help provides context
sensitive information related to specific icons, commands and dialog forms. Help on most
objects in the user interface can be obtained by pointing with the mouse and pressing F1.

ISIS is a vast and tremendously powerful piece of software and it is unreasonable to expect to
master all of it at once. However, the basics of how to enter a straightforward circuit diagram and
create your own components are extremely simple and the techniques required for these tasks
can be mastered most quickly by following the Tutorial. It is strongly recommended to work
through this as it will save time in the long run.

With some of the more advanced aspects of the package, some of the concepts are new, let alone
the details of how ISIS handles them. Each area of the software has been given a chapter of its
own, and it generally starts by explaining the background theory before going into the operation
and use of the relevant features.

 Choice of a programmer (The PIC16FXX programmer)

After the program has been written and simulated using the PROTON IDE, it must be
transferred into the microcontroller. This can only be achieved with the help of a programmer. In
this project, we are going to use a PIC16FXX programmer.

3.2.3 Choose of a communication medium


In this research we produce different feasible ways to leverage the RF remote using the
existing services but redefining the trivial purposes they serve.
The RF it is flexible it goes through obstacle such as walls, it covers a longer distance and it
have wave which can be use for free. So Instead of sending out light signals, an RF remote
transmits radio waves that correspond to the binary command for the button you're pushing. A
radio receiver on the RECHAS system receives the signal and decodes it, then perform the
command on the corresponding device. The problem we can have with RF remotes is the
sheer number of radio signals flying through the air at any given time. Cell phones, walkie-
talkies, Wi-Fi setups and cordless phones are all transmitting radio signals at varying
frequencies. But we have RF remotes addressing the interference issued, by transmitting at
specific radio frequencies and by embedding digital address codes in the radio signal. This
helps to keep the radio receiver on the system informed on when to respond to the signal and
when to ignore it.
37

3.2 The remote control block.


The remote control is the device which is used to give the various commands. The circuit was
designed using the RF techniques because of it advantages over the other transmission protocols.
The remote control was designed with the following circuits which we shall be designing. The
push buttons, the PIC16F682A Encoder, RF digital transmitter and a battery.

3.2.1 The Push buttons.


My system is built using 8 push buttons with each of them performing specific functions load.
When a button is pressed, a coded binary signal in the PIC16F628A is sent to the HT12E
encoder for a specific task.

 Criteria of choice and dimensioning.


I connected the push buttons to RB0 – RB7, using all ports B as input which is from pin6-pin13
of the microcontroller. One end of the pushbuttons gets connected to the 5V positive voltage rail
through a 10K resistor. This resisrors R2,R3,R4,R5,R6,R7,R8,R9, serves as pull up resistors,
pulling up the RB0,RB1,RB2,RB3,RB4,RB5,RB6,RB7 pins to a high voltage. When pressed
down, the push buttons now makes direct contact with ground and the pin drops to a low value.
The microcontroller can easily read whether there is voltage on the pin (HIGH State) or the is no
voltage on the pin (LOW State).

Figure 3.2: Push buttons used for control.


38

3.2.2 The PIC16F628A

The processing unit (MCU) is made up of microcontroller, and the following criteria permit the
selection of this component: It’s working frequency, the type of communication it possess
(parallel/serial), Memory capacity, the type (flash or non flash), and its timers. Since the
program space needed for this project was not too dense (about 6kB) and also because we
needed a microcontroller that we can reprogram at anytime that the program is upset, , we
decided to choose PIC16F628A using the Proteus 7.10 version library.
The quartz oscillator was chosen because the PICs needed a 20MHz working frequency.
The associated capacitors C1 and C2 are just for frequency balancing.

Figure 3.3: The PIC16F628A


39

3.2.3 The HT12E Encoder.

The HT12E is an encoder integrated circuit of 212 series of encoders. They are paired with 212
series of decoders for use in remote control system applications. It is mainly used in interfacing
RF and infrared circuits. HT12E converts the parallel inputs into serial output. It encodes the
12 bit parallel data into serial for transmission through an RF transmitter. These 12 bits are
divided into 8 address bits and 4 data bits.
HT12E has a transmission enable pin which is active low. When a trigger signal is
received on TE pin, the programmed addresses/data are transmitted via an RF medium.
HT12E begins a 4-word transmission cycle upon receipt of a transmission enable. This
cycle is repeated as long as TE is kept low. As soon as TE returns to high, the encoder
output completes its final cycle and then stops.
I used it because when it receives a parallel data from the PIC16F628A it sends the same digital
serial data to the transmitter. It has an operating voltage of 2.4V – 12V, low power and high
noise immunity CMOS technology, low stardard current 0.1A at 5V. the resistors R1 and R2 are
high value resistors given by the manufacturer to enable the oscillation of the encoder.

Figure 3.4: The HT12E encoder.


40

3.2.4 The digital RF transmitter.


A radio frequency transmitter or RF transmitter is an electronic component that sends
information from one circuit or device to another device by receiving electronic data and sending
them as radio signals. The data that is been generated by the encoder is been sent to the 433MHz
module for transmission. I used the 433MHz transmitter module because of the following;
 Transmission Distance: 20-200 m (dependent on supply voltage).
 Operating Voltage: 3.5-12V.
 Dimensions: 19 * 19mm.
 Max transfer rate: 4Kb/s (4000 bits per second).
 Transmission power: 10mW.
 Emission frequency: 433MHz.
 It is portable.

Figure 3.5: RF Transmitter (433MHz) [2]

3.3 The Receiver circuit.


3.3.1 The digital RF receiver.
A radio frequency receiver or RF receiver is an electronic component that receives information in
the form of radio signals from one circuit and feeds it to another device or circuit. In this
project, the RF receiver feeds the received signal into a decoder in the form of electric signals.
In general, the receiver outputs a code to uniquely identify the RF signal that it received. This
code is then used in order to convert signals from the transmitter into a format that can be
understood by the decoder. Since RF does not require a line-of-sight, the receiver can be placed
anywhere within the range of transmission of the transmitter. I choose it because of the
following;
 RF Receiver (433MHz).
 Super regeneration design ensures sensitivity to weak signals.
 Low power consumption (4mA).
 Operating Voltage: 3.5-12V.
41

 Dimensions: 19 * 19mm.
 Max reciever rate: 4Kb/s (4000 bits per second).
 Emission frequency: 433MHz.
 It is portable.

Figure 3.6: RF Receiver (433MHz) [2]

3.3.2 The Decoder (HT12D decoder).

The HT12D IC comes from HolTek Company. HT12D is a decoder integrated circuit that
belongs to 212 series of decoders. It is mainly provided to interface RF and infrared circuits.
They are paired with 212 series of encoders. The chosen pair of encoder/decoder should have
same number of addresses and data format. In simple terms, HT12D converts the serial input
data into parallel parallel outputs. It decodes the serial addresses data received by, say, an RF
receiver, into parallel data and sends them to output data pins. The input data code is
decoded when no error or unmatched codes are found. A valid transmission is indicated by
a high signal at VT pin.
HT12D is capable of decoding 12 bits, of which 8 are address bits and 4 are data bits.
The data on 4 bit latch type output pins remain unchanged until new is received.
The decoder in the main circuit is to decode the encoded signal received by the transmitter before
sending to the microcontroller to perform the required task.
42

Figure 3.7: The HT12D decoder.

3.3.3 The control unit (Microcontroller).


The processing unit (MCU) is made up of microcontroller, and the following criteria permit the
selection of this component: It’s working frequency, the type of communication it possess
(parallel/serial), Memory capacity, the type (flash or non flash), and its timers. Since the
program space needed for this project was too dense (about 8kB) and also because I needed a
microcontroller that I can reprogram at anytime that the program is upset, I decided to
choose PIC16F877A using the Proteus 7.10 version library.
The quartz oscillator was chosen because the PICs needed a 8MHz working frequency.
The associated capacitors C1 and C2 are just for frequency balancing.

I used the PIC16F877A microcontroller to control the receiver circuit. When the received signal
has been decoded by the HT12D it is sent to the microcontroller which then selects the
corresponding output pin and puts ON or OFF the relay circuit.
The average output voltage at any port of the microcontroller is 5V, the LEDs (D1 to D6)
chosen have a maximum forward current of 50mA. Applying ohms laws here, the resistors (R1
to R6) such that
43

Figure 3.8: the microcontroller circuit.

3.3.4 The automatic light control unit.


This unit controls the automatic light switching of the system with the help of the LDR, to switch
ON the light at night and OFF at day. From the remote control the is a coded button that sends a
specific signal to the PIC which identifies the specific pin that is linked to the opto-coupler
(PC817) pin1 and puts it at 1. When night falls, a signal is sent from the LDR to the OPAM
(TL082) for amplification which then bias the transistor C2330 and it will close to link pin2 of
the OPAM to the ground. The opto-coupler will then trigger the relay circuit.

Figure 3.9: the automatic light switching.


44

The voltage will bias the transistor and the opto coupler will then connect to the ground and
trigger the relay circuit.

3.3.5 Switching interface.

This block functions as an electronic switch and the same time as an interface circuit. As a
switch, it switches ON and OFF the supply connected to its outputs depending on the control
signal from the control unit. As an interface, it isolates the AC high voltage circuit from the DC
low voltage of the control circuit. This is to prevent destruction of low voltage components. The
circuit diagram of this block is as shown on figure below. The relays are used primarily as a
switching device and as an isolator. The role of the diode is to permit the discharge of the coil of
the relay when the relays are de-energized and also to protect the transistor from over current.
The role of the transistor is permit a link between the relay through it to the ground.
The resistor is to limit the current to the input of the transistor. It value is calculated as shown
below. The transistors functions in commutation mode; that is as a switch.
45

Figure 3.10: relay circuit.

3.3.6 Regulated power supply.


There are many different types of power supplies, but generally the design of a power supply is
to convert a high AC to a much lower voltage DC. This conversion of voltage allows the
resulting power to be used for electronic circuit, computers, and most other devices. The power
supply completes this task by four elements; the transformer, rectifier, filter and voltage
regulator. For this work, below is a block breakdown of the 5V and 12V regulated power supply.

a. Block diagram of the power supply

Figure 3.11: Block Diagram of the Power Supply.


46

As seen on the diagram above, the power supply circuit is divided into four different parts:

1. The transformer

2. The rectifier

3. The filter

4. The regulators
a) The transformer

This is used to step down the voltage level of the A.C. input from 220V to 12V A.C. The
current rating of the transformer is 1 A. This is more than enough to supply the current to the
relay unit and to all the other circuits of our system.

b) The rectifier

The rectifier used here is a bridge rectifier. This is more efficient than the centre tap. Here, the

A.C. signal coming from the transformer is rectified and converted into the pulsating D.C. and
this is further fed to the filter. The characteristics of the rectifier diodes are as follows:

=2 = 2 × √2 × 12 = 33.94
≈1

We choose diode 1N4004 with the following characteristics


VMR=400V

Average rectified current 1A

Maximum forward voltage drop 1.1V

c) The filter

This unit is nothing but a capacitor of high value which can charge and supply its charge
to the circuitry in the falling edge of the input signal. This way it continuously maintains
the direct cycle voltage across the circuit. Here, and electrolytic capacitor of 1000uf/470V is
used.

d) The regulator

The regulator is used to give constant output no matter what its input voltage is. The input to
this unit is nearly 12V D.C and its output voltage is constant at 5V since we are using the
regulator 7805.
47

Characteristics of the regulator 7805

Maximum = 40
Minimum = 7.3

Maximum current = 1A

3.4 Circuit design of simulation.


Finalizing the analysis of the various sub circuits that constitute the global system, it will be
with the help of this that the practical part of this research work is guarantee by producing the
printed circuit (PC). The figures bellow shows the copper and components sides of the entire
system.

3.4.1 The remote control circuit.

Figure 3.12: wiring diagram of the remote control.


48

3.4.2 The printed circuit and 3D visualization of the remote


control

Figure 3.13: printed circuit and 3D visualization of the remote control.

3.4.2 Circuit diagram of the main control unit.

Figure 3.14: The circuit diagram.


49

3.4.3 The printed circuit and 3D visualization of the main control


unit

Figure 3.15: The PC and 3D visualization of the main control unit.


50

3.4.4 The switching interface.

The switching interface, consist of the relay circuits and the automatic light switching. The relay
circuits are to receive signals from the microcontroller and switch ON or OFF the commanded
appliance.

Figure 3.16: Circuit diagram of switching interface.


51

3.4.4 Printed circuit of switching interface.

Figure 3.17: PC and 3D visualization of switching interface.


52

3.4.5 Simplified flow chart of transmitter and receiver code.

Where:
 Bn is { B1, B2, B3, B4, B5, B6, B7, B8}
 Code n; are the codes assigned to a particular command button.
 Load n; are the various loads.
At the level of the transmitter, when the system begins it initializes and when a button is pressed
a 4 word parallel data assigned to that particular button is transmitted and the cycle begins again.
When the system initializes and it receives no signal, it keeps returning back to init.
While at the receiver when the system begins, it initializes and when it receives a code it toggles
the state of the load assigned to that code from ‘0’ to ‘1’ or vice-versa and the cycle begins again.
When it initializes and no signal is received, it keeps returning back to init.

Figure 3.18: Simplified flow chart of transmitter and receiver code.


53

Chapter four
Results and discussions

4.0 Introduction
After a successful analysis of the various sub circuit that constitute the global system, it will be
with the help of this that the practical part of this research work is guarantee. In this chapter, I
am are going to execute the production of the PCB, mounting and soldering of components of
the various sub circuits at their respective positions and finally the evaluation of the cost
estimate of the whole project.

4.1 Realization of the project

4.1.1 Production of the printed circuit board (PCB)


I first of all produced my printed circuit (PC).The printed circuit layout is designed using the
software called “ARES” and it is later on printed on a glosery paper. The printing of the
layout on the l a y o u t w a s d o n e u s i n g t h e l a s e r p r i n t e r .
 Prepare the virgin cupper clad: to prepare the virgin cupper clad we do the following.
 I sized the copper clad to the dimension of the printed circuit with a hark saw.
 I cleaned the board with kitchen sponge and dishwashing liquid.
 I firmly pressed the glossy paper on the washed clad board with preheated iron.
 After, I placed the board in warm water and clean off the paper from the board
 Finally I Checked if the paper was completely removed and the connection lines of the
circuit are linked.

Figure 4.1: Production of the printed circuit board (PCB)


54

 Prepare the water with chemical: to prepare the water with chemical, I used the flowing
steps.
 I mixed the ferric chloride with warm water of about 60oc temperature.
 I then put the board inside the mixed solution and stared until the copper was cleaned off
and the circuit presented (etching).
 I removed the board from the mixed solution and clean with soft sponge

4.1.2 Drilling of the PCB


 Preparing the board: The PCB should be cleaned and kept on a flat wooden surface for
easy drilling.
 Select the appropriate drill bits and fit on machine: since as there are different sizes of
drill bits, you need to select the appropriate drill bits which will suit the pin size of your
components.
 Power ON the drill machine: Connect the power cord of the drill machine to supply and
switch ON the machine.
 Drill corresponding holes: Drill the corresponding hole that suit the drill bit on the
machine. Drill the hole vertically straight to avoid poor drilling so as to fit the
components properly.
 Verify if all holes have been drilled: verify if all the holes on the board have been drilled
with the corresponding bits.
 Clean the board: clean the surface of the PCB to avoid any form of poor presentation or
short circuit.

Figure 4.2: Drilling of the PCB


55

4.1.3 Mounting and soldering


 Mounting of components.
 Mount components on corresponding pattern: mount the components following the
circuit diagram.
 Make sure the components are been fitted in their corresponding positions.
 Verify if the component is well mounted: verify if the component is well mounted on
its right positions and cut off the long pins where necessary.
 Start soldering.
 Solder the components on the PCB: use the soldering wire and the hot soldering iron to
solder the mounted component on the PCB.
 Hold the soldering iron like a pen, near the base of the handle; remember not to touch
the hot element or tip.
 Touch the soldering iron onto the joint to be made; make sure it touches both the
component lead and the track. Hold tip there for a few seconds and
 Feed a little solder onto the joint; it should flow smoothly onto the lead and track to form
a volcano shape. Apply the solder to the joint, not the iron.
 Remove the solder, then iron, while keeping the joint still; allow the joint a few seconds
to cool before the circuit board will be moved.

Figure 4.3: Clean the soldered PCB

 Clean the soldered PCB:

Clean the board using acetone chemical or local system with a brush and screw driver to avoid
any form of short circuit or poor presentation.
56

 The soldered circuits

Figure 4.4: The soldered circuits


57

4.1.4 Testing and Trouble shooting.


 Test the functioning of the circuits.

 Check all the connections carefully.


 Check that components are the correct way round (LEDS, capacitor, transistors).
 Check that no leads are touching (unless they connect to the same block).
 Connect the 9V battery to the supply terminals of the remote.
 Then switch ON the circuit for the LEDs to blink.

Figure 4.5: Testing and Trouble shooting.

The circuit didn’t work normally so I disconnect (or switch off) the power supply and veried
carefully and re-checked every connection against the circuit diagram. finally I could identify the
fault and correct it after following the procedures below in trouble shooting.

 Steps to troubleshoot the circuits.


 Be sure that the power is turned ON.
 Be sure the ground connections are common.
 Be sure the circuit you built is identical to that in the diagram. (do a node- by – node
check).
 Be sure that the supply voltages are correct.
58

 Be sure you plug in cable to the right terminal in the multimeter to measure the voltage/
resistance (upper terminal) or the current (lower terminal).
 Be sure that the equipment is set up correctly and you are measuring the correct
parameter.
 Be sure the IC’s are well fitted in the sockets.
 If the first 5 steps are correct then you probably have used a component with the wrong
value or one that doesn’t work. To find your problem you must trace through the
voltages in your circuit node by node and compare the signal you have to the signal you
expect to have.

4.1.5 The final system.

 When a command button has not yet been pressed.

Figure 4.6: When a command button has not yet been pressed
59

 Sending commands.

Figure 4.7: Sending commands.


60

4.2 Cost estimate of the system.


Table 4.1: Cost estimate of the system.

No Components Quantity Unit cost T. amount


Estimate for the remote control
1 Push buttons 8 250 2000
2 IC HT12E 1 2000 2000
3 433MHz transmitter module 1 3500 3500
4 Pic16F628A 1 2500 2500
5 Quartz , 20MHz 1 500 500
6 Capacitors 22pf 2 100 200
7 Resistors
10k, 6 50 300
220k, 1 50 50
560k 1 50 50
8 Regulator 5v 1 400 400
9 Sockets 8pin 2 300 600
10 Battery, 9v 1 300 300
11 Battery socket 1 300 300
12 Connectors 2 250 500
13 TOTAL a 13200frs
Estimate for the main control unit
14 433MHz receiver module 1 3500 3500
15 PIC16F877A 1 4000 4000
16 Quartz 8MHz 1 500 500
17 Capacitors 15pf 2 100 200
18 Decoder HT12D 1 2000 2000
19 LED 9 50 450
20 Resistors
330, 9 50 450
27k 1 50 50
21 Regulator 5v 1 400 400
22 Capacitor (ceramic) 1 100 100
23 Sockets
8 pins 1 300 300
40 pins 1 300 300
24 Connectors 3 250 750
25 LCD Screen 16 x 2 1 4000 4000
26 Connection Cables 2.5 bundle 2000 2000
TOTAL b 19000frs
Estimate for switching interface
27 Relay drives 4 500 2000
28 Diodes 1N4001 6 100 600
29 Resistors
330 6 50 300
10k 2 50 100
4.7k 1 50 50
30 Variable resistor 100k 1 400 400
31 Power Transistors 5 300 1500
61

32 OPAM 1 500 500


33 Opto- coupler 1 500 500
34 Connectors 8 250 2000
TOTAL c 7950frs
Estimate for power supply
35 Transformer 1 1500 1500
36 Power cord 1 700 700
37 Regulator 12V 1 500 500
38 Bridge rectifier 1 500 500
39 Capacitors 1
2200 µf 2 400 800
10 µf 1 100 100
100nf 1 100 100
40 LED 1 50 50
41 Resistor, 330Ω 1 50 50
Estimate for PCB production
42 Copper board 4 2000 8000
43 drilling 4 350 1400
44 Ferric chloride 3 table 500 1500
spoon
45 Printing and glossy paper 4 800 3200
TOTAL d 18400frs
Estimate for production of remote and control unit case.
46 Remote control 1 2000 2000
47 Control unit 1 5000 5000
48 Bulbs 4 500 2000
49 Bulb holder 4 300 1200
50 cables 2m 150 300
TOTAL e 10500frs
Sum total= Total a+ b+ c+ d+ e 69050frs
62

Chapter five
Summary of major findings, recommendation and conclusion

5.0 Introduction.
This chapter discusses the summary of major findings, the recommendations of the project and
the conclusion of the entire work.

5.1 Summary of major findings.


A great majority of Cameroonians have used remote control at home. A remote control is used to
control equipments such as TVs, video projectors, digital satellite receivers e.t.c. After all that
have been realized above we can be able to answer questions like “Is it possible to put in place a
remote control capable of controlling equipments and appliances in our house and office such as
the internal lighting system, security systems, sockets, doors, gates, air conditioners, windows,
fans e.t.c” the answer is yes because this remote can and is capable of handling other issues like
to reduce human labour, energy saving, distant saving, and time consumption. It has also solve
the problems of forgetting to switch “OFF or ON” appliances at home especially in homes
where we have children.
In the course of my research I was able to;
4 Design and realize a remote control with 6 buttons using the PIC16F628A, the HT12E
and the 433MHz transmitter.
5 Design and realize the main control unit of high noise rejection with major components
like the (PIC16F877A, HT12D, 433MHz receiver) and the switching interface.
 Write and install the programme in the PIC16F877A to decode the transmitted signals
and execute the desired commands.
 Design and realize an automatic light control system using LDR to detect day or night to
manage our security lights automatically in order to reduce energy consumption.
 Realize an electronic system that can be used to ease our mobility at are homes and
reduce human labour, energy waste, distance in operation and time consumption in our
homes.
 Building an electronic system that can be affordable by an average income Cameroonian.
63

5.2 Recommendation

The system (RECHAS) will be of great help to sick people because of their in ability to move
up and down maybe because of the pains they are feeling and the energy they need to save. It is
necessary that we put in place this system in hospitals and homes, so that through this the sick
or even those who are not able to move freely can be able to control appliances with little or no
stress.
I will also like to recommend that this system should be installed in industries to activate and
secure industrial processes and also use to manage electrical appliances in an office.

This system is highly recommended in our homes since as is going to serve us a lot like to reduce
human labour, energy saving, distant saving, and time consumption. It will also solve the
problems of forgetting to switch “OFF or ON” appliances at home especially in homes where
we have children.

HTTTC Bambili being a technical teacher training college, this system will be of great use since
as it will be used as a didactic tool in teaching on Home automation, wireless control systems,
e.t.c.

5.3. Conclusion

This research work has presented a new concept of making a flexible home automation
electronic system which is indeed a user friendly system, through the use of a low cost
PIC16F628A, HT12D, 433MHz transmitter and receiver module, HT12D, PIC16F877A and a
LDR sensor. The home automation system is developed based on the radio frequency (RF)
transmission system which employs Amplitude Shift Keying (ASK) with transmitter/receiver
(Tx/Rx) pair operating at 433MHz. The transmitter module takes serial input and transmits
these signals through RF. The transmitted signals are received by the receiver module placed
away from the source of transmission.

The system allows one way communication between two nodes, namely, transmission and
reception. The RF module has been used in conjunction with a set of four channel
encoder/decoder ICs. Here HT12E & HT12D have been used as encoder and decoder
respectively. The encoder converts the parallel inputs (from PIC16F628A activated by the
remote buttons) into serial set of signals. These signals are serially transferred through RF to
64

the reception point. The decoder is used after the RF receiver to decode the serial format
and retrieve the original signals as outputs. These outputs are sent to the PIC16F877A to activate
the corresponding command and can be observed on the corresponding LEDs and the 16x2 LCD
screen. The switching interface circuit activates the loads by receiving the signals from the
PIC16F877A. The LDR sensor controls the automatic night and day switching, when a command
for automatic switching is received by the PIC16F877A it sets pin1 of the opto-coupler on 1,
and at night fall a signal is sent to the amplifier TL082 by the LDR which is then amplified and
triggers the transistor Q5. When the transistor is closed it links pin 2 of the opto-coupler to
enable it activate the relay and at day the LDR sends 0.

To wrap up, I will like to declare here that, though the process of this project was
somehow convoluted, still it was such a successful one. The study and realization of this
project has enabled me to acquire knowledge in several domains notably in electronic
components, microcontroller programming and fabrication.

5.4 Area for further study

In connection with this research, the following suggestions for further works are made.
 Design and realization of a home automation system surveyance camera.
Since this system is operated at a distant, we need to install a surveyance camera at every
operating point of the equipment such that we should be able to see what we are operating. This
is for security purposes especially in the case where we are in the house and we need to open
remotely the gate of which we don’t know who exactly is at the gate.
 Study and realization of an electrical control of loads using RF with a feedback.
This is to enable us get a feedback on if the load has been activated.
65

Reference

[1] APPLICATION NOTE 3435 Manchester Data Encoding for Radio Communications Jan 26,
2005 http://www.maximintegrated.com/an3435

[2] Cytron Technologies Sdn. Bhd. Version 1.2 Aug 2008 , Jalan Kebudayaan 1A, Taman
Universiti, 81300 Skudai, Johor, Malaysia.

[3] Gotschlich, M. (2010) Radio Frequency or Infrared. Infineon Technologies AG.

[4] Herschede, R., summer 1999 “Microcontroller Foundations for Mechatronics


Students,” master’s thesis, Colorado State University,.
[5] Horowitz, P. and Hill, W. 1989, the Art of Electronics, 2nd Edition, Cambridge
University Press, New York.
[6] http://Mikroelectronika.com

[7] IOSR Journal of Computer Engineering (IOSR-JCE) e-ISSN: 2278-0661, p- ISSN: 2278-
8727Volume 11, Issue 1 (May. - Jun. 2013), PP 56-60 www.iosrjournals.org

[8] Lander, C.W. 1993: power electronics. London: McGraw-Hill


[9] Micro C pro for pic manual by Microchip

[10] Microchip Technology Inc., PIC16F8X Data Sheet, Chandler, AZ, 1998.
[11] Moore A.W, Lent Term — 2009, Digital Communications I

[12] Muhammad Z.B,May 2012 “Remote Rf Control For Home Appliance Development Board”
[13] Proteus8.0 pro, version 1989-2012

[13] Tchakoute, T , July 2015 “Electrical control of several loads from a distance
using a remote control” final year thesis, HTTTC Bambili

[14] The Arduino Uno Revision 3 and the Arduino IDE v1.0.x and IDE v1.5.x

[15] Yong, J., “Testing Electronic Components”


66

Appendices

 Datasheet of LDR
67

 The transmitter code in mikro C


void main() {

cmcon|=7;

TRISA.F0 = 0;

TRISA.F1 = 0;

TRISA.F2 = 0;

TRISA.F3 = 0;

TRISB=0xFF;

PORTA = 0xFF;

while (1) { // Endless loop

if (PORTB.F0) { // Detect one-to-zero transition

PORTA.F0=0;

Delay_ms(500);

PORTA = 0xFF;

if (PORTB.F1) { // Detect one-to-zero transition

PORTA.F1=0;

Delay_ms(500);

PORTA = 0xFF;

if (PORTB.F2) { // Detect one-to-zero transition

PORTA.F2=0;

Delay_ms(500);

PORTA = 0xFF;

if (PORTB.F3) { // Detect one-to-zero transition

PORTA.F3=0;

Delay_ms(500);

PORTA = 0xFF;

if (PORTB.F4) { // Detect one-to-zero transition

PORTA.F0=0;
68

PORTA.F1=0;

Delay_ms(500);

PORTA = 0xFF;

if (PORTB.F5) { // Detect one-to-zero transition

PORTA.F1=0;

PORTA.F2=0;

Delay_ms(500);

PORTA = 0xFF;

if(PORTB.F6) { // Detect one-to-zero transition

PORTA.F2=0;

PORTA.F3=0;

Delay_ms(500);

PORTA = 0xFF;

if (PORTB.F7) { // Detect one-to-zero transition

PORTA.F0=0;

PORTA.F3=0;

Delay_ms(500);

PORTA = 0xFF;

}
69

 The reciever code in mikro C


// LCD module connections

sbit LCD_RS at RB4_bit;

sbit LCD_EN at RB5_bit;

sbit LCD_D4 at RB0_bit;

sbit LCD_D5 at RB1_bit;

sbit LCD_D6 at RB2_bit;

sbit LCD_D7 at RB3_bit;

sbit LCD_RS_Direction at TRISB4_bit;

sbit LCD_EN_Direction at TRISB5_bit;

sbit LCD_D4_Direction at TRISB0_bit;

sbit LCD_D5_Direction at TRISB1_bit;

sbit LCD_D6_Direction at TRISB2_bit;

sbit LCD_D7_Direction at TRISB3_bit;

#define SBIT_PS1 5

#define SBIT_PS0 4

// End LCD module connections

char txt1[] = " RECHAS USING RF TECHNIQUES";

char txt2[] = " MANDELA ELECTRONICS";

int l1,l2,l3,l4,l5,l6,l7,l8;

char TimerValue =0;

int v=0;

bit Aut,EM;

void Display_LCD(int L,int * pis){

int g=pis;

if (!L){

Lcd_Out(2,pis,"N");

if (g == 11){

Lcd_Out(2,pis,"C");
70

else {

Lcd_Out(2,pis,"F");

if (g == 11){

Lcd_Out(2,pis,"O");

void Move_Delay() { // Function used for text moving

Delay_ms(300); // You can change the moving speed here

char i; // Loop variable

void main() {

TRISD = 0x00;

TRISC = 0xFF;

PORTC = 0x00;

PORTD = 0x00;

CMCON = 7; // Disable comparators

l1 =L2=L3=L4=L5=L6=L7=L8= 0;

EM=0;

Lcd_Init(); // Initialize LCD

Delay_ms(500);

Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off

Lcd_Cmd(_LCD_CLEAR); // Clear LCD display

Lcd_Out(1,1,txt1);

for(i=0; i<38; i++) { // Move text to the right 4 times

Lcd_Cmd(_LCD_SHIFT_LEFT);

Move_Delay();

Lcd_Cmd(_LCD_CLEAR); // Clear LCD display


71

Delay_ms(1000);

Lcd_Out(1,1,txt2);

for(i=0; i<33; i++) { // Move text to the right 4 times

Lcd_Cmd(_LCD_SHIFT_LEFT);

Move_Delay();

Lcd_Cmd(_LCD_CLEAR); // Clear LCD display

Delay_ms(1000);

Lcd_Out(1,1,"1 2 3 4 5 G A E");

Lcd_Out(2,1,"F F F F F C F F");

Delay_ms(1000);

while(1){

if (portc.f0 && portc.f1 && portc.f2 && !portc.f3 && EM == 0){ //L1

portd.f0 =~ portd.f0;

Display_LCD((int)l1,1);

l1=~l1;

Delay_ms(500);

if (portc.f0 && portc.f1 && !portc.f2 && portc.f3 && EM == 0){

portd.f1 =~ portd.f1; //L2

Display_LCD((int)l2,3);

l2=~l2;

Delay_ms(500);

if (portc.f0 && !portc.f1 && portc.f2 && portc.f3 && EM == 0){ //L3

portd.f2 =~ portd.f2;

Display_LCD((int)l3,5);

l3=~l3;

Delay_ms(500);

if (!portc.f0 && portc.f1 && portc.f2 && portc.f3 && EM == 0){ //L4
72

portd.f3 =~ portd.f3;

Display_LCD((int)l4,7);

l4=~l4;

Delay_ms(500);

if (portc.f0 && portc.f1 && !portc.f2 && !portc.f3 && EM == 0){ //Aut

portd.f4 =~ portd.f4;

Display_LCD((int)l5,13);

l5=~l5;

Delay_ms(500);

if (portc.f0 && !portc.f1 && !portc.f2 && portc.f3 && EM == 0){ //L5

portd.f5 =~ portd.f5;

Display_LCD((int)l6,9);

l6=~l6;

Delay_ms(500);

if (!portc.f0 && !portc.f1 && portc.f2 && portc.f3){ //emmergency

if (!EM){

l1=0;

l2=0;

l3=0;

l4=0;

l5=0;

l6=0;

l8=0;

portd.f6 =1;

portd.f7 =0;

portd.f6 =0;

portd.f0 = 0;

portd.f1 = 0;

portd.f2 = 0;
73

portd.f3 = 0;

portd.f4 = 0;

portd.f5 = 0;

Lcd_Out(2,1,"F F F F F O F F");

Display_LCD((int)l7,15);

EM=~EM;

l7=~l7;

Delay_ms(500);

if (!portc.f0 && portc.f1 && portc.f2 && !portc.f3 && EM == 0){ //gate

if (l8 == 0){

Display_LCD((int)1,11);

portd.f6 =1;

portd.f7 =0;

Delay_ms(5000);

portd.f6 =0;

if (l8 == 1) {

Display_LCD((int)0,11);

portd.f6 =0;

portd.f7 =1;

Delay_ms(5000);

portd.f7 =0;

if (l8 == 0)l8=1;

else l8=0;

}
74
75

You might also like