Design and Construction of Time Based Home Appliances-1
Design and Construction of Time Based Home Appliances-1
CONTROLLER
BY
2017/HND/EE/PM/001
SUPERVISOR:
The rapid growth of large scale integrated (LSI) technology has contributed to the
has profundly revolutionized the world, especially in system design and control. To
as its central processing unit. In this work,effort is made to design and construct
appliances ON and OFF at a given time of the day. It offers the advantage of
Home devices such as Heaters, Fans, Security lights etc., have a time which
they are most suitable to operate. Time based appliance controllers are systems
This system will reduce human effort in switching on/off of devices and will help
reduse the energy wastage and risk of fire outbreak from any controlled device.
This can be achieved by the use of microcontroller and a real time clock as the
The aim and objective of this project is to design and construct a device that is
Due to stress and other issues bothering Man, there is a high tendency of forgetting
to switch off devices before leaving home for work. This may result to fire
outbreak. Also, in this era of prepaid billing meter for electricity consumption, it is
more expensive to run some devices all day long. Therefore, it is neccessary to
appropriate time.
1.3 MOTIVATION
The nature of our weather and the fact that energy need to be conserved is the
motivation behind the design of this device. The device will serve energy because
Fan
Lighting points (Bulbs)
Aircondition
Water heater
1.5 APPLICATIONS
period of time.
CHAPTER TWO
2.0 INTRODUCTION:
In this chapter, attempt is made to review some past related projects, and
Attempts have been made in the past to design and construct controller systems.
Also, Raja Gopal Akella (2006), “Design and construction of Remotely RTC-
Tan Ailing, University of Malaysia Perlis (April 2007), “ Home appliance remote
control using microcontroller and power line”. In this work, human effort is still
very flexible and few components are used due to the fact that most of the work is
software based. The microprocessor used in this project is S PIC16F877 and Dallas
2.2 THEORY
The diagram of figure 2.0 shows the functional block diagram of Time based
Most electronic devices require dc voltage to operate. Therefore, batteries are very
useful in low power or portable devices but the operating time of such devices is
limited unless the batteries are recharged or replaced constantly. The more readily
order to eliminate the variation of power supply voltage with changing input
current. A typical arrangement for dc power supply is shown bellow in figure 2.1;
2.2.2 TRANSFORMER
The transformer is a device used in transforming electric power in one circuit into
electric power of the same frequency but different voltage in another circuit but
B.L 1997).
The transformation is based on the mutual induction between the two circuits
inductive coils which are electrically separated but magnetically link through a
laminated core, most of which is linked with the other coil in which it produces
induction e = Mdl ⁄dt). If the second coil is closed, a current flow in it and so
electric energy is transferred. For the purpose of this project, a 240V to 15V step-
A rectifier is a circuit which employs one or more diodes to convert ac voltage into
pulsating dc voltage. Full wave bridge rectifier circuit is most frequently used for
operation is such that; during the positive diodes D1 and D3 conducts, while the
other two diodes (D2 and D4) conducts during the negative half-cycle. The output
D1 D3
DIODE DIODE
D2 D4
DIODE DIODE
t
0 Π 2Π
2.2.4 FILTRATION
The output of the rectifier has considerable amount of ripples. The ripple voltage is
defined as the deviation of the load from its average or the dc filtering is done by
shunting the load with a capacitor. The effect of this is that the capacitor store
energy during the conduction period. This prolongs the time during which the
current passes through the load thereby decreasing the ripple as shown below;
The function of the filter is to smooth pulsation present in the output voltage
supplied by the rectifier. In practice, no filter gives output voltage that is ripple free
capacitor is used to achieve the filtering.The arrangement of a filter circuit and its
corresponding wave form is shown in figure
TR2
BR2
AC Main
C2
1000u
G2SB20
TRAN-2P2S
t
0 Π 2Π 3Π
Figure 2.7: Output Waveform of Filter.
integrated circuit.
Where;
Vmax = maximum dc output voltage
In a general form
peripheral devices, alleviating the load from the main CPU Compared to a human
being, the brain is the main CPU and the PIC is equivalent to the autonomic
nervous system. The PIC, like the CPU, has calculation functions and memory, and
However, the through put and the memory capacity are low. Depending on the
kind of PIC, the maximum clock operating frequency is about 20 MHz and the
memory capacity (to write the program) is about 1K to 4K words. For this project,
The clock frequency determines the speed at which a program is read and an
instruction is executed. The throughput cannot be judged with the clock frequency
alone. It changes with the processor architecture. However within the same
architecture, the one with the highest clock frequency has the highest throughput.
word long. Program memory is measured in BYTES, one byte is 8 bits. The bit is
the smallest unit, and can have the value of 1 or 0. The instruction word of the
bytes).
1K bytes = 1,024 bytes. 1K bytes is not equal to 1000 bytes. This is because the
Pin Diagram
Fig 2.8: The PIC16F877 Pin Diagram.
low Reset )
parallel slave
OSC1/CLKIN Oscillator In/Ecternal
structure where separate memories are used for the program and data which are
accessed via separate buses. In the PIC16F877, the program bus is 14 bits wide,
whereas the data bus is 8 bits wide. In addition, the PIC family is based on a
instructions than a Complex Instruction Set Computer (CISC). All the PIC devices
program written for one PIC device can easily be assembled and used in another
device type with a minimum number of modifications. The PIC families are fully
static devices, meaning that they preserve the contents of their registers when the
corresponding clock period is 1μsec, so each instruction will take 4μsec–this time
is called the instruction cycle time ti. The fastest devices in the PIC family can
times of 121nsec. Most instructions execute in one instruction cycle, but some
require two cycles because they need to branch to some destination other than the
next address in the PC. Instructions that need two cycles to execute are btfsc, btfss,
word lengths. The low-end PICs, such as the eight pin 12C5XX series, have 12 bit
word length instructions. The mid-range PICs, such as the PIC16XXX, have 14 bit
instructions and the high-end 17XXX PICs have 16 bit instructions. All PIC
actually use PIC microcontrollers; all that is needed is practice in writing programs
The program counter (PC) is a 13 bit wide register which will enable 8K (8 ×
bits wide, so the PC can 10 address 8K × 14 bits of memory space. However, only
The data memory is partitioned into multiple banks which contain the General
Purpose Registers and the Special Function Registers. Bits RP1 (STATUS<6>)
and RP0 (STATUS<5>) are the bank select bits. Each bank extends up to 7Fh (128
bytes). The lower locations of each bank are reserved for the Special Function
Registers. Above the Special Function Registers are General Purpose Registers,
Registers. Some “high use” Special Function Registers from one bank may be
Some pins for these I/O ports are multiplexed with an alternate function for the
peripheral features on the device. In general, when a peripheral is enabled, that pin
may not be used as a general purpose I/O pin. Additional information on I/O ports
register is TRISA. Setting a TRISA bit (=1) will make the corresponding PORTA
pin an input (i.e., put the corresponding output driver in a hi-impedance mode).
Clearing a TRISA bit (=0) will make the corresponding PORTA pin an output (i.e.,
put the contents of the output latch on the selected pin). Reading the PORTA
register reads the status of the pins, whereas writing to it will write to the port
port implies that the port pins are read, the value is modified and then written to the
port data latch. Pin RA4 is multiplexed with the Timer0 module clock input to
become the RA4/T0CKI pin. The RA4/T0CKI pin is a Schmitt Trigger input and
an open drain output. All other PORTA pins have TTL input levels and full CMOS
output drivers. Other PORTA pins are multiplexed with analog inputs and analog
VREF input. The operation of each pin is selected by clearing/setting the control
register is TRISB. Setting a TRISB bit (=1) will make the corresponding PORTB
pin an input (i.e., put the corresponding output driver in a hi-impedance mode).
Clearing a TRISB bit (=0) will make the corresponding PORTB pin an output (i.e.,
Three pins of PORTB are multiplexed with the Low Voltage Programming
Each of the PORTB pins has a weak internal pull-up. A single control bit
can turn on all the pull-ups. This is performed by clearing bit RBPU
(OPTION_REG<7>). The weak pull-up is automatically turned off when the port
register is TRISC. Setting a TRISC bit (=1) will make the corresponding PORTC
pin an input (i.e., put the corresponding output driver in a hi-impedance mode).
Clearing a TRISC bit (=0) will make the corresponding PORTC pin an output (i.e.,
put the contents of the output latch on the selected pin). PORTC is multiplexed
with several peripheral functions (Table 3-5). PORTC pins have Schmitt Trigger
input buffers. When the I2C module is enabled, the PORTC (3:4) pins can be
configured with normal I2C levels or with SMBUS levels by using the CKE bit
defining TRIS bits for each PORTC pin. Some peripherals override the TRIS bit to
make a pin an output, while other peripherals override the TRIS bit to make a pin
an input. Since the TRIS bit override is in effect while the peripheral is enabled,
should be avoided. The user should refer to the corresponding peripheral section
PORTD is an 8-bit port with Schmitt Trigger input buffers. Each pin is
bit wide microprocessor port (parallel slave port) by setting control bit PSPMODE
PORTE has three pins, RE0/RD/AN5, RE1/WR/AN6 and RE2/CS/AN7, which are
input buffers. I/O PORTE becomes control inputs for the microprocessor port
when bit PSPMODE (TRISE<4>) is set. In this mode, the user must make sure that
the TRISE<2:0> bits are set (pins are configured as digital inputs). Ensure
ADCON1 is configured for digital I/O. In this mode, the input buffers are TTL.
Register 3-1 shows the TRISE register, which also controls the parallel slave port
operation. PORTE pins are multiplexed with analog inputs. When selected as an
analog input, these pins will read as ’0’s. TRISE controls the direction of the RE
pins, even when they are being used as analog inputs. The user must make sure to
keep the pins configured as inputs when using them as analog inputs.
3.5 REAL TIME CLOCK (RTC)
A real time clock is a computer clock (most often in the form of an integrated
circuit) that keeps tract of the current time. Although the term often referes to the
divice in personal computers, servers and embedded systems. RTCs are present in
RTCs often have an alternate power source, so they can continue to keep time
while the primary source is off or unavailable. This alternate power source is
normaly a lithium battery in older system, but some newer system use a
Most of the RTCs use a crystal ocsillator , but some use the power line
Real Time Clock system (RTC DS1307) can be used, which counts seconds,
minutes, hours, days, day of the week, date, month, and year with leap year
time, calendar, and alarm, a 12– or 24–hour clock with AM and PM in 12–hour
add hardware year 2000 compliance. A century byte was added to memory
wave generator, and 113 bytes of non-volatile static RAM. The real time clock is
distinctive in that time-of-day and memory are maintained even in the absence of
power.
2.5 IC PC817 opto-coupler:
The schematic diagram of IC PC817 opto coupler is shown above and its pin
diagram is also shown. It is a 6-pin IC which has infra-red LED and a photo
this terminal is mainly dealt with dc supply. But here we are only dealing
with ac supply and we are no way concerned with dc supply hence we made
radiation when it gets 9V supply. This 9V is supplied by Zener diode which is used
This is so accurate that even a pulse of voltage makes the led to emit the
radiation. And this is the reason the switch over is possible which made this device
power LED triggers the photo transistor. Photo transistor is one which needs
respectively. Whenever the radiation falls on base the electron moment starts and
electrons flow from emitter to control logic. This gives signal to control logic
lights, which triggers phototransistor Q1, which pulls the output pin low. This
Among other applications, opto-isolators can help cut down on ground loops,
circuits. The latter are used within motor and machine control function
blocks.
Most switched-mode power supplies utilize opto- coupler for mains
isolation.
machines, clocks, railway departure indicators and many and other devices
(other shapes are also possible, although not common) such that by switching on or
off selected lights, text or graphics can be displayed. A dot matrix controller
converts instructions from a processor into signals which turns on or off lights in
multicolour LCDs are sometimes initially dark and light up. (Svenungson, 2005).
display (LCD) display device designed for interfacing with embedded systems.
These screens come in common configurations of 8x1, which is one row of eight
characters, 16x2, and 20x4, among others. They are limited to text only, with eight
PIN CONFIGURATION
Character LCDs use a standard 14-pin interface. If the screen has a backlight, it
Number
1 Vss - - GND
(+)
3 Vee - - Contrast
Adjust
4 RS High/Low I (Register
(H/L) Select)
L –Instruction
Input
H – Data
Input
LCd Module
H – Read
from LCD
module
(LSB)
15 BL1 - - Backlight
Power Supply
(+)
16 BL2 - - Backlight
Power
supply(-)
2.9 Relay:
Contact Specifications:
Life expectancy
Dielectric strength
Weight : 130g
METHODOLOGY
This unit comprises of the transformer, diode rectifier, filtering capacitor and
regulators.
3.2.1 Transformer
The local main is expected to deliver 240V, the system voltage requirement
is 12V and 5V, therefore a 240V/15V transformer was used. The system
input resistance is about 200Ω, therefore the expected load current is
A transformer with the current rating of 500mA which is greater than load
current was used. Thus the power rating of the transformer was calculated to
be
S = VI = 12 X 500 mA = 6VA
3.2.2 Rectifier
D3 D2
Terminal 2
+
C1
Vdc = 14.80v
3.2.3 The filter
smoothen the voltage to have the minimum ripple factor (at least 10% of the
Vripple = 0.1Vpeak
Vripple = 0.1 × 16.97
Vripple = 1.697V
But also Vripple = I/2fC for full wave
Where; I = current taken by the load
f = frequency of supply
C = filtering capacitor
C = I /2fVripple
= 0.17/ (2 × 50 × 1.697)
C = 1001.7µF
From this calculation, a standard capacitor of 2200µF was chosen.
The regulator is a single chip that regulates the ripple free rectified voltage
to give a constant output voltage. Since the circuit needs a supply voltage of
12V and 5V, a 12V and 5V regulators were used. The percentage regulation
or simply regulator of a power supply is given by:
% regulation = [(Vmax – Vmin)/Vmax] × 100
Where;
Vmax = maximum dc output voltage
Vmin = minimum dc output voltage
In a general form
% regulation = [(Vno load – Vfull load)/Vfull load] × 100
The overall power supply circuit and it output wave form is shown in figure
3.2
U1
7812 Voltage
TR1
BR1 1 3
VI VO +
GND
D1 D2
AC Main
C1
2
D3 D4 1000u -
G2SB20 Time
TRAN-2P2S
Figure 3.2. Overall power supply circuit and it output wave form.
it values for the design were gotten from the data sheet except in some few cases.
The above diagram shows how RC oscillator is connected with PIC16F877A. With
value of resistor R being below 2.2k, oscillator can become unstable, or it can even
stop the oscillation. With very high value of R (ex.1M) oscillator becomes very
be between 3 and 100k. Even though oscillator will work without an external
capacitor (C=0pF), capacitor above 20pF should still be used for noise and
stability. No matter which oscillator is being used, in order to get a clock that
Oscillator clock divided by 4 can also be obtained on OSC2/CLKOUT pin, and can
So the recommended value of R and C for a frequency of 4MHz was gotten from a
The master clear (MCLR) is used for putting the microcontroller into a 'known'
position. Reset is not only used when microcontroller doesn't behave the way we
want it to, but can also be used when trying out a device as an interrupt in program
In order to prevent from bringing a logical zero to MCLR pin accidentally (line
above it means that reset is activated by a logical zero), MCLR has to be connected
via resistor or a capacitor to the positive supply pole. If a resistor is used, the value
should be between 5 and 10K. On the other hand, if a capacitor is used the value
keep a certain line on a logical one as a preventive, called a pull up. So a capacitor
4.1 Introduction
This chapter deals with the description of the various tests carried out on the
functionality of the implemented project where results obtained from the exercise
The tests carried-out based on the output gotten from the digital calendar
with clock and alarm are the tests done on the clock timing, the calendar, the
alarm and then by comparing with standard equipment’s that have such
functionalities.
For the test on the clock timing the procedure carried out in doing the test
was by comparing with a standard clock and a stopwatch. The implemented digital
clock was set at the initial time of 06:00:00 and allowed to continue running for 2
weeks where the time at intervals of 24 hours were observed and compared with
that of the standard clock and the results were analyzed for accuracy as presented
Likewise, the calendar was checked to see if it was corresponding with the
right date and it changes at the right moment in which also analysis was made as
regard when the Digital clock would be lacking by a day. While for the alarm,
several alarm times were set and observed to see if there would sound at the right
time.
For the test done on the battery level displayed, the procedure carried out
was by also comparing with a level of the battery, if the level of the battery is
reduced the LCD will indicated the present level of the battery.
4.3 Results Obtained
This section presents the results obtained from the various measurements
taken on the clock timing, calendar, alarm and battery displayed. Then the section
meter.
Various tests were carried out on different stages of the system using the
following test equipment’s
(3) Logic probe; the logic levels (HIGH or LOW) of all the digital
components used were tested at different points with a logic probe.
(4) Project board; the testing of different units and subsequently the
whole system were done on a project board before soldering the
components.
In order to save time and energy when troubleshooting, various stages of the
system were constructed in separate. This enables the testing of each unit
separately to determine its workability before coupling the system. For each
unit, test points were selected and used as follows:
(l) Power supply output: the outputs of the power supply were tested and
voltages of 5.02v and 12v were obtained on no-load condition. The test was
repeated on full load and the voltages obtained were 4.95v and 11.89v.
The resulting voltage regulation is given as:
VR = VNL-VFL x l00
VFL
For 5v:
5.02
For 12v:
12
The results obtained for the clock timing as compared with the standard
clock are given in the table below with the accuracy estimated or measured from
Standard Constructed
Clock Clock
Day Timing Timing % Error
seconds every day and the accuracy of the clock timing is computed as below.
t cc −t sc
% Error= ×100−−−−4.1
t sc
Where, tcc is the time observed from the constructed clock in seconds
Hence,
86402−86400
∴ % Error= ×100 ≈ 0.0023 %
86400
86404−86400
∴ % Error= × 100 ≈ 0.0046 %
86400
86406−86400
∴ % Error= × 100≈ 0.0069 %
86400
For the fourth day, we have:
86408−86400
∴ % Error= ×100 ≈ 0.0093 %
86400
86410−86400
∴ % Error= ×100 ≈ 0.0116 %
86400
86412−86400
∴ % Error= ×100 ≈ 0.0139 %
86400
86414−86400
∴ % Error= × 100 ≈ 0.0162 %
86400
86416−86400
∴ % Error= × 100≈ 0.0185 %
86400
For the ninth day, we have:
86418−86400
∴ % Error= ×100 ≈ 0.0208 %
86400
86420−86400
∴ % Error= ×100 ≈ 0.0231 %
86400
86422−86400
∴ % Error= ×100 ≈ 0.0255 %
86400
t cc =( 24 X 60 X 60 )+ 24=86424 secs
86424−86400
∴ % Error= × 100 ≈ 0.0278 %
86400
86426−86400
∴ % Error= × 100≈ 0.0301 %
86400
For the fourteenth day, we have:
86428−86400
∴ % Error= ×100 ≈ 0.0324 %
86400
0.4932
Average % Error= =0.0352≈ 0.04 %
14
¿ 100−0.04
¿ 99.96 %
CHAPTER FIVE:
5.1 Summary
In summary, this report has gone through past and similar projects done on
the design and implementation of digital clocks in which areas with shortcomings
and how this project differs from others were pinpointed in chapter two. Then,
details of the design methodology used, the implementation procedures and then
the operation of the project were also discussed in chapter three. While in chapter
four, the various tests carried out and results obtained in order to determine the
accuracy of the project and areas where lapses encountered were discussed
thoroughly
.
5.2 Conclusion
In conclusion, it could be said that the aim to design and construct a device
robustness were surely achieved though with some shortcomings here and there.
5.3 Recommendations
The recommendation regarding this project is that though the project has
been built as it was intended but there is still room for improvement most
especially in providing a means by which a user can choose between either to use
the 24-hour format or the 12-hour format of timing. Also there is also room for
improvement in the power being consumed by the whole circuitry of the digital
clock.
REFERENCES:
System for Multifunctional Devices," IEEE Consumer Electronics, vol. 51, no. 4, pp.
[3] http://www.123eng.com/projects/microcontroller_based_
home_security_project.html, Web.
of a cell phone based remote control system: an effective switching system for
controlling home and office appliances”, International Journal of Electrical &
Appliance Control System (HACS) for Automating Appliances and Security”, Issues
[8] www.atmel.com
http://www.sbprojects.com/knowledge/ir/rc5.php.