SlideShare a Scribd company logo
CHAPTER-1
INTRODUCTION
1.1 INTRODUCTION
The WSNs are increasingly being used in the home for energy controlling services.
Regular household appliances are monitored and controlled by WSNs installed in the home.
New technologies include cutting-edge advancements in Information technology, sensors,
metering, transmission, distribution, and electricity storage technology, as well as providing
new information and flexibility to both consumers and providers of electricity. The ZigBee
Alliance, wireless communication platform is presently examining Japan’s new smart home
wireless system implication by having a new initiative with Japan’s Government that will
evaluate use of the forthcoming ZigBee, Internet Protocol (IP) specification. There are
several proposals to interconnect various domestic appliances by wireless networks to
monitor and control such as provided. But the prototypes are verified using test bed scenarios.
Also, smart meter systems like have been designed to specific usages particularly related to
geographical usages and are limited to specific places. Different information and
communication technologies integrating with smart meter devices have been proposed and
tested at different flats in a residential area for optimal power utilization but individual
controlling of the devices are limited to specific houses.
Wireless sensor network (WSN), which integrates sensor technology, wireless
communication technology, embedded computing technology and distributed information
management technology, has been under rapid development during recent years.A wireless
sensor network is a collection of nodes organized into an interactive network. Each node
consists of processing capability (one or more microcontroller’s chips) and contains types of
memory, with a Zigbee transceiver module and also, each node have a stable power source
and the last part of a node, it is accommodate various sensors and actuators. The nodes
communicate wirelessly and often self-organize after being deployed in an ad hoc method.
Such systems can revolutionize the way we live and work therefore in this project we want to
use WSN technology to control and manage energy in building.
Fig 1.1: Wireless sensor network
1.2 Motivation of the Project
It is foreseen that service and personal care, wireless mice- tonic systems will become
more and more ubiquitous at home in the near future and will be very useful in assistive
healthcare particularly for the elderly and disabled people. Wireless Mechatronic systems
consist of numerous spatially distributed sensors with limited data collection and processing
capability to monitor the environmental situation. Wireless sensor networks (WSNs) have
become increasingly important because of their ability to monitor and manage situational
information for various intelligent service. Different information and communication
technologies integrating with smart meter devices have been proposed and tested at different
flats in a residential area for Optimal power utilization but individual controlling of the
devices are limited to specific houses.
1.3 Objective of the Project
There has been designing and developments of smart meters Predicting the usage of
power consumption. However, a low-cost, flexible, and robust system to Continuously
monitor and control based on consumer requirements is at the early stages of development. In
this study, we have designed and implemented a ZigBee-based intelligent home energy
management and control service.
1) Use of Triac with Opto-isolated driver for controlling electrical appliances: usehold
appliances are controlled either remotely or automatically with the help of fabricated smart
sensing units consisting of triac –BT138.
2) The design of smart sensing unit does not require a processing unit at the sensing end.
3) Flexibility in controlling the appliances: Depending on the user requirements,
appliances can be monitored and controlled in different ways. Section III-B discusses about
the various options of controlling the devices.
1.4 What is “Intelligent Buildings”?
The Intelligent Building Institute defines an intelligent building as: ““…. one that
provides a productive and cost-effective environment through optimization of its four basic
elements – structure, systems, services and management – and the interrelationships between
them. Intelligent buildings help building owners, property managers and occupants realise
their goals in the area of cost, energy management, comfort, convenience, safety, long term
flexibility and marketability.” (Caffrey 1985). These buildings are characterized by three
features (Wong et al.,2005):
 Automated control
 The incorporation of occupant preferences and feedback
 Learning ability (performance adjustment based on environmental and occupant
changes)
The concept of intelligent buildings was established 1982 by AT&T to demonstrate
how advanced IT from different suppliers could be used in the intelligent building. Through
the last more than 20 years there has often been a mismatch between what users expect from
an intelligent building or smart house and what the suppliers were able to deliver. Often the
intelligent building services was defined based on the available technologies and systems,
rather than in terms of the goals and needs for services defined by the occupants which often
led to situations, where the technology were inappropriate for the user needs resulting in
reduced living quality, productivity as well as increasing costs. A typical technological view
on Intelligent Buildings can be seen in figure 1, which illustrates how the development in
communication protocols increase the integration of building services functions and
communication functions in a building, with full integration – the Intelligent Building - as the
goal.
Fig 1.2 : Intelligent Buildings
Definition
A number of different definitions on intelligent buildings exist. Below is described
just acouple:
“An intelligent building is one that provides a productive and cost-effective
environment through optimization of its four basic elements – structure, systems, services and
management – and the interrelationships between them. Intelligent buildings help building
owners, property managers and occupants realise their goals in the area of cost, energy
management, comfort, convenience, safety, long term flexibility and marketability” by
Caffrey 1985
"Intelligent buildings are buildings that through their physical design and IT
installations are responsive, flexible and adaptive to changing needs from its users and the
organisations that inhabit the building during it's life time. The building will supply services
for its inhabitants, its administration and operation & maintenance. The intelligent building
will accomplish transparent 'intelligent' behaviour have state memory, support human and
installation systems communication, and be equipped with sensors and actuators" by Per
Christiansson in his approach.
“An intelligent building is one in which the building fabric, space, services and
information systems can respond in an efficient manner to the initial and changing demands
of the owner, the occupier and the environment” by Arup in 2004.
CHAPTER-2
LITERATURE SURVEY
2.1 LITERATURE OVERVIEW
Han et al. proposed a Home Energy Management System (HEMS) using the ZigBee
technology to reduce the standby power. The suggested system consists of an automatic
standby power cut-off outlet, a ZigBee hub and a server. The power outlet with a ZigBee
module cuts off the ac power when the energy consumption of the device connected to the
power outlet is below a fixed value. The central hub collects information from the power
channels and controls these power channels through the ZigBee module. The central hub
sends the present state information to a server and then a user can monitor or control the
present energy usage using the HEMS user interface. This facility may create some
uneasiness for the users. For example, if the users may want low intensity of light, for some
situation but the system will cut the power off leading to darkness.
Wireless sensor networks have become increasingly important because of their ability
to monitor and manage situational information for various intelligent services. X.P.Liu,
W.Gueaieb, S.C.Mukhopadhya, Warwick and Z.Yin reports some of the latest theoretical
developments and applications in this fast-growing area. Mechatronic systems will become
more and more ubiquitous at home in near future and will be very useful in assistive
healthcare particularly for the elderly and disable people. Wireless mechatronic devices,
services, and systems consisting of spatially distributed autonomous sensors are used to
monitor globally or locally physical or environmental conditions, such as temperature,
vibration, pressure, motion etc.
WSN also has been applied in healthcare fields. Advances computer and
communication technology have enabled online healthcare monitoring using miniature
sensing devices attached to patient’s body. Data collected in this manner is delivered in real
time trough one or more wireless hopes to the hospital network. J.Misic and V.B.Misic
present an article in which they discuss design alternatives for the wireless portion of an
online healthcare monitoring system and present performance results for a two-tier network
that uses IEEE 802.15.4 low data rate wireless personal area networking (WPAN) for the
patient’s body area network and IEEE 802.11b for the connection between the body area
network coordinators and the wired portion of healthcare system.
In the country like United States (US) some areas such as California and Texas, smart
meters are almost fully deployed. From June 2011, 20 million i.e. 50% of all households
equipped with smart meters and it is expected that the number will increase to approximately
65 million Meters by 2015.It is realistic estimate of the size of the home energy management
market.
M.S.Pan, L.W.Yeh, Y.A.Chen, Y.H.Lin and Y.C.Tseng presented A WSN based
intelligent light control system considering user activities and profiles. In which wireless
sensors are responsible for measuring current illuminations and the lights are controlled by
applying the model of user’s actions and profiles for indoor environments, such as a home for
a reduction in energy consumption.
Suh and Ko proposed an intelligent home control system based on a wireless
sensor/actuator network with a link quality indicator based routing protocol to enhance
network reliability. It can integrate diversified physical sensing information and control
various consumer home devices, with the support of active sensor networks having both
sensor and actuator components.
2.2 Drawbacks of existing systems
2.2.1Viewable Pathway Correspondence
To control the gadgets at the controlled segment a viewable pathway of
correspondence is essential. Beforehand Existed correspondence framework is IR based, for
IR correspondence a viewable pathway correspondence is essential.
2.2.2 It Covers Restricted Separation Just
The separation secured by the line of correspondence framework is restricted. Despite
the fact that it is RF based the separation scope is less. So the separation scope is fundamental
disadvantage of the existed frameworks
2.2.3 Pure Relationship Arrangement
Already existed frameworks are immaculate similarity. The gadgets and parts that are
utilized as a part of the already existed frameworks are exceptionally essential and not
propelled segments. Because of utilization of extremely fundamental segments the measure
of framework may increment.
2.2.4 Limited Number of Operations
With the current frameworks we can perform just barely numerical operations, on the
grounds that these frameworks utilize just equipment part. So in light of equipment the no of
operations of the framework chose.
2.2.5 No Predefined Charges
Beforehand existed frameworks have no microcontroller part and no programming, so
no predefined charges are existed. Even though it is controller part, the controller does not
bolster the re programming choice. So, predefined summons are not accessible.
2.2.6 High Power Utilization
Because of utilizing of the simple parts and gadgets, it devours the powerful
because of utilizing of inductors and transistors.
2.2.7 Unintelligent
These are not smaller scale controller based frameworks, so it can't identify the information
arriving. So these frameworks are the un shrewd frameworks, correspondence that is built up
by the current frameworks are not dependable some of the time.
2.3 Advantages of proposed system
2.3.1 Reliable Correspondence
Correspondence started by the computerized radios is exceptionally solid. Here the
computerized radio means GSM which is works at 2.4 GHz recurrence range. This is having
an exceptional code for recognizing them in system. In view of that address remaining
gadgets will speak with this gadget.
2.3.2 Unlimited Number of Operations
Essentially our proposing framework is microcontroller based, by adjusting a bit of
programming both at controller segment and controlled area we can perform boundless
number of operations.
2.3.3 Pure Advanced Framework:
Our proposed framework is small scale controlled frameworks; programming is
required for working of that framework. So it is immaculate advanced framework.
2.3.4 Provides Security
The correspondence started by the framework is, unadulterated computerized
correspondence based framework. This correspondence framework gives some encoding and
translating of the information operations. So it gives security while exchanging or accepting
information.
2.3.5 Acknowledgement for Each Operation
At whatever point we send some order to the controlled area, it can offer replay to the
controller segment with respect to the activity performed at controlled area.
2.3.6 Status Evidence on LCD Show
In past existing frameworks for status sign a LED is utilized, yet in proposed
frameworks we are utilizing the LCD show for status evidence. We are utilizing two LCD
show for both sides.
2.3.7 Low Power Consumption
The segments and gadgets including the microcontroller are low power utilization
modules. This devours low power for their operation.
2 .3.8 Reliable Operation
Operations that are performed by the proposing frameworks are solid.
2.4 Applications
2.4.1 Shopping Centres
We can use this framework in the shopping centres, on the grounds that shopping
centres having the huge measure of the electrical apparatuses for guests. In any case, the
guests search for their needs; they may not auto about the apparatuses that are running
without vicinity of the guests. so framework is useful for controlling apparatuses to spare
influence and cash as well.
2.4.2 Offices
In workplaces additionally having vast measure of electrical machines and PCs are
there, so workers takes think about their work just not about force sparing. a remote
controlled force administration framework is useful for controlling electrical apparatuses
without labour.
2.4.3 Educational Organizations
In instructive associations like schools and universities, the understudies not having
thought regarding influence sparing, a few understudies can works the electrical apparatuses
seriously as a piece of fiendish things, it is unsafe for understudies and losing of influence
and cash results. So, frameworks extremely accommodating to stay away from these lord
things.
2.4.4 Hotels and Lodges
Vacationers having no clue about the switch sheets for trigging the lights and fans. So
with this framework they may feel great
2.4.5 Apartments
Condo having such a variety of electrical apparatuses for the individuals who are
living in that flat. Neighbours may not take think about the electrical apparatuses of the other
than house. So therefore this framework is exceptionally useful in the trigging of electrical
machines.
2.4.6 Houses
In home, we are utilizing such a variety of apparatuses. Infrequently we may neglect
to switch off the apparatuses when we are leaving that specific room or lobby.
CHAPTER-3
BLOCK DIAGRAM DESCRIPTION
The hardware requirements are discussed in the preceding section.
3.1 Functional Block diagram
Fig 3.1 Functional block diagram of the system
3.2 Block diagram description
The system has been designed for measurement of electrical parameters of household
appliances. Important functions to the system are the ease of modelling, setup, and use. From
the consumer point of view, electrical power consumption of various appliances in a house
along with supply voltage and current is the key parameter. Fig.3.1 shows the functional
description of the developed system to monitor electrical parameters and control appliances
based on the consumer requirements.
The measurement of electrical parameters of home appliances is done by interfacing
with fabricated sensing modules.. The output signals from the sensors are integrated and
connected to XBee module for transmitting electrical parameters data wirelessly. The XBee
modules are interfaced with various sensing devices and interconnected in the form of mesh
topology to have reliable data reception at a centralized ZigBee coordinator. The maximum
distance between the adjacent ZigBee nodes is less than 10 m, and through hopping technique
of the mesh topology, reliable sensor fusion data has been performed. The ZigBee
coordinator has been connected through the RS232 cable of the host computer, which stores
the data into a database of computer system. The collected sensor fusion data have been sent
to an internet residential gateway for remote monitoring and controlling the home
environment. By analysing the power from the system, energy consumption can be
controlled. An electricity tariff plan has been set up to run various appliances at peak and off-
peak tariff rates. The appliances are controlled either automatically or manually
(local/remotely). The smart power metering circuit is connected to mains 240 V/50 Hz
supply.
3.3 Detailed block diagram
1) Slave mode:
Fig 3.2 Slave mode
Micro
Controller
RELAY LOAD3
LCD
Display
Power
supply
MAX232
Low Side Power Supply
5 or 3.3v
RELAY LOAD1
RELAY LOAD2
Mastermode:
Fig 3.3 Master mode
3.4 Hardware tools used in this project
 Arm7 Microcontroller
 MAX 232
 LCD
 Zig-bee pair
 Relay(12/5 v)
 Different loads bulbs/fans
3.5 Software Tools
 Programming language: Embedded c
 Development tool: Kiel u Vision and flash magic
3.6 Functions of each block
3.6.1 Micro controller
This section forms the control unit of the whole project. This section basically
consists of a Microcontroller with its associated circuitry like Crystal with capacitors, Reset
circuitry, Pull up resistors (if needed) and so on. The Microcontroller forms the heart of the
project because it controls the devices being interfaced and communicates with the devices
according to the program being written.
PC
Power
Supply
Keys
3.6.2 ARM7TDMI
ARM is the abbreviation of Advanced RISC Machines, it is the name of a class of
processors, and is the name of a kind technology too. The RISC instruction set, and related
decode mechanism are much simpler than those of Complex Instruction Set Computer
(CISC) designs.
It takes the power value from the power measurement IC and compares it with the
threshold value set by the control unit and accordingly takes the controlling action like
whether to keep device ON or switch it OFF. It also takes corrective action for power factor
improvement.
3.6.3 Liquid-crystal display
LCD is a flat panel display, electronic visual display that uses the light modulation
properties of liquid crystals. Liquid crystals do not emit light directly. LCDs are available to
display arbitrary images or fixed images which can be displayed or hidden, such as preset
words, digits, and 7-segment displays as in a digital clock.
3.6.4 ZIGBEE
Zigbee modules feature a UART interface, which allows any microcontroller or
microprocessor to immediately use the services of the Zigbee protocol. All a Zigbee hardware
designer has to do in this is ensure that the host’s serial port logic levels are compatible with
the XBee’s 2.8- to 3.4-V logic levels. The logic level conversion can be performed using
either a standard RS-232 IC or logic level translators such as the 74LVTH125 when the host
is directly connected to the XBee UART. The X-Bee RF Modules interface to a host device
through a logic-level asynchronous Serial port. Through its serial port, the module can
communicate with any logic and voltage Compatible UART; or through a level translator to
any serial device.
Data is presented to the X-Bee module through its DIN pin, and it must be in the
asynchronous serial format, which consists of a start bit, 8 data bits, and a stop bit. Because
the input data goes directly into the input of a UART within the XBee module, no bit
inversions are necessary within the asynchronous serial data stream. All of the required
timing and parity checking is automatically taken care of by the X-Bee’s UART.
3.6.6 Power Supply:
The input to the circuit is applied from the regulated power supply. The ac. input i.e.,
230V from the mains supply is step down by the transformer to 12V and is fed to a rectifier.
The output obtained from the rectifier is a pulsating dc voltage. So in order to get a pure dc
voltage, the output voltage from the rectifier is fed to a filter to remove any ac components
present even after rectification. Now, this voltage is given to a voltage regulator to obtain a
pure constant dc voltage.
CHAPTER-4
HARDWARE DESCRIPTION
4.1 ARM – ADVANCED RISC MACHINE (LPC 2148)
The LPC2148 microcontrollers are based on a 32 bit ARM7TDMI-S CPU with real-
time emulation and embedded trace support, that combines the microcontroller with
embedded high speed flash memory ranging from 32 kB to 512 kB. A 128-bit wide memory
interface and unique accelerator architecture enable 32-bit code execution at the maximum
clock rate. For critical code size applications, the alternative 16-bit Thumb mode reduces
code by more than 30 % with minimal performance penalty.
Due to the tiny size and low power consumption, LPC2148 is ideal for applications
where miniaturization is a key requirement, such as access control and point-of-sale. A blend
of serial communications interfaces ranging from a USB 2.0 Full Speed device, multiple
UARTs, SPI, SSP to I2Cs, and on-chip SRAM of 8 kB up to 40 kB, make these devices very
well suited for communication gateways and protocol converters, soft modems, voice
recognition and low end imaging, providing both large buffer size and high processing
power. Various 32-bit timers, single or dual 10-bit ADC(s), 10-bit DAC, PWM channels and
45 fast GPIO lines with up to nine edge or level sensitive external interrupt pins make these
microcontrollers particularly suitable for industrial control and medical systems.
FEATURES
 16/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.
 8 to 40 KB of on-chip static RAM and 32 to 512 KB of on-chip flash program
memory.
 128 bit wide interface/accelerator enables high speed 60 MHz operation.
 In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software.
Single flash sector or full chip erase in 400 ms and programming of 256 bytes in 1 ms.
 USB 2.0 Full Speed compliant Device Controller with 2 KB of endpoint RAM.
 In addition, LPC2148 provides 8 KB of on-chip RAM accessible to USB by DMA.
 Two 10-bit A/D converters provide a total of 6/14 analog inputs, with conversion
times as low as 2.44 micros per channel.
 Single 10-bit D/A converter provides variable analog output.
 Two 32-bit timers/external event counters (with four captures and four compare
channels each), PWM unit (six outputs) and watchdog.
 Low power real-time clock with independent power and dedicated 32 kHz clock
input.
 Multiple serial interfaces including two UARTs (16C550), two Fast I2C-buses
 (400 Kbit/s), SPI and SSP with buffering and variable data length capabilities.
 Vectored interrupt controller with configurable priorities and vector addresses.
 Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
 Up to nine edge or level sensitive external interrupt pins available.
4.1.1 ARCHITECTURAL OVERVIEW
The LPC2148 consists of an ARM7TDMI-S CPU with emulation support, the ARM7
Local Bus for interface to on-chip memory controllers, the AMBA Advanced High-
performance Bus (AHB) for interface to the interrupt controller, and the ARM Peripheral Bus
(APB, a compatible superset of ARM’s AMBA Advanced Peripheral Bus) for connection to
on-chip peripheral functions. The LPC2148 configures the ARM7TDMI-S processor in little-
endian byte order. AHB peripherals are allocated a 2 megabyte range of addresses at the very
top of the 4 gigabyte ARM memory space. Each AHB peripheral is allocated a 16 kB address
space within the AHB address space. LPC2148 peripheral functions (other than the interrupt
controller) are connected to the APB bus. The AHB to APB bridge interfaces the APB bus to
the AHB bus. APB peripherals are also allocated a 2 megabyte range of addresses, beginning
at the 3.5 gigabyte address point. Each APB peripheral is allocated a 16 kB address space
within the APB address space. The connection of on-chip peripherals to device pins is
controlled by a Pin Connect Block. This must be configured by software to fit specific
application requirements for the use of peripheral functions and pins.
FIG 4.1- Block Diagram of LPC 2148
4.1.2 ARM7TDMI-S PROCESSOR
The ARM7TDMI-S is a general purpose 32-bit microprocessor, which offers high
performance and very low power consumption. The ARM architecture is based on Reduced
Instruction Set Computer (RISC) principles, and the instruction set and related decode
mechanism are much simpler than those of micro programmed Complex Instruction Set
Computers. This simplicity results in a high instruction throughput and impressive real-time
interrupt response from a small and cost-effective processor core. Pipeline techniques are
employed so that all parts of the processing and memory systems can operate continuously.
Typically, while one instruction is being executed, its successor is being decoded, and a third
instruction is being fetched from memory. The ARM7TDMI-S processor also employs a
unique architectural strategy known as THUMB, which makes it ideally suited to high-
volume applications with memory restrictions or applications where code density is an issue.
The key idea behind THUMB is that of a super-reduced instruction set. Essentially, the
ARM7TDMI-S processor has two instruction sets:
• The standard 32-bit ARM instruction set.
• A 16-bit THUMB instruction set.
The THUMB set’s 16-bit instruction length allows it to approach twice the density of
standard ARM code while retaining most of the ARM’s performance advantage over a
traditional 16-bit processor using 16-bit registers. This is possible because THUMB code
operates on the same 32-bit register set as ARM code. THUMB code is able to provide up to
65% of the code size of ARM, and 160% of the performance of an equivalent ARM
processor connected to a 16-bit memory system.
4.1.3 Description about the Block Diagram:
On chip Flash Program Memory
LPC 2148 is having 512 k B Flash memory. This memory may be used for both code
and data storage. Programming of the flash memory may be accomplished in several ways
(ISP/IAP).
On chip Static RAM
On-chip static RAM may be used for code and/or data storage. The SRAM may be
accessed as 8-bit, 16-bit, and 32-bit. An 8 k B SRAM block intended to be utilized mainly by
the USB
Interrupt Controller
The Vectored Interrupt Controller (VIC) accepts all of the interrupt request inputs and
categorizes them as Fast Interrupt Request (FIQ), vectored Interrupt Request (IRQ), and non-
vectored IRQ as defined by programmable settings.
Analog to Digital Converter
LPC2148 contains two analog to digital converters (ADC0 & ADC1). Total number
of available ADC inputs is 14. These two ADC’s are 10 bit successive approximation analog
to digital converters. The measurement range is 0 V to VREF and is Global Start command for
both converters.
Digital to Analog Converter
The DAC enables to generate a variable analog output. The maximum DAC output
voltage is the VREF voltage. 10-bit DAC, Buffered output and Power-down mode are
available.
USB 2.0 Device Controller
The USB is a 4-wire serial bus that supports communication between a host and a
number (127max) of peripherals. This enables 12 M bit/s data exchange with a USB host
controller. A DMA controller (available only in LPC2146/48) can transfer data between an endpoint
buffer and the USB RAM.
UART
LPC2148 contains two UARTs (UART0 & UART1). In addition to standard transmit
and receive data lines, the LPC2148 UART1 also provide a full modem control handshake
interface. 16 byte Receive and Transmit FIFOs are used. It contains Built-in fractional baud
rate generator covering wide range of baud rates without a need for external crystals of
particular values.
I2C-bus serial I/O controller
I2C is a bidirectional. It is a multi-master bus; it can be controlled by more than one
bus master connected to it. It supports bit rates up to 400 k bit/s. Bidirectional data transfer
between masters and slaves. Serial clock synchronization allows devices with different bit
rates to communicate via one serial bus. Serial clock synchronization can be used as a
handshake mechanism to suspend and resume serial transfer.
SPI serial I/O control
It is s a full duplex serial interface, designed to handle multiple masters and slaves
connected to a given bus. Synchronous, Serial, Full Duplex Communication is considered in
the system.
SSP serial I/O control:-
Supports full duplex transfers. Data frames of 4 bits to 16 bits of data flowing from
the master to the slave and from the slave to the master. Synchronous serial communication
Master or slave operation. 8-frame FIFOs for both transmit and receive. Four bits to 16 bits
per frame
Timers
LPC 2148 has two 32-bit timer/counters with a programmable 32-bit pre scalar. It also
having external event counter. Four 32-bit capture channels per timer/counter that can take a
snapshot of the timer value when an input signals transitions. A capture event may also
optionally generate an interrupt..
Watchdog Timer
The purpose of the watchdog is to reset the microcontroller within a reasonable
amount of time if it enters an erroneous state. When enabled, the watchdog will generate a
system reset if the user program fails to ‘feed’ (or reload) the watchdog within a
predetermined amount of time.
Real Time Clock
The RTC is designed to provide a set of counters to measure time when normal or idle
Operating mode is selected. The RTC has been designed to use little power, making it
Suitable for battery powered systems where the CPU is not running continuously (Idle
Mode).
Crystal Oscillator
On-chip integrated oscillator operates with external crystal in range of 1 MHz to 25 M
Hz. The oscillator output frequency is called foscand the ARM processor clock frequency is
referred to as CCLK for purposes of rate equations, etc. fosc and CCLK are the same value
unless the PLL is running and connected.
PLL
The PLL accepts an input clock frequency in the range of 10 MHz to 25 MHz’s The
input frequency is multiplied up into the range of 10 MHz to 60 MHz with a Current
Controlled Oscillator (CCO). The multiplier can be an integer value from 1 to 32 (in practice,
the multiplier value cannot be higher than 6 on this family of microcontrollers due to the
upper frequency limit of the CPU). The CCO operates in the range of 156 MHz to 320 MHz,
so there is an additional divider in the loop to keep the CCO within its frequency range while
the PLL is providing the desired output frequency.
4.1.4 LPC 2148 REGISTERS
The ARM CPU provides in user mode 16 general purpose registers (R0 - R15) and a
Program Status Register. Registers in LPC 2148 are 8, 16 or 32 bits wide. The ARM CPU
provides shadow registers which are selected on an Operation Mode switch. These shadow
registers reduce interrupt latency. All CPU Registers are shown in the following picture.
SP: Stack pointer
LR: Link register
PC: Program counter
CPSR: Current Program Status Register.
SPSR: Saved Program Status Register.
Fig 4.2: Registers
LR (Link register): Used by the processor when there is a branch operation this occurs due
to function call or due to some condition checking. When the processor is executing and there
is a need to branch to other location the return address (the address from where the execution
is to be started, returning after completing the function execution). If there are multiple
function calls then LR will store only the last address before jumping.
CPSR: Used to store the important back-up data whenever there is change of any mode. E.g.
if the processor is executing user mode and there is an interrupt, before going to service the
interrupt the all the data and the status registers and the current mode of operation
information is stored in CPSR. CPSR registers are present in all the 7 modes but are not
usually shown.
SPSR: stores the copy of CPSR register in which ever mode the processor enters. All the 7
modes have SPSR registers and are shown in the mode registers. If the processor switches
from USER mode to IRQ mode because of an IRQ, the CPSR value is updated in the user
mode and the processor switches to IRQ mode. Beforestarting the IRQ code execution the
value of CPSR is copied to SPSR of IRQ mode. While executing IRQ mode and high priority
interrupt occurs (FIQ) then the status of the IRQ mode is updated in its CPSR register and
when the processor switches to FIQ mode the contents of CPSR in IRQ mode is copied to
SPSR register in FIQ mode.
4.1.5 General Purpose Input/output ports (GPIO)
Every physical GPIO port is accessible either the group of registers by providing an
enhanced features and accelerated port access or the legacy group of registers.
• Accelerated GPIO functions:
– GPIO registers are relocated to the ARM local bus so that the fastest possible I/O Timing
can be achieved.
– Mask registers allow treating sets of port bits as a group, leaving other bits Unchanged.
– All registers are byte and half-word addressable.
– Entire port value can be written in one instruction.
• Bit-level set and clear registers allow a single instruction set or clear of any number of bits
in one port.
• Direction control of individual bits.
• All I/O default to inputs after reset.
• Backward compatibility with other earlier devices is maintained with legacy registers
appearing at the original addresses on the VPB bus.
Applications:
• General purpose I/O
• Driving LEDs, or other indicators
• Controlling off-chip devices
• Sensing digital inputs
4.1.6 Pin Description
IOPIN: The current state of the GPIO configured port pins can always be read from this
register, regardless of pin direction.
IOSET: This register controls the state of output pins in conjunction with the IOCLR
register. Writing one’s produces highs at the corresponding port pins. Writing zeroes has no
effect.
IODIR: GPIO Port Direction control register: This register individually controls the
direction of each port pin. Direction bit for any pin must be set according to the pin
functionality.
IOCLR: GPIO Port Output Clear register: This register controls the state of output pins.
Writing ones produces lows at the corresponding port pins and clears the corresponding bits
in the IOSET register. Writing zeros has no effect.
4.1.7 PIN diagram of LPC 2148
Fig 4.3:Pin diagram of LPC 2148
EXTERNAL INTERRUPT INPUTS
The LPC 2148 includes four External Interrupt Inputs as selectable pin functions. The
External Interrupt Inputs can optionally be used to wake up the processor from the Power
Down mode.
REGISTER DESCRIPTION
The external interrupt function has four registers associated with it. The EXTINT
register contains the interrupt flags, and the EXTWAKEUP register contains bits that enable
individual external interrupts to wake up the LPC 2148 from Power Down mode. The
EXTMODE and EXTPOLAR registers specify the level and edge sensitivity parameters.
External Interrupt Flag Register
When a pin is selected for its external interrupt function, the level or edge on that pin
selected by its bits in the EXTPOLAR and EXTMODE registers will set its interrupt flag in
this register. This asserts the corresponding interrupt request to the VIC, which will cause an
interrupt if interrupts from the pin are enabled. Writing ones to bits EINT0 through EINT3 in
EXTINT register clears the corresponding bits. In level-sensitive mode this action is
efficacious only when the pin is in its inactive state.
4.1.8 UART0
FEATURES
• 16 byte Receive and Transmit FIFO.
• Register locations conform to ‘550 industry standard.
• Receiver FIFO triggers points at 1, 4, 8, and 14 bytes.
• Built-in baud rate generator.
UART PIN DESCRIPTION
Table 4.1: UART PIN description
There are two Universal Asynchronous Receiver Transmitters (UART) configured in
ARM 7-LPC 2148 viz. UART-0 and UART -1.Register which are related for UART
configurations are UO/1LCR, UO/1THR, UO/1RBR and UO/1LSR.
LCR: Line Control Register.
THR: Transmit Holding Register.
RBR: Receive Buffer Register.
LSR: Line Status Register.
UO/1LSR –
7 6 5 4 3 2 1 0
Divisor
latch bit
UART
trans
enb/disable
Odd/even
parity
Enable
/disable
Parity Bit
Stop
Bit
Width of data
Recvd& trans.
Bits 1:0-
‘0 0 ‘- 5 bit data.
‘0 1- 6 bit data.
‘1 0 -7 bit data.
‘1 1’- 8 bit data.
Bit 2:
‘0’ - 1 stop bit.
‘1’ - 2 stop bits.
Bit 3:
‘0’ - Disable parity bit.
‘1’ - Enable parity bit.
Bits 4:5 :
‘0 0’ - odd parity.
‘0 1’ – even parity.
Bit 6:
‘0’ - Enable transmission bit.
‘1’ - Disable transmission bit.
Bit- 7:
‘1’ - to set baud rate.
To set baud rate two registers UO/1DLL (Divisor Latch LSB) and U0/1DLM (Divisor Latch
MSB) are used.
Baud rate value = Processor clock frequency
16* Baud rate (in bits per sec)
U0/1LSR: (status of UART)
7 6 5 4 3 2 1 0
X X TRANS STATUS X X X X RECEIV
STATUS
U0/1THR: Data that is transmitted will be available in U0/1THR and then sent to other
registers.
U0/1RBR: Data that is received will be available in U0/1THR and then sent to other
registers.
4.2. ZIGBEE
When you hold the TV remote and wish to use it you have to necessarily point your control at
the device. This one-way, line-of-sight, short-range communication uses infrared (IR) sensors
to enable communication and control and it is possible to operate the TV remotely only with
its control unit.
Add other home theatre modules, an air- conditioner and remotely enabled fans and
lights to your room, and you become a juggler who has to handle not only these remotes, but
also more numbers that will accompany other home appliances you are likely to use.
Some remotes do serve to control more than one device after ‘memorizing' access
codes, but this interoperability is restricted to LOS, that too only for a set of related
equipment, like the different units of a home entertainment system
Now picture a home with entertainment units, security systems including fire alarm,
smoke detector and burglar alarm, air-conditioners and kitchen appliances all within
whispering distance from each other and imagine a single unit that talks with all the devices,
no longer depending on line-of-sight, and traffic no longer being one-way.
This means that the devices and the control unit would all need a common standard to enable
intelligible communication. ZigBee is such a standard for embedded application software and
has been ratified in late 2004 under IEEE 802.15.4 Wireless Networking Standards.
ZigBee is one of the global standards of communication protocol formulated by the
relevant task force under the IEEE 802.15 working group. The fourth in the series, WPAN
Low Rate/ZigBee is the newest and provides specifications for devices that have low data
rates, consume very low power and are thus characterized by long battery life. Other
standards like Bluetooth and IrDA address high data rate applications such as voice, video
and LAN communications.
The ZigBee Alliance has been set up as “an association of companies working
together to enable reliable, cost-effective, low-power, wirelessly networked, monitoring and
control products based on an open global standard”.
Once a manufacturer enrolls in this Alliance for a fee, he can have access to the
standard and implement it in his products in the form of ZigBee chipsets that would be built
into the end devices. Philips, Motorola, Intel, HP are all members of the Alliance . The goal is
“to provide the consumer with ultimate flexibility, mobility, and ease of use by building
wireless intelligence and capabilities into every day devices. ZigBee technology will be
embedded in a wide range of products and applications across consumer, commercial,
industrial and government markets worldwide. For the first time, companies will have a
standards-based wireless platform optimized for the unique needs of remote monitoring and
control applications, including simplicity, reliability, low-cost and low-power”.
The target networks encompass a wide range of devices with low data rates in the
Industrial, Scientific and Medical (ISM) radio bands, with building-automation controls like
intruder/fire alarms, thermostats and remote (wireless) switches, video/audio remote controls
likely to be the most popular applications. So far sensor and control devices have been
marketed as proprietary items for want of a standard. With acceptance and implementation of
ZigBee, interoperability will be enabled in multi-purpose, self-organizing mesh networks .
4.2.1 Architecture
Though WPAN implies a reach of only a few meters, 30 feet in the case of ZigBee,
the network will have several layers, so designed as to enable intrapersonal communication
within the network, connection to a network of higher level and ultimately an uplink to the
Web.
The ZigBee Standard has evolved standardized sets of solutions, called ‘layers'. These
layers facilitate the features that make ZigBee very attractive: low cost, easy implementation,
reliable data transfer, short-range operations, very low power consumption and adequate
security features.
1. Network and Application Support layer: The network layer permits growth of network
sans high power transmitters. This layer can handle huge numbers of nodes. This level in the
ZigBee architecture includes the ZigBee Device Object (ZDO), user-defined application
profile(s) and the Application Support (APS) sub-layer.
The APS sub-layer's responsibilities include maintenance of tables that enable
matching between two devices and communication among them, and also discovery, the
aspect that identifies other devices that operate in the operating space of any device.
The responsibility of determining the nature of the device (Coordinator / FFD or
RFD) in the network, commencing and replying to binding requests and ensuring a secure
relationship between devices rests with the ZDO (Zigbee Define Object). The user-defined
application refers to the end device that conforms to the ZigBee Standard.
2. Physical (PHY) layer :The IEEE802.15.4 PHY physical layer accommodates high levels
of integration by using direct sequence to permit simplicity in the analog circuitry and enable
cheaper implementations.
3. Media access control (MAC) layer : The IEEE802.15.4 MAC media access control layer
permits use of several topologies without introducing complexity and is meant to work with
large numbers of devices.
Figure 4.4: IEEE 802.15.4 / ZigBee Stack Architecture
4.2.2 Device Types
There are three different ZigBee device types that operate on these layers in any self-
organizing application network.
These devices have 64-bit IEEE addresses, with option to enable shorter addresses to reduce
packet size, and work in either of two addressing modes – star and peer-to-peer.
1. The ZigBee coordinator node
There is one, and only one, ZigBee coordinator in each network to act as the router to
other networks, and can be likened to the root of a (network) tree. It is designed to store
information about the network.
2. The full function device FFD
The FFD is an intermediary router transmitting data from other devices. It needs
lesser memory than the ZigBee coordinator node, and entails lesser manufacturing costs. It
can operate in all topologies and can act as a coordinator.
3. The reduced function device RFD
This device is just capable of talking in the network; it cannot relay data from other
devices. Requiring even less memory, (no flash, very little ROM and RAM), an RFD will
thus be cheaper than an FFD. This device talks only to a network coordinator and can be
implemented very simply in star topology.
4.2.3 ZigBee Characteristics
The focus of network applications under the IEEE 802.15.4 / ZigBee standard include
the features of low power consumption, needed for only two major modes (TX/Rx or Sleep),
high density of nodes per network, low costs and simple implementation.
These features are enabled by the following characteristics. 2.4GHz and 868/915 MHz dual
PHY modes. This represents three license-free bands: 2.4-2.4835 GHz, 868-870 MHz and
902-928 MHz The number of channels allotted to each frequency band is fixed at sixteen
(numbered 11-26), one (numbered 0) and ten (numbered 1-10) respectively. The higher
frequency band is applicable worldwide, and the lower band in the areas of North America,
Europe, Australia and New Zealand.
 Low power consumption, with battery life ranging from months to years. In the
ZigBee standard, longer battery life is achievable by either of two means: continuous
network connection and slow but sure battery drain, or intermittent connection and
even slower battery drain.
 Maximum data rates allowed for each of these frequency bands are fixed as 250 kbps
@2.4 GHz, 40 kbps @ 915 MHz, and 20 kbps @868 MHz
 High throughput and low latency for low duty-cycle applications (<0.1%)
 Channel access using Carrier Sense Multiple Access with Collision Avoidance
(CSMA - CA)
 Addressing space of up to 64 bit IEEE address devices, 65,535 networks
 50m typical range
 Fully reliable “hand-shaked” data transfer protocol.
 Different topologies as illustrated below: star, peer-to-peer, mesh .
Figure 4.5: ZigBee Topologies
4.2.4 Traffic Types
ZigBee/IEEE 802.15.4 addresses three typical traffic types. IEEE 802.15.4 MAC can
accommodate all the types.
1. Data is periodic. The application dictates the rate, and the sensor activates, checks for data
and deactivates.
2. Data is intermittent. The application, or other stimulus, determines the rate, as in the case
of say smoke detectors. The device needs to connect to the network only when
communication is necessitated. This type enables optimum saving on energy.
3. Data is repetitive, and the rate is fixed a priori. Depending on allotted time slots, called
GTS (guaranteed time slot), devices operate for fixed durations.
ZigBee employs either of two modes, beacon or non-beacon to enable the to-and-fro
data traffic. Beacon mode is used when the coordinator runs on batteries and thus offers
maximum power savings, whereas the non-beacon mode finds favor when the coordinator is
mains-powered.
In the beacon mode, a device watches out for the coordinator's beacon that gets
transmitted at periodically, locks on and looks for messages addressed to it. If message
transmission is complete, the coordinator dictates a schedule for the next beacon so that the
device ‘goes to sleep'; in fact, the coordinator itself switches to sleep mode.
While using the beacon mode, all the devices in a mesh network know when to
communicate with each other. In this mode, necessarily, the timing circuits have to be quite
accurate, or wake up sooner to be sure not to miss the beacon.
Figure 4.6 : Beacon Network Communication
The non-beacon mode will be included in a system where devices are ‘asleep' nearly
always, as in smoke detectors and burglar alarms. The devices wake up and confirm their
continued presence in the network at random intervals.
On detection of activity, the sensors ‘spring to attention', as it were, and transmit to
the ever-waiting coordinator's receiver (since it is mains-powered). However, there is the
remotest of chances that a sensor finds the channel busy, in which case the receiver
unfortunately would ‘miss a call'.
Figure 4.7: Non-Beacon Network Communication
Network Model
The functions of the Coordinator, which usually remains in the receptive mode,
encompass network set-up, beacon transmission, node management, storage of node
information and message routing between nodes.
The network node, however, is meant to save energy (and so ‘sleeps' for long periods)
and its functions include searching for network availability, data transfer, checks for pending
data and queries for data from the coordinator.
Figure 4.8 :ZigBee Network Model
For the sake of simplicity without jeopardizing robustness, this particular IEEE
standard defines a quartet frame structure and a super-frame structure used optionally only by
the coordinator.
The four frame structures are
 Beacon frame for transmission of beacons
 Data frame for all data transfers
 Acknowledgement frame for successful frame receipt confirmations
 MAC command frame
These frame structures and the coordinator's super-frame structure play critical roles in
security of data and integrity in transmission.
All protocol layers contribute headers and footers to the frame structure, such that the
total overheads for each data packet range are from 15 octets (for short addresses) to 31 octets
(for 64-bit addresses).
The coordinator lays down the format for the super-frame for sending beacons after every
15.38 ms or/and multiples thereof, up to 252s. This interval is determined a priori and the
coordinator thus enables sixteen time slots of identical width between beacons so that channel
access is contention-less. Within each time slot, access is contention-based. Nonetheless, the
coordinator provides as many as seven GTS (guaranteed time slots) for every beacon interval
to ensure better quality.
4.2.5 Technology Comparisons
The “Why ZigBee” question has always had an implied, but never quite worded
follower phrase “…when there is Bluetooth”. A comparative study of the two can be found in
The bandwidth of Bluetooth is 1 Mbps, ZigBee's is one-fourth of this value. The strength of
Bluetooth lies in its ability to allow interoperability and replacement of cables, ZigBee's, of
course, is low costs and long battery life.
In terms of protocol stack size, ZigBee's 32 KB is about one-third of the stack size
necessary in other wireless technologies (for limited capability end devices, the stack size is
as low as 4 KB).
Most important in any meaningful comparison are the diverse application areas of all
the different wireless technologies. Bluetooth is meant for such target areas as wireless
USB's, handsets and headsets, whereas ZigBee is meant to cater to the sensors and remote
controls market and other battery operated products.
In a gist, it may be said that they are neither complementary standards nor
competitors, but just essential standards for different targeted applications. The earlier
Bluetooth targets interfaces between PDA and other device (mobile phone / printer etc) and
cordless audio applications.
4.2.6 ZigBee Applications
The ZigBee Alliance targets applications "across consumer, commercial, industrial
and government markets worldwide".
Unwired applications are highly sought after in many networks that are characterized by
numerous nodes consuming minimum power and enjoying long battery lives.
ZigBee technology is designed to best suit these applications, for the reason that it
enables reduced costs of development, very fast market adoption, and rapid ROI.
Air bee Wireless Inchas tied up with Radio crafts AS to deliver "out-of-the-box"
ZigBee-ready solutions; the former supplying the software and the latter making the module
platforms. With even light controls and thermostat producers joining the ZigBee Alliance, the
list is growing healthily and includes big OEM names like HP, Philips, Motorola and Intel.
With ZigBee designed to enable two-way communications, not only will the
consumer be able to monitor and keep track of domestic utilities usage, but also feed it to a
computer system for data analysis.
A recent analyst report issued by West Technology Research Solutions estimates that
by the year 2008, "annual shipments for ZigBee chipsets into the home automation segment
alone will exceed 339 million units," and will show up in "light switches, fire and smoke
detectors, thermostats, appliances in the kitchen, video and audio remote controls,
landscaping, and security systems."
The ZigBee Alliance is nearly 200 strong and growing, with more OEM's signing up.
This means that more and more products and even later, all devices and their controls will be
based on this standard. Since Wireless personal Area Networking applies not only to
household devices, but also to individualized office automation applications, ZigBee is here
to stay. It is more than likely the basis of future home-networking solutions.
4.3 ANALOG TO DIGITAL CONVERTER:
ARM-7 LPC-2148 has built in ADC with 10 bit resolution, 4.5 MHz frequency and
2.44micro sec operation or conversion time.
Description
Basic clocking for the A/D converters is provided by the APB clock. A programmable
divider is included in each converter, to scale this clock to the 4.5 MHz (max) clock needed
by the successive approximation process. A fully accurate conversion requires 11 of these
clocks.
4.3.1 Features of ADC
 10 bit successive approximation analog to digital converter
 Input multiplexing among 6 or 8 pins (ADC0 and ADC1).
 Power-down mode.
 Measurement ranges 0 V to VREF (typically 3 V).
 10 bit conversion time ( >2.44 micro seconds).
 Burst conversion mode for single or multiple inputs.
AD Registers are used in conversion process. Each register is 32 bit in size. Various registers
used are:
ADxCR: control register to
 Select which pin input is given to.
 Set the clk rate and number of output bits.
 Start signal
 Edge signal
ADxGDR: global data register
 To store the digital values of most recent conversion when DONE bit is 1.
 Also contains info about which channel the input was given to.
 Contains OVERRUN bit to indicate if converted value was overwritten before it was
made available.
 DONE bit to check if converted data is read from register
ADDRx: data register
 Contains data after completion.
 Flags indicating completion and overrun if any.
4.3.2 ADC Registers
ADCR: (Analog to Digital Control Register-32 bits)
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Burst
mode
To set
Conv. Freq
X
Power
down
mode
X
Start/
stop
conv.
XXXX
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
For clock division For channel selection
ADDR: (Analog to Digital Data Register-32 bits)
Bit 31: Done bit.
Bits 15 to 6 will have converted data in digital form.
4.4 MAX 232
A standard serial interface for PC, RS232C, requires negative logic, i.e., logic 1 is -3V
to -12V and logic 0 is +3V to +12V. To convert TTL logic, say, TXD and RxD pins of the
microcontroller thus need a converter chip. A MAX232 chip has long been using in many
microcontrollers boards. It is a dual RS232 receiver / transmitter that meets all RS232
specifications while using only +5V power supply. It has two on board charge pump voltage
converters which generate +10V to -10V power supplies from a single 5V supply. It has four
level translators, two of which are RS232 transmitters that convert TTL/CMOS input levels
into +9V RS232 outputs. The other two level translators are RS232 receivers that convert
RS232 input to 5V. Typical MAX232 circuit is shown below.
Fig 4.9: MAX 232 pin diagram
4.4.1 Features
 Operates With Single 5-V Power Supply
 LinBiCMOSEProcess Technology
 Two Drivers and Two Receivers
 ±30-V Input Levels
 Low Supply Current . 8 mA Typical
 Meets or Exceeds TIA/EIA-232-F and ITU
Recommendation V.28
 7.Designed to be Interchangeable With
Maxim MAX232
 Applications
a. TIA/EIA-232-F
b. Battery-Powered Systems
c. Terminals
d. Modems
e. Computers
4.4.2 Circuit connections
A standard serial interfacing for PC, RS232C, requires negative logic, i.e., logic '1' is -3V
to -12V and logic '0' is +3V to +12V. To convert a TTL logic, say, TxD and RxD pins of the
chips, thus need a converter chip. A MAX232 chip has long been using in many uC boards. It
provides 2-channel RS232C port and requires external 10uF capacitors. Carefully check the
polarity of capacitor when soldering the board. A DS275 however, no need external capacitor
and smaller. Either circuit can be used without any problems.
Table 4.2 Pin description of MAX 232
Fig 4.10: circuit diagram of MAX 232
4.5 LCD (Liquid Cristal Display)
A liquid crystal display (LCD) is a thin, flat display device made up of any number of colour
or monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of a
column of liquid crystal molecules suspended between two transparent electrodes, and two
polarizing filters, the axes of polarity of which are perpendicular to each other. Without the
liquid crystals between them, light passing through one would be blocked by the other. The
liquid crystal twists the polarization of light entering one filter to allow it to pass through the
other.
A program must interact with the outside world using input and output devices that
communicate directly with a human being. One of the most common devices attached to a
controller is an LCD display. Some of the most common LCDs connected to the controllers
are 16X1, 16x2 and 20x2 displays. This means 16 characters per line by 1 line 16 characters
per line by 2 lines and 20 characters per line by 2 lines, respectively.
Many microcontroller devices use 'smart LCD' displays to output visual information.
LCD displays designed around LCD NT-C1611 module, are inexpensive, easy to use, and it
is even possible to produce a readout using the 5X7 dots plus cursor of the display. They
have a standard ASCII set of characters and mathematical symbols. For an 8-bit data bus, the
display requires a +5V supply plus 10 I/O lines (RS RW D7 D6 D5 D4 D3 D2 D1 D0). For
a 4-bit data bus it only requires the supply lines plus 6 extra lines (RS RW D7 D6 D5 D4).
When the LCD display is not enabled, data lines are tri-state and they do not interfere with
the operation of the microcontroller.
4.5.1 Features
● 16 characters with 2 lines display
● Over 200 character fonts available
● High display resolution: 5X8 dots per character
● Display with driver mounted on a single printed circuit board
● Standard CMOS logic compatible
● 6 inch cable with 14-pin connector that plugs directly into the module board
Key Specifications
● Power supply: +4.5V to +5.5V max @ 5mA max
● High level input voltage = 2.2V to VCC
● Low level Input Voltage = 0.0V to 0.6V
● Font size: 4.35mm X 2.95mm
● Overall dimension : 80.0mm(width)X36.0mm(height)X11.0mm(depth)
Data can be placed at any location on the LCD. For 16×1 LCD, the address locations are:
Shapes and S
available. Line
Table 4.3 Address location of LCD
Electrical block diagram:
Fig 4.11 Electrical block diagram of LCD
Power supply for LCD driving:
Fig 4.12 Power supply for LCD driving
4.5.2 PIN DESCRIPTION:
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two
pins are extra in both for back-light LED connections).
Fig 4.13: pin diagram of 1x16 lines LCD
Pin Symbol Function
1 Vss Ground
2 Vdd Supply Voltage
3 Vo Contrast Setting
4 RS Register Select
5 R/W Read/Write Select
6 En Chip Enable Signal
7-14 DB0-DB7 Data Lines
15 A/Vee Gnd for the backlight
16 K Vcc for backlight
4.5.3 CONTROL LINES
EN:
Line is called "Enable." This control line is used to tell the LCD that you are sending
it data. To send data to the LCD, your program should make sure this line is low (0) and then
set the other two control lines and/or put data on the data bus. When the other lines are
completely ready, bring EN high (1) and wait for the minimum amount of time required by
the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.
RS:
Line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high
(1), the data being sent is text data which should be displayed on the screen. For example, to
display the letter "T" on the screen you would set RS high.
RW
Line is the "Read/Write" control line. When RW is low (0), the information on the
data bus is being written to the LCD. When RW is high (1), the program is effectively
querying (or reading) the LCD. Only one instruction ("Get LCD status") is a read command.
All others are write commands, so RW will almost always be low.
Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation
selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1,
DB2, DB3, DB4, DB5, DB6, and DB7.
Logic status on control lines
• E - 0 Access to LCD disabled
- 1 Access to LCD enabled
• R/W - 0 Writing data to LCD
- 1 Reading data from LCD
• RS - 0 Instructions
- 1 Character
Writing data to the LCD
 Set R/W bit to low
 Set RS bit to logic 0 or 1 (instruction or character)
 Set data to data lines (if it is writing)
 Set E line to high
 Set E line to low
Read data from data lines (if it is reading)on LCD
1) Set R/W bit to high
2) Set RS bit to logic 0 or 1 (instruction or character)
3) Set data to data lines (if it is writing)
4) Set E line to high
5) Set E line to low
RELAYS
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. 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.
Fig 4.14 Relay
Relays are usually SPDT (single pole double through switch)or DPDT (double pole
double through switch) but they can have many more sets of switch contacts, for example
relays with 4 sets of changeover contacts are readily available.
Basic operation of a relay:
An electric current through a conductor will produce a magnetic field at right angles to
the direction of electron flow. If that conductor is wrapped into a coil shape, the magnetic
field produced will be oriented along the length of the coil. The greater current, the greater
strength of the magnetic field, all other factors being equal.
Fig 4.15 Operation of Relay circuit diagram
Inductors react against changes in current because of the energy stored in this
magnetic field. When we construct a transformer from two inductor coils around a common
iron core, we use this field to transfer energy from one coil to the other. However, there are
simpler and more direct uses for electromagnetic fields than the applications we've seen with
inductors and transformers. The magnetic field produced by a coil of current-carrying wire
can be used to exert a mechanical force on any magnetic object, just as we can use a
permanent magnet to attract magnetic objects, except that this magnet (formed by the coil)
can be turned on or off by switching the current on or off through the coil.
If we place a magnetic object near such a coil for the purpose of making that object
move when we energize the coil with electric current, we have what is called a solenoid. The
movable magnetic object is called an armature, and most armatures can be moved with either
direct current (DC) or alternating current (AC) energizing the coil. The polarity of the
magnetic field is irrelevant for the purpose of attracting an iron armature. Solenoids can be
used to electrically open door latches, open or shut valves, move robotic limbs, and even
actuate electric switch mechanisms and is used to actuate a set of switch contacts
Relays can be categorized according to the magnetic system and operation:
Neutral Relays
This is the most elementary type of relay. The neutral relays have a magnetic coil,
which operates the relay at a specified current, regardless of the polarity of the voltage
applied.
Biased Relays
Biased relays have a permanent magnet above the armature. The relay operates if the
current through the coil winding establishes a magneto-motive force that opposes the flux by
the permanent magnet. If the fluxes are in the same direction, the relay will not operate, even
for a greater current through the coil.
Polarized Relays
Like the biased relays, the polarized relays operate only when the current through the
coil in one direction. But there the principle is different. The relay coil has a diode connected
in series with it. This blocks the current in the reverse direction.
The major difference between biased relays and polarized relays is that the former
allows the current to pass through in the reverse direction, but does the not operate the relay
and the later blocks the current in reverse direction. You can imagine how critical these
properties when relays are connected in series to form logic circuits.
Magnetic Stick Relays or Perm polarized Relays
These relays have a magnetic circuit with high permanence. Two coils, one to operate
(pick up) and one to release (drop) are present. The relay is activated by a current in the
operate coil. On the interruption of the current the armature remains in picked up position by
the residual magnetism. The relay is released by a current through the release coil.
Slow Release Relays
These relays have a capacitor connected in parallel to their coil. When the operating current is
interrupted the release of relay is delayed by the stored charge in the capacitor. The relay
releases as the capacitor discharges through the coil.
Relays for AC
These are neutral relays and picked up for a.c. current through their coil. These are
very fast in action and used on power circuits of the point motors, where high current flows
through the contacts. A normal relay would be slow and make sparks which in turn may weld
the contacts together.
All relays have two operating values (voltages), one pick-up and the other other drop
away. The pick-up value is higher than the drop away value.
Applications
 To control a high-voltage circuit with a low-voltage signal, as in some types of
modems or audio amplifiers,
 To control a high-current circuit with a low-current signal, as in the starter solenoid of
an automobile,
 To detect and isolate faults on transmission and distribution lines by opening and
closing circuit breakers (protection relays),
CHAPTER- 5
SOFTWARE TOOL DESCRIPTION
5.1 Introduction to C
C is a general-purpose, high-level language that was originally developed by Dennis M.
Ritchie to develop the UNIX operating system at Bell Labs. C was originally first
implemented on the DEC PDP-11 computer in 1972.
In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available description
of C, now known as the K&R standard.
The UNIX operating system, the C compiler, and essentially all UNIX application programs
have been written in C. C has now become a widely used professional language for various
reasons:
 Easy to learn
 Structured language
 It produces efficient programs
 It can handle low-level activities
 It can be compiled on a variety of computer platforms
Facts about C
 C was invented to write an operating system called UNIX.
 C is a successor of B language which was introduced around the early 1970s.
 The language was formalized in 1988 by the American National Standard Institute
(ANSI).
 The UNIX OS was totally written in C.
 Today C is the most widely used and popular System Programming Language.
 Most of the state-of-the-art software have been implemented using C.
 Today's most popular Linux OS and RDBMS MySQL have been written in C.
Why Use C?
C was initially used for system development work, particularly the programs that make-up
the operating system. C was adopted as a system development language because it produces
code that runs nearly as fast as the code written in assembly language. Some examples of the
use of C might be:
 Operating Systems
 Language Compilers
 Assemblers
 Text Editors
 Print Spoolers
 Network Drivers
 Modern Programs
 Databases
 Language Interpreters
 Utilities
5.2 Kiel µVision Software
It is possible to create the source files in a text editor such as Notepad, run the
Compiler on each C source file, specifying a list of controls, run the Assembler on each
Assembler source file, specifying another list of controls, run either the Library Manager or
Linker (again specifying a list of controls) and finally running the Object-HEX Converter to
convert the Linker output file to an Intel Hex File. Once that has been completed the Hex File
can be downloaded to the target hardware and debugged. Alternatively KEIL can be used to
create source files; automatically compile, link and covert usingoptions set with an easy to
use user interface and finally simulate or perform debugging on with access to C variables
and memory. Unless you have to use the tolls on the command line, the choice is clear. KEIL
Greatly simplifies the process of creating and testing an embedded application.
By using softwares Kiel uvision 4 and flash magic using we will get out puts.
Step 1: Give a double click on u vision 4 icon on the desk top, it will generate a window as
shown below.
Step 2: To create new project go to project select new micro vision project.
Step 3: select a drive where you would like to create your project.
Step 4: Create a new folder and name it with your project name.
Step 5: Open that project folder and give a name of your project executable file and save it.
Step 6: After saving it will show some window there you select your microcontroller
company i.e., NXP from Phillips.
Step 7: Select your chip as LPC2148
Step 8: After selecting chip click on OK then it will display some window asking to add
STARTUP file. Select YES.
Step 9: A target is created and start-up files is added to your project target
Step 10:To write your project code select a new file from FILE menu bar.
Step 11: It will display some text editor, to save that file select SAVE option from FILE
menu bar.
Step 12: By giving a file name with extension .C for c files and save it.
Step 13: Write the code of your project and save it.
Step 14: To add our c file to target give a right click on Source Group, choose “ADD files
to Group” option.
Step 15: It will display some window there select the file you have to add and click on
ADD option.
Step 16: The file will be added to our target and it shows in the project window.
Step 17:Now give a right click on target in the project window and select “Options for
Target”.
Step 18: It will show some window,in that go to output option and choose Create Hex file
option by selecting that box.
Step 19:In the same window go to Linker option and choose Use Memory Layout from
Target Dialog by selecting the box, and click OK.
Step 20: Now to Compile your project go to Project select Build Target option or pressF7.
Step 21: In the build OUT PUT window you can see the errors and warnings if there in
your code. And here your project Hex file will be created.
5.3 Flash Magic:
Features:
 Straightforward and intuitive user interface
 Five simple steps to erasing and programming a device and setting any options
desired
 Programs Intel Hex Files
 Automatic verifying after programming
 Fills unused flash to increase firmware security
 Ability to automatically program checksums. Using the supplied checksum
calculation routine your firmware can easily verify the integrity of a Flash
block, ensuring no unauthorized or corrupted code can ever be executed
 Program security bits
 Check which Flash blocks are blank or in use with the ability to easily erase
all blocks in use
 Read the device signature
 Read any section of Flash and save as an Intel Hex File
 Reprogram the Boot Vector and Status Byte with the help of confirmation
features that prevent accidentally programming incorrect values
 Displays the contents of Flash in ASCII and Hexadecimal formats
 Single-click access to the manual, Flash Magic home page and NXP
Microcontrollers home page
 Ability to use high-speed serial communications on devices that support it.
Flash Magic calculates the highest baud rate that both the device and your PC
can use and switches to that baud rate transparently
 Command Line interface allowing Flash Magic to be used in IDEs and Batch
Files
 supports half-duplex communications
 Verify Hex Files previously programmed
 This enables us to send commands to place the device in Boot ROM mode,
with support for command line interfaces. The installation includes an
example project for the Keil and Raisonance 8051 compilers that show how to
build support for this feature into applications.
CHAPTER-6
CONCLUSION AND FUTURE SCOPE
CONCLUSION
An intelligent power monitoring and control system has been designed and developed
toward the implementation of a smart building. The developed system effectively monitors
and controls the electrical appliance usages at an elderly home. Thus, the real-time
monitoring of the electrical appliances can be viewed through a website. The system can be
extended for monitoring the whole smart building. The sensor networks are programmed with
various user interfaces suitable for users of varying ability and for expert users such that the
system can be maintained easily and interacted with very simply. This study also aims to
assess consumer’s response toward perceptions of smart grid technologies, their advantages
and disadvantages, possible concerns, and overall perceived utility.
FUTURE SCOPE
In future the system will be integrated with co-systems like smart home inhabitant
behaviour recognition systems to determine the wellness of inhabitant in terms of energy
consumption.
REFERENCES
[1] D. Man Han and J. Hyun Lim, “Smart home energy management system using IEEE
802.15.4 and zigbee,” IEEE Trans. Consumer Electron. vol. 56 ,no. 3, pp. 1403–
1410,Aug2010.
[2] E. Andrey and J. Morelli, “Design of a smart meter techno-economic model for electric
utilities in Ontario,” in Proc. IEEE- Electric Power Energy Conf., 2010, pp.
[3] F. Benzi, N. Anglani, E. Bassi, and L. Frosini, “Electricity smart meters interfacing the
households,” IEEE Trans. Ind. Electron., vol. 58, no. 10, pp. 4487– 4494, Oct. 2011.
[4] J. Han, C. S. Choi, and I. Lee, “More efficient home energy management system based
on zigbee communication and infrared remote con trols,” IEEE Trans. Consumer Electron.,
vol. 57, no. 1, pp. 85–89, Feb. 2011.
[5] M. S. Pan, L. W. Yeh, Y. A. Chen, Y. H. Lin, and Y. C. Tseng, “A WSN based
intelligent light control system considering user activities and profiles,” IEEE Sensors J., vol.
8, no.10, pp. 1710–1721, Oct. 2008.
[6] Janani Prasad, Indumathi.S, “ Energy Conservation in smart home using Lab VIEW”,
International Conference on Computing and Control Engineering (ICCCE 2012), 12 & 13
April, 2012 ISBN 978
[7] Nagender Kumar Suryadevara, Subhas Chandra Mukhopadhyay, Tebje Kelly, and
Satinder Pal Singh Gill,“WSN- Based Smart Sensors and Actuator for Power Management in
Intelligent Buildings” , IEEE/ASME Transactions On Mechatronics.
[8 ]Suryadevara, N.K.Mukhopadhyay, S.C. Kelly, S.D.T.; Gill, S.P.S., "WSN-Based Smart
Sensors and Actuator for Power Management in Intelligent Buildings,", IEEE/ASME
Transactions onMechatronics, vol.20, no.2, pp.564,571, April 2015
http://www.nxp.com/documents/data_sheet/LPC2141_42_44_46_48.pdf
]http://www.engineersgarage.com/electroniccomponents/16x2lcd-module-datasheet
ANNEXURE
SOURCE CODE:
#include "pwr_management_buildings_header.h"
int main()
{
char recv;
IODIR0 |= (BUZZER);
IODIR1 |= (LCD | LOADS);
ADC0_Init();
start:
IOCLR1 = LOADS;
IOCLR0 = BUZZER;
delay(100);
lcd_init();
lcd_str(1,1,"SYSTEM ACTIVE");
serial_init();
uart0_str("SYSTEM ACTIVE");
ADC0_Channel_2();
ADC0_Channel_3();
uart0_str("rnnLOADS ACTIVATED. Current Usage ");
uart0_tx((current/100)+48);
uart0_tx(((current%100)/10)+48);
uart0_tx('.');
uart0_tx((current%10)+48);
current = current/10;
uart0_str("A. rnTo Know the Current Status Enter '?'rnn");
uart0_str("PRESS '1' to SWITCH ON Load 1rn");
uart0_str("PRESS '2' to SWITCH ON Load 2rn");
uart0_str("PRESS '3' to SWITCH OFF Load 1rn");
uart0_str("PRESS '4' to SWITCH OFF Load 2rn");
lcd_str(2,1,"L1,2:OFF,OFF ");
if(U0LSR & 0x01)
{
recv = U0RBR;
if(recv == '1')
{
load1_flag = ON;
IOSET1 = LOAD1;
uart0_str("LOAD1 SWITCHED ONrn");
}
else if(recv == '2')
{
load2_flag = ON;
IOSET1 = LOAD2;
uart0_str("LOAD2 SWITCHED ONrn");
}
else if(recv == '3')
{
load1_flag = OFF;
IOCLR1 = LOAD1;
uart0_str("LOAD1 SWITCHED OFFrn");
}
else if(recv == '4')
{
load2_flag = OFF;
IOCLR1 = LOAD2;
uart0_str("LOAD2 SWITCHED OFFrn");
}
else if(recv == '*')
{
}
else if(recv == '?')
{
if(load1_flag == ON)
uart0_str("rnLOAD1 SWITCHED ONrn");
else
uart0_str("rnLOAD1 SWITCHED OFFrn");
if(load2_flag == ON)
uart0_str("LOAD2 SWITCHED ONrn");
else
uart0_str("LOAD2 SWITCHED OFFrn");
}
delay(100);
uart0_str("Current: ");
uart0_tx(((current%10000)/1000)+48);
uart0_tx(((current%1000)/100)+48);
uart0_tx('.');
uart0_tx(((current%100)/10)+48);
uart0_tx((current%10)+48);
uart0_str("Arnn");
lcd_str(2,6," ");
if(load1_flag == ON)
lcd_str(2,6,"ON");
else
lcd_str(2,6,"OFF");
if(load2_flag == ON)
lcd_str(0,0,",ON");
else
lcd_str(0,0,",OFF");
}
if(current >= 110)
{
IOCLR1 = LOADS;
load1_flag = load2_flag = load3_flag = 0;
IOSET0 = BUZZER;
uart0_str("rnnHight Current Usage ");
uart0_tx(((current%10000)/1000)+48);
uart0_tx(((current%1000)/100)+48);
uart0_tx('.');
uart0_tx(((current%100)/10)+48);
uart0_tx((current%10)+48);
uart0_str("A Detected. Power Switched OFF.rn");
uart0_str("Please Check the Condition and Enter '#' torn");
uart0_str("Activate the LOADS or Reset the Kitrnn");
delay(500);
IOCLR0 = BUZZER;
rep:
if(U0LSR & 0x01)
recv = U0RBR;
else
recv = 0;
lcd_str(2,1,"HIGH CURRENT ");
delay(200);
if(recv == '#')
goto ok;
if(U0LSR & 0x01)
recv = U0RBR;
else
recv = 0;
lcd_str(2,1,"USAGE DTECTED. ");
delay(200);
if(recv == '#')
goto ok;
if(U0LSR & 0x01)
recv = U0RBR;
else
recv = 0;
lcd_str(2,1,"CHECK THE COND. ");
delay(200);
if(recv == '#')
goto ok;
if(U0LSR & 0x01)
recv = U0RBR;
else
recv = 0;
lcd_str(2,1," & Restart KIT ");
delay(200);
if(recv == '#')
goto ok;
goto rep;
ok:
IOCLR1 = LOADS;
goto start;
}
delay(100);
IOCLR0 = BUZZER;
}
}
void delay(unsigned int val)
{
unsigned int i,j;
for(i=0;i<val;i++)
for(j=0;j<25000;j++);
}

More Related Content

What's hot

Energy efficient wireless technology
Energy efficient wireless technologyEnergy efficient wireless technology
Energy efficient wireless technology
Eisha Madhwal
 
Energy Efficient Wireless Communications
Energy Efficient Wireless CommunicationsEnergy Efficient Wireless Communications
Energy Efficient Wireless Communications
Jingon Joung
 
Smart Home EEF
Smart Home EEFSmart Home EEF
Smart Home EEF
Abdullah Topçu
 
KNX introduction
KNX introductionKNX introduction
KNX introduction
João Portela
 
Micro Electronic Pill
Micro Electronic PillMicro Electronic Pill
Micro Electronic Pill
Darani Daran
 
SMART DUST
SMART DUSTSMART DUST
SMART DUST
Khyravdhy Tannaya
 
Smart dust using mems
Smart dust using memsSmart dust using mems
Smart dust using mems
venkatesh nayakoti
 
Smart Home / Smart Office
Smart Home / Smart OfficeSmart Home / Smart Office
Smart Home / Smart Office
Karl Seiler
 
Wireless microservers
Wireless microserversWireless microservers
Wireless microservers
rajesh killamsetti
 
Electronic Pills
Electronic PillsElectronic Pills
Electronic Pills
Burhanuddin Kapadia
 
Smart Antenna for mobile communication
Smart Antenna for mobile communicationSmart Antenna for mobile communication
Smart Antenna for mobile communication
Yasoob raza
 
Gsm based home(ppt)
Gsm based home(ppt)Gsm based home(ppt)
Gsm based home(ppt)
kjabraham007
 
Brain controlled-car-for-disabled
Brain controlled-car-for-disabledBrain controlled-car-for-disabled
Brain controlled-car-for-disabled
shahnaazmd
 
Turn on 5G with Ericsson 5G Platform
Turn on 5G with Ericsson 5G PlatformTurn on 5G with Ericsson 5G Platform
Turn on 5G with Ericsson 5G Platform
Ericsson
 
FLEXIBLE ELECTRONIC SKIN
FLEXIBLE ELECTRONIC SKINFLEXIBLE ELECTRONIC SKIN
FLEXIBLE ELECTRONIC SKIN
Aryan Jain
 
THE SMART OFFICE USING IOT
THE SMART OFFICE USING IOTTHE SMART OFFICE USING IOT
THE SMART OFFICE USING IOT
live_and_let_live
 
smart dust
smart dustsmart dust
smart dust
KARTHIKLINGALA
 
Wireless greenhouse environment monitoring through sensors
Wireless greenhouse environment monitoring through sensorsWireless greenhouse environment monitoring through sensors
Wireless greenhouse environment monitoring through sensors
Sudhanshu Tripathi
 
Microelectronic pill
Microelectronic pillMicroelectronic pill
Microelectronic pill
nirmalk1503
 
Human Area Networking Technology
Human Area Networking TechnologyHuman Area Networking Technology
Human Area Networking Technology
Vinayak Hegde
 

What's hot (20)

Energy efficient wireless technology
Energy efficient wireless technologyEnergy efficient wireless technology
Energy efficient wireless technology
 
Energy Efficient Wireless Communications
Energy Efficient Wireless CommunicationsEnergy Efficient Wireless Communications
Energy Efficient Wireless Communications
 
Smart Home EEF
Smart Home EEFSmart Home EEF
Smart Home EEF
 
KNX introduction
KNX introductionKNX introduction
KNX introduction
 
Micro Electronic Pill
Micro Electronic PillMicro Electronic Pill
Micro Electronic Pill
 
SMART DUST
SMART DUSTSMART DUST
SMART DUST
 
Smart dust using mems
Smart dust using memsSmart dust using mems
Smart dust using mems
 
Smart Home / Smart Office
Smart Home / Smart OfficeSmart Home / Smart Office
Smart Home / Smart Office
 
Wireless microservers
Wireless microserversWireless microservers
Wireless microservers
 
Electronic Pills
Electronic PillsElectronic Pills
Electronic Pills
 
Smart Antenna for mobile communication
Smart Antenna for mobile communicationSmart Antenna for mobile communication
Smart Antenna for mobile communication
 
Gsm based home(ppt)
Gsm based home(ppt)Gsm based home(ppt)
Gsm based home(ppt)
 
Brain controlled-car-for-disabled
Brain controlled-car-for-disabledBrain controlled-car-for-disabled
Brain controlled-car-for-disabled
 
Turn on 5G with Ericsson 5G Platform
Turn on 5G with Ericsson 5G PlatformTurn on 5G with Ericsson 5G Platform
Turn on 5G with Ericsson 5G Platform
 
FLEXIBLE ELECTRONIC SKIN
FLEXIBLE ELECTRONIC SKINFLEXIBLE ELECTRONIC SKIN
FLEXIBLE ELECTRONIC SKIN
 
THE SMART OFFICE USING IOT
THE SMART OFFICE USING IOTTHE SMART OFFICE USING IOT
THE SMART OFFICE USING IOT
 
smart dust
smart dustsmart dust
smart dust
 
Wireless greenhouse environment monitoring through sensors
Wireless greenhouse environment monitoring through sensorsWireless greenhouse environment monitoring through sensors
Wireless greenhouse environment monitoring through sensors
 
Microelectronic pill
Microelectronic pillMicroelectronic pill
Microelectronic pill
 
Human Area Networking Technology
Human Area Networking TechnologyHuman Area Networking Technology
Human Area Networking Technology
 

Similar to WSN BASED SMART SENSORS AND ACTUATORS FOR POWER MANAGEMENTIN INTELLIGENT BUILDINGS PROJECT FINAL DOCUMENT

Design and Implementation of IOT Based Smart Power Monitoring and Management ...
Design and Implementation of IOT Based Smart Power Monitoring and Management ...Design and Implementation of IOT Based Smart Power Monitoring and Management ...
Design and Implementation of IOT Based Smart Power Monitoring and Management ...
ijesajournal
 
DESIGN AND IMPLEMENTATION OF IOT BASED SMART POWER MONITORING AND MANAGEMENT ...
DESIGN AND IMPLEMENTATION OF IOT BASED SMART POWER MONITORING AND MANAGEMENT ...DESIGN AND IMPLEMENTATION OF IOT BASED SMART POWER MONITORING AND MANAGEMENT ...
DESIGN AND IMPLEMENTATION OF IOT BASED SMART POWER MONITORING AND MANAGEMENT ...
ijesajournal
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
theijes
 
[IJET V2I3P5] Authors: Jamuna H G, Shobha Hugar
[IJET V2I3P5] Authors: Jamuna H G, Shobha Hugar[IJET V2I3P5] Authors: Jamuna H G, Shobha Hugar
[IJET V2I3P5] Authors: Jamuna H G, Shobha Hugar
IJET - International Journal of Engineering and Techniques
 
White paper tower power, inc. energy management, iot,
White paper tower power, inc.   energy management, iot, White paper tower power, inc.   energy management, iot,
White paper tower power, inc. energy management, iot,
Volkmar Kunerth
 
A Comprehensive Review of Artificial Neural Network Techniques Used for Smart...
A Comprehensive Review of Artificial Neural Network Techniques Used for Smart...A Comprehensive Review of Artificial Neural Network Techniques Used for Smart...
A Comprehensive Review of Artificial Neural Network Techniques Used for Smart...
ssuser793b4e
 
29 9136 eee learning manuscript on power (edit lafi)
29 9136 eee   learning manuscript on power (edit lafi)29 9136 eee   learning manuscript on power (edit lafi)
29 9136 eee learning manuscript on power (edit lafi)
IAESIJEECS
 
IOT Based Smart Power Management System using WSN
IOT Based Smart Power Management System using WSNIOT Based Smart Power Management System using WSN
IOT Based Smart Power Management System using WSN
IRJET Journal
 
Wireless Sensor Networks
Wireless Sensor NetworksWireless Sensor Networks
Wireless Sensor Networks
abdullah roomi
 
IoT Enabled Smart Grid
IoT Enabled Smart GridIoT Enabled Smart Grid
IoT Enabled Smart Grid
ijsrd.com
 
Advance Metering Infrastructure:Smart Meter
Advance Metering Infrastructure:Smart MeterAdvance Metering Infrastructure:Smart Meter
Advance Metering Infrastructure:Smart Meter
MD NAWAZ
 
Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...
Ecwaytech
 
Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...
ecwayerode
 
IRJET- IOT Based Residence Energy Control System
IRJET- IOT Based Residence Energy Control SystemIRJET- IOT Based Residence Energy Control System
IRJET- IOT Based Residence Energy Control System
IRJET Journal
 
Journal new horizons volume 81-82
Journal new horizons volume 81-82Journal new horizons volume 81-82
Journal new horizons volume 81-82
Muhammad Saad Ali
 
Instant Access of Power Usage through IP Enabled Electronic Power Meter
Instant Access of Power Usage through IP Enabled Electronic Power MeterInstant Access of Power Usage through IP Enabled Electronic Power Meter
Instant Access of Power Usage through IP Enabled Electronic Power Meter
IJERD Editor
 
Dw4301735740
Dw4301735740Dw4301735740
Dw4301735740
IJERA Editor
 
Dlodlo (2013), towards a demand side smart domestic electrical energy managem...
Dlodlo (2013), towards a demand side smart domestic electrical energy managem...Dlodlo (2013), towards a demand side smart domestic electrical energy managem...
Dlodlo (2013), towards a demand side smart domestic electrical energy managem...
Maulana Norman Kharis
 
Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...
Ecwayt
 
Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...
Ecwaytech
 

Similar to WSN BASED SMART SENSORS AND ACTUATORS FOR POWER MANAGEMENTIN INTELLIGENT BUILDINGS PROJECT FINAL DOCUMENT (20)

Design and Implementation of IOT Based Smart Power Monitoring and Management ...
Design and Implementation of IOT Based Smart Power Monitoring and Management ...Design and Implementation of IOT Based Smart Power Monitoring and Management ...
Design and Implementation of IOT Based Smart Power Monitoring and Management ...
 
DESIGN AND IMPLEMENTATION OF IOT BASED SMART POWER MONITORING AND MANAGEMENT ...
DESIGN AND IMPLEMENTATION OF IOT BASED SMART POWER MONITORING AND MANAGEMENT ...DESIGN AND IMPLEMENTATION OF IOT BASED SMART POWER MONITORING AND MANAGEMENT ...
DESIGN AND IMPLEMENTATION OF IOT BASED SMART POWER MONITORING AND MANAGEMENT ...
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
 
[IJET V2I3P5] Authors: Jamuna H G, Shobha Hugar
[IJET V2I3P5] Authors: Jamuna H G, Shobha Hugar[IJET V2I3P5] Authors: Jamuna H G, Shobha Hugar
[IJET V2I3P5] Authors: Jamuna H G, Shobha Hugar
 
White paper tower power, inc. energy management, iot,
White paper tower power, inc.   energy management, iot, White paper tower power, inc.   energy management, iot,
White paper tower power, inc. energy management, iot,
 
A Comprehensive Review of Artificial Neural Network Techniques Used for Smart...
A Comprehensive Review of Artificial Neural Network Techniques Used for Smart...A Comprehensive Review of Artificial Neural Network Techniques Used for Smart...
A Comprehensive Review of Artificial Neural Network Techniques Used for Smart...
 
29 9136 eee learning manuscript on power (edit lafi)
29 9136 eee   learning manuscript on power (edit lafi)29 9136 eee   learning manuscript on power (edit lafi)
29 9136 eee learning manuscript on power (edit lafi)
 
IOT Based Smart Power Management System using WSN
IOT Based Smart Power Management System using WSNIOT Based Smart Power Management System using WSN
IOT Based Smart Power Management System using WSN
 
Wireless Sensor Networks
Wireless Sensor NetworksWireless Sensor Networks
Wireless Sensor Networks
 
IoT Enabled Smart Grid
IoT Enabled Smart GridIoT Enabled Smart Grid
IoT Enabled Smart Grid
 
Advance Metering Infrastructure:Smart Meter
Advance Metering Infrastructure:Smart MeterAdvance Metering Infrastructure:Smart Meter
Advance Metering Infrastructure:Smart Meter
 
Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...
 
Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...
 
IRJET- IOT Based Residence Energy Control System
IRJET- IOT Based Residence Energy Control SystemIRJET- IOT Based Residence Energy Control System
IRJET- IOT Based Residence Energy Control System
 
Journal new horizons volume 81-82
Journal new horizons volume 81-82Journal new horizons volume 81-82
Journal new horizons volume 81-82
 
Instant Access of Power Usage through IP Enabled Electronic Power Meter
Instant Access of Power Usage through IP Enabled Electronic Power MeterInstant Access of Power Usage through IP Enabled Electronic Power Meter
Instant Access of Power Usage through IP Enabled Electronic Power Meter
 
Dw4301735740
Dw4301735740Dw4301735740
Dw4301735740
 
Dlodlo (2013), towards a demand side smart domestic electrical energy managem...
Dlodlo (2013), towards a demand side smart domestic electrical energy managem...Dlodlo (2013), towards a demand side smart domestic electrical energy managem...
Dlodlo (2013), towards a demand side smart domestic electrical energy managem...
 
Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...
 
Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...Towards the implementation of io t for environmental condition monitoring in ...
Towards the implementation of io t for environmental condition monitoring in ...
 

More from N Harisha

Arm7 document
Arm7  documentArm7  document
Arm7 document
N Harisha
 
poka yoke seminar report with index
poka yoke seminar report with indexpoka yoke seminar report with index
poka yoke seminar report with index
N Harisha
 
POKA-YOKE REPORT IN PDF FORM
POKA-YOKE REPORT IN PDF FORMPOKA-YOKE REPORT IN PDF FORM
POKA-YOKE REPORT IN PDF FORM
N Harisha
 
poka yoke
poka yoke poka yoke
poka yoke
N Harisha
 
Seminar ppt
Seminar pptSeminar ppt
Seminar ppt
N Harisha
 
Harisha
HarishaHarisha
Harisha
N Harisha
 

More from N Harisha (6)

Arm7 document
Arm7  documentArm7  document
Arm7 document
 
poka yoke seminar report with index
poka yoke seminar report with indexpoka yoke seminar report with index
poka yoke seminar report with index
 
POKA-YOKE REPORT IN PDF FORM
POKA-YOKE REPORT IN PDF FORMPOKA-YOKE REPORT IN PDF FORM
POKA-YOKE REPORT IN PDF FORM
 
poka yoke
poka yoke poka yoke
poka yoke
 
Seminar ppt
Seminar pptSeminar ppt
Seminar ppt
 
Harisha
HarishaHarisha
Harisha
 

Recently uploaded

Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
PauloRodrigues104553
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
ssuser36d3051
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 

Recently uploaded (20)

Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 

WSN BASED SMART SENSORS AND ACTUATORS FOR POWER MANAGEMENTIN INTELLIGENT BUILDINGS PROJECT FINAL DOCUMENT

  • 2. 1.1 INTRODUCTION The WSNs are increasingly being used in the home for energy controlling services. Regular household appliances are monitored and controlled by WSNs installed in the home. New technologies include cutting-edge advancements in Information technology, sensors, metering, transmission, distribution, and electricity storage technology, as well as providing new information and flexibility to both consumers and providers of electricity. The ZigBee Alliance, wireless communication platform is presently examining Japan’s new smart home wireless system implication by having a new initiative with Japan’s Government that will evaluate use of the forthcoming ZigBee, Internet Protocol (IP) specification. There are several proposals to interconnect various domestic appliances by wireless networks to monitor and control such as provided. But the prototypes are verified using test bed scenarios. Also, smart meter systems like have been designed to specific usages particularly related to geographical usages and are limited to specific places. Different information and communication technologies integrating with smart meter devices have been proposed and tested at different flats in a residential area for optimal power utilization but individual controlling of the devices are limited to specific houses. Wireless sensor network (WSN), which integrates sensor technology, wireless communication technology, embedded computing technology and distributed information management technology, has been under rapid development during recent years.A wireless sensor network is a collection of nodes organized into an interactive network. Each node consists of processing capability (one or more microcontroller’s chips) and contains types of memory, with a Zigbee transceiver module and also, each node have a stable power source and the last part of a node, it is accommodate various sensors and actuators. The nodes communicate wirelessly and often self-organize after being deployed in an ad hoc method. Such systems can revolutionize the way we live and work therefore in this project we want to use WSN technology to control and manage energy in building.
  • 3. Fig 1.1: Wireless sensor network 1.2 Motivation of the Project It is foreseen that service and personal care, wireless mice- tonic systems will become more and more ubiquitous at home in the near future and will be very useful in assistive healthcare particularly for the elderly and disabled people. Wireless Mechatronic systems consist of numerous spatially distributed sensors with limited data collection and processing capability to monitor the environmental situation. Wireless sensor networks (WSNs) have become increasingly important because of their ability to monitor and manage situational information for various intelligent service. Different information and communication technologies integrating with smart meter devices have been proposed and tested at different flats in a residential area for Optimal power utilization but individual controlling of the devices are limited to specific houses. 1.3 Objective of the Project There has been designing and developments of smart meters Predicting the usage of power consumption. However, a low-cost, flexible, and robust system to Continuously monitor and control based on consumer requirements is at the early stages of development. In this study, we have designed and implemented a ZigBee-based intelligent home energy management and control service.
  • 4. 1) Use of Triac with Opto-isolated driver for controlling electrical appliances: usehold appliances are controlled either remotely or automatically with the help of fabricated smart sensing units consisting of triac –BT138. 2) The design of smart sensing unit does not require a processing unit at the sensing end. 3) Flexibility in controlling the appliances: Depending on the user requirements, appliances can be monitored and controlled in different ways. Section III-B discusses about the various options of controlling the devices. 1.4 What is “Intelligent Buildings”? The Intelligent Building Institute defines an intelligent building as: ““…. one that provides a productive and cost-effective environment through optimization of its four basic elements – structure, systems, services and management – and the interrelationships between them. Intelligent buildings help building owners, property managers and occupants realise their goals in the area of cost, energy management, comfort, convenience, safety, long term flexibility and marketability.” (Caffrey 1985). These buildings are characterized by three features (Wong et al.,2005):  Automated control  The incorporation of occupant preferences and feedback  Learning ability (performance adjustment based on environmental and occupant changes) The concept of intelligent buildings was established 1982 by AT&T to demonstrate how advanced IT from different suppliers could be used in the intelligent building. Through the last more than 20 years there has often been a mismatch between what users expect from an intelligent building or smart house and what the suppliers were able to deliver. Often the intelligent building services was defined based on the available technologies and systems, rather than in terms of the goals and needs for services defined by the occupants which often led to situations, where the technology were inappropriate for the user needs resulting in reduced living quality, productivity as well as increasing costs. A typical technological view on Intelligent Buildings can be seen in figure 1, which illustrates how the development in communication protocols increase the integration of building services functions and communication functions in a building, with full integration – the Intelligent Building - as the goal.
  • 5. Fig 1.2 : Intelligent Buildings Definition A number of different definitions on intelligent buildings exist. Below is described just acouple: “An intelligent building is one that provides a productive and cost-effective environment through optimization of its four basic elements – structure, systems, services and management – and the interrelationships between them. Intelligent buildings help building owners, property managers and occupants realise their goals in the area of cost, energy management, comfort, convenience, safety, long term flexibility and marketability” by Caffrey 1985 "Intelligent buildings are buildings that through their physical design and IT installations are responsive, flexible and adaptive to changing needs from its users and the organisations that inhabit the building during it's life time. The building will supply services for its inhabitants, its administration and operation & maintenance. The intelligent building will accomplish transparent 'intelligent' behaviour have state memory, support human and
  • 6. installation systems communication, and be equipped with sensors and actuators" by Per Christiansson in his approach. “An intelligent building is one in which the building fabric, space, services and information systems can respond in an efficient manner to the initial and changing demands of the owner, the occupier and the environment” by Arup in 2004.
  • 8. 2.1 LITERATURE OVERVIEW Han et al. proposed a Home Energy Management System (HEMS) using the ZigBee technology to reduce the standby power. The suggested system consists of an automatic standby power cut-off outlet, a ZigBee hub and a server. The power outlet with a ZigBee module cuts off the ac power when the energy consumption of the device connected to the power outlet is below a fixed value. The central hub collects information from the power channels and controls these power channels through the ZigBee module. The central hub sends the present state information to a server and then a user can monitor or control the present energy usage using the HEMS user interface. This facility may create some uneasiness for the users. For example, if the users may want low intensity of light, for some situation but the system will cut the power off leading to darkness. Wireless sensor networks have become increasingly important because of their ability to monitor and manage situational information for various intelligent services. X.P.Liu, W.Gueaieb, S.C.Mukhopadhya, Warwick and Z.Yin reports some of the latest theoretical developments and applications in this fast-growing area. Mechatronic systems will become more and more ubiquitous at home in near future and will be very useful in assistive healthcare particularly for the elderly and disable people. Wireless mechatronic devices, services, and systems consisting of spatially distributed autonomous sensors are used to monitor globally or locally physical or environmental conditions, such as temperature, vibration, pressure, motion etc. WSN also has been applied in healthcare fields. Advances computer and communication technology have enabled online healthcare monitoring using miniature sensing devices attached to patient’s body. Data collected in this manner is delivered in real time trough one or more wireless hopes to the hospital network. J.Misic and V.B.Misic present an article in which they discuss design alternatives for the wireless portion of an online healthcare monitoring system and present performance results for a two-tier network that uses IEEE 802.15.4 low data rate wireless personal area networking (WPAN) for the patient’s body area network and IEEE 802.11b for the connection between the body area network coordinators and the wired portion of healthcare system. In the country like United States (US) some areas such as California and Texas, smart meters are almost fully deployed. From June 2011, 20 million i.e. 50% of all households equipped with smart meters and it is expected that the number will increase to approximately
  • 9. 65 million Meters by 2015.It is realistic estimate of the size of the home energy management market. M.S.Pan, L.W.Yeh, Y.A.Chen, Y.H.Lin and Y.C.Tseng presented A WSN based intelligent light control system considering user activities and profiles. In which wireless sensors are responsible for measuring current illuminations and the lights are controlled by applying the model of user’s actions and profiles for indoor environments, such as a home for a reduction in energy consumption. Suh and Ko proposed an intelligent home control system based on a wireless sensor/actuator network with a link quality indicator based routing protocol to enhance network reliability. It can integrate diversified physical sensing information and control various consumer home devices, with the support of active sensor networks having both sensor and actuator components. 2.2 Drawbacks of existing systems 2.2.1Viewable Pathway Correspondence To control the gadgets at the controlled segment a viewable pathway of correspondence is essential. Beforehand Existed correspondence framework is IR based, for IR correspondence a viewable pathway correspondence is essential. 2.2.2 It Covers Restricted Separation Just The separation secured by the line of correspondence framework is restricted. Despite the fact that it is RF based the separation scope is less. So the separation scope is fundamental disadvantage of the existed frameworks 2.2.3 Pure Relationship Arrangement Already existed frameworks are immaculate similarity. The gadgets and parts that are utilized as a part of the already existed frameworks are exceptionally essential and not propelled segments. Because of utilization of extremely fundamental segments the measure of framework may increment.
  • 10. 2.2.4 Limited Number of Operations With the current frameworks we can perform just barely numerical operations, on the grounds that these frameworks utilize just equipment part. So in light of equipment the no of operations of the framework chose. 2.2.5 No Predefined Charges Beforehand existed frameworks have no microcontroller part and no programming, so no predefined charges are existed. Even though it is controller part, the controller does not bolster the re programming choice. So, predefined summons are not accessible. 2.2.6 High Power Utilization Because of utilizing of the simple parts and gadgets, it devours the powerful because of utilizing of inductors and transistors. 2.2.7 Unintelligent These are not smaller scale controller based frameworks, so it can't identify the information arriving. So these frameworks are the un shrewd frameworks, correspondence that is built up by the current frameworks are not dependable some of the time. 2.3 Advantages of proposed system 2.3.1 Reliable Correspondence Correspondence started by the computerized radios is exceptionally solid. Here the computerized radio means GSM which is works at 2.4 GHz recurrence range. This is having an exceptional code for recognizing them in system. In view of that address remaining gadgets will speak with this gadget. 2.3.2 Unlimited Number of Operations Essentially our proposing framework is microcontroller based, by adjusting a bit of programming both at controller segment and controlled area we can perform boundless number of operations. 2.3.3 Pure Advanced Framework:
  • 11. Our proposed framework is small scale controlled frameworks; programming is required for working of that framework. So it is immaculate advanced framework. 2.3.4 Provides Security The correspondence started by the framework is, unadulterated computerized correspondence based framework. This correspondence framework gives some encoding and translating of the information operations. So it gives security while exchanging or accepting information. 2.3.5 Acknowledgement for Each Operation At whatever point we send some order to the controlled area, it can offer replay to the controller segment with respect to the activity performed at controlled area. 2.3.6 Status Evidence on LCD Show In past existing frameworks for status sign a LED is utilized, yet in proposed frameworks we are utilizing the LCD show for status evidence. We are utilizing two LCD show for both sides. 2.3.7 Low Power Consumption The segments and gadgets including the microcontroller are low power utilization modules. This devours low power for their operation. 2 .3.8 Reliable Operation Operations that are performed by the proposing frameworks are solid. 2.4 Applications 2.4.1 Shopping Centres We can use this framework in the shopping centres, on the grounds that shopping centres having the huge measure of the electrical apparatuses for guests. In any case, the guests search for their needs; they may not auto about the apparatuses that are running without vicinity of the guests. so framework is useful for controlling apparatuses to spare influence and cash as well. 2.4.2 Offices
  • 12. In workplaces additionally having vast measure of electrical machines and PCs are there, so workers takes think about their work just not about force sparing. a remote controlled force administration framework is useful for controlling electrical apparatuses without labour. 2.4.3 Educational Organizations In instructive associations like schools and universities, the understudies not having thought regarding influence sparing, a few understudies can works the electrical apparatuses seriously as a piece of fiendish things, it is unsafe for understudies and losing of influence and cash results. So, frameworks extremely accommodating to stay away from these lord things. 2.4.4 Hotels and Lodges Vacationers having no clue about the switch sheets for trigging the lights and fans. So with this framework they may feel great 2.4.5 Apartments Condo having such a variety of electrical apparatuses for the individuals who are living in that flat. Neighbours may not take think about the electrical apparatuses of the other than house. So therefore this framework is exceptionally useful in the trigging of electrical machines. 2.4.6 Houses In home, we are utilizing such a variety of apparatuses. Infrequently we may neglect to switch off the apparatuses when we are leaving that specific room or lobby.
  • 14. The hardware requirements are discussed in the preceding section. 3.1 Functional Block diagram Fig 3.1 Functional block diagram of the system 3.2 Block diagram description The system has been designed for measurement of electrical parameters of household appliances. Important functions to the system are the ease of modelling, setup, and use. From the consumer point of view, electrical power consumption of various appliances in a house along with supply voltage and current is the key parameter. Fig.3.1 shows the functional description of the developed system to monitor electrical parameters and control appliances based on the consumer requirements. The measurement of electrical parameters of home appliances is done by interfacing with fabricated sensing modules.. The output signals from the sensors are integrated and connected to XBee module for transmitting electrical parameters data wirelessly. The XBee modules are interfaced with various sensing devices and interconnected in the form of mesh topology to have reliable data reception at a centralized ZigBee coordinator. The maximum distance between the adjacent ZigBee nodes is less than 10 m, and through hopping technique of the mesh topology, reliable sensor fusion data has been performed. The ZigBee coordinator has been connected through the RS232 cable of the host computer, which stores the data into a database of computer system. The collected sensor fusion data have been sent
  • 15. to an internet residential gateway for remote monitoring and controlling the home environment. By analysing the power from the system, energy consumption can be controlled. An electricity tariff plan has been set up to run various appliances at peak and off- peak tariff rates. The appliances are controlled either automatically or manually (local/remotely). The smart power metering circuit is connected to mains 240 V/50 Hz supply. 3.3 Detailed block diagram 1) Slave mode: Fig 3.2 Slave mode Micro Controller RELAY LOAD3 LCD Display Power supply MAX232 Low Side Power Supply 5 or 3.3v RELAY LOAD1 RELAY LOAD2
  • 16. Mastermode: Fig 3.3 Master mode 3.4 Hardware tools used in this project  Arm7 Microcontroller  MAX 232  LCD  Zig-bee pair  Relay(12/5 v)  Different loads bulbs/fans 3.5 Software Tools  Programming language: Embedded c  Development tool: Kiel u Vision and flash magic 3.6 Functions of each block 3.6.1 Micro controller This section forms the control unit of the whole project. This section basically consists of a Microcontroller with its associated circuitry like Crystal with capacitors, Reset circuitry, Pull up resistors (if needed) and so on. The Microcontroller forms the heart of the project because it controls the devices being interfaced and communicates with the devices according to the program being written. PC Power Supply Keys
  • 17. 3.6.2 ARM7TDMI ARM is the abbreviation of Advanced RISC Machines, it is the name of a class of processors, and is the name of a kind technology too. The RISC instruction set, and related decode mechanism are much simpler than those of Complex Instruction Set Computer (CISC) designs. It takes the power value from the power measurement IC and compares it with the threshold value set by the control unit and accordingly takes the controlling action like whether to keep device ON or switch it OFF. It also takes corrective action for power factor improvement. 3.6.3 Liquid-crystal display LCD is a flat panel display, electronic visual display that uses the light modulation properties of liquid crystals. Liquid crystals do not emit light directly. LCDs are available to display arbitrary images or fixed images which can be displayed or hidden, such as preset words, digits, and 7-segment displays as in a digital clock. 3.6.4 ZIGBEE Zigbee modules feature a UART interface, which allows any microcontroller or microprocessor to immediately use the services of the Zigbee protocol. All a Zigbee hardware designer has to do in this is ensure that the host’s serial port logic levels are compatible with the XBee’s 2.8- to 3.4-V logic levels. The logic level conversion can be performed using either a standard RS-232 IC or logic level translators such as the 74LVTH125 when the host is directly connected to the XBee UART. The X-Bee RF Modules interface to a host device through a logic-level asynchronous Serial port. Through its serial port, the module can communicate with any logic and voltage Compatible UART; or through a level translator to any serial device. Data is presented to the X-Bee module through its DIN pin, and it must be in the asynchronous serial format, which consists of a start bit, 8 data bits, and a stop bit. Because the input data goes directly into the input of a UART within the XBee module, no bit inversions are necessary within the asynchronous serial data stream. All of the required timing and parity checking is automatically taken care of by the X-Bee’s UART. 3.6.6 Power Supply:
  • 18. The input to the circuit is applied from the regulated power supply. The ac. input i.e., 230V from the mains supply is step down by the transformer to 12V and is fed to a rectifier. The output obtained from the rectifier is a pulsating dc voltage. So in order to get a pure dc voltage, the output voltage from the rectifier is fed to a filter to remove any ac components present even after rectification. Now, this voltage is given to a voltage regulator to obtain a pure constant dc voltage.
  • 20. 4.1 ARM – ADVANCED RISC MACHINE (LPC 2148) The LPC2148 microcontrollers are based on a 32 bit ARM7TDMI-S CPU with real- time emulation and embedded trace support, that combines the microcontroller with embedded high speed flash memory ranging from 32 kB to 512 kB. A 128-bit wide memory interface and unique accelerator architecture enable 32-bit code execution at the maximum clock rate. For critical code size applications, the alternative 16-bit Thumb mode reduces code by more than 30 % with minimal performance penalty. Due to the tiny size and low power consumption, LPC2148 is ideal for applications where miniaturization is a key requirement, such as access control and point-of-sale. A blend of serial communications interfaces ranging from a USB 2.0 Full Speed device, multiple UARTs, SPI, SSP to I2Cs, and on-chip SRAM of 8 kB up to 40 kB, make these devices very well suited for communication gateways and protocol converters, soft modems, voice recognition and low end imaging, providing both large buffer size and high processing power. Various 32-bit timers, single or dual 10-bit ADC(s), 10-bit DAC, PWM channels and 45 fast GPIO lines with up to nine edge or level sensitive external interrupt pins make these microcontrollers particularly suitable for industrial control and medical systems. FEATURES  16/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.  8 to 40 KB of on-chip static RAM and 32 to 512 KB of on-chip flash program memory.  128 bit wide interface/accelerator enables high speed 60 MHz operation.  In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software. Single flash sector or full chip erase in 400 ms and programming of 256 bytes in 1 ms.  USB 2.0 Full Speed compliant Device Controller with 2 KB of endpoint RAM.  In addition, LPC2148 provides 8 KB of on-chip RAM accessible to USB by DMA.  Two 10-bit A/D converters provide a total of 6/14 analog inputs, with conversion times as low as 2.44 micros per channel.  Single 10-bit D/A converter provides variable analog output.  Two 32-bit timers/external event counters (with four captures and four compare channels each), PWM unit (six outputs) and watchdog.
  • 21.  Low power real-time clock with independent power and dedicated 32 kHz clock input.  Multiple serial interfaces including two UARTs (16C550), two Fast I2C-buses  (400 Kbit/s), SPI and SSP with buffering and variable data length capabilities.  Vectored interrupt controller with configurable priorities and vector addresses.  Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.  Up to nine edge or level sensitive external interrupt pins available. 4.1.1 ARCHITECTURAL OVERVIEW The LPC2148 consists of an ARM7TDMI-S CPU with emulation support, the ARM7 Local Bus for interface to on-chip memory controllers, the AMBA Advanced High- performance Bus (AHB) for interface to the interrupt controller, and the ARM Peripheral Bus (APB, a compatible superset of ARM’s AMBA Advanced Peripheral Bus) for connection to on-chip peripheral functions. The LPC2148 configures the ARM7TDMI-S processor in little- endian byte order. AHB peripherals are allocated a 2 megabyte range of addresses at the very top of the 4 gigabyte ARM memory space. Each AHB peripheral is allocated a 16 kB address space within the AHB address space. LPC2148 peripheral functions (other than the interrupt controller) are connected to the APB bus. The AHB to APB bridge interfaces the APB bus to the AHB bus. APB peripherals are also allocated a 2 megabyte range of addresses, beginning at the 3.5 gigabyte address point. Each APB peripheral is allocated a 16 kB address space within the APB address space. The connection of on-chip peripherals to device pins is controlled by a Pin Connect Block. This must be configured by software to fit specific application requirements for the use of peripheral functions and pins.
  • 22. FIG 4.1- Block Diagram of LPC 2148 4.1.2 ARM7TDMI-S PROCESSOR The ARM7TDMI-S is a general purpose 32-bit microprocessor, which offers high performance and very low power consumption. The ARM architecture is based on Reduced Instruction Set Computer (RISC) principles, and the instruction set and related decode mechanism are much simpler than those of micro programmed Complex Instruction Set Computers. This simplicity results in a high instruction throughput and impressive real-time interrupt response from a small and cost-effective processor core. Pipeline techniques are employed so that all parts of the processing and memory systems can operate continuously. Typically, while one instruction is being executed, its successor is being decoded, and a third instruction is being fetched from memory. The ARM7TDMI-S processor also employs a unique architectural strategy known as THUMB, which makes it ideally suited to high- volume applications with memory restrictions or applications where code density is an issue.
  • 23. The key idea behind THUMB is that of a super-reduced instruction set. Essentially, the ARM7TDMI-S processor has two instruction sets: • The standard 32-bit ARM instruction set. • A 16-bit THUMB instruction set. The THUMB set’s 16-bit instruction length allows it to approach twice the density of standard ARM code while retaining most of the ARM’s performance advantage over a traditional 16-bit processor using 16-bit registers. This is possible because THUMB code operates on the same 32-bit register set as ARM code. THUMB code is able to provide up to 65% of the code size of ARM, and 160% of the performance of an equivalent ARM processor connected to a 16-bit memory system. 4.1.3 Description about the Block Diagram: On chip Flash Program Memory LPC 2148 is having 512 k B Flash memory. This memory may be used for both code and data storage. Programming of the flash memory may be accomplished in several ways (ISP/IAP). On chip Static RAM On-chip static RAM may be used for code and/or data storage. The SRAM may be accessed as 8-bit, 16-bit, and 32-bit. An 8 k B SRAM block intended to be utilized mainly by the USB Interrupt Controller The Vectored Interrupt Controller (VIC) accepts all of the interrupt request inputs and categorizes them as Fast Interrupt Request (FIQ), vectored Interrupt Request (IRQ), and non- vectored IRQ as defined by programmable settings. Analog to Digital Converter LPC2148 contains two analog to digital converters (ADC0 & ADC1). Total number of available ADC inputs is 14. These two ADC’s are 10 bit successive approximation analog to digital converters. The measurement range is 0 V to VREF and is Global Start command for both converters.
  • 24. Digital to Analog Converter The DAC enables to generate a variable analog output. The maximum DAC output voltage is the VREF voltage. 10-bit DAC, Buffered output and Power-down mode are available. USB 2.0 Device Controller The USB is a 4-wire serial bus that supports communication between a host and a number (127max) of peripherals. This enables 12 M bit/s data exchange with a USB host controller. A DMA controller (available only in LPC2146/48) can transfer data between an endpoint buffer and the USB RAM. UART LPC2148 contains two UARTs (UART0 & UART1). In addition to standard transmit and receive data lines, the LPC2148 UART1 also provide a full modem control handshake interface. 16 byte Receive and Transmit FIFOs are used. It contains Built-in fractional baud rate generator covering wide range of baud rates without a need for external crystals of particular values. I2C-bus serial I/O controller I2C is a bidirectional. It is a multi-master bus; it can be controlled by more than one bus master connected to it. It supports bit rates up to 400 k bit/s. Bidirectional data transfer between masters and slaves. Serial clock synchronization allows devices with different bit rates to communicate via one serial bus. Serial clock synchronization can be used as a handshake mechanism to suspend and resume serial transfer. SPI serial I/O control It is s a full duplex serial interface, designed to handle multiple masters and slaves connected to a given bus. Synchronous, Serial, Full Duplex Communication is considered in the system. SSP serial I/O control:- Supports full duplex transfers. Data frames of 4 bits to 16 bits of data flowing from the master to the slave and from the slave to the master. Synchronous serial communication
  • 25. Master or slave operation. 8-frame FIFOs for both transmit and receive. Four bits to 16 bits per frame Timers LPC 2148 has two 32-bit timer/counters with a programmable 32-bit pre scalar. It also having external event counter. Four 32-bit capture channels per timer/counter that can take a snapshot of the timer value when an input signals transitions. A capture event may also optionally generate an interrupt.. Watchdog Timer The purpose of the watchdog is to reset the microcontroller within a reasonable amount of time if it enters an erroneous state. When enabled, the watchdog will generate a system reset if the user program fails to ‘feed’ (or reload) the watchdog within a predetermined amount of time. Real Time Clock The RTC is designed to provide a set of counters to measure time when normal or idle Operating mode is selected. The RTC has been designed to use little power, making it Suitable for battery powered systems where the CPU is not running continuously (Idle Mode). Crystal Oscillator On-chip integrated oscillator operates with external crystal in range of 1 MHz to 25 M Hz. The oscillator output frequency is called foscand the ARM processor clock frequency is referred to as CCLK for purposes of rate equations, etc. fosc and CCLK are the same value unless the PLL is running and connected. PLL The PLL accepts an input clock frequency in the range of 10 MHz to 25 MHz’s The input frequency is multiplied up into the range of 10 MHz to 60 MHz with a Current Controlled Oscillator (CCO). The multiplier can be an integer value from 1 to 32 (in practice, the multiplier value cannot be higher than 6 on this family of microcontrollers due to the upper frequency limit of the CPU). The CCO operates in the range of 156 MHz to 320 MHz,
  • 26. so there is an additional divider in the loop to keep the CCO within its frequency range while the PLL is providing the desired output frequency. 4.1.4 LPC 2148 REGISTERS The ARM CPU provides in user mode 16 general purpose registers (R0 - R15) and a Program Status Register. Registers in LPC 2148 are 8, 16 or 32 bits wide. The ARM CPU provides shadow registers which are selected on an Operation Mode switch. These shadow registers reduce interrupt latency. All CPU Registers are shown in the following picture. SP: Stack pointer LR: Link register PC: Program counter CPSR: Current Program Status Register. SPSR: Saved Program Status Register. Fig 4.2: Registers LR (Link register): Used by the processor when there is a branch operation this occurs due to function call or due to some condition checking. When the processor is executing and there is a need to branch to other location the return address (the address from where the execution
  • 27. is to be started, returning after completing the function execution). If there are multiple function calls then LR will store only the last address before jumping. CPSR: Used to store the important back-up data whenever there is change of any mode. E.g. if the processor is executing user mode and there is an interrupt, before going to service the interrupt the all the data and the status registers and the current mode of operation information is stored in CPSR. CPSR registers are present in all the 7 modes but are not usually shown. SPSR: stores the copy of CPSR register in which ever mode the processor enters. All the 7 modes have SPSR registers and are shown in the mode registers. If the processor switches from USER mode to IRQ mode because of an IRQ, the CPSR value is updated in the user mode and the processor switches to IRQ mode. Beforestarting the IRQ code execution the value of CPSR is copied to SPSR of IRQ mode. While executing IRQ mode and high priority interrupt occurs (FIQ) then the status of the IRQ mode is updated in its CPSR register and when the processor switches to FIQ mode the contents of CPSR in IRQ mode is copied to SPSR register in FIQ mode. 4.1.5 General Purpose Input/output ports (GPIO) Every physical GPIO port is accessible either the group of registers by providing an enhanced features and accelerated port access or the legacy group of registers. • Accelerated GPIO functions: – GPIO registers are relocated to the ARM local bus so that the fastest possible I/O Timing can be achieved. – Mask registers allow treating sets of port bits as a group, leaving other bits Unchanged. – All registers are byte and half-word addressable. – Entire port value can be written in one instruction. • Bit-level set and clear registers allow a single instruction set or clear of any number of bits in one port. • Direction control of individual bits. • All I/O default to inputs after reset.
  • 28. • Backward compatibility with other earlier devices is maintained with legacy registers appearing at the original addresses on the VPB bus. Applications: • General purpose I/O • Driving LEDs, or other indicators • Controlling off-chip devices • Sensing digital inputs 4.1.6 Pin Description IOPIN: The current state of the GPIO configured port pins can always be read from this register, regardless of pin direction. IOSET: This register controls the state of output pins in conjunction with the IOCLR register. Writing one’s produces highs at the corresponding port pins. Writing zeroes has no effect. IODIR: GPIO Port Direction control register: This register individually controls the direction of each port pin. Direction bit for any pin must be set according to the pin functionality. IOCLR: GPIO Port Output Clear register: This register controls the state of output pins. Writing ones produces lows at the corresponding port pins and clears the corresponding bits in the IOSET register. Writing zeros has no effect. 4.1.7 PIN diagram of LPC 2148
  • 29. Fig 4.3:Pin diagram of LPC 2148 EXTERNAL INTERRUPT INPUTS The LPC 2148 includes four External Interrupt Inputs as selectable pin functions. The External Interrupt Inputs can optionally be used to wake up the processor from the Power Down mode. REGISTER DESCRIPTION The external interrupt function has four registers associated with it. The EXTINT register contains the interrupt flags, and the EXTWAKEUP register contains bits that enable individual external interrupts to wake up the LPC 2148 from Power Down mode. The EXTMODE and EXTPOLAR registers specify the level and edge sensitivity parameters. External Interrupt Flag Register When a pin is selected for its external interrupt function, the level or edge on that pin selected by its bits in the EXTPOLAR and EXTMODE registers will set its interrupt flag in this register. This asserts the corresponding interrupt request to the VIC, which will cause an interrupt if interrupts from the pin are enabled. Writing ones to bits EINT0 through EINT3 in
  • 30. EXTINT register clears the corresponding bits. In level-sensitive mode this action is efficacious only when the pin is in its inactive state. 4.1.8 UART0 FEATURES • 16 byte Receive and Transmit FIFO. • Register locations conform to ‘550 industry standard. • Receiver FIFO triggers points at 1, 4, 8, and 14 bytes. • Built-in baud rate generator. UART PIN DESCRIPTION Table 4.1: UART PIN description There are two Universal Asynchronous Receiver Transmitters (UART) configured in ARM 7-LPC 2148 viz. UART-0 and UART -1.Register which are related for UART configurations are UO/1LCR, UO/1THR, UO/1RBR and UO/1LSR. LCR: Line Control Register. THR: Transmit Holding Register. RBR: Receive Buffer Register. LSR: Line Status Register. UO/1LSR –
  • 31. 7 6 5 4 3 2 1 0 Divisor latch bit UART trans enb/disable Odd/even parity Enable /disable Parity Bit Stop Bit Width of data Recvd& trans. Bits 1:0- ‘0 0 ‘- 5 bit data. ‘0 1- 6 bit data. ‘1 0 -7 bit data. ‘1 1’- 8 bit data. Bit 2: ‘0’ - 1 stop bit. ‘1’ - 2 stop bits. Bit 3: ‘0’ - Disable parity bit. ‘1’ - Enable parity bit. Bits 4:5 : ‘0 0’ - odd parity. ‘0 1’ – even parity. Bit 6: ‘0’ - Enable transmission bit. ‘1’ - Disable transmission bit. Bit- 7: ‘1’ - to set baud rate. To set baud rate two registers UO/1DLL (Divisor Latch LSB) and U0/1DLM (Divisor Latch MSB) are used.
  • 32. Baud rate value = Processor clock frequency 16* Baud rate (in bits per sec) U0/1LSR: (status of UART) 7 6 5 4 3 2 1 0 X X TRANS STATUS X X X X RECEIV STATUS U0/1THR: Data that is transmitted will be available in U0/1THR and then sent to other registers. U0/1RBR: Data that is received will be available in U0/1THR and then sent to other registers. 4.2. ZIGBEE When you hold the TV remote and wish to use it you have to necessarily point your control at the device. This one-way, line-of-sight, short-range communication uses infrared (IR) sensors to enable communication and control and it is possible to operate the TV remotely only with its control unit. Add other home theatre modules, an air- conditioner and remotely enabled fans and lights to your room, and you become a juggler who has to handle not only these remotes, but also more numbers that will accompany other home appliances you are likely to use. Some remotes do serve to control more than one device after ‘memorizing' access codes, but this interoperability is restricted to LOS, that too only for a set of related equipment, like the different units of a home entertainment system Now picture a home with entertainment units, security systems including fire alarm, smoke detector and burglar alarm, air-conditioners and kitchen appliances all within whispering distance from each other and imagine a single unit that talks with all the devices, no longer depending on line-of-sight, and traffic no longer being one-way. This means that the devices and the control unit would all need a common standard to enable intelligible communication. ZigBee is such a standard for embedded application software and has been ratified in late 2004 under IEEE 802.15.4 Wireless Networking Standards.
  • 33. ZigBee is one of the global standards of communication protocol formulated by the relevant task force under the IEEE 802.15 working group. The fourth in the series, WPAN Low Rate/ZigBee is the newest and provides specifications for devices that have low data rates, consume very low power and are thus characterized by long battery life. Other standards like Bluetooth and IrDA address high data rate applications such as voice, video and LAN communications. The ZigBee Alliance has been set up as “an association of companies working together to enable reliable, cost-effective, low-power, wirelessly networked, monitoring and control products based on an open global standard”. Once a manufacturer enrolls in this Alliance for a fee, he can have access to the standard and implement it in his products in the form of ZigBee chipsets that would be built into the end devices. Philips, Motorola, Intel, HP are all members of the Alliance . The goal is “to provide the consumer with ultimate flexibility, mobility, and ease of use by building wireless intelligence and capabilities into every day devices. ZigBee technology will be embedded in a wide range of products and applications across consumer, commercial, industrial and government markets worldwide. For the first time, companies will have a standards-based wireless platform optimized for the unique needs of remote monitoring and control applications, including simplicity, reliability, low-cost and low-power”. The target networks encompass a wide range of devices with low data rates in the Industrial, Scientific and Medical (ISM) radio bands, with building-automation controls like intruder/fire alarms, thermostats and remote (wireless) switches, video/audio remote controls likely to be the most popular applications. So far sensor and control devices have been marketed as proprietary items for want of a standard. With acceptance and implementation of ZigBee, interoperability will be enabled in multi-purpose, self-organizing mesh networks . 4.2.1 Architecture Though WPAN implies a reach of only a few meters, 30 feet in the case of ZigBee, the network will have several layers, so designed as to enable intrapersonal communication within the network, connection to a network of higher level and ultimately an uplink to the Web. The ZigBee Standard has evolved standardized sets of solutions, called ‘layers'. These layers facilitate the features that make ZigBee very attractive: low cost, easy implementation,
  • 34. reliable data transfer, short-range operations, very low power consumption and adequate security features. 1. Network and Application Support layer: The network layer permits growth of network sans high power transmitters. This layer can handle huge numbers of nodes. This level in the ZigBee architecture includes the ZigBee Device Object (ZDO), user-defined application profile(s) and the Application Support (APS) sub-layer. The APS sub-layer's responsibilities include maintenance of tables that enable matching between two devices and communication among them, and also discovery, the aspect that identifies other devices that operate in the operating space of any device. The responsibility of determining the nature of the device (Coordinator / FFD or RFD) in the network, commencing and replying to binding requests and ensuring a secure relationship between devices rests with the ZDO (Zigbee Define Object). The user-defined application refers to the end device that conforms to the ZigBee Standard. 2. Physical (PHY) layer :The IEEE802.15.4 PHY physical layer accommodates high levels of integration by using direct sequence to permit simplicity in the analog circuitry and enable cheaper implementations. 3. Media access control (MAC) layer : The IEEE802.15.4 MAC media access control layer permits use of several topologies without introducing complexity and is meant to work with large numbers of devices. Figure 4.4: IEEE 802.15.4 / ZigBee Stack Architecture
  • 35. 4.2.2 Device Types There are three different ZigBee device types that operate on these layers in any self- organizing application network. These devices have 64-bit IEEE addresses, with option to enable shorter addresses to reduce packet size, and work in either of two addressing modes – star and peer-to-peer. 1. The ZigBee coordinator node There is one, and only one, ZigBee coordinator in each network to act as the router to other networks, and can be likened to the root of a (network) tree. It is designed to store information about the network. 2. The full function device FFD The FFD is an intermediary router transmitting data from other devices. It needs lesser memory than the ZigBee coordinator node, and entails lesser manufacturing costs. It can operate in all topologies and can act as a coordinator. 3. The reduced function device RFD This device is just capable of talking in the network; it cannot relay data from other devices. Requiring even less memory, (no flash, very little ROM and RAM), an RFD will thus be cheaper than an FFD. This device talks only to a network coordinator and can be implemented very simply in star topology. 4.2.3 ZigBee Characteristics The focus of network applications under the IEEE 802.15.4 / ZigBee standard include the features of low power consumption, needed for only two major modes (TX/Rx or Sleep), high density of nodes per network, low costs and simple implementation. These features are enabled by the following characteristics. 2.4GHz and 868/915 MHz dual PHY modes. This represents three license-free bands: 2.4-2.4835 GHz, 868-870 MHz and 902-928 MHz The number of channels allotted to each frequency band is fixed at sixteen (numbered 11-26), one (numbered 0) and ten (numbered 1-10) respectively. The higher frequency band is applicable worldwide, and the lower band in the areas of North America, Europe, Australia and New Zealand.
  • 36.  Low power consumption, with battery life ranging from months to years. In the ZigBee standard, longer battery life is achievable by either of two means: continuous network connection and slow but sure battery drain, or intermittent connection and even slower battery drain.  Maximum data rates allowed for each of these frequency bands are fixed as 250 kbps @2.4 GHz, 40 kbps @ 915 MHz, and 20 kbps @868 MHz  High throughput and low latency for low duty-cycle applications (<0.1%)  Channel access using Carrier Sense Multiple Access with Collision Avoidance (CSMA - CA)  Addressing space of up to 64 bit IEEE address devices, 65,535 networks  50m typical range  Fully reliable “hand-shaked” data transfer protocol.  Different topologies as illustrated below: star, peer-to-peer, mesh . Figure 4.5: ZigBee Topologies 4.2.4 Traffic Types ZigBee/IEEE 802.15.4 addresses three typical traffic types. IEEE 802.15.4 MAC can accommodate all the types. 1. Data is periodic. The application dictates the rate, and the sensor activates, checks for data and deactivates. 2. Data is intermittent. The application, or other stimulus, determines the rate, as in the case of say smoke detectors. The device needs to connect to the network only when communication is necessitated. This type enables optimum saving on energy.
  • 37. 3. Data is repetitive, and the rate is fixed a priori. Depending on allotted time slots, called GTS (guaranteed time slot), devices operate for fixed durations. ZigBee employs either of two modes, beacon or non-beacon to enable the to-and-fro data traffic. Beacon mode is used when the coordinator runs on batteries and thus offers maximum power savings, whereas the non-beacon mode finds favor when the coordinator is mains-powered. In the beacon mode, a device watches out for the coordinator's beacon that gets transmitted at periodically, locks on and looks for messages addressed to it. If message transmission is complete, the coordinator dictates a schedule for the next beacon so that the device ‘goes to sleep'; in fact, the coordinator itself switches to sleep mode. While using the beacon mode, all the devices in a mesh network know when to communicate with each other. In this mode, necessarily, the timing circuits have to be quite accurate, or wake up sooner to be sure not to miss the beacon. Figure 4.6 : Beacon Network Communication The non-beacon mode will be included in a system where devices are ‘asleep' nearly always, as in smoke detectors and burglar alarms. The devices wake up and confirm their continued presence in the network at random intervals. On detection of activity, the sensors ‘spring to attention', as it were, and transmit to the ever-waiting coordinator's receiver (since it is mains-powered). However, there is the remotest of chances that a sensor finds the channel busy, in which case the receiver unfortunately would ‘miss a call'.
  • 38. Figure 4.7: Non-Beacon Network Communication Network Model The functions of the Coordinator, which usually remains in the receptive mode, encompass network set-up, beacon transmission, node management, storage of node information and message routing between nodes. The network node, however, is meant to save energy (and so ‘sleeps' for long periods) and its functions include searching for network availability, data transfer, checks for pending data and queries for data from the coordinator. Figure 4.8 :ZigBee Network Model For the sake of simplicity without jeopardizing robustness, this particular IEEE standard defines a quartet frame structure and a super-frame structure used optionally only by the coordinator. The four frame structures are  Beacon frame for transmission of beacons  Data frame for all data transfers  Acknowledgement frame for successful frame receipt confirmations
  • 39.  MAC command frame These frame structures and the coordinator's super-frame structure play critical roles in security of data and integrity in transmission. All protocol layers contribute headers and footers to the frame structure, such that the total overheads for each data packet range are from 15 octets (for short addresses) to 31 octets (for 64-bit addresses). The coordinator lays down the format for the super-frame for sending beacons after every 15.38 ms or/and multiples thereof, up to 252s. This interval is determined a priori and the coordinator thus enables sixteen time slots of identical width between beacons so that channel access is contention-less. Within each time slot, access is contention-based. Nonetheless, the coordinator provides as many as seven GTS (guaranteed time slots) for every beacon interval to ensure better quality. 4.2.5 Technology Comparisons The “Why ZigBee” question has always had an implied, but never quite worded follower phrase “…when there is Bluetooth”. A comparative study of the two can be found in The bandwidth of Bluetooth is 1 Mbps, ZigBee's is one-fourth of this value. The strength of Bluetooth lies in its ability to allow interoperability and replacement of cables, ZigBee's, of course, is low costs and long battery life. In terms of protocol stack size, ZigBee's 32 KB is about one-third of the stack size necessary in other wireless technologies (for limited capability end devices, the stack size is as low as 4 KB). Most important in any meaningful comparison are the diverse application areas of all the different wireless technologies. Bluetooth is meant for such target areas as wireless USB's, handsets and headsets, whereas ZigBee is meant to cater to the sensors and remote controls market and other battery operated products. In a gist, it may be said that they are neither complementary standards nor competitors, but just essential standards for different targeted applications. The earlier Bluetooth targets interfaces between PDA and other device (mobile phone / printer etc) and cordless audio applications.
  • 40. 4.2.6 ZigBee Applications The ZigBee Alliance targets applications "across consumer, commercial, industrial and government markets worldwide". Unwired applications are highly sought after in many networks that are characterized by numerous nodes consuming minimum power and enjoying long battery lives. ZigBee technology is designed to best suit these applications, for the reason that it enables reduced costs of development, very fast market adoption, and rapid ROI. Air bee Wireless Inchas tied up with Radio crafts AS to deliver "out-of-the-box" ZigBee-ready solutions; the former supplying the software and the latter making the module platforms. With even light controls and thermostat producers joining the ZigBee Alliance, the list is growing healthily and includes big OEM names like HP, Philips, Motorola and Intel. With ZigBee designed to enable two-way communications, not only will the consumer be able to monitor and keep track of domestic utilities usage, but also feed it to a computer system for data analysis. A recent analyst report issued by West Technology Research Solutions estimates that by the year 2008, "annual shipments for ZigBee chipsets into the home automation segment alone will exceed 339 million units," and will show up in "light switches, fire and smoke detectors, thermostats, appliances in the kitchen, video and audio remote controls, landscaping, and security systems." The ZigBee Alliance is nearly 200 strong and growing, with more OEM's signing up. This means that more and more products and even later, all devices and their controls will be based on this standard. Since Wireless personal Area Networking applies not only to household devices, but also to individualized office automation applications, ZigBee is here to stay. It is more than likely the basis of future home-networking solutions. 4.3 ANALOG TO DIGITAL CONVERTER: ARM-7 LPC-2148 has built in ADC with 10 bit resolution, 4.5 MHz frequency and 2.44micro sec operation or conversion time. Description Basic clocking for the A/D converters is provided by the APB clock. A programmable divider is included in each converter, to scale this clock to the 4.5 MHz (max) clock needed
  • 41. by the successive approximation process. A fully accurate conversion requires 11 of these clocks. 4.3.1 Features of ADC  10 bit successive approximation analog to digital converter  Input multiplexing among 6 or 8 pins (ADC0 and ADC1).  Power-down mode.  Measurement ranges 0 V to VREF (typically 3 V).  10 bit conversion time ( >2.44 micro seconds).  Burst conversion mode for single or multiple inputs. AD Registers are used in conversion process. Each register is 32 bit in size. Various registers used are: ADxCR: control register to  Select which pin input is given to.  Set the clk rate and number of output bits.  Start signal  Edge signal ADxGDR: global data register  To store the digital values of most recent conversion when DONE bit is 1.  Also contains info about which channel the input was given to.  Contains OVERRUN bit to indicate if converted value was overwritten before it was made available.  DONE bit to check if converted data is read from register ADDRx: data register  Contains data after completion.  Flags indicating completion and overrun if any. 4.3.2 ADC Registers ADCR: (Analog to Digital Control Register-32 bits)
  • 42. 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Burst mode To set Conv. Freq X Power down mode X Start/ stop conv. XXXX 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 For clock division For channel selection ADDR: (Analog to Digital Data Register-32 bits) Bit 31: Done bit. Bits 15 to 6 will have converted data in digital form. 4.4 MAX 232 A standard serial interface for PC, RS232C, requires negative logic, i.e., logic 1 is -3V to -12V and logic 0 is +3V to +12V. To convert TTL logic, say, TXD and RxD pins of the microcontroller thus need a converter chip. A MAX232 chip has long been using in many microcontrollers boards. It is a dual RS232 receiver / transmitter that meets all RS232 specifications while using only +5V power supply. It has two on board charge pump voltage converters which generate +10V to -10V power supplies from a single 5V supply. It has four level translators, two of which are RS232 transmitters that convert TTL/CMOS input levels into +9V RS232 outputs. The other two level translators are RS232 receivers that convert RS232 input to 5V. Typical MAX232 circuit is shown below.
  • 43. Fig 4.9: MAX 232 pin diagram 4.4.1 Features  Operates With Single 5-V Power Supply  LinBiCMOSEProcess Technology  Two Drivers and Two Receivers  ±30-V Input Levels  Low Supply Current . 8 mA Typical  Meets or Exceeds TIA/EIA-232-F and ITU Recommendation V.28  7.Designed to be Interchangeable With Maxim MAX232  Applications a. TIA/EIA-232-F b. Battery-Powered Systems c. Terminals d. Modems e. Computers 4.4.2 Circuit connections A standard serial interfacing for PC, RS232C, requires negative logic, i.e., logic '1' is -3V to -12V and logic '0' is +3V to +12V. To convert a TTL logic, say, TxD and RxD pins of the chips, thus need a converter chip. A MAX232 chip has long been using in many uC boards. It provides 2-channel RS232C port and requires external 10uF capacitors. Carefully check the polarity of capacitor when soldering the board. A DS275 however, no need external capacitor and smaller. Either circuit can be used without any problems.
  • 44. Table 4.2 Pin description of MAX 232 Fig 4.10: circuit diagram of MAX 232 4.5 LCD (Liquid Cristal Display) A liquid crystal display (LCD) is a thin, flat display device made up of any number of colour or monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of a column of liquid crystal molecules suspended between two transparent electrodes, and two polarizing filters, the axes of polarity of which are perpendicular to each other. Without the liquid crystals between them, light passing through one would be blocked by the other. The liquid crystal twists the polarization of light entering one filter to allow it to pass through the other.
  • 45. A program must interact with the outside world using input and output devices that communicate directly with a human being. One of the most common devices attached to a controller is an LCD display. Some of the most common LCDs connected to the controllers are 16X1, 16x2 and 20x2 displays. This means 16 characters per line by 1 line 16 characters per line by 2 lines and 20 characters per line by 2 lines, respectively. Many microcontroller devices use 'smart LCD' displays to output visual information. LCD displays designed around LCD NT-C1611 module, are inexpensive, easy to use, and it is even possible to produce a readout using the 5X7 dots plus cursor of the display. They have a standard ASCII set of characters and mathematical symbols. For an 8-bit data bus, the display requires a +5V supply plus 10 I/O lines (RS RW D7 D6 D5 D4 D3 D2 D1 D0). For a 4-bit data bus it only requires the supply lines plus 6 extra lines (RS RW D7 D6 D5 D4). When the LCD display is not enabled, data lines are tri-state and they do not interfere with the operation of the microcontroller. 4.5.1 Features ● 16 characters with 2 lines display ● Over 200 character fonts available ● High display resolution: 5X8 dots per character ● Display with driver mounted on a single printed circuit board ● Standard CMOS logic compatible ● 6 inch cable with 14-pin connector that plugs directly into the module board Key Specifications ● Power supply: +4.5V to +5.5V max @ 5mA max ● High level input voltage = 2.2V to VCC ● Low level Input Voltage = 0.0V to 0.6V ● Font size: 4.35mm X 2.95mm ● Overall dimension : 80.0mm(width)X36.0mm(height)X11.0mm(depth) Data can be placed at any location on the LCD. For 16×1 LCD, the address locations are: Shapes and S available. Line
  • 46. Table 4.3 Address location of LCD Electrical block diagram: Fig 4.11 Electrical block diagram of LCD Power supply for LCD driving:
  • 47. Fig 4.12 Power supply for LCD driving 4.5.2 PIN DESCRIPTION: Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two pins are extra in both for back-light LED connections). Fig 4.13: pin diagram of 1x16 lines LCD Pin Symbol Function 1 Vss Ground 2 Vdd Supply Voltage 3 Vo Contrast Setting 4 RS Register Select 5 R/W Read/Write Select 6 En Chip Enable Signal 7-14 DB0-DB7 Data Lines 15 A/Vee Gnd for the backlight 16 K Vcc for backlight 4.5.3 CONTROL LINES
  • 48. EN: Line is called "Enable." This control line is used to tell the LCD that you are sending it data. To send data to the LCD, your program should make sure this line is low (0) and then set the other two control lines and/or put data on the data bus. When the other lines are completely ready, bring EN high (1) and wait for the minimum amount of time required by the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again. RS: Line is the "Register Select" line. When RS is low (0), the data is to be treated as a command or special instruction (such as clear screen, position cursor, etc.). When RS is high (1), the data being sent is text data which should be displayed on the screen. For example, to display the letter "T" on the screen you would set RS high. RW Line is the "Read/Write" control line. When RW is low (0), the information on the data bus is being written to the LCD. When RW is high (1), the program is effectively querying (or reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others are write commands, so RW will almost always be low. Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3, DB4, DB5, DB6, and DB7. Logic status on control lines • E - 0 Access to LCD disabled - 1 Access to LCD enabled • R/W - 0 Writing data to LCD - 1 Reading data from LCD • RS - 0 Instructions - 1 Character Writing data to the LCD  Set R/W bit to low  Set RS bit to logic 0 or 1 (instruction or character)
  • 49.  Set data to data lines (if it is writing)  Set E line to high  Set E line to low Read data from data lines (if it is reading)on LCD 1) Set R/W bit to high 2) Set RS bit to logic 0 or 1 (instruction or character) 3) Set data to data lines (if it is writing) 4) Set E line to high 5) Set E line to low RELAYS 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. 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. Fig 4.14 Relay Relays are usually SPDT (single pole double through switch)or DPDT (double pole double through switch) but they can have many more sets of switch contacts, for example relays with 4 sets of changeover contacts are readily available.
  • 50. Basic operation of a relay: An electric current through a conductor will produce a magnetic field at right angles to the direction of electron flow. If that conductor is wrapped into a coil shape, the magnetic field produced will be oriented along the length of the coil. The greater current, the greater strength of the magnetic field, all other factors being equal. Fig 4.15 Operation of Relay circuit diagram Inductors react against changes in current because of the energy stored in this magnetic field. When we construct a transformer from two inductor coils around a common iron core, we use this field to transfer energy from one coil to the other. However, there are simpler and more direct uses for electromagnetic fields than the applications we've seen with
  • 51. inductors and transformers. The magnetic field produced by a coil of current-carrying wire can be used to exert a mechanical force on any magnetic object, just as we can use a permanent magnet to attract magnetic objects, except that this magnet (formed by the coil) can be turned on or off by switching the current on or off through the coil. If we place a magnetic object near such a coil for the purpose of making that object move when we energize the coil with electric current, we have what is called a solenoid. The movable magnetic object is called an armature, and most armatures can be moved with either direct current (DC) or alternating current (AC) energizing the coil. The polarity of the magnetic field is irrelevant for the purpose of attracting an iron armature. Solenoids can be used to electrically open door latches, open or shut valves, move robotic limbs, and even actuate electric switch mechanisms and is used to actuate a set of switch contacts Relays can be categorized according to the magnetic system and operation: Neutral Relays This is the most elementary type of relay. The neutral relays have a magnetic coil, which operates the relay at a specified current, regardless of the polarity of the voltage applied. Biased Relays Biased relays have a permanent magnet above the armature. The relay operates if the current through the coil winding establishes a magneto-motive force that opposes the flux by the permanent magnet. If the fluxes are in the same direction, the relay will not operate, even for a greater current through the coil. Polarized Relays Like the biased relays, the polarized relays operate only when the current through the coil in one direction. But there the principle is different. The relay coil has a diode connected in series with it. This blocks the current in the reverse direction. The major difference between biased relays and polarized relays is that the former allows the current to pass through in the reverse direction, but does the not operate the relay and the later blocks the current in reverse direction. You can imagine how critical these properties when relays are connected in series to form logic circuits.
  • 52. Magnetic Stick Relays or Perm polarized Relays These relays have a magnetic circuit with high permanence. Two coils, one to operate (pick up) and one to release (drop) are present. The relay is activated by a current in the operate coil. On the interruption of the current the armature remains in picked up position by the residual magnetism. The relay is released by a current through the release coil. Slow Release Relays These relays have a capacitor connected in parallel to their coil. When the operating current is interrupted the release of relay is delayed by the stored charge in the capacitor. The relay releases as the capacitor discharges through the coil. Relays for AC These are neutral relays and picked up for a.c. current through their coil. These are very fast in action and used on power circuits of the point motors, where high current flows through the contacts. A normal relay would be slow and make sparks which in turn may weld the contacts together. All relays have two operating values (voltages), one pick-up and the other other drop away. The pick-up value is higher than the drop away value. Applications  To control a high-voltage circuit with a low-voltage signal, as in some types of modems or audio amplifiers,  To control a high-current circuit with a low-current signal, as in the starter solenoid of an automobile,  To detect and isolate faults on transmission and distribution lines by opening and closing circuit breakers (protection relays),
  • 54. 5.1 Introduction to C C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC PDP-11 computer in 1972. In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available description of C, now known as the K&R standard. The UNIX operating system, the C compiler, and essentially all UNIX application programs have been written in C. C has now become a widely used professional language for various reasons:  Easy to learn  Structured language  It produces efficient programs  It can handle low-level activities  It can be compiled on a variety of computer platforms Facts about C  C was invented to write an operating system called UNIX.  C is a successor of B language which was introduced around the early 1970s.  The language was formalized in 1988 by the American National Standard Institute (ANSI).  The UNIX OS was totally written in C.  Today C is the most widely used and popular System Programming Language.  Most of the state-of-the-art software have been implemented using C.  Today's most popular Linux OS and RDBMS MySQL have been written in C. Why Use C? C was initially used for system development work, particularly the programs that make-up the operating system. C was adopted as a system development language because it produces code that runs nearly as fast as the code written in assembly language. Some examples of the use of C might be:  Operating Systems  Language Compilers  Assemblers  Text Editors  Print Spoolers  Network Drivers  Modern Programs  Databases  Language Interpreters
  • 55.  Utilities 5.2 Kiel µVision Software It is possible to create the source files in a text editor such as Notepad, run the Compiler on each C source file, specifying a list of controls, run the Assembler on each Assembler source file, specifying another list of controls, run either the Library Manager or Linker (again specifying a list of controls) and finally running the Object-HEX Converter to convert the Linker output file to an Intel Hex File. Once that has been completed the Hex File can be downloaded to the target hardware and debugged. Alternatively KEIL can be used to create source files; automatically compile, link and covert usingoptions set with an easy to use user interface and finally simulate or perform debugging on with access to C variables and memory. Unless you have to use the tolls on the command line, the choice is clear. KEIL Greatly simplifies the process of creating and testing an embedded application. By using softwares Kiel uvision 4 and flash magic using we will get out puts. Step 1: Give a double click on u vision 4 icon on the desk top, it will generate a window as shown below. Step 2: To create new project go to project select new micro vision project. Step 3: select a drive where you would like to create your project. Step 4: Create a new folder and name it with your project name. Step 5: Open that project folder and give a name of your project executable file and save it. Step 6: After saving it will show some window there you select your microcontroller company i.e., NXP from Phillips. Step 7: Select your chip as LPC2148 Step 8: After selecting chip click on OK then it will display some window asking to add STARTUP file. Select YES. Step 9: A target is created and start-up files is added to your project target Step 10:To write your project code select a new file from FILE menu bar.
  • 56. Step 11: It will display some text editor, to save that file select SAVE option from FILE menu bar. Step 12: By giving a file name with extension .C for c files and save it. Step 13: Write the code of your project and save it. Step 14: To add our c file to target give a right click on Source Group, choose “ADD files to Group” option. Step 15: It will display some window there select the file you have to add and click on ADD option. Step 16: The file will be added to our target and it shows in the project window. Step 17:Now give a right click on target in the project window and select “Options for Target”. Step 18: It will show some window,in that go to output option and choose Create Hex file option by selecting that box. Step 19:In the same window go to Linker option and choose Use Memory Layout from Target Dialog by selecting the box, and click OK. Step 20: Now to Compile your project go to Project select Build Target option or pressF7. Step 21: In the build OUT PUT window you can see the errors and warnings if there in your code. And here your project Hex file will be created. 5.3 Flash Magic: Features:  Straightforward and intuitive user interface  Five simple steps to erasing and programming a device and setting any options desired  Programs Intel Hex Files  Automatic verifying after programming
  • 57.  Fills unused flash to increase firmware security  Ability to automatically program checksums. Using the supplied checksum calculation routine your firmware can easily verify the integrity of a Flash block, ensuring no unauthorized or corrupted code can ever be executed  Program security bits  Check which Flash blocks are blank or in use with the ability to easily erase all blocks in use  Read the device signature  Read any section of Flash and save as an Intel Hex File  Reprogram the Boot Vector and Status Byte with the help of confirmation features that prevent accidentally programming incorrect values  Displays the contents of Flash in ASCII and Hexadecimal formats  Single-click access to the manual, Flash Magic home page and NXP Microcontrollers home page  Ability to use high-speed serial communications on devices that support it. Flash Magic calculates the highest baud rate that both the device and your PC can use and switches to that baud rate transparently  Command Line interface allowing Flash Magic to be used in IDEs and Batch Files  supports half-duplex communications  Verify Hex Files previously programmed  This enables us to send commands to place the device in Boot ROM mode, with support for command line interfaces. The installation includes an example project for the Keil and Raisonance 8051 compilers that show how to build support for this feature into applications.
  • 59. CONCLUSION An intelligent power monitoring and control system has been designed and developed toward the implementation of a smart building. The developed system effectively monitors and controls the electrical appliance usages at an elderly home. Thus, the real-time monitoring of the electrical appliances can be viewed through a website. The system can be extended for monitoring the whole smart building. The sensor networks are programmed with various user interfaces suitable for users of varying ability and for expert users such that the system can be maintained easily and interacted with very simply. This study also aims to assess consumer’s response toward perceptions of smart grid technologies, their advantages and disadvantages, possible concerns, and overall perceived utility. FUTURE SCOPE In future the system will be integrated with co-systems like smart home inhabitant behaviour recognition systems to determine the wellness of inhabitant in terms of energy consumption.
  • 60. REFERENCES [1] D. Man Han and J. Hyun Lim, “Smart home energy management system using IEEE 802.15.4 and zigbee,” IEEE Trans. Consumer Electron. vol. 56 ,no. 3, pp. 1403– 1410,Aug2010. [2] E. Andrey and J. Morelli, “Design of a smart meter techno-economic model for electric utilities in Ontario,” in Proc. IEEE- Electric Power Energy Conf., 2010, pp. [3] F. Benzi, N. Anglani, E. Bassi, and L. Frosini, “Electricity smart meters interfacing the households,” IEEE Trans. Ind. Electron., vol. 58, no. 10, pp. 4487– 4494, Oct. 2011. [4] J. Han, C. S. Choi, and I. Lee, “More efficient home energy management system based on zigbee communication and infrared remote con trols,” IEEE Trans. Consumer Electron., vol. 57, no. 1, pp. 85–89, Feb. 2011. [5] M. S. Pan, L. W. Yeh, Y. A. Chen, Y. H. Lin, and Y. C. Tseng, “A WSN based intelligent light control system considering user activities and profiles,” IEEE Sensors J., vol. 8, no.10, pp. 1710–1721, Oct. 2008. [6] Janani Prasad, Indumathi.S, “ Energy Conservation in smart home using Lab VIEW”, International Conference on Computing and Control Engineering (ICCCE 2012), 12 & 13 April, 2012 ISBN 978 [7] Nagender Kumar Suryadevara, Subhas Chandra Mukhopadhyay, Tebje Kelly, and Satinder Pal Singh Gill,“WSN- Based Smart Sensors and Actuator for Power Management in Intelligent Buildings” , IEEE/ASME Transactions On Mechatronics. [8 ]Suryadevara, N.K.Mukhopadhyay, S.C. Kelly, S.D.T.; Gill, S.P.S., "WSN-Based Smart Sensors and Actuator for Power Management in Intelligent Buildings,", IEEE/ASME Transactions onMechatronics, vol.20, no.2, pp.564,571, April 2015 http://www.nxp.com/documents/data_sheet/LPC2141_42_44_46_48.pdf ]http://www.engineersgarage.com/electroniccomponents/16x2lcd-module-datasheet
  • 61. ANNEXURE SOURCE CODE: #include "pwr_management_buildings_header.h" int main() { char recv; IODIR0 |= (BUZZER); IODIR1 |= (LCD | LOADS); ADC0_Init(); start: IOCLR1 = LOADS; IOCLR0 = BUZZER; delay(100); lcd_init(); lcd_str(1,1,"SYSTEM ACTIVE"); serial_init(); uart0_str("SYSTEM ACTIVE"); ADC0_Channel_2(); ADC0_Channel_3(); uart0_str("rnnLOADS ACTIVATED. Current Usage "); uart0_tx((current/100)+48); uart0_tx(((current%100)/10)+48); uart0_tx('.'); uart0_tx((current%10)+48); current = current/10; uart0_str("A. rnTo Know the Current Status Enter '?'rnn"); uart0_str("PRESS '1' to SWITCH ON Load 1rn"); uart0_str("PRESS '2' to SWITCH ON Load 2rn"); uart0_str("PRESS '3' to SWITCH OFF Load 1rn"); uart0_str("PRESS '4' to SWITCH OFF Load 2rn"); lcd_str(2,1,"L1,2:OFF,OFF "); if(U0LSR & 0x01) { recv = U0RBR; if(recv == '1') { load1_flag = ON; IOSET1 = LOAD1; uart0_str("LOAD1 SWITCHED ONrn"); } else if(recv == '2') { load2_flag = ON;
  • 62. IOSET1 = LOAD2; uart0_str("LOAD2 SWITCHED ONrn"); } else if(recv == '3') { load1_flag = OFF; IOCLR1 = LOAD1; uart0_str("LOAD1 SWITCHED OFFrn"); } else if(recv == '4') { load2_flag = OFF; IOCLR1 = LOAD2; uart0_str("LOAD2 SWITCHED OFFrn"); } else if(recv == '*') { } else if(recv == '?') { if(load1_flag == ON) uart0_str("rnLOAD1 SWITCHED ONrn"); else uart0_str("rnLOAD1 SWITCHED OFFrn"); if(load2_flag == ON) uart0_str("LOAD2 SWITCHED ONrn"); else uart0_str("LOAD2 SWITCHED OFFrn"); } delay(100); uart0_str("Current: "); uart0_tx(((current%10000)/1000)+48); uart0_tx(((current%1000)/100)+48); uart0_tx('.'); uart0_tx(((current%100)/10)+48); uart0_tx((current%10)+48); uart0_str("Arnn"); lcd_str(2,6," "); if(load1_flag == ON) lcd_str(2,6,"ON"); else lcd_str(2,6,"OFF"); if(load2_flag == ON) lcd_str(0,0,",ON"); else
  • 63. lcd_str(0,0,",OFF"); } if(current >= 110) { IOCLR1 = LOADS; load1_flag = load2_flag = load3_flag = 0; IOSET0 = BUZZER; uart0_str("rnnHight Current Usage "); uart0_tx(((current%10000)/1000)+48); uart0_tx(((current%1000)/100)+48); uart0_tx('.'); uart0_tx(((current%100)/10)+48); uart0_tx((current%10)+48); uart0_str("A Detected. Power Switched OFF.rn"); uart0_str("Please Check the Condition and Enter '#' torn"); uart0_str("Activate the LOADS or Reset the Kitrnn"); delay(500); IOCLR0 = BUZZER; rep: if(U0LSR & 0x01) recv = U0RBR; else recv = 0; lcd_str(2,1,"HIGH CURRENT "); delay(200); if(recv == '#') goto ok; if(U0LSR & 0x01) recv = U0RBR; else recv = 0; lcd_str(2,1,"USAGE DTECTED. "); delay(200); if(recv == '#') goto ok; if(U0LSR & 0x01) recv = U0RBR; else recv = 0; lcd_str(2,1,"CHECK THE COND. "); delay(200); if(recv == '#') goto ok; if(U0LSR & 0x01) recv = U0RBR; else recv = 0; lcd_str(2,1," & Restart KIT ");
  • 64. delay(200); if(recv == '#') goto ok; goto rep; ok: IOCLR1 = LOADS; goto start; } delay(100); IOCLR0 = BUZZER; } } void delay(unsigned int val) { unsigned int i,j; for(i=0;i<val;i++) for(j=0;j<25000;j++); }