Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 43

DESIGN AND CONSTRUCTION OF A PC SOFTWARE BASED LOAD

CONTROL SYSTEM

BY

AROWOWOSEGBE FEMI AMOS 2112120022


OLAWOYIN TOHEEB AKINKUNMI 2112120023
YUSUF DARE RAMOUS 2112220058
AZEEZ SAMAD ABIODUN 2112220059

SUBMITTED TO

DEPARTMENT OF ELECTRICAL ELECTRONICS ENGINEERING

OSUN STATE COLLEGE OF TECHNOLOGY, ESA OKE

A FINAL YEAR PROJECT REPORT SUBMITTED IN PARTIAL


FULFILLMENT OF THE REQUIREMENTS FOR THE AWARD OF
HIGHER NATIONAL DIPLOMA IN ELECTRICAL
ELECTRONICS ENGINEERING,
FACULTY OF ENGINEERING

NOVEMBER 2023.

1
CERTIFICATION

This is to certify that the project entitled “Design and construction of PC software based load

control system has been successfully completed under the guidance of Engr. O.Y

Ogunkeyede by the following students

AROWOWOSEGBE FEMI AMOS 2112120022


OLAWOYIN TOHEEB AKINKUNMI 2112120023
YUSUF DARE RAMOUS 2112220058
AZEEZ SAMAD ABIODUN 2112220059

in recognition to the fulfillment of the Higher National Diploma in Electrical and Electronic

Engineering, Osun State College of Technology, Esa Oke.

----------------------------------------------------- ------------------------------

Engr Ogunkeyede O.Y Date


Supervisor

----------------------------------------------------- ------------------------------

Engr S.A Adeniran Date


Head of Department

DEDICATION

This project is dedicated to the Almighty God for keeping us alive.

2
ACKNOWLEDGEMENT

3
I would like to express my gratitude to Engr ogunkeyede O.Y who was our

supervisor, for his constant guidance in the implementation of this project. I must

particularly thank him for his commitment and unrelenting effort to see me do all the

assignments appertaining to this project. Without his encouragement, the project would

not have been implemented as successfully as is the case.

I also want to appreciate my Head of Department for the time been our leader and

adviser, we appreciate him always and also all lecturers present in the department for their

contribution to our success in life.

Finally, I would also like to thank my parents for their endless support and not

forgetting my friends and classmates with whom we spent sleepless nights at times when

trying to get some concepts right and I was able to come up with a working project .

ABSTRACT

Home automation which is the systematic controlling and monitoring of everyday home
devices such as lighting, heating, window blinds and other appliances has become one of the
most exciting research areas in technology for the home in the last decades. Hundreds of
products are now available nowadays which allow us to control our devices automatically,

4
either by remote, voice commands or hand gestures. However, many of these systems are
expensive, difficult to install, and use. This research work proposed a low-cost solution for a
home automation system that overcomes the above drawbacks. The system provides control
of appliances at a fraction of the cost of commercially available systems by developing a
software to monitor all available users within the load. The system can be easily integrated
into an existing electrical system of a building or a room at reduced installations costs. It
comprises of microcontroller unit (PIC18F2550) which controls DC relays via relay drivers.
The relays are used to connect or disconnect the home appliances that are connected to the
contacts of the relays from the mains supply. A wireless area network interfaced to the
software for proper monitoring. The microcontroller is interfaced to a 20 x 4 characters
Liquid Crystal Display (LCD) to provide visual display of the operational status. The
software interface displays the load usage within the building, and command is sent to the
microcontroller via the UART port, and appropriate relay is energized or de-energized to
switch ON or OFF specific home appliances respectively.

TABLE OF CONTENTS
Title page i
Certification ii
Dedication iii
Acknowledgement iv

5
Abstract v
Table of content vi
CHAPTER ONE
1.0 introduction 1
1.1 Background to the study 1
1.2 Statement of the problem 2
1.3 Aim 2
1.4 Objective of The Study 2
1.5 Justification 2
1.6 Significant of the project 3
1.7 Scope of the project 3
1.8 Limitation of the project 3
CHAPTER TWO
2.0 Review of past project 4
2.1 Historical Background 4
2.2 The basic of PC based Home Appliance Control system 6
2.3 The brain of the system 7
2.4 Hardware design of the interface box 8
2.5 Optocoupler 12
2.6 Hig Voltage High current darlington transistor aray (ULN803) 12
2.7 Relay 12
2.8 MAX232 level Converter 14
2.9 DB9 16
2.10 Voltage Regulator 17
CHAPTER THREE
3.0 methodology 20
3.1 Construction and Installation 20
3.2 Description of flow process 20
3.3 Approach of developing the project 23

6
3.4 Software Interface 27
3.5 PIC-GUI Communication 27
CHAPTER FOUR
4.0 Testing 30
4.1 Hardware 32
4.2 Application Program Design 33
4.3 Securing the PC 33
CHAPTER FIVE
5.0 Summary 35
5.1 Conclusion 35
5.2 Recommendation 35
Reference 36

CHAPTER ONE

INTRODUCTION

1.1 Background to the Study

A PC Based Home control appliance is the use of control systems at home, in the

office and in industry to reduce human efforts. Home control appliances has greatly decreases

the need for human sensory and mental requirements as well. Home appliances control plays

an increasingly important role in the world economy and in daily experience. It is more

efficient and stress-free.

Personal computers are increasingly becoming the platform of choice to design and

implement control algorithms because it is simple to write, modify and update software

7
programs that implement a control algorithm. In this project, we use the personal computer to

control the electric appliances. For example turning high power AC loads such as lights, fans,

heater etc ON or OFF. To successfully integrate the interface box with the machine (laptop),

an interface device is used within the PC that can perform the necessary tasks. In this project,

we present the design of the interface box. The interface box can be controlled by the

computer by connecting to the USB port and develop a program in any preferable language.

Here we write a program in C#(c-sharp) programming language. The program will

demonstrate the basic idea of how to control devices and monitor events. By the program we

can have the computer to turn electric devices ON/OFF while disregarding the manual

control system. Moreover the people who are physically disabled in home and work place are

able to control the home appliances by interacting with the interface of the developed

application.

Now it is a necessity to employ the service of Home Appliances Control as it is more

effective, efficient and stress-free. In this project, we have developed a PC-based home/office

appliances control system.

1.2 Statement of the Problem

This project resolves the problem of those houses, offices and industries that have

switches scattered all over as it becomes so easy and stress free to switch appliances ‘ON’

and ‘OFF’. An individual can control his electrical appliances in the kitchen, bedroom, study

room, living room and other place in the house by mere clicking on his system situated

anywhere in the building. This equipment helps in regulating current and voltage.

In the case of controlling our household appliances with the personal computer, it can

be said that the voltage and current in connection with the equipment are being regulated,

thereby elongating the lifespan of our appliances by avoiding surge, blown circuits known

8
fully well that power supply in Nigeria today is not so reliable. The conveniency attached to

the use of the home appliances control system cannot be underestimated.

1.3 Aim: The aim of this study is to design and implement a PC-based home appliances

control system.

1.4 Objective of the Study.

The objectives of the project are to:

i. Develop a software in connection to the functional block diagram of the PC based

control system.

ii. Develop a circuit diagram of the functional unit in the block diagram.

iii. Carry out the circuit implementation on the Ferro-board.

iv. Evaluate the performance of the control system by applying its usage on

electrical appliances.

1.5 Justification

This project, Home appliances control system, can be a veritable tool which can

enhance the effective, efficient and stress-free use of home appliances.

1.6 Significant of the Project

The project is significant because of the following:

i. Home appliances control system can replace good amount of human work force.

ii. Full security because it requires specific codes in order to access the appliances.

1.7 Scope of the Project

This project can be implemented at home/office and in industry to control the various

appliances through PC. Devices can be controlled from the system while working on it.

1.8 Limitation of the Project.

i. It is a wired system.

9
ii. It cannot work for more than 7 outputs.

iii. The program is lengthy.

10
CHAPTER TWO

LITERATURE REVIEW

2.0 Review of Past Project

Some people have embarked on similar project some years back. An instance was a

student of the Federal University of Technology, Akure, in 2009 who embarked on similar

project with an objective to developing a functional block diagram, circuit diagram of the

functional unit in the block diagram, implementation of circuit components on the Ferro-

board and evaluating the performance of the control system by demonstrating its usage on

electrical appliances.

He developed a console application (user interact with the environment mainly by use

of text “commands” from the keyboard). He also controlled the connected appliances by the

use of text commands from the developed application.

2.0.1 Limitation of Past Project

i. The program is not user friendly

ii. It does not monitor event (i.e. it does not report information about the status of

the appliances been controlled.)

2.1 Historical Background

Increasingly, home and office appliances, including televisions, VCRs, stereo

equipment, refrigerators, washing machines, thermostats, light switches, telephones, copiers,

and factory equipment, have embedded computers, and often come with remote controls.

However, the trend has been that as appliances get more computerized with more features,

their user interfaces get harder to use [Brouwer-Janse 1992]. The Wall Street Journal reports

that “appliances – TVs, telephones, cameras, washing machines, microwave ovens – are

getting harder [to use]…. The result is a new epidemic of man-machine alienation” [Gomes

2003].

11
At the same time, PCs are commonly used with better input-output capabilities than

the average home appliance, such as high-resolution screens, text-entry technologies, and

speech capabilities. PCs are likely to maintain this advantage over appliances, because

improved hardware is a key differentiator between PC and is often marketed as an incentive

to upgrade to a new PC. All PC also come with the ability to communicate over the LAN

(Local Area Network), and most have built-in short range communication capabilities, such

as Bluetooth, that could allow them to communicate with and control appliances in their

surrounding environment. PC laptops are also personal devices, which allow them to provide

interfaces that are personalized. For example, a PC could provide interfaces that are

consistent with previous appliance interfaces that the user has seen, or it might combine

multiple appliance interfaces to create a single interface organize. Appliance manufacturers

could store pre-designed remote control user interfaces on each appliance, but there are too

many different kinds of windows application to provide a different interface for each.

Appliances could also provide web-style interfaces that are rendered in the built-in web

browser that most PC ship with (an approach used by UPnP [UPnP 2005] and others), but

web-style interfaces do not support the level of interaction that people want to have with their

appliances. For example, a web interface cannot support an interactive slider that adjusts a

value in real-time, such as you might want for the volume on a stereo. Most PC web browsers

also suffer from poor rendering of pages, which could lead to low quality user interfaces.

In this project, we present a framework for generating appliance interface from

abstract specifications of appliances’ functions that are stored on the appliances. This

interface allows control of the full functionality of each appliance and are generated to be

consistent with other interfaces that are provided on the PC. This allows users to leverage

their existing knowledge of their PC windows application to control appliances. The interface

is also fully interactive, which enables real-time incremental adjustment of the appliance’s

12
features, such as volume. An important focus of our system is to generate high quality

interface.

2.2 The Basis of PC based Home Appliances Control System

To think of home base appliances in its simplest, it is nothing but a DFB (Distribution

Fuse Board) whose command is sent to it through a windows form application using C#. The

project is microcontroller PIC16F876A which receives the command sent from the windows

application form and cause the necessary action to take place. The code for this

microcontroller is developed by mikro C pro compiler.

The entire project is connected to PC in control room via serial port (communication

port) which includes Optocoupler that is fixed on project board which is used to isolate the

setup from the PC to avoid any damage to both our system and microcontroller. A window

application which is Graphically User Interface in nature is developed on the PC which

enables us to interact with the electrical appliances.

The GUI consists of:

i. ON and OFF button to control the appliances.

ii. The room status which has check status and clear report option

Check Status option on the window application provides information on the controlled

appliances and the Clear Report option on the window application to get rid of unwanted or

already viewed information on the controlled appliances.

iii. A computer system (PC) which acts as a remote control.

2.2.1 Choice of Programming Language

The application program was developed courtesy c-sharp.

Reasons for the choice of programming language

i. It is very convenient to use (i.e. it has improved GUI)

ii. It has controls that you can pick and drop

13
iii. It is easier to communicate with the PIC microcontroller.

2.3 The Brain of the System.

The brain in most advanced system is actually a small computer. Its job is to close the

switch that activates the switches that power sensing devices when ON or OFF. Home base

PC differs mainly in which DFB (distribution fused board) and how various home base

appliances are wired in to the brain. The brain and the DFB features may be wired into the

control room, but they usually have a back-up power source as well.

The system consists of two units:

i. Control unit: The control unit is based on the use of standard personal computer with
Graphical User Interface (GUI) software to control the electrical appliances.
ii. Interface unit: The Interface unit is for interfacing the high power loads with the
control unit.
The below diagram display the architecture of the project in fig.1

Fig.1: Architecture of the PC home based appliances control

14
(S. M. Anamul Haque and S. M. Kamruzzaman Microprocessor and Interfacing
programming and hardware, publication, Second Edition, 2006)

2.4 Hardware Design of the Interface Box

In this section, we present the design of the interface box that is used to connect high

power loads to the computer. Details about the components that comprise the interface box

are also shown here.

2.4.1 Interface Box

The upper panel of the interface box consists of sockets, which are easily accessible to

the electric appliances for proper and safe operation. External panel of an interface box The

Front Panel consists of an AC power supply Cable, Sockets. AC power supply cable connects

the interface box to the main AC supply. Power ON switch supplies 220V (50Hz) mains’

supply to the interface box when turned on and stop supplies when turned off. USB cable

connects the interface box to the PC’s parallel port. Electric appliances are generally

connected to Socket.

2.4.2 Internal Module

The Internal circuitry of the interface box can be divided into three main categories:

Relay driver Circuit, Relays and +6V DC power supply.

2.4.3 Computer Interfacing

The Universal Serial Bus (USB) is one of the most common interfaces used in

electronic consumer products today, including PCs, cameras, GPS devices, MP3 players,

modems, printers, and scanners, to mention a few. These are data lines, control lines and

status lines. The USB is a high-speed serial interface that can also provide power to devices

connected to it. A USB bus supports up to 127 devices (limited by the 7-bit address field—

note that address 0 is not used as it has a special purpose) connected through a four-wire

serial cable of up to three or even five meters in length. Many USB devices can be connected

15
to the same bus with hubs, which can have 4, 8, or even 16 ports. A device can be plugged

into a hub which is plugged into another hub, and so on.

The maximum number of tiers permitted is six. According to the specification, the

maximum distance of a device from its host is about thirty meters, accomplished by using

five hubs. For longer-distance bus communications, other methods such as use of ethernet are

recommended. The USB bus specification comes in two versions: the earlier version,

USB1.1, supports 11Mbps, while the new version, USB 2.0, supports up to 480Mbps. The

USB specification defines three data speeds:

i. Low speed—1.5Mb/sec

ii. Full speed—12Mb/sec

iii. High speed—480Mb/sec

The maximum power available to an external device is limited to about 100mA at

5.0V. USB is a four-wire interface implemented using a four-core shielded cable. Two types

of connectors are specified and used: Type A and Type B. Figure a shows typical USB

connectors. Figure b shows the pin-out of the USB connectors. The signal wire colors are

specified. The pins and wire colors of a Type A or Type B

USB connector pin assignment. The specification also defines a mini-B connector, mainly
used in smaller portable electronic devices such as cameras and other handheld devices. This
connector has a fifth pin called ID, though this pin is not used. The pin assignment and wire
colors of a mini-B connector are given. Two of the pins, Data+ and Data -, form a twisted
pair and carry differential data signals and some single-ended data states.

Pin no. Name Color Fig.a Pin no Name Colour

1 +5.0V Red Fig.b 1 +5.0V Red


2 -Data White
2 Data - White
+Data Green
3 Data + Green 3
Not Used _____
4 Ground Black 4
5 Ground Black

16
Fig.a and Fig.b shows USB pin configuration and USB pin assignment

2.4.3.1 Enumeration

When a device is plugged into a USB bus, it becomes known to the host through a

process called enumeration. The steps of enumeration are:

i. When a device is plugged in, the host becomes aware of it because one of the a

data line (Dþ or D) becomes logic high.

ii. The host sends a USB reset signal to the device to place the device in a known

state. The reset device responds to address 0.

iii. The host sends a request on address 0 to the device to find out its maximum

packet size using a Get Descriptor command.

iv. The device responds by sending a small portion of the device descriptor.

v. The host sends a USB reset again.

vi. The host assigns a unique address to the device and sends a Set Address request

to the device. After the request is completed, the device assumes the new

address.

At this point the host is free to reset any other newly plugged-in devices on the bus.

The host sends a Get Device Descriptor request to retrieve the complete device descriptor,

gathering information such as manufacturer, type of device, and maximum control packet

size. The host sends a Get Configuration Descriptors request to receive the device’s

configuration data, such as power requirements and the types and number of interfaces

supported. The host may request any additional descriptors from the device. The initial

communication between the host and the device is carried out using the control transfer type

of data flow. Initially, the device is addressed, but it is in an unconfigured state. After the host

gathers enough information about the device, it loads a suitable device driver which

17
configures the device by sending it a Set Configuration request. At this point the device has

been configured, and it is ready to respond to device-specific requests (i.e., it can receive data

from and send data to the host).

2.4.3.2 Descriptors

All USB devices have a hierarchy of descriptors that describe various features of the

device: the manufacturer ID, the version of the device, the version of USB it

supports, what the device is, its power requirements, the number and type of endpoints, and

so forth.

The most common USB descriptors are:

i. Device descriptors

ii. Configuration descriptors

iii. Interface descriptors

iv. HID descriptors

v Endpoint descriptors

At the top of the hierarchy we have the device descriptor, then the configuration

descriptors, followed by the interface descriptors, and finally the endpoint descriptors. The

HID descriptor always follows the interface descriptor when the interface belongs to the HID

class. All descriptors have a common format. The first byte (b Length) specifies the length of

the descriptor, while the second byte (Descriptor Type) indicates the descriptor type.

2.5 Optocoupler

18
There are many situations where signals and data need to be transferred from one

subsystem to another within a piece of electronics equipment, or from one piece of equipment

to another, without making a direct ohmic contact electrical connection. Often this is because

the source and destination are (or may be at times) at very different voltage levels, like a

microprocessor which is operating from 5V DC but being used to control a triac which is

switching 240V AC. In such situations the link between the two must be an isolated one, to

protect the microprocessor from over-voltage damage.

2.6 High Voltage High Current Darlington Transistor Array (ULN2803)

The eight NPN Darlington connected transistors in this family of arrays are ideally

suited for interfacing between low logic level digital circuitry (such as TTL, CMOS or

PMOS/NMOS) and the higher current/voltage requirements of lamps, relays, printer

hammers or other similar loads for a broad range of computer, industrial, and consumer

applications. All devices feature open–collector outputs and free wheeling clamp diodes for

transient suppression.

The ULN2803 is designed to be compatible with standard TTL families while the

ULN2804 is optimized for 6 to 15 volt high level CMOS or PMOS.

2.7 Relay

A relay is an electrical switch that opens and closes under the control of another

electrical circuit. In the original form, the switch is operated by an electromagnet to open or

close one or many sets of contacts. It was invented by Joseph Henry in 1835. Because a relay

is able to control an output circuit of higher power than the input circuit, it can be considered

to be, in a broad sense, a form of an electrical amplifier. Here relay is used for the isolation of

various heavy appliances to the PC. Since the PC operates on very low current, but the

current in various appliances is in Amperes therefore isolation is necessary and relay is

required. Here we have used single pole dual through relay for the purpose.

19
2.7.1 The Relay Switch Tripping Stage

As the collector current is passed across the relay, it completes the circuit enabling

current to flow across it from the battery to the earth. The movable contact of the relay is

acted upon by a force to move away from the normally closed contact to the normally open

contact. At this point, a characteristic audible sound is heard emaciating from the relay.

The movable contact remains in this position for as long as pin 2 is provided with a

voltage and it appears that the electrical equipment is connected directly to the supply, so it is

turned ‘ON’.

2.7.2 How Relay Influence the Socket Output to be Controlled

The relay has 5 pins which are:

i. Relay coil

ii. Coil

iii. Normally open

iv. Normally close

iv. Common

At zero state, when there is no signal. The normally close and common pins are joined

together. Meanwhile, the neutral wire of the mains is connected to the neutral wire of the

socket to be controlled without obstruction or stop-over at any junction. However, when the

relay is energized the life wire from the mains goes to the common pin and in turn fed out

through the normally open and finally goes to the socket. Hence, the controlled socket is

turned on. The diagram showing how relay influence a socket is shown below in fig.2

common
Relay normally open
Socket

20
L N
L

N
Fig.2: Diagram showing how relay influence a socket output
(Circuit theory and practice 2ED by Robbin & Mill, 2009)

2.8 MAX232 Level Converter

The MAX232 is an IC, first created in 1987 by maxim integrated products, that

converts signals from an RS-232 serial port to signal suitable for use in TTL compatible

digital logic circuits. The MAX232 is a dual driver/receiver and typically converts the RX,

TX, CTS and RTS signals. The drivers provide RS-232 voltage level outputs (approx. +-

7.5v) from a single +5v supply on-chip charge pumps and external capacitors. This makes it

useful for implementing RS- 232 in devices that otherwise do not need any voltages outside

the 0v to +5v range, as power supply design does not need to be made complicated just for

driving the RS 232 in this case.

The receivers reduce RS232 inputs (which may be as high as +-25v), to standard 5v TTL

levels. These receivers have a typical threshold of 1.3v and a typical hysteresis of 0.5v.

2.8.1 Voltage Level

It is helpful to understand what occurs to the voltage levels. When a MAX232 IC

receives a TTL level to convert, it change a TTL logic 0 to between +3v to +15v and changes

TTL logic 1 to between -3v to -15v and vice versa for converting from RS232 to TTL. This

can be confusing when you realize that the RS232 data transmission voltages at a certain

logic state are opposite from the RS232 control line voltages at the same logic state. The table

below thus clarifies the matter.

RS232 LINE TYPE LOGIC RS232 VOLTAGE TTL VOLTAGE

21
LEVEL TO/FROM

MAX232

Data transmission (RX/TX) Logic 0 +3v to +15v 0v

Data transmission (RX/TX) Logic 1 -3v to -15v 5v

Control signals Logic 0 -3v to -15v 5v

(RTS/CTS/DTR/DSR)

Control signals Logic 1 +3v to +15v 0v

(RTS/CTS/DTR/DSR)

Diagram showing level conversion of MAX232

2.8.2 Applications

The MAX232 (A) has two receivers (converts from RS232 to TTL voltage levels) and

two drivers (converts TTL logic to RS232 voltage levels). This means only two of the RS232

signals can be converted in each direction. Typically, a pair of a driver/receiver of the

MAX232 is used for TX and RX signals, and the second one for CTS and RTS signals.

There are not enough drivers/receivers in the MAX232 to also connect the DTR, DSR

and DCD signals usually these signals can be omitted when e.g. communicating with a PC’s

serial interface. If the DTE really requires these signal either a second MAX232 is needed, or

some other IC from the MAX232 family can be used. Also, it is possible to directly wire

DTR (DB 9 pin N4) to DSR (DB 9 pin N6) without going through any circuitry. This gives

automatic (brain dead) DSR acknowledge of an incoming DTR signal.

2.9 DB-9

22
A db-9 connector is a 9-pin connector, approximately 2cm long by 0.75cm wide, with

2 rows of pins or sockets, a row of 5 and a row of 4, hence 9 pins total. It is often used in low

speed communications such as RS-232 and is the connector on personal computers since the

IBM PC-AT used COM ports. There are larger versions with 15 pins called DB-15 and used

for game ports and 10base5 network AUIs and 25 pins called DB-25 and used for earlier

COM ports and printer ports among other things.

2.9.1 Where are DB-9 Connectors Used?

DB 9 connectors were once very common on PCs and servers. DB 9 connectors are

designed to work with EIA/TIA 232 serial interface standard, which determined the function

of all nine pins as a standard, so that multiple companies could design them into their

products. DB 9 connectors were commonly used for serial peripheral devices like keyboard,

mice, joystick e.t.c. Also, they are used on DB 9 cable assemblies for data connectivity.

Today, the DB 9 has mostly been replaced by more modern interfaces such as USB,

PS/2, firewire and others. However, there are still many legacy devices that use the DB 9

interface for serial communication. The diagram below shows the Db-9 pin configuration

PIN SIG SIGNAL NAME DTE (PC)

1. DCD Data carrier detect In

2. RXD Receive data In

3. TXD Transmit data Out

4. DTR Data terminal ready Out

5. GND Signal ground -

6. DSR Data set ready In

7. RTS Request to send Out

8. CTS Clear to send In

9. RI Ring indicator In

23
Table 1 DB-9 pin configuration

2.10 Voltage Regulator

Two voltage regulators are used for producing constant voltage supply to both

PIC16F876A and relay respectively. The voltage regulators used are:

i. LM7812 voltage regulator

ii. LM7805 voltage regulator

2.10.1 Voltage Regulator LM7812

Details about the LM7812 voltage regulator

Manufacturer: Fairchild semiconductor Texas Instrument

Output Load: fixed

Output Voltage: 12v

Load regulation: 100mv, 240mv

Input Voltage (maximum): 27v

Maximum Operating Temperature: +125 C

Mounting Style: Through hole

Package/Case: TO-220-3

The voltage regulator LM 7812 produces constant 12v supply regardless of the

variation in the input load. The 12v is such that is needed for the workability of the relay.

PIN NO FUNCTION NAME


1. Input voltage (12v-27v) Input
2. Ground 0v Ground
3. Regulated output (12v) Output
Pin configuration of LM7812 voltage regulator

2.10.2 Voltage Regulator 7805

24
Details about the LM7805 voltage regulator

Manufacturer: STMicroelectronics-SGS Thomson

Manufacture part no: TO-220

ROHS: Yes

Product Category: Linear voltage regulator-standard

Polarity: positive

Number of Outputs: Single

Output Type: fixed

Output Voltage: 5v

Output Current: 1A

Line Regulator: 50mv

Load regulator: 100mv

Dropout voltage (maximum): 2.5v @ 1A

Maximum Operating Temperature: 150 C

Minimum Operating Temperature: 0 C

Mounting Style: Through hole

The voltage regulator 7805 produces constant 5v supply irrespective of the variation

in the input load. The 5v supply is such that is needed for the workability of the PIC

microcontroller.

LM7805 is a family of independent (78XX) fixed linear electrical energy regulator

IC’s (integrated circuit) the LM7805 works by producing a somewhat constant output voltage

of +5v dc. The ground pin is linked to a resistor partition network between output and ground

wire that adjusts the output voltage to boost the circuits. The LM7805 is a lined energy

device that generates a reasonably stable output voltage of +5v dc. It has an input stick which

is over +7v dc, a baseline pin and an output stick and works in a way that when a baseline pin

25
is linked to a device between output and the baseline, it can be changed to an output voltage

exceeding +5v dc.

PIN NO FUNCTION NAME

1. Input voltage (5v-18v) Input

2. Ground 0v Ground

3. Regulated output (5v) Output

Pin configuration of the LM7805 voltage regulator

Fig.3 IC voltage regulator

(IEEE 802.15, retrieved August 28, 2007,)

26
CHAPTER THREE

Methodology

3.1 Construction and Installation

The design demonstrates a system that allows one to control home appliances and turn

on or off any appliance that is connected to a computer. The appliances are connected to the

computer via a microcontroller. The power supply for each appliance is wired through an

electromechanical relay. A number of relays are used depending on the number of appliances

to be controlled. All the relays are controlled by a microcontroller. The microcontroller is

connected to the computer via a USB to RS232 Converter. The diagram below (Fig. 2) shows

the block diagram of the design system.

3.2 Description of Flow Process

Initially, all the switches are in the off state. When the ON button is clicked in the

software interface to turn on the desired device, the software converts the ON command into

hex code then sends the value to USB port address. It sends logic 1 (3.5-5V) to the

microcontroller through RS232 converter. Then the microcontroller sends a 1 to the

transistor. It will activate the transistor used to energize the relay. There is an inductor (a wire

coil), when energized with an electric pulse, will generate a magnetic field. The second part

of a relay is a system of metallic arms, which make up the physical contact of the switch.

When the relay is on, or an electric pulse is sent to the relay, the swing or switching arm of

the relay moves to another contact of the relay (the relay we used has two contacts). The arm

moves as the generated magnetic field pulls the swinging arm toward the inductor (or wire

coil). And hence the a.c circuit is completed and the electrical appliance is turned on. When

the OFF button is clicked to turn off a device, the software converts the OFF command into

hex code

27
Fig.4: Block Diagram of the designed system.

then sends the value to USB port address. It sends logic 0 (0-1.5V) to the microcontroller

through the RS232 converter. Then the microcontroller sends a 0 to the transistor. It will

deactivate the transistor used to energize the relay. So the arm of the relay is swing back to

another position, which makes the path of the current flow open. And hence electrical

appliance is turned off.

The terminal input of each appliances is wired across the Common and Normally

Open terminals of the relays, thus the power to the appliances is switched on or off depending

on whether the relay is active or not. The diagram of the flow chart designed system is as

shown below.

28
Fig 5. The flow chart of the designed system

29
3.3 Approach to Developing the Project

The basic of the hardware construction is mainly the PIC16F876A microcontroller

whose program was developed using micro C pro compiler. Two circuit diagrams were

developed to achieve the successful construction of the project. This circuit diagram includes:

i. Power supply regulation circuit

ii. Main component circuit

3.3.1 Power Supply Regulation Circuit

The a.c power supply to the circuit has to be regulated to a reasonable amount for the

workability and durability of the circuit components. The power supply regulation process is

accomplished following the four (4) stages listed below which are:

i. Transformer

ii. Rectification

iii. Filtering

iv. Voltage regulation

3.3.1.1 Transformer

The a.c supply gives out 220v or above and the supply is stepped down by the

transformer to a reasonable amount of 12v which is needed for the operation of the circuit.

NOTE: a.c supply less than 220v is stepped down to voltage less than 12v which is not

conducive for the workability of the circuit. Hence, the hardware fails to work.

3.3.1.2 Rectification

There is need for the conversion of the a.c voltage to d.c voltage. Diodes help in this

conversion process. However, in the conversion process the voltage drop across the diode

which is greater than 1v is added to the already stepped down 12v making the total voltage in

the rectification stage becomes 13v or greater.

30
3.3.1.3 Filtering

The capacitor removes or filters the ripples generated and produced alongside the

rectification process.

3.3.1.4 Voltage Regulation

Voltage regulators are devices that produce constant d.c voltage regardless of the

variation in the input load.

Two voltage regulators are used in this stages which are:

i. LM7812 voltage regulator

ii. LM7805 voltage regulator

220V
ac 1 3 +12

2
4700µf
50v
1
3 +5

Fig.6: Power supply regulation circuit

3.3.2 Main Component Circuit Analysis

The USB cable is fed to the DB-9 which is actually a serial connector. This serial

connector allows for bi-directional communication between the system and the hardware (i.e.

it send signal to and receives signal from the PC). The DB-9 though stabbed at pin 5 is fed to

the MAX232 which is the level converter.

31
The level converter does and undoes the signal by generating a total of 12v supply and

reversing it to 5v d.c supply. It is fed to the PIC16F876A microcontroller from the level

converter. A d.c voltage of 5v is needed for the operation of the PIC. It processes the signal

according to instruction. Attached to the microcontroller is the clock pulse which generates

clock frequency for the microcontroller. The clock pulse is the heart of the microcontroller as

the microcontroller fails to work in the absence of those clock frequencies.

A d.c voltage of 12v is needed for the operation of the relay. A total of seven (7)

relays were used as each relay demands a transistor for amplification. One kilo ohms (1kΩ)

resistor was also introduced to restrict and oppose the amount of current that floes to the base

of the transistor. The signal is finally executed as the relay opens up to socket to be

controlled. The circuit diagram for the design is shown below

32
+5
+5V

+12
2uf 10k
USB
+ 1 27
+12
Tx Rx
12 16 + -
2uf 26
1 +12
23 13
3 PIC16F876A
DB.9 14 + - 2uf
MAX232 4 25
+12
5
16
11
+ - 17 24
12
6 +12
15
2uf
23
+12
22pf
11
20MHz
10 22
+12

22pf 8 9 21

Fig.7 Main component circuit analysis

33
3.4 Software Interface

The layout of the software used for controlling various home appliances is shown in

fig.4 as an experimental basis we have the following layout in the software interface:

i. Seven rooms with their corresponding on and off button

ii. Selection of communication port

iii. All ON button

v. All OFF button

vi. Room status interface which consist of check status and clear report.

At First, a port number is set in the Selection Com Port field of the layout to activate

connection between computer and microcontroller. If the connection is successful then we are

able to control the appliances from the computer. Each device can be controlled either as an

ON or OFF mode by pressing ON or OFF button on the layout. The check status reports the

state (ON or OFF) of the control electrical appliances by displaying information that the

appliances is ON. The clear report command gets rid of the information reported in the room

status interface. Although we have shown only seven rooms but any number of devices can

be controlled from a computer with a slight modification in our designed system.

3.5 PIC-GUI Communication

The hardware uses RS232 converter to communicate with the software. Contained in

the RS232 converter is the RS232 library which has RX (receiver) and TX (transmitter) for

both transmissions and reception of signals. The software in the other end has serial port

library which is one of the controls in c-sharp library. It is thus programmed to enable

transmission and reception of signal.

Once the COM port is selected in the software, a link is open up for communication

between the hardware and the software which will last for microseconds (µs). Though there is

a propagation delay which allows for execution of command or instruction before

34
transmission of another signal. For every button clicked in the graphically user interface the

serial port library uses its TX to transmit the signal to the hardware. The signal is received by

the hardware via its RX, processed according to instruction and opens up the relay of the

required unit and therefore switched on its socket.

The hardware on the reverse end uses its TX to transmit signal (indicating the

reception of the sent signal by the program) to the software. The software receives the signal

via its RX and thus acknowledges it by displaying the message about the state (ON or OFF)

of the required unit on the room status interface.

35
Fig 9. Flow chart showing PIC – GUI communication

36
CHAPTER FOUR

RESULT AND DISCUSSION

4.0 Testing

The printer plug is connected to the printer port and the main is also connected to the

circuit. The personal computer is put ‘ON’ and the software application for electrical

appliances installed on the system is selected from the start button (programs). It displays all

the pins on the monitor. The mouse components are driven by this software to release a

voltage to pin 2 which is conveyed to the optical isolator. An audible ‘click’ sound is heard

from the relay switch; hence the bulb is turned ‘ON’ automatically. This indicates that the

interface circuit designed is working perfectly.

4.0.1 Observation Test Method on the Circuit

There are four of human serves that are employed in determining whether the

interface circuit is faulty or not, these include:

i. Visual

ii. Touch

iii. Smell

iv. Hearing

Visual Test: This is done by using our sense of sight in the following manners:

i. If there had been a loose jumper cable on the board which had resulted in

breakdown of the entire circuit. A block soothe around the terminal will indicate

loose contact which has resulted in sparks.

ii. Charred terminal or burn out terminal will also indicate a loose contact.

Test by Feeling (TOUCH): This can be done by placing ones palm on the

machine/casing. This enables one whether there is a rise in temperature or an abnormal

vibration.

37
Test by Smelling: This enables one to quickly know whether a circuit component is

overheated or burnt.

Test by Hearing: Strange sounds that are not associated with the normal operation

of the circuit are detected by the ears.

38
4.1 Hardware Design

The following components were used for the implementation of the project:

COMPONENT FUNCTION
Optocoupler In case of external threat it isolates the project
from the system (over voltage damage).
Relay It is an electrical switch that opens and closes
under the control of another electrical circuit.

Capacitors, resistor They both help in filtering of generated ripples.

Transformer It serves as protection of instrument and


appliances connected to a.c power supply.
The ULN2003 is a high voltage, high current
ULN 2803 Darlington arrays each containing seven open
collector Darlington pairs With common
emitters.
Transistor For maximum amplification

Clock frequency For generating clock pulse.


Diode It is used for rectification.
Voltage regulator It produces constant DC voltage from a high DC
voltage.
PIC16F876A It receives the command sent from the windows
application form and cause the necessary action
to take place.

Finally, this project, Home appliances control system, is then connected to the PC system or

Laptop system to establish communication.

39
4.2 Application Program Design

The application program was developed by CN (C-sharp) using Microsoft visual

studio. The controls in this software are of great help because they make the application

development easier.

4.2.1 Program Control Function

CONTROL FUNCTION
Units They represent the available appliances to
be controlled (room 1-7).
ON button It is used to turn on the required
appliances.
OFF button It is used to turn off the required
appliances.
All ON button It turns on all the Units at once.
All OFF button It turns off all the Units at once.
Check status button It provides information on the state (ON
and OFF) of the unit on the room status
interface.
Clear report It deletes information provided or
reported on the room status interface.
Note:
Activation of command is only possible after the introduction of the USB cable from
the project and it is recognized in the selection communication port interface.
ii. ON command is converted to logic 1 while the OFF button is converted to logic 0
for activation.

4.3 Securing the PC

One of the beauty of this project is that the maximum security of the PC is

guaranteed. The system must not suffer the same fate with the hardware in case of any over-

voltage damage or electrical threat. This is only possible if there is no direct link of the

system with the hardware. Optocoupler enables this to be achieved as it provides signal and

40
data transfer from the PC to the project without making a direct ohmic contact electrical

connection. It is soldered in the hardware board therefore isolating the PC from the project

and thus guarantees its security should there be any complication.

Computer ---------------------Optocoupler ---------------


Project
No direct ohmic electrical contact connection

100% secured

Fig. 11: Diagram showing how the system is secured

41
CHAPTER FIVE

CONCLUSION AND RECOMMENDATION

5.0 Summary

The primary objective of this project is to present a system to control home appliances

from a computer. The system is designed for controlling the ON/OFF mode of different home

appliances such as light, fan, TV, air-condition and so on. All the commands are carried out

from a software layout running on a computer to control the home appliances.

5.1 Conclusion

The process of home appliances control system works by making everything in the

house controlled using technology to do the jobs.

The user’s choice is clicked in the developed window application through the PC and signal

travels via the USB cable to the corresponding connection. Based upon this command the

required appliance is triggered. It can be used at home, street light management, hotel power

management, high voltage grid control and in industry.

5.2 Recommendation

Following the operation of PC based Home Appliances Control system in a restricted

place (control room). We strongly recommend the use of intelligence wireless phone or Radio

Frequency Identification (RFID) technology which enables controlling of electrical

appliances in an unrestricted place.

42
REFERENCES

Home automation software, [Online] Available: http://www.vagueware.com/top-10-home-


automation-software-that-will equip-your-adobe-for-the-21st-century.

H. Sumino, N. Ishikawa, H. Tsutsui, H. Ochi, Y. Nakamura and Y. Uchida, “Home


Appliance Control from Mobile Phones”, Consumer Communications and
Networking Conference, 2007. CCNC 2007.4th IEEE, pp. 793 - 797, 2007.

J. C. Nunes and J. C. M. Delgado, “An Internet application for home automation,”


Electrotechnical Conference, 2000, MELECON 10th Mediterranean,Vol. 1, pp. 298 -
301, 2000.

N. Dickey, D. Banks, and S. Sukittanon, “Home Automation using Cloud Network


and Mobile Devices”, Proc. of IEEE International Conference at Southeast on,
pp. 1-4, Mar. 2012.

S.A Awodipe, “PC Based Home Appliance Control System, 2009, Federal
University Technology, Akure.

S. M. Anamul Haque and S. M. Kamruzzaman Microprocessor and Interfacing


programming and hardware, publication, Second Edition, 2006)

S. Sharma, G. Chitranshi, B. Mahato, A. K. Srivastava, N. Gupta and B. P. Singh, ”Control


of Home-Appliances through IR interface using web (GPRS) enabled Mobile
Phones”, International journal of advanced engineering sciences and technologies
(IJAEST), Vol. No. 6, Issue No. 2, 242 –245, 2011.

T. Kim, H. Lee and Y. Chung, “Advanced Universal Remote Controller for Home
Automation and Security”, IEEE Transactions on Consumer Electronics, Vol. 56,
No. 4, pp. 2537-2542, Nov. 2010.

43

You might also like