Sie sind auf Seite 1von 5

COMBINING ENERGY SAVINGS WITH MODERN LIFESTYLES: THE

POTENTIAL OF BASIC MICROCONTROLLERS IN FACILITATING


MODERN LIVING
E. Chikuni, T. Kavayi O. Okoro,
Polytechnic of Namibia, Former Student, University of Nigeria,
Windhoek, University of Zimbabwe Nsukka,
Namibia. Harare, Zimbabwe Nigeria.
e-mail: chikuni@yahoo.com e-mail: oiokoro@yahoo.co.uk

Abstract  Ever since civilization began, man has component, the PIC micro-controller, and the
endeavoured to live more comfortably and to relieve configuration of the PIC. The main features section gives
himself of hard work, tedium and bring about safe and a detailed description of the main circuitry and how its
healthy working and living environments. design interfaced with the software development. The
Unfortunately some of the methods and means used to remaining sections describe the input/output interface
achieve this have resulted in damage to the design. In the software design section, details of the
environment contributed to global warming. Energy initialisation, interrupt processing, and real-time clock
use in the home can no longer be regarded as processing are first discussed. There then follows a
insignificant when making energy projections within description of how each of the three main subsystems
planning scenarios. In Southern Africa most homes (geyser, gate and alarm) was implemented in software.
now have at least one TV, HIFI, Electric Boiler, and The parser algorithm used for processing the keypad is
even washing machines and vacuum cleaners. Can the also described.
modern microprocessor be of use in the achievement The major objective of this project was to design a low
of energy savings and introducing convenience to the cost system to control three separate domestic utilities: the
management of such a wide ranging of home devices? geyser, electric gate and an alarm system. The main
In this paper the authors argue for more awareness of benefits would be any easy to use centralised control
the role micro-controllers can play in energy mechanism suitable for use by the average homeowner.
management gives an example of a student project Thus, the commercial application of this project would be
that utilizes an inexpensive and widely available very feasible, especially in the local context where
micro-controller to control access to a dwelling, electricity costs are very high and the geyser control
provide security monitoring and geyser control. mechanism alone would be very appealing on the local
market.
Index Terms  Energy Savings, Smart Homes, Micro- Central to this project is an embedded
controller Applications microcontroller based approach. This will provide
flexibility in that software can be easily changed to suit
1 INTRODUCTION design specifications. A number of low cost
The paper starts with a short treatise (PART I, ENERGY microcontrollers are now available and one of these was
EFFICIENCY THROUGH SMART HOMES) of the chosen for the project. Unfortunately due to the current
opportunities augured by modern technology especially shortage of foreign currency in Zimbabwe, the availability
through inherent energy saving design and production. It of components such as microcontrollers is not what it
is pointed out that having intelligent control of and should be. Also, the prices of such imported components
management of the modern “gadgets” of a household can are now abnormally high in the context of their
save energy through the application and management of applications. This will be put into jeopardy any plans for
diversity. The part that follows (PART 2, design and commercial production of the system.
construction) part of the paper details the design of a Hardware design was carried out using standard TTL
controller for selected home devices or utilities. The and CMOS digital ICs. The software development
design itself was split into two parts: the hardware and the concentrated on an interrupt driven approach as this was
software design. Although the two are presented as found to be the most effective and efficient mechanism
separate entities in this report, there was obviously a lot of for implementing the real-time, multi-tasking design that
integration between the two during the development phase this system required. The software development
and the final implementation. The hardware design eventually required a lot more work than the hardware
section details all the aspects involved in the design of the development, since the main functions were controlled
hardware, starting from a description of the main more in software than in hardware.

1
2 PART I: ENERGY EFFICIENCY THROUGH
SMART HOMES

Successful Building Management Systems or Smart


Homes rely on efficient, reliable and cost-effective
control technologies, which allow integration, automation,
and optimisation of all the services and equipment that
provide services and manages the environment of the
building concerned.
Embedded micro-controllers or Programmable Logic
Controllers (PLC's) usually form the basis of the control
strategy used to achieve this.

With the increased intensity of network technology and


remote sensing, in commercial and residential buildings,
distributed-intelligence micro-processors are coming to
the fore.
The use of these technologies allows the optimisation of Fig. 2: Efficient Flourescent Fitting
various site and building services, often yielding
significant cost reductions and large energy savings.
3 LINKING DIVERSE DEVICES TOGETHER
Efficiency however cannot be achieved by processing
alone. The basic equipment itself has obviously got to be There are numerous methods by which building services
efficient in the first place. By way of example Fig. 1 within buildings can be controlled, falling broadly into
shows a modern monitor based on the latest display two method types:
technology to replace Cathode Ray Tube (CRT) systems • Time based - providing heating or lighting
which have been used for many years. Although services, etc., only when required, and
somewhat more expensive these modern screens are
poised to become standard in the home, office, laboratory • Optimiser Parameter based - often utilising a
etc. representative aspect of the service, such as
temperature for space heating or illuminance for
Similarly Fig. 2 shows are more modern luminare which lighting. Heating - time-based control
designed not only for efficiency, but also to look good in
a building. Time-based controls can be used to turn on and off the
heating system (and/or water heating) at pre-selected
periods (of the day, of the week, etc).

Optimiser Parameters: whatever the conditions, the


controls make sure the building reaches the desired
temperature when occupancy starts.
Other methods can include thermostats, occupancy
sensing PIR's (passive infra-red sensors) and manual user
control.

Energy Star and Intelligent Appliances

Energy savings can also be achieved by purchasing


appliances that comply with the “ENERGY STAR”
standard.
If your computer, fax or photocopier complies with the
ENERGY STAR standard, it will automatically switch
itself into a power-saving 'sleep' mode after a certain
amount of idle time. As soon as you need to use the
computer again, simply press a key or move the mouse
and the computer 'wakes up', with all your programs and
Fig. 1 LCD MONITOR documents exactly as you left them. Fig. 3 gives an

2
overview a smart home / building and is a modified • Geyser subsystem: timer mechanism to switch
version of a commercial offering. geyser on and off at desired time(s); should be
able to set more than one on/off program to
4 PART II, A SYSTEM DESIGN BASED ON A enable geyser use at different times of day;
override facility to enable geyser use at any time
STUDENT PROJECT
other than programmed times; should be able to
As part of their BSc requirements, students at the work with any type of electric geyser; ability to
University of Zimbabwe, like those of many other control multiple geysers; ability to detect geyser
Universities have to undertake a major project. The malfunction.
importance of this project is reflected in the weighting, for • Alarm subsystem: central control of one or
examination purposes which is 50% of the final year more passive infrared detector alarms; ability to
mark. indicate location of sounding alarm; ability to
arm all alarms simultaneously with one press of
4.1 REQUIREMENTS SEPECIFICATIONS button.

The required functionality of the intended system is


summarised below.

Fig. 3: Smart Home Overview 4.2 HARDWARE DESIGN


The hardware design proceeded, bearing in mind
• Gate subsystem: Control of opening and closing
considerations from the functional requirements and the
of gate from a remote location; ability to set
evolving software design. Where possible, any
gate-open time, i.e. time when gate remains open
hardware/software tradeoffs were resolved in favour of
before closing again; two gate-open types for
software in order to minimise costs. However, the limited
pedestrian (partially open) and motor vehicle
capabilities of the PIC16F84A made it appropriate to
(fully open); should be able to allow manual
implement certain functionalities in hardware.
operation of gate during power failure.
Table 1 shows how the input/output pins of the
microcontroller were utilised. A first consideration was

3
the design of the human interface to the system. A keypad 5 SOFTWARE DESIGN
consisting of a bank of pushbutton switches and an LCD
display will constitute the interface. Six user commands to The basic approach to the software design involves the
the system were identified (see Table2). In order to save use of a modular approach to achieve the desired
on the limited number of I/O pins which are available, functionality. An executive routine performs the main
outputs of the microcontroller share one output pin background processing. The system is to be interrupt
(general purpose output) and are then demultiplexed out driven such that the system functions are carried out by
to the relevant devices. Selection of the output is done via interrupt service routines (ISR). In this case, interrupts are
a 3-bit code. Pin RA3 enables the output latch. caused by the user pressing a pushbutton on a keypad,
PIR detectors sensing an intruder, and a software interrupt
PORT USAGE I/O caused by the TMR0 module for implementation of a real-
RA0 Command code bit 0 / alarm code bit 0 I time clock.
RA1 Command code bit 1 / alarm code bit 1 I
RA2 Command code bit 2 / alarm code bit 2 I Interrupt processing: Here the main component is the
RA3 Output enable O determination of the source of all interrupts and then the
RA4 Input code select O calling of the appropriate ISR once the determination has
RB0/INT Interrupt I been made. For hardware interrupts, this involves reading
RB1 General purpose output O the state of the input pins <RA2:RA0> and then using the
RB2 LCD (RS) O value obtained to access a look-up table in order to call
RB3 LCD (EN) O the relevant ISR.
RB4 LCD (data 1) O Real-time clock processing: The TMR0 timer register
RB5 LCD (data 2) / output select bit 0 O implements the real-time clock. It is a prescalable 8-bit
RB6 LCD (data 3) / output select bit 1 O register which increments every clock cycle. When it
RB7 LCD (data 4) / output select bit 2 O overflows from FFh to 00h it generates an interrupt. By
Table 1 – Micro-controller port utilisation appropriate prescaling at 1:16, the generation of an
interrupt occurs every 4ms, such that a second will
When a hardware interrupt occurs, the transpire after the generation of 250 such interrupts.
microcontroller reads the 3-bit code on pins <RA0:RA2>. Geyser subsystem: The geyser timer functions in
RA4 is initially set to select the command code output conjunction with the real-time clock. Every time a minute
from the keypad section. If this code is '000', it means an has elapsed in the RT_CLOCK routine, the geyser
alarm event has caused the interrupt. RA4 then selects the subsystem checks to see if the on or off times of geyser
alarm code output from the alarm section in order to operation have arrived, and if so, appropriate routines are
determine the zone where the alarm occurred. If the initial called to either switch on or switch off the geyser. Four
code was not '000', that code identifies a keypad press programs of operation are available to the user, meaning a
which is used to call up an appropriate serving routine. user can program the geyser for four on and off cycles
within a 24-hour period. It is envisioned that for the
USER COMMAND CODE majority of users, only two cycles, for the morning and
(reserved for alarm interrupt) 000 evening, will probably be required but having four
Set clock/program timer 001 available gives greater flexibility.
Digit up 010
Gate subsystem: Operation of the gate is carried out by
Digit down 011
routines which control the opening and closing
Gate (car) 100 sequencing of the gate. This involves setting the correct
Gate (pedestrian) 101 direction for motor operation, depending on whether
Arm/disarm alarm 110 opening or closing, and controlling the time the motor is
Geyser/gate override 111 running and the time the gate remains open. For
Table2 – User command codes motorcars, the gate takes 5s to open, 10s to remain open,
then another 5s to close. Opening/closing is 2s for
In order to save on the limited number of I/O pins pedestrians. Because the times involved are quite lengthy
which are available, outputs of the microcontroller share in microprocessing terms, it is obviously undesirable to
one output pin (general purpose output) and are then have the MCU tied up for 20s doing nothing but operating
demultiplexed out to the relevant devices. Selection of the the gate. Thus, the system is designed to be able to carry
output is done via a 3-bit code. Pin RA3 enables the on all the other processing while the gate is in operation.
output latch This is primarily accomplished by using the RT_CLOCK
routine to periodically check on the status of the gate and
to act accordingly in 1s intervals, whilst carrying out any
other processing in between these 1s intervals.

4
Alarm subsystem: The main functions of the alarm
subsystem are to identify the zone where an alarm has
been activated, and to arm and disarm the alarms. Arming 9 REFERENCES
involves making the PIR alarms sensitive to moving
sources of infrared radiation by setting the drain terminal [1] Stout, D, F, "Microprocessor applications handbook",
of the FET device to 5V. Setting the drain terminal to 0V Book.
desensitses the alarm (disarming). [2] Tseng, V, "Microprocessor development and
development systems", Book.
6 OBSERVATIONS
[3] , “Overview of 'intelligent buildings' and
Although having the advantage of being low cost, the 'intelligent homes' technologies”
PIC16F84A was found a little wanting in the area of
available port pins. This meant that more functionality
had to carried out in hardware than in software. As result Edward. Chikuni: His contact address is:
costs increased, which was undesirable. This holds a BEng. degree in Electrical
microcontroller would be more suitable for an application Engineering from the University Department of Elec. Eng
involving the geyser or the alarm subsystems alone. In of Sierra Leone, an MSc. from Polytechnic of Namibia,
this application, with three different subsystems to control University of Manchester Institute PO BOX MP 13388,
of Science & Technology Windhoek,
it was found impossible to fit all the different inputs and
(UMIST) and a PhD from the NAMIBIA
outputs to the subsystems to the 13 available port pins. University of Wales, Swansea. e-mail: chikuni@yahoo.com
Another problem was the application required a lot of He is a Chartered Electrical
functionality and this resulted in the code space running Engineer (MIEE) (London) and
out on the chip. The software then had to be redesigned to Fellow of the Zimbabwe
ensure all the code would fit into the memory space. Institution of Engineers. At
Unfortunately, some functionality had to be sacrificed. In present he is Senior Lecturer in
particular, the alarm subsystem was simplified so that Electrical Engineering at the
when arming or disarming, all alarm zones were affected Polytechnic of Namibia on
extended leave from the
simultaneously. The ability to arm and disarm individual
University of Zimbabwe
alarm zones required greater complexity in software, and
hence more program memory space.
Tawanda Kavayi is a former student at the University of
This project gave a good insight into some of the Zimbabwe who as part of his final year project designed
complexities involved in the design and implementation and programmed the example described in this paper.
of microprocessor based applications. For the styudent it
was both challenging and very rewarding and the know-
how gained will prove very valuable in the future. Dr.-Ing. Ogbonnaya Inya
Okoro(1969) received the B.Eng.
7 CONCLUSIONS and M.Eng. in Electrical
Engineering from University of
The “smart home, which was considered futuristic is now Nigeria, Nsukka/Nigeria, in 1991
reality and the idea of saving energy, which was given and 1997, respectively. From
only token consideration is now deeply embedded in the 1998 until 2002 he received a
DAAD scholarship at the “IEE-
minds of many architects and property owners. Yet the
Elektrische Maschinen” of the
full benefits of technology are still to be realised. Universität Kassel/Germany and
According to the European Commission, as many as 90% obtained his doctor degree at He is a member of the IEEE and
of all existing buildings have inapplicable or ineffective Universität Kassel/Germany in the Solar Energy Society of
controls and may require complete refurbishment of 2002. Since 2002 he has been Nigeria.(Department of
control systems. When a combination of measures are with the department of electrical Electrical Engineering,
introduced including the use of natural daylight up to 75% engineering, Faculty of University of Nigeria, Nsukka,
of lighting energy can be saved [3]. engineering, University of Enugu State, Nigeria)
Nigeria, Nsukka/Nigeria. His
8 ACKNOWLEDGEMENT research interests are in the areas
of dynamic simulation and
Our thanks go to the following for their help during the control of induction machines as
course of this project: the late Dr G. Madungwe, Dr E well as thermal and dynamic
analysis of ac machines.
Kapuya, and Mr E Rashayi.

Das könnte Ihnen auch gefallen