Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A PROJECT REPORT
Submitted
In
VLSI AND EMBEDDED SYSTEM DESIGN
by
CH.SAI KUMAR
J.SRAVANTHI , M. Tech.
Assistant
Professor,
Department of
ECE
This is to certify that the Project Work entitled “AN INVESTIGATION ON ENERGY
EFFICIENT WIRELESS SENSOR NETWORK FOR HOME AND OFFICE AUTOMATION “ is a
bonafide work done by J.SRAVANTHI (Regd.No: 17HT1D6801) in partial fulfillment of the
curriculum of Master of Technology in Electronics and Communication during the academic year
2017– 2019.
EXTERNAL EXAMINER
ACKNOWLEDGEMENT
I express my deepest gratitude to Mr. D.NAGA RAVI KIRAN, M.Tech, (Ph.D), H.O.D of
ECE Department, Chalapathi Institute of Technology for his advice to the successful completion of this
project.
I sincerely thank all the staff members in the Department of Electronics And Communication
for their sustained help in this pursuit. I also thank all those who contributed directly or indirectly
in successfully carrying out this work.
has been carried out in the presence J.SRAVANTHI , M.Tech, Asst. Professor,
Department of ECE. This report is being submitted in partial fulfillment for the
award of the Degree of Master of Technology in Department of
Electronics&Communication Engineering from Jawaharlal Nehru Technological
University, Kakinada
CHAPTER 1
INTRODUCTION 1-10
1.1 Introduction 1
1.2 Block Diagram 2
1.3 Operation 3
1.4 Flow Chart 4
1.5 Existing System 5
1.6 Proposed Model 6-10
CHAPTER 2
LITERETURE REVIEW 11-14
2.1 Introduction 11
2.1.1 Embedded System 12
2.2 History 13
2.3 Embedded System Special Features 14
2.4 Categories Of Embedded System 14
CHAPTER 1
INTRODUCTION
1. INTRODUCTION :
Home/Office automation consists in the exploitation of micro/nanoelectronic
technology within the home/office environment to assist and enhance the quality of life/work of
its occupants through the main goals of increasing comfort, saving energy and providing remote
surveillance and real time monitoring [1]-[3]. Wireless Sensor Network (WSN) platforms are
exploited to implement this paradigm [4]-[6]. At this purpose, each WSN physical node is
equipped with multi-sensor devices for heterogeneous ambient sensing and is also able to store,
pre-process, transmit and receive data to a host controller. More generally, intelligent wireless
interconnected sensing devices are expected to pervade all the emerging applications in the
Internet of Things (IoT) area [7]-[10]. In this context, key performances of the WSN nodes are
reduced power consumption and maximum throughput at a maximum communication distance
[9]. Additional specifications that must be considered are cost, size and ease of configuration and
installation [7]-[8]. Presently, to prolong the battery life up to months or even years, WSN nodes
are implemented through energy-efficient communication schemes combined with low-power
design [7], [11]-[12]. To this end, Wi-Fi, ZigBee, and Bluetooth are popular wireless protocols
which use a license-free ISM (Industrial, Scientific and Medical) frequency band. ZigBee, in
particular, offers the best trade-off between cost and communication distance, as proven by the
several related papers in the literature [12]-[16]. Combination of Wi-Fi and Zigbee are also
proposed for power saving [17], [18]. Another solution embeds several radio modules to reduce
energy consumption and latency for neighbor discovery and opportunistic networking [19], but
at the expense of increasing both the size and cost of devices. Nevertheless, the use of Wi-Fi,
Bluetooth and Zigbee as a low power radio is still too costly for WSN applications. Bluetooth
Low Energy (BLE) protocol reduces power consumption and provides connection to smart
phones with easy setup but has limited operating range and is subject to royalties, which makes
BLE unsuitable for WSN ubiquitous low-cost devices.A last, profitable, approach is offered by
Sub-1GHz wireless connectivity schemes providing long distance communication (tens of
kilometers, thanks to the lower frequencies exploited) in a less crowded spectrum than ISM band
(769 MHz - 935 MHz), while requiring lower power Consumption [20]. The main disadvantage
can be related to the dimension of the antenna and the need of an additional transceiver in the
concentrator node. It should be also observed that most researches in the field are just proposals,
and very few are complete implementations [10]. To take both the research and implementation a
step further, this paper presents a novel design of a WSN platform amenable to home/office
automation and, more generally, to IoT applications thanks to its reduced dimension and its
energy autonomy. The WSN nodes are able to make available information from several sensor
devices (temperature, humidity, presence, etc.) to the user or to a centralized control host.
The energy subsystem includes as main elements the PV panel, a rechargeable thin film battery,
as well as some blocks constituting the Power Management Unit (PMU) for optimized use of the
available harvested energy.
WSN platform characteristics
III. PROTOTYPING :
Two subsequent prototypes were designed and fabricated in order to validate
the proposed platform and the energy management strategies. The first prototype is shown in Fig.
5 and was originally conceived to allow easy monitoring and testing as well as easy comparison
of different solutions and components in terms of performance and power consumptions. It
sequences tested to verify that an optimum trade-off between functionalities and energy
constraints was met. The input scattering parameter, |S11|, of the slot antenna has been measured
and, although the resonance is at a higher frequency than that predicted by simulations, the
antenna is well matched at 868 MHz, as it is apparent from Fig.10. The folded dipole antenna
exhibits similar gain and radiation power pattern. However, it was not characterized standalone
but, directly in the system. The overall system was then evaluated. With reference to the flow
chart shown in Fig. 8, two main sequences were considered: the former includes the system
awakening, initialization, after-awakening controls, and a complete cycle of sensor data
acquisition (sequence A); the latter includes, in addition to the previous phases, also the final
power-hungry phase of data transmission to the concentrator node (sequence B). As previously
stated, the transmission phase requires a relatively long period to charge the supercapacitor with
the energy required for two transmissions (the first one, optional, for synchronization purposes
and the other, mandatory, for data transmission). The use of the supercapacitor allows sustaining
the current absorption peaks required by the RF communication without relying on the battery.
Fig. 11 shows the measured current consumption during the two aforementioned operating
sequences. Sequence A, as illustrated in Fig. 11a, starts at 1.6 s and ends at 4.4 s. Its average
current consumption is 662 A, with an average charge consumption of 0.52 A/h. Assuming
an average operating battery level of 3.9 V, the average power consumption is 2.58 mW.
Sequence B, as illustrated in Fig. 11b, starts approximately at 2 s. After initial sensor data
acquisition, the supercapacitor
lower than the average value. In addition, the proposed node shows the highest value of the
maximum transmit power, equal to 16 dBm (the average value is 6 dBm). Finally, the proposed
system has the highest level of configurability in terms of RF carrier frequency, as detailed in
Section II.C, whereas most of the commercial products (nearly 60%) adopts Bluetooth, ZigBee
or WiFi protocols operating in the ISM 2.4-GHz band. Only Waspmote shows a similar level of
flexibility and, moreover, is the only other device equipped with NFC interface. Regarding
power consumption, the standby current of the proposed device, equal to 3 A, is only 30% of
the average value of 9.6 A [35]. Finally, Fig. 13b illustrates the number of devices embedding
different types of sensors. The histogram shows that the proposed solution embeds four of the
sensors, namely temperature, humidity, accelerometer, and pressure that are mostly present in all
devices. It is worth noting that other sensors can be easily added to the node by exploiting the
onboard I2C interface.
Aa a result, the comparison with the state of the art shows that the proposed platform has
remarkable advantages in terms of system configurability, dimensions and standby power that
allows to satisfy many potential different applications with better performance than other similar
commercial solutions.
VI. CONCLUSION :
An innovative WSN platform expressly conceived for ambient monitoring in
indoor environments, but which could be efficiently applied also in other IoT applications, has
been proposed, designed and experimentally tested.
It consists of a self-powered autonomous sensor node that exploits embedded PV panels to
harvest the energy, a microcontroller, a RF transceiver (plus antenna) and different sensors.
The main strength of the prototype is to achieve the desired (complex) functionality in a small
volume with very low power consumption while ensuring ambient monitoring even during night
hours. As an example of application, the proposed system was tailored for measuring ambient
light, temperature, humidity and pressure inside a typical office that alternates working hours
with artificial light and dark hours during night, week-ends or holydays.
The implemented node can harvest indoor ambient light starting from 100 lux and, according to
the available energy, adaptively sets the sensors acquisition and RF transmission rate. Moreover,
it provides relatively long-distance data transmission (tens of meters) with air data rate from 1 to
500 kbps. The WSN node device is implemented on a flexible PCB and occupies the same area
of a credit card.
A comprehensive comparison with other commercial IoT systems implemented on a PCB shows
that the proposed platform represents a sensible advance of the state of the art thanks to its very
high flexibility, low standby power consumption and small volume
VII.APPENDIX :
The energy storage devices of the WSN node and its worst-case power
consumption have been tailored by specifying acquisition and data transmission rates to reach
the energy balance, also on the basis of the system architecture described in Sec. II, of the
available energy source, and of the “office” case study selected in Sec. III.
Energy Source. Each PV module provides a maximum output power of about 46 μW under a
radiation of 300 lux. Since the PV panel is made up of 2 strings of 3 series-connected modules
(Fig. 3), the total power from the PV panel, Ppanel, is 276 μW. Moreover, SPV1050 has a power
conversion efficiency of 77% and an efficiency of 96% related to the Maximum Power Point
Tracker (MPPT) algorithm, thus the available output power is: Pavail = Ppanel 0.96 0.77 =
204 μW. Assuming a nominal battery voltage of 3.9 V, and 8 h of light per working day, the
WPN node can store a charge of: 204 μW 8 h / 3.9 V = 418.5 μAh.
Storage. The EFL700A39 rechargeable solid-state lithium thin-film battery has a capacity of 700
μAh. Its operating voltage ranges from 3.6 V to 4.2 V. It can also provide maximum a
continuous discharge current of 5 mA and a maximum pulsed discharge current of 10 mA.
Current consumption. Current consumption of each component has been evaluated in the three
different operating modes (sleep, run and peak) by taking into account the electrical
characteristics included in the datasheets and summarized in Table III. These data take into
account consumption of external RTC, ambient sensor, power management, microcontroller and
RF module.
CHAPTER 2
INTRODUCTION TO EMBEDDED SYSTEMS
2.1 INTRODUCTION:
Hardware Software
Five-nine” availability, compact PCI hot swap support, and hard real-time
communications stacks, and fault-management facilities make Linux OS the ideal choice
for companies looking for single operating system for all embedded telecommunication
applications from complex central to single line/trunk cards.
Designers of industrial and process control systems know from experience that
Linux works operating system provide the security and reliability that their industrial
applications require. From ISO 9001 certification to fault-tolerance, secure portioning
and high availability, we’ve got it all. The advantage of our 20 years of experience with
the embedded system. Now a day’s embedded system widely using in the industrial areas
to reduce to tike perform the particular task .This replacing the less work and also more
efficient gives the accurate result.
CHAPTER- 4
MEMORY ORGANISATION &TIMERS IN MICRO CONTROLLER
Types of memory:
The 89C51 have three general types of memory. They are on-chip memory, external Code
memory and external Ram. On-Chip memory refers to physically existing memory on the micro
controller itself. External code memory is the code memory that resides off chip. This is often in
the form of an external EPROM. External RAM is the Ram that resides off chip. This often is in
the form of standard static RAM or flash RAM.
Code memory
Code memory is the memory that holds the actual 89C51 programs that is to be run. This
memory is limited to 64K. Code memory may be found on-chip or off-chip. It is possible to have
4K of code memory on-chip and 60K off chip memory simultaneously. If only off-chip memory
is available then there can be 64K of off chip ROM. This is controlled by pin provided as EA
Internal RAM
The 89C51 have a bank of 128 of internal RAM. The internal RAM is found on-chip. So it is the
fastest Ram available. And also it is most flexible in terms of reading and writing. Internal Ram
is volatile, so when 89C51 is reset, this memory is cleared. 128 bytes of internal memory are
subdivided. The first 32 bytes are divided into 4 register banks. Each bank contains 8 registers.
Internal RAM also contains 128 bits, which are addressed from 20h to 2Fh. These bits are bit
addressed i.e. each individual bit of a byte can be addressed by the user. They are numbered 00h
to 7Fh. The user may make use of these variables with commands such as SETB and CLR.
Memory types:
erased through the source. Intel Flash memory is an extremely reliable non volatile memory
architecture.
4.3 SPECIAL FUNCTION REGISTERS:
The Special Function Registers (SFR's) are located in upper 128 Bytes direct addressing area.
The SFR Memory Map in shows that.
Not all of the addresses are occupied. Unoccupied addresses are not implemented on the chip.
Read accesses to these addresses in general return random data, and write accesses have no
effect. User software should not write 1s to these unimplemented locations, since they may be
used in future microcontrollers to invoke new features. In that case, the reset or inactive values of
the new bits will always be 0, and their active values will be 1.
The functions of the SFR’s are outlined in the following sections.
Accumulator (ACC)
ACC is the Accumulator register. The mnemonics for Accumulator-specific instructions,
however, refer to the Accumulator simply as A.
B Register (B)
The B register is used during multiply and divide operations. For other instructions it can be
treated as another scratch pad register.
Program Status Word (PSW)
The PSW register contains program status information.
Stack Pointer (SP)
The Stack Pointer Register is eight bits wide. It is incremented before data is stored during
PUSH and CALL executions. While the stack may reside anywhere in on chip RAM, the Stack
Pointer is initialized to 07H after a reset. This causes the stack to begin at location 08H.
Data Pointer (DPTR)
The Data Pointer consists of a high byte (DPH) and a low byte (DPL). Its function is to hold a 16-bit
address. It may be manipulated as a 16-bit register or as two independent 8-bit registers
Serial Data Buffer (SBUF)
The Serial Data Buffer is actually two separate registers, a transmit buffer and a receive buffer
transmission. (Moving a byte to SBUF initiates the transmission.) When data is moved from
SBUF, it
Timer Registers
CHAPTER-5
HARDWARE DESIGN
Serial Communication:
The main requirements for serial communication are:
1. Microcontroller
2. PC
3. RS 232 cable
4. MAX 232 IC
5. HyperTerminal
When the pins P3.0 and P3.1 of microcontroller are set, UART which is inbuilt in
the microcontroller will be enabled to start the serial communication.
Timers:
The 8051 has two timers: Timer 0 and Timer 1. They can be used either as timers to
generate a time delay or as counters to count events happening outside the
microcontroller.
Both Timer 0 and Timer 1 are 16-bit wide. Since the 8051 has an 8-bit architecture,
each 16-bit timer is accessed as two separate registers of low byte and high byte.
Lower byte register of Timer 0 is TL0 and higher byte is TH0. Similarly lower byte
register of Timer1 is TL1 and higher byte register is TH1.
C/T
Timer or counter selected. Cleared for timer operation and set for counter operation.
M1
Mode bit 1
M0
Mode bit 0
Mode Selection
The mode used here to generate a time delay is MODE 2.This mode 2 is an 8-bit
timer and therefore it allows only values of 00H to FFH to be loaded into the timer’s
register TH. After TH is loaded with the 8-bit value, the 8051 give a copy of it to
TL. When the timer starts, it starts to count up by incrementing the TL register. It
counts up until it reaches its limit of FFH. When it rolls over from FFH to 00H, it
sets high the TF (timer flag). If Timer 0 is used, TF0 goes high and if Timer 1 is
used, TF1 goes high. When the TL register rolls from FFH to 0 and TF is set to 1,
TL is reloaded automatically with the original value kept by the TH register.
In serial communication, the data is sent one bit at a time. The 8051 has serial
communication capability built into it, thereby making possible fast data transfer
using only a few wires.
The fact that serial communication uses a single data line instead of the 8-bit data
line instead of the 8-bit data line of parallel communication not only makes it
cheaper but also enables two computers located in two different cities to
communicate over the telephone.
Serial data communication uses two methods, asynchronous and synchronous. The
synchronous method transfers a block of data at a time, while the asynchronous
method transfers a single byte at a time. With synchronous communications, the two
devices initially synchronize themselves to each other, and then continually send
characters to stay in sync. Even when data is not really being sent, a constant flow of
bits allows each device to know where the other is at any given time. That is, each
character that is sent is either actual data or an idle character. Synchronous
communications allows faster data transfer rates than asynchronous methods,
because additional bits to mark the beginning and end of each data byte are not
required. The serial ports on IBM-style PCs are asynchronous devices and therefore
only support asynchronous serial communications.
Asynchronous means "no synchronization", and thus does not require sending and
receiving idle characters. However, the beginning and end of each byte of data must
be identified by start and stop bits. The start bit indicates when the data byte is about
to begin and the stop bit signals when it ends. The requirement to send these
additional two bits causes asynchronous communication to be slightly slower than
synchronous however it has the advantage that the processor does not have to deal
with the additional idle characters.
There are special IC chips made by many manufacturers for serial data
communications. These chips are commonly referred to as UART(universal
asynchronous receiver-transmitter) and USART(universal synchronous-
asynchronous receiver-transmitter). The 8051 has a built-in UART.
In the asynchronous method, the data such as ASCII characters are packed between
a start and a stop bit. The start bit is always one bit, but the stop bit can be one or
two bits. The start bit is always a 0 (low) and stop bit (s) is 1 (high). This is called
framing.
The rate of data transfer in serial data communication is stated as bps (bits per
second). Another widely used terminology for bps is baud rate. The data transfer
rate of a given computer system depends on communication ports incorporated into
that system. And in asynchronous serial data communication, this baud rate is
generally limited to 100,000bps. The baud rate is fixed to 9600bps in order to
interface with the microcontroller using a crystal of 11.0592 MHz.
RS232 CABLE:
To allow compatibility among data communication equipment, an interfacing
standard called RS232 is used. Since the standard was set long before the advent of
the TTL logic family, its input and output voltage levels are not TTL compatible.
For this reason, to connect any RS232 to a microcontroller system, voltage
converters such as MAX232 are used to convert the TTL logic levels to the RS232
voltage levels and vice versa.
MAX 232:
This IC provides best noise rejection and very reliable against discharges and short
circuitsMax232 IC is a specialized circuit which makes standard voltages as
required by RS232. MAX232 IC chips are commonly referred to as line drivers.
To ensure data transfer between PC and microcontroller, the baud rate and voltage
levels of Microcontroller and PC should be the same. The voltage levels of
microcontroller are logic1 and logic 0 i.e., logic 1 is +5V and logic 0 is 0V. But for
PC, RS232 voltage levels are considered and they are: logic 1 is taken as -3V to -
25V and logic 0 as +3V to +25V. So, in order to equal these voltage levels,
MAX232 IC is used. Thus this IC converts RS232 voltage levels to microcontroller
voltage levels and vice versa.
SM0 SCON.7 Serial port mode specifier
SM1 SCON.6 Serial port mode specifier
SM2 SCON.5 Used for multiprocessor communication
REN SCON.4 Set/cleared by software to enable/disable
reception
TB8 SCON.3 Not widely used
RB8 SCON.2 Not widely used
TI SCON.1 Transmit interrupt flag. Set by hardware at
the
beginning of the stop bit in mode 1. Must be
cleared by software.
SM0 SM1
0 0 Serial Mode 0
0 1 Serial Mode 1, 8-bit data, 1 stop bit, 1 start bit
1 0 Serial Mode 2
1 1 Serial Mode 3
Of the four serial modes, only mode 1 is widely used. In the SCON register, when
serial mode 1 is chosen, the data framing is 8 bits, 1 stop bit and 1 start bit, which
makes it compatible with the COM port of IBM/ compatible PC’s. And the most
important is serial mode 1 allows the baud rate to be variable and is set by Timer 1
of the 8051. In serial mode 1, for each character a total of 10 bits are transferred,
where the first bit is the start bit, followed by 8 bits of data and finally 1 stop bit.
RF ENCODER:
Features:
✓ 18 pin DIP
✓ Operating voltage is 2.4V ~ 12V
✓ Low power and high noise immunity CMOS technology
✓ Low standby current: 0.1µA (typ.) at VDD = 5V
ALU
CU
Memory
Timer, Counter,serial
communication ROM,
ADC, DAC, Timers,
USART, Oscillators
Etc.,
AT89C51 MICROCONTROLLER:
FEATURES:
➢ 80C51 based architecture
➢ 4-Kbytes of on-chip Reprogrammable Flash Memory
➢ 128 x 8 RAM
➢ Two 16-bit Timer/Counters
➢ Full duplex serial channel
➢ Boolean processor
➢ Four 8-bit I/O ports, 32 I/O lines
➢ Memory addressing capability
– 64K ROM and 64K RAM
➢ Power save modes:
– Idle and power-down
➢ Six interrupt sources
➢ Most instructions execute in 0.3 us
➢ CMOS and TTL compatible
➢ Maximum speed: 40 MHz @ Vcc = 5V
➢ Industrial temperature available
➢ Packages available:
– 40-pin DIP
Pinconfiguration
PIN DESCRIPTION:
VCC
Supply voltage
GND
Ground
Port 0
Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can
sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as
high impedance inputs.
Port 0 can also be configured to be the multiplexed low order address/data bus
during access to external program and data memory. In this mode, P 0 has internal
pull-ups. Port 0 also receives the code bytes during Flash programming and outputs
the code bytes during program verification. External pull-ups are required during
program verification.
Port 1
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The port 1output
buffers can sink/source four TTL inputs. When 1s are written to port 1 pins, they are
pulled high by the internal pull-ups can be used as inputs. As inputs, Port 1 pins that
are externally being pulled low will source current (1) because of the internal pull-
ups.
Port 2
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The port 2 output
buffers can sink/source four TTL inputs. When 1s are written to port 2 pins, they are
pulled high by the internal pull-ups can be used as inputs. As inputs, Port 2 pins that
are externally being pulled low will source current because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program
memory and during access to DPTR. In this application Port 2 uses strong internal
pull-ups when emitting 1s. During accesses to external data memory that use 8-bit
data address (MOVX@R1), Port 2 emits the contents of the P2 Special Function
Register. Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification.
Port 3
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The port 3 output
buffers can sink/source four TTL inputs. When 1s are written to port 3 pins, they are
pulled high by the internal pull-ups can be used as inputs. As inputs, Port 3 pins that
are externally being pulled low will source current because of the internal pull-ups.
Port 3 also receives some control signals for Flash Programming and verification.
RST
Rest input A on this pin for two machine cycles while the oscillator is running resets
the device.
ALE/PROG:
Address Latch Enable is an output pulse for latching the low byte of the address
during access to external memory. This pin is also the program pulse input (PROG)
during Flash programming.
In normal operation ALE is emitted at a constant rate of 1/16 the oscillator
frequency and may be used for external timing or clocking purpose. Note, however,
that one ALE pulse is skipped during each access to external Data memory.
PSEN
Program Store Enable is the read strobe to external program memory when the
AT89c51 is executing code from external program memory PSEN is activated twice
each machine cycle, except that two PSEN activations are skipped during each
access to external data memory.
EA /VPP
External Access Enable (EA) must be strapped to GND in order to enable the
device to fetch code from external program memory locations starting at 0000h up
to FFFFH. Note, however, that if lock bit 1 is programmed EA will be internally
latched on reset. EA should be strapped to Vcc for internal program executions. This
pin also receives the 12-volt programming enable voltage (Vpp) during Flash
programming when 12-volt programming is selected.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL 2
Output from the inverting oscillator amplifier.
4.TIMERS:
On-chip timing/counting facility has proved the capabilities of the microcontroller
for implementing the real time application. These includes pulse counting, frequency
measurement, pulse width measurement, baud rate generation, etc,. Having
sufficient number of timer/counters may be a need in a certain design application.
The 8051 has two timers/counters. They can be used either as timers to generate a
time delay or as counters to count events happening outside the microcontroller. Let
discuss how these timers are used to generate time delays and we will also discuss
how they are been used as event counters.
PROGRAMMING 8051 TIMERS:
The 8051 has timers: Timer 0 and Timer1.they can be used either as timers
or as event counters. Let us first discuss about the timers’ registers and how to
program the timers to generate time delays.
BASIC RIGISTERS OF THE TIMER:
Both Timer 0 and Timer 1 are 16 bits wide. Since the 8051 has an 8-bit
architecture, each 16-bit timer is accessed as two separate registers of low byte and
high byte.
TIMER 0 REGISTERS
The 16-bit register of Timer 0 is accessed as low byte and high byte. the low
byte register is called TL0(Timer 0 low byte)and the high byte register is referred to
as TH0(Timer 0 high byte).These register can be accessed like any other register,
such as A,B,R0,R1,R2,etc.for example, the instruction ”MOV TL0, #4F”moves the
value 4FH into TL0,the low byte of Timer 0.These registers can also be read like
any other register.
TH0 TL0
TIMER 1 REGISTERS:
Timer 1 is also 16-bit register is split into two bytes, referred to as TL1
(Timer 1 low byte) and TH1(Timer 1 high byte).these registers are accessible n the
same way as the register of Timer 0.
GATE
Gate control when set. The timer/counter is enabled only while the INTx pin is
high and the TRx control pin is set. When cleared, the timer is enabled. C/T Timer
or counter selected cleared for timer operation (Input from internal system clock).set
for counter
5. INTERRUPT SYSTEM:
An interrupt is an external or internal event that suspends the operation of
micro controller to inform it that a device needs its service. In interrupt method,
whenever any device needs its service, the device notifies the micro controller by
sending it an interrupt signal. Upon receiving an interrupt signal, the micro
controller interrupts whatever it is doing and serves the device. The program
associated with interrupt is called as interrupt service subroutine (ISR).Main
advantage with interrupts is that the micro controller can serve many devices.
Baud Rate
The baud rate in Mode 0 is fixed as shown in the following equation. Mode 0
Baud Rate = Oscillator Frequency /12 the baud rate in Mode 2 depends on the value
of the SMOD bit in Special Function Register PCON. If SMOD = 0 the baud rate is
1/64 of the oscillator frequency. If SMOD = 1, the baud rate is 1/32 of the oscillator
frequency.
Mode 2 Baud Rate = 2SMODx (Oscillator Frequency)/64.
In the IS89C51, the Timer 1 overflow rate determines the baud rates in Modes 1 and
3.
Memory Interrupt
Location Name
0000H Reset
0003H External
000BH interrupt 0
0013H Timer
001BH interrupt 0
0023H External
interrupt 1
Timer
CHAPTER 6
POWER SUPPLY
6.1 Introduction :
Power supply is a reference to a source of electrical power. A device or system that
supplies electrical or other types of energy to an output load or group of loads is called a power
supply unit or PSU. The term is most commonly applied to electrical energy supplies, less often
to mechanical ones, and rarely to others
This power supply section is required to convert AC signal to DC signal and also to
reduce the amplitude of the signal. The available voltage signal from the mains is 230V/50Hz
which is an AC voltage, but the required is DC voltage(no frequency) with the amplitude of +5V
and +12V for various applications.
In this section we have Transformer, Bridge rectifier, are connected serially and voltage
regulators for +5V and +12V (7805 and 7812) via a capacitor (1000µF) in parallel are connected
parallel as shown in the circuit diagram below. Each voltage regulator output is again is
connected to the capacitors of values (100µF, 10µF, 1 µF, 0.1 µF) are connected parallel through
which the corresponding output(+5V or +12V) are taken into consideration.
6.2.1 Transformer:
A transformer is a device that transfers electrical energy from one circuit to another
through inductively coupled electrical conductors. A changing current in the first circuit (the
primary) creates a changing magnetic field; in turn, this magnetic field induces a changing
voltage in the second circuit (the secondary). By adding a load to the secondary circuit, one can
make current flow in the transformer, thus transferring energy from one circuit to the other.
The secondary induced voltage VS, of an ideal transformer, is scaled from the primary VP
by a factor equal to the ratio of the number of turns of wire in their respective windings:
Taking the ratio of the two equations for VS and V P gives the basic equation for
stepping up or stepping down the voltage
If the voltage is increased (stepped up) (VS > VP), then the current is decreased
(stepped down) (IS < IP) by the same factor. Transformers are efficient so this formula is
a reasonable approximation.
If the voltage is increased (stepped up) (VS > VP), then the current is decreased
(stepped down) (IS < IP) by the same factor. Transformers are efficient so this formula is
a reasonable approximation.
The impedance in one circuit is transformed by the square of the turns ratio. For
example, if an impedance Z S is attached across the terminals of the secondary coil, it
appears to the primary circuit to have an impedance of
Detailed operation :
The simplified description above neglects several practical factors, in particular
the primary current required to establish a magnetic field in the core, and the
contribution to the field due to current in the secondary circuit.
Models of an ideal transformer typically assume a core of negligible reluctance
with two windings of zero resistance. When a voltage is applied to the primary winding,
a small current flows, driving flux around the magnetic circuit of the core. The current
required to create the flux is termed the magnetizing current; since the ideal core has
been assumed to have near-zero reluctance, the magnetizing current is negligible,
although still required to create the magnetic field.
The changing magnetic field induces an electromotive force (EMF) across each
winding. Since the ideal windings have no impedance, they have no associated voltage
drop, and so the voltages VP and VS measured at the terminals of the transformer, are
equal to the corresponding EMFs. The primary EMF, acting as it does in opposition to
the primary voltage, is sometimes termed the "back EMF". This is due to Lenz's law
which states that the induction of EMF would always be such that it will oppose
development of any such change in magnetic field.
When the right hand corner is positive relative to the left hand corner, current
flows along the upper colored path and returns to the supply via the lower colored path.
resistor is large enough so that this time constant is much longer than the time of one
ripple cycle, the above configuration will produce a smoothed DC voltage across the
load.
In some designs, a series resistor at the load side of the capacitor is added. The
smoothing can then be improved by adding additional stages of capacitor–resistor pairs,
often done only for sub-supplies to critical high-gain circuits that tend to be sensitive to
supply voltage noise.
The idealized waveforms shown above are seen for both voltage and current
when the load on the bridge is resistive. When the load includes a smoothing capacitor,
both the voltage and the current waveforms will be greatly changed. While the voltage is
smoothed, as described above, current will flow through the bridge only during the time
when the input voltage is greater than the capacitor voltage. For example, if the load
draws an average current of n Amps, and the diodes conduct for 10% of the time, the
average diode current during conduction must be 10n Amps. This non-sinusoidal
current leads to harmonic distortion and a poor power factor in the AC supply.
In a practical circuit, when a capacitor is directly connected to the output of a
bridge, the bridge diodes must be sized to withstand the current surge that occurs when
the power is turned on at the peak of the AC voltage and the capacitor is fully
discharged. Sometimes a small series resistor is included before the capacitor to limit
this current, though in most applications the power supply transformer's resistance is
already sufficient.
Output can also be smoothed using a choke and second capacitor. The choke
tends to keep the current (rather than the voltage) more constant. Due to the relatively
high cost of an effective choke compared to a resistor and capacitor this is not
employed in modern equipment.
Some early console radios created the speaker's constant field with the current
from the high voltage ("B +") power supply, which was then routed to the consuming
circuits, (permanent magnets were considered too weak for good performance) to
create the speaker's constant magnetic field. The speaker field coil thus performed 2
jobs in one: it acted as a choke, filtering the power supply, and it produced the magnetic
field to operate the speaker.
78xx ICs
have three terminals and are most commonly found in the TO220 form factor, although
smaller surface-mount and larger TrO3 packages are also available from some
manufacturers. These devices typically support an input voltage which can be anywhere
from a couple of volts over the intended output voltage, up to a maximum of 35 or 40
volts, and can typically provide up to around 1 or 1.5 amps of current (though smaller or
larger packages may have a lower or higher current rating).
CHAPTER 7
LCD (Liquid Crystal Display)
EN (Enable LCD):
ACK bit is to acknowledge the MCU that LCD is free so that it can send new
command or data to be stored in its internal Ram locations
ACK = 1 => Not ACK
ACK = 0 => ACK
7.3 LCD diagram:
16 x 2 Char LCD
D0 EN RW RS Vf GND
A K D7
ACK
Vcc
D0 – D7
R1
R2
Block Diagram
LCD
D0-D7 RS RW EN
Data Lines
Embedded
Controller
P1.0
P1.1
P1.2
Hardware connections:
7.4 FLOWCHART:
START
Wait
Yes
Is LCD Free
No
Clear RS Bit
Enable LCD
Send Command
Disable LCD
Is Command
Count Zero
No
1
CHAPTER 8
GSM MODEM
8.1 INTRODUCTION:
GSM (Global System for Mobile communications) is an open, digital cellular technology
used for transmitting mobile voice and data services.
GSM (Global System for Mobile communication) is a digital mobile telephone system
that is widely used in Europe and other parts of the world. GSM uses a variation of Time
Division Multiple Access (TDMA) and is the most widely used of the three digital wireless
telephone technologies (TDMA, GSM, and CDMA). GSM digitizes and compresses data, then
sends it down a channel with two other streams of user data, each in its own time slot. It operates
at either the 900 MHz or 1,800 MHz frequency band. It supports voice calls and data transfer
speeds of up to 9.6 kbit/s, together with the transmission of SMS (Short Message Service).
8.1.1 History:
In 1982, the European Conference of Postal and Telecommunications Administrations
(CEPT) created the Group Special Mobile (GSM) to develop a standard for a mobile telephone
system that could be used across Europe. In 1987, a memorandum of understanding was signed
by 13 countries to develop a common cellular telephone system across Europe. Finally the
system created by SINTEF lead by Torleiv Maseng was selected.
In 1989, GSM responsibility was transferred to the European Telecommunications
Standards Institute (ETSI) and phase I of the GSM specifications were published in 1990. The
first GSM network was launched in 1991 by Radiolinja in Finland with joint technical
infrastructure maintenance from Ericsson.
By the end of 1993, over a million subscribers were using GSM phone networks being
operated by 70 carriers across 48 countries. As of the end of 1997, GSM service was available in
more than 100 countries and has become the de facto standard in Europe and Asia.
8.2 GSM Frequencies:
GSM networks operate in a number of different frequency ranges (separated into GSM
frequency ranges for 2G and UMTS frequency bands for 3G). Most 2G GSM networks operate
in the 900 MHz or 1800 MHz bands. Some countries in the Americas (including Canada and the
United States) use the 850 MHz and 1900 MHz bands because the 900 and 1800 MHz frequency
bands were already allocated. Most 3G GSM networks in Europe operate in the 2100 MHz
frequency band. The rarer 400 and 450 MHz frequency bands are assigned in some countries
where these frequencies were previously used for first-generation systems.
GSM-900 uses 890–915 MHz to send information from the mobile station to the base
station (uplink) and 935–960 MHz for the other direction (downlink), providing 124 RF channels
(channel numbers 1 to 124) spaced at 200 kHz. Duplex spacing of 45 MHz is used. In some
countries the GSM-900 band has been extended to cover a larger frequency range. This 'extended
GSM', E-GSM, uses 880–915 MHz (uplink) and 925–960 MHz (downlink), adding 50 channels
(channel numbers 975 to 1023 and 0) to the original GSM-900 band.
Time division multiplexing is used to allow eight full-rate or sixteen half-rate speech
channels per radio frequency channel. There are eight radio timeslots (giving eight burst periods)
grouped into what is called a TDMA frame. Half rate channels use alternate frames in the same
timeslot. The channel data rate for all 8 channels is 270.833 Kbit/s, and the frame duration is
4.615 ms.
The transmission power in the handset is limited to a maximum of 2 watts in
GSM850/900 and 1 watt in GSM1800/1900. GSM operates in the 900MHz and 1.8GHz bands in
Europe and the 1.9GHz and 850MHz bands in the US. The 850MHz band is also used for GSM
and 3G in Australia, Canada and many South American countries. By having harmonized
spectrum across most of the globe, GSM’s international roaming capability allows users to
access the same services when travelling abroad as at home. This gives consumers seamless and
same number connectivity in more than 218 countries.
Terrestrial GSM networks now cover more than 80% of the world’s population. GSM
satellite roaming has also extended service access to areas where terrestrial coverage is not
available.
Mobile Telephony Standards
1G
The first generation of mobile telephony (written 1G) operated using analogue communications
and portable devices that were relatively large. It used primarily the following standards:
• AMPS (Advanced Mobile Phone System), which appeared in 1976 in the United States,
was the first cellular network standard. It was used primarily in the Americas, Russia and
Asia. This first-generation analogue network had weak security mechanisms which
allowed hacking of telephones lines.
• TACS (Total Access Communication System) is the European version of the AMPS
model. Using the 900 MHz frequency band, this system was largely used in England and
then in Asia (Hong-Kong and Japan).
• ETACS (Extended Total Access Communication System) is an improved version of the
TACS standard developed in the United Kingdom that uses a larger number of
communication channels.
The first-generation cellular networks were made obsolete by the appearance of an entirely
digital second generation.
The second generation of mobile networks marked a break with the first generation of cellular
telephones by switching from analogue to digital. The main 2G mobile telephony standards are:
• GSM (Global System for Mobile communications) is the most commonly used standard
in Europe at the end of the 20th century and supported in the United States. This standard
uses the 900 MHz and 1800 MHz frequency bands in Europe. In the United States,
however, the frequency band used is the 1900 MHz band. Portable telephones that are
able to operate in Europe and the United States are therefore called tri-band.
• CDMA (Code Division Multiple Access) uses a spread spectrum technique that allows a
radio signal to be broadcast over a large frequency range.
• TDMA (Time Division Multiple Access) uses a technique of time division of
communication channels to increase the volume of data transmitted simultaneously.
TDMA technology is primarily used on the American continent, in New Zealand and in
the Asia-Pacific region.
With the 2G networks, it is possible to transmit voice and low volume digital data, for example
text messages (SMS, for Short Message Service) or multimedia messages (MMS, for Multimedia
Message Service). The GSM standard allows a maximum data rate of 9.6 kbps.
Extensions have been made to the GSM standard to improve throughput. One of these is
the GPRS (General Packet Radio System) service which allows theoretical data rates on the
order of 114 Kbit/s but with throughput closer to 40 Kbit/s in practice. As this technology does
not fit within the "3G" category, it is often referred to as 2.5G
The EDGE (Enhanced Data Rates for Global Evolution) standard, billed as 2.75G,
quadruples the throughput improvements of GPRS with its theoretical data rate of 384 Kbps,
thereby allowing the access for multimedia applications. In reality, the EDGE standard allows
maximum theoretical data rates of 473 Kbit/s, but it has been limited in order to comply with the
IMT-2000 (International Mobile Telecommunications-2000) specifications from the ITU
(International Telecommunications Union).
3G
The IMT-2000 (International Mobile Telecommunications for the year 2000) specifications
from the International Telecommunications Union (ITU) defined the characteristics of 3G (third
generation of mobile telephony). The most important of these characteristics are:
• High transmission data rate.
• 144 Kbps with total coverage for mobile use.
• 384 Kbps with medium coverage for pedestrian use.
• 2 Mbps with reduced coverage area for stationary use.
• World compatibility.
• Compatibility of 3rd generation mobile services with second generation networks.
3G offers data rates of more than 144 Kbit/s, thereby allowing the access to multimedia uses
such as video transmission, video-conferencing or high-speed internet access. 3G networks use
different frequency bands than the previous networks: 1885-2025 MHz and 2110-2200 MHz.
GSM uses narrowband TDMA, which allows eight simultaneous calls on the same radio
frequency. There are three basic principles in multiple access, FDMA (Frequency Division
Multiple Access), TDMA (Time Division Multiple Access), and CDMA (Code Division
Multiple Access). All three principles allow multiple users to share the same physical channel.
But the two competing technologies differ in the way user sharing the common resource.
TDMA allows the users to share the same frequency channel by dividing the signal into
different time slots. Each user takes turn in a round robin fashion for transmitting and receiving
over the channel. Here, users can only transmit in their respective time slot.
CDMA uses a spread spectrum technology that is it spreads the information contained in
a particular signal of interest over a much greater bandwidth than the original signal. Unlike
TDMA, in CDMA several users can transmit over the channel at the same time.
TDMA in brief:
Advantages of TDMA:
Disadvantages of TDMA:
One major disadvantage using TDMA technology is that the users has a predefined time
slot. When moving from one cell site to other, if all the time slots in this cell are full the user
might be disconnected. Likewise, if all the time slots in the cell in which the user is currently in
are already occupied, the user will not receive a dial tone.
Mobile telephone networks are based on the concept of cells, circular zones that overlap
to cover a geographical area.
Cellular networks are based on the use of a central transmitter-receiver in each cell,
called a "base station" (or Base Transceiver Station, written BTS). The smaller the radius of a
cell, the higher is the available bandwidth. So, in highly populated urban areas, there are cells
with a radius of a few hundred meters, while huge cells of up to 30 kilometers provide coverage
in rural areas.
In a cellular network, each cell is surrounded by 6 neighbouring cells (thus a cell is
generally drawn as a hexagon). To avoid interference, adjacent cells cannot use the same
frequency. In practice, two cells using the same frequency range must be separated by a distance
of two to three times the diameter of the cell.
The SIM card therefore allows each user to be identified independently of the terminal
used during communication with a base station. Communications occur through a radio link (air
interface) between a mobile station and a base station.
All the base stations of a cellular network are connected to a base station
controller (BSC) which is responsible for managing distribution of the resources. The system
consisting of the base station controller and its connected base stations is called the Base Station
Subsystem (BSS).
Finally, the base station controllers are themselves physically connected to the Mobile
Switching Centre (MSC), managed by the telephone network operator, which connects them to
the public telephone network and the Internet. The MSC belongs to a Network Station
Subsystem (NSS), which is responsible for managing user identities, their location and
establishment of communications with other subscribers. The MSC is generally connected to
databases that provide additional functions:
CHAPTER 9
by the United States Department of Defense. It is the only fully functional GNSS in the
world. It uses a constellation of between 24 and 32 Medium Earth Orbit satellites that
transmit precise microwave signals, which enable GPS receivers to determine their current
location, the time, and their velocity. Its official name is NAVSTAR GPS. Although
NAVSTAR is not an acronym a few backronyms have been created for it.0. The GPS
satellite constellation is managed by the United States Air Force 50th Space Wing. GPS is
often used by civilians as a navigation system GPS receiver calculates its position by
carefully timing the signals sent by the GPS satellites high above the Earth. Each satellite
continually transmits messages containing the time the message was sent, precise orbital
information (the ephemeris), and the general system health and rough orbits of all GPS
satellites (the almanac). The receiver measures the transit time of each message and
computes the distance to each satellite. Geometric trilateration is used to combine these
distances with the location of the satellites to determine the receiver's location. The position
is displayed, perhaps with a moving map display or latitude and longitude; elevation
information may be included. Many GPS units also show derived information such as
General Packet Radio Service (GPRS) is a packet oriented Mobile Data Service available to
Newer Garmin GPS receivers with WAAS (Wide Area Augmentation System) capability can
improve accuracy to less than three meters on average. No additional equipment or fees are
required to take advantage of WAAS. Users can also get better accuracy with Differential GPS
(DGPS), which corrects GPS signals to within an average of three to five meters. The U.S. Coast
Guard operates the most common DGPS correction service. This system consists of a network of
towers that receive GPS signals and transmit a corrected signal by beacon transmitters. In order
to get the corrected signal, users must have a differential beacon receiver and beacon antenna in
The 24 satellites that make up the GPS space segment are orbiting the earth about 12,000 miles
above us. They are constantly moving, making two complete orbits in less than 24 hours. These
running in the event of a solar eclipse, when there's no solar power. Small rocket boosters on
Here are some other interesting facts about the GPS satellites (also called NAVSTAR, the
• Each satellite is built to last about 10 years. Replacements are constantly being built and
• A GPS satellite weighs approximately 2,000 pounds and is about 17 feet across with the
GPS satellites transmit two low power radio signals, designated L1 and L2. Civilian GPS uses
the L1 frequency of 1575.42 MHz in the UHF band. The signals travel by line of sight, meaning
they will pass through clouds, glass and plastic but will not go through most solid objects such as
A GPS signal contains three different bits of information - a pseudorandom code, ephemeris data
and almanac data. The pseudorandom code is simply an I.D. code that identifies which satellite is
transmitting information. You can view this number on your Garmin GPS unit's satellite page, as
buildings or large rock surfaces before it reaches the receiver. This increases the travel time
• Receiver clock errors - A receiver's built-in clock is not as accurate as the atomic clocks
onboard the GPS satellites. Therefore, it may have very slight timing errors.
• Orbital errors - Also known as ephemeris errors, these are inaccuracies of the satellite's
reported location.
• Number of satellites visible - The more satellites a GPS receiver can "see," the better the
accuracy. Buildings, terrain, electronic interference, or sometimes even dense foliage can
block signal reception, causing position errors or possibly no position reading at all. GPS
• Satellite geometry/shading - This refers to the relative position of the satellites at any given
time. Ideal satellite geometry exists when the satellites are located at wide angles relative to
each other. Poor geometry results when the satellites are located in a line or in a tight
grouping.
degradation of the signal once imposed by the U.S. Department of Defense. SA was
intended to prevent military adversaries from using the highly accurate GPS signals. The
government turned off SA in May 2000, which significantly improved the accuracy of
9.5 Applications :
GPS has a variety of applications on land, at sea and in the air. Basically, GPS is usable
everywhere except where it's impossible to receive the signal such as inside most buildings, in
caves and other subterranean locations, and underwater. The most common airborne applications
are for navigation by general aviation and commercial aircraft. At sea, GPS is also typically used
for navigation by recreational boaters, commercial fishermen, and professional mariners. Land-
based applications are more diverse. The scientific community uses GPS for its precision timing
Surveyors use GPS for an increasing portion of their work. GPS offers cost savings by drastically
reducing setup time at the survey site and providing incredible accuracy. Basic survey units,
costing thousands of dollars, can offer accuracies down to one meter. More expensive systems
Recreational uses of GPS are almost as varied as the number of recreational sports available.
GPS is popular among hikers, hunters, snowmobilers, mountain bikers, and cross-country skiers,
just to name a few. Anyone who needs to keep track of where he or she is, to find his or her way
to a specified location, or know what direction and how fast he or she is going can utilize the
GPS is now commonplace in automobiles as well. Some basic systems are in place and provide
emergency roadside assistance at the push of a button (by transmitting your current position to a
dispatch center). More sophisticated systems that show your position on a street map are also
available. Currently these systems allow a driver to keep track of where he or she is and suggest
RELAYS :
10.1 Introduction :
The relay allows the isolation of two separate sections of a system with two different voltage
sources i.e., a small amount of voltage/current on one side can handle a large amount of
voltage/current on the other side but there is no chance that these two voltages mix up.
Inductor
When current flows through the coil, a magnetic field is created around the coil i.e., the
coil is energized. This causes the armature to be attracted to the coil. The armature’s contact acts
like a switch and closes or opens the circuit. When the coil is not energized, a spring pulls the
armature to its normal state of open or closed. There are all types of relays for all kinds of
applications.
Transistors and ICs must be protected from the brief high voltage 'spike' produced when the
relay coil is switched off. The above diagram shows how a signal diode (eg 1N4148) is
connected across the relay coil to provide this protection. The diode is connected 'backwards' so
that it will normally not conduct. Conduction occurs only when the relay coil is switched off, at
this moment the current tries to flow continuously through the coil and it is safely diverted
through the diode. Without the diode no current could flow and the coil would produce a
damaging high voltage 'spike' in its attempt to keep the current flowing.
1. The contacts can be normally open (NO) or normally closed (NC). In the NC type, the
contacts are closed when the coil is not energized. In the NO type, the contacts are closed when
the coil is energized.
2. There can be one or more contacts. i.e., different types like SPST (single pole single throw),
SPDT (single pole double throw) and DPDT (double pole double throw) relays.
3. The voltage and current required to energize the coil. The voltage can vary from a few volts to
50 volts, while the current can be from a few milliamps to 20milliamps. The relay has a
minimum voltage, below which the coil will not be energized. This minimum voltage is called
the “pull-in” voltage.
4. The minimum DC/AC voltage and current that can be handled by the contacts. This is in the
range of a few volts to hundreds of volts, while the current can be from a few amps to 40A or
more, depending on the relay.
DRIVING A RELAY:
An SPDT relay consists of five pins, two for the magnetic coil, one as the common
terminal and the last pins as normally connected pin and normally closed pin. When the current
flows through this coil, the coil gets energized. Initially when the coil is not energized, there will
be a connection between the common terminal and normally closed pin. But when the coil is
energized, this connection breaks and a new connection between the common terminal and
normally open pin will be established. Thus when there is an input from the microcontroller to
the relay, the relay will be switched on. Thus when the relay is on, it can drive the loads
connected between the common terminal and normally open pin. Therefore, the relay takes 5V
SOURCE CODE
#include <lpc214x.h>
#include <string.h>
#include<stdio.h>
#include"gpio.h"
#include"lcd.h"
#include"serial.h"
#define r1 P0_20
#define r2 P0_21
unsigned char
gchr='x',gchr1='x',gchr2='x',gchr3='x',gchr4='x',gchr5='x',gchr6='x',ch='x',strx[4]="0000",stry[4]
="0000",strz[4]="0000";
int set=1;
void pin()
PINSEL1=0X15000000;
PINSEL2=0X00000000;
IODIR0=0xffffffff;
IODIR1=0XFFFFFFFF;//PORT1 AS OUTPUT
IOCLR1=0XFFFFFFFF;
return pinState;
U0IER = 0x01;
VICVectCntl0 = 0x00000026; //select a
priority slot for a given interrupt
VICVectAddr0 = (unsigned long)isrPtr; //pass the address of the IRQ into the
VIC slot
U1IER = 0x01;
VICVectAddr1 = (unsigned long)isrPtr; //pass the address of the IRQ into the
VIC slot
void okcheck()
do{
rr = receive_0();
}while(rr != 'K');
}
void okc()
do{
rr = receive_1();
}while(rr != 'K');
int main()
pin();
IOCLR0=r1;IOCLR0=r2;
ser_init_0(0x61,0x00);
ser_init_1(0x61,0x00);
initlcd();
stringlcd(0xC0,"DEVICE CONTROL");delay(1000);clcd(1);
string_0("AT\r\n");okcheck();
string_0("ATE0\r\n");okcheck();
string_0("AT+CMGF=1\r\n");okcheck();
string_0("AT+CNMI=1,2,0,0\r\n");okcheck();
clcd(1);stringlcd(0x80,"READY TO READ DATA");
stringlcd(0xc0,"FROM SERVER");delay(300);
while(1)
stringlcd(0x01,"AT+SAPBR=3,1,CONTYPE
GPRS");string_0("AT+SAPBR=3,1,");send_0('"');string_0("Contype");send_0('"');send_0(',');sen
d_0('"');string_0("GPRS");send_0('"');string_0("\r\n");delay(5000);
stringlcd(0x01,"AT+SAPBR=3,1, APN
WWW");string_0("AT+SAPBR=3,1,");send_0('"');string_0("APN");send_0('"');send_0(',');send_
0('"');string_0("WWW");send_0('"');string_0("\r\n");delay(5000);
stringlcd(0x01,"AT+SAPBR=1,1");string_0("AT+SAPBR=1,1\r\n");delay(5000);
stringlcd(0x01,"AT+SAPBR=2,1");string_0("AT+SAPBR=2,1\r\n");delay(5000);
stringlcd(0x01,"AT+HTTPINIT");string_0("AT+HTTPINIT\r\n");delay(5000);
stringlcd(0x01,"AT+HTTPPARA");string_0("AT+HTTPPARA=");send_0('"');string_0("URL");
send_0('"');send_0(',');send_0('"');string_0("api.thingspeak.com/channels/272149/fields/1.json?re
sults=1");send_0('"');string_0("\r\n");delay(3000);
start:
stringlcd(0x01,"AT+HTTACTION=0");string_0("AT+HTTPACTION=0\r\n");okcheck();
do{
//
API.thingspeak.com/channels/219582/field/1.json
ch = receive_0();
}while(ch != '+');
stringlcd(0xC0,"AT+HTTACTION=0"); string_0("AT+HTTPACTION=0\r\n");okcheck();
do{
ch = receive_0();
}while(ch != '+');
stringlcd(0x01,"AT+HTTPREAD");string_0("AT+HTTPREAD\r\n");
do{
rcv=receive_0();
if((rcv=='O')||(rcv=='K'))
goto start;
}while(rcv != '[');
back:rcv=receive_0();
if(rcv=='{')
count=0;
do{
rcv=receive_0();
data1[count]=rcv;
count=count+1;
}while(rcv != '}');
rcv=receive_0();
if(rcv!=']')
goto back;
}
clcd(1);
dlcd(data1[58]);dlcd(data1[59]);dlcd(data1[60]);delay(2000);
if((data1[58]=='1')||(data1[59]=='1')||(data1[60]=='1'))
IO0SET=r1;
delay(500);
if((data1[58]=='2')||(data1[59]=='2')||(data1[60]=='2'))
IO0CLR=r1;delay(500);
if((data1[58]=='3')||(data1[59]=='3')||(data1[60]=='3'))
IO0SET=r2;delay(500);
if((data1[58]=='4')||(data1[59]=='4')||(data1[60]=='4'))
IO0CLR=r2;delay(500);
}
}
rec1 = receive_0();
if(rec1 == '*')
gchr1 = receive_0();
if(gchr1=='1')
IOSET0=r1;
if(gchr1=='2')
IOCLR0=r1;
if(gchr1=='3')
IOSET0=r2;
}
if(gchr1=='4')
IOCLR0=r2;
ch = receive_1();
if(ch == '*')
}
RESULTS :
The main features of the proposed platform were compared to those of other solutions
designed for distributed sensing. The evaluation is carried out by considering [8] and [35], where
an extensive survey of the state of the art of IoT nodes is performed. In order to make a fair
comparison, we considered a number of 58 IoT commercial devices that are implemented on
PCB, out of 142 included in [8] and [35] at the date of writing. First of all, it is worth noting that
the proposed sensor node is the only one exploiting energy harvesting based on PV cells. It also
follows from the comparison that the maximum size (along three dimensions) of the proposed
device (86 mm) is slightly higher than the average value, equal to 62 mm, of the considered 58
devices. Nonetheless, it is worth noting that the overall volume of the proposed node, equal to 13
932 mm3, is much lower (about an order of magnitude) than the average value, equal to 130 360
mm3 [35]. This is mainly due to the low thickness of the overall assembled system in Fig. 6,
which is equal to 3 mm only. Fig. 13a shows the distribution of the sensitivity of RF receivers of
the IoT devices (in this case, all the 142 devices in [35] are considered). It is apparent that the
transceiver adopted in this work exhibits the best performance, which is 21 dBm
CONCLUSION :
An innovative WSN platform expressly conceived for ambient monitoring in
indoor environments, but which could be efficiently applied also in other IoT applications, has
been proposed, designed and experimentally tested.
The implemented node can harvest indoor ambient light starting from 100 lux
and, according to the available energy, adaptively sets the sensors acquisition and RF
transmission rate. Moreover, it provides relatively long-distance data transmission (tens of
meters) with air data rate from 1 to 500 kbps. The WSN node device is implemented on a
flexible PCB and occupies the same area of a credit card.
Certificate of Acceptance
This is to certify that our review board has accepted research paper of
“An investigation on energy efficient wireless sensor network for home and office automation”
M.Jithendra Reddy
Asst Editor In Chief
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 06 Issue: 07 | July 2019 www.irjet.net p-ISSN: 2395-0072
---------------------------------------------------------------------***---------------------------------------------------------------------
Abstract At this purpose, each WSN physical node is equipped with
Smart homes/offices based on Wireless Sensor Networks multi-sensor devices for heterogeneous ambient sensing and
(WSNs) can provide an assisted living and working is also able to store, pre-process, transmit and receive data to
environment to the users. In these applications, the a host controller. More generally, intelligent wireless
distributed network nodes are made up of low-power low- interconnected sensing devices are expected to pervade all
cost high-energy-efficient electronic platforms equipped with the emerging applications in the Internet of Things (IoT) area
sensors, microcontroller, radio and antenna, able to [7]-[10]. In this context, key performances of the WSN nodes
periodically sense, receive, store, pre-process and transmit are reduced power consumption and maximum throughput
ambient data to a remote host station. Conventional nodes at a maximum communication distance [9]. Additional
are usually supplied by batteries, resulting in a significant specifications that must be considered are cost, size and ease
limitation to the life time and to the maximum number of of configuration and installation [7]-[8]. Presently, to prolong
deployable devices. To meet the demand of next Internet of the battery life up to months or even years, WSN nodes are
Things (IoT) applications, requiring a vast plurality of implemented through energy-efficient communication
interconnected wireless network nodes, this paper presents schemes combined with low-power design [7], [11]-[12]. To
the design and implementation of a WSN platform whose this end, Wi-Fi, ZigBee, and Bluetooth are popular wireless
nodes are energetically autonomous thanks to an embedded protocols which use a license-free ISM (Industrial, Scientific
photovoltaic (PV) panel associated to a rechargeable battery and Medical) frequency band. ZigBee, in particular, offers the
and a power-efficient design with optimized power- best trade-off between cost and communication distance, as
management strategy. The implemented node is able to proven by the several related papers in the literature [12]-
harvest indoor ambient light starting from 100 lux and, [16]. Combination of Wi-Fi and Zigbee are also proposed for
according to the available energy, adaptively sets the sensors power saving [17], [18]. Another solution embeds several
acquisition and RF transmission rate. Moreover, it provides radio modules to reduce energy consumption and latency for
long-distance data transmission with air data rate from 1 to neighbor discovery and opportunistic networking [19], but at
500 kbps. The WSN node device is implemented on an 8.6 x the expense of increasing both the size and cost of devices.
5.4-cm2 flexible PCB, being therefore amenable to conform Nevertheless, the use of Wi-Fi, Bluetooth and Zigbee as a low
even to curved surfaces. Comparison with commercial IoT power radio is still too costly for WSN applications. Bluetooth
nodes reveals a significant improvement in the state of the Low Energy (BLE) protocol reduces power consumption and
art. provides connection to smart phones with easy setup but has
limited operating range and is subject to royalties, which
Key Words: WSN, Internet of Things (IoT), low power, makes BLE unsuitable for WSN ubiquitous low-cost devices.A
microcontrollers, Energy harvesting, home last, profitable, approach is offered by Sub-1GHz wireless
automation,low power processors. connectivity schemes providing long distance communication
(tens of kilometers, thanks to the lower frequencies
1. INTRODUCTION exploited) in a less crowded spectrum than ISM band (769
Home/Office automation consists in the exploitation of MHz - 935 MHz), while requiring lower power Consumption
micro/nanoelectronic technology within the home/office [20]. The main disadvantage can be related to the dimension
environment to assist and enhance the quality of life/work of of the antenna and the need of an additional transceiver in
its occupants through the main goals of increasing comfort, the concentrator node. It should be also observed that most
saving energy and providing remote surveillance and real researches in the field are just proposals, and very few are
time monitoring [1]-[3]. Wireless Sensor Network (WSN) complete implementations [10]. To take both the research
platforms are exploited to implement this paradigm [4]-[6]. and implementation a step further, this paper presents a
© 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 1
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 06 Issue: 07 | July 2019 www.irjet.net p-ISSN: 2395-0072
novel design of a WSN platform amenable to home/office protocols. Moreover, every node can easily act as an IoT
automation and, more generally, to IoT applications thanks gateway if connected to a processing host that collects and
to its reduced dimension and its energy autonomy. The WSN store the data coming from the sensor nodes. The flexible
nodes are able to make available information from several PCB embeds a flexible PV panel and printed integrated
sensor devices (temperature, humidity, presence, etc.) to the antenna. Thin film batteries and low-profile components are
user or to a centralized control host. also employed to achieve both compact dimensions
(compatible with the size of a credit card: 8.6 x 5.4 cm2) and
ability to conform non-flat surfaces.
Finally, the GUI provides an easy configuration tool and
allows the user to interact with the system.
The paper is organized as follows. Section II describes the
WSN node architecture, energy management strategy and first
component selection based on the energy budget
specifications (discussed in the Appendix). Example of
application and further implementation highlights are
presented in Section III, whereas experimental results are
shown in Section IV. Finally, a comprehensive performance
comparison with other implemented platforms for distributed
Fig. 1. WSN node functional block diagram sensing is reported in Section V. Concluding remarks are
. summarized in Section VI.
Low-power operation and energy efficiency are obtained
Through careful hardware and software co-design. To this II. ARCHITECTURE AND ENERGY MANAGEMENT STRATEGY
end, the microcontroller, which manages the whole ystem, OF THE WSN NODE
does not execute a rigid control algorithm but adaptively Since the WSN node must be able to periodically sense,
changes tasks and their timings by taking into account the receive, store, pre-process and transmit ambient data to a
energy available to the node and the power consumption of remote host station, its overall architecture can be divided into
each task. Long distance communication is enabled through the three main functional subsystems, namely: energy, sensor
the use of a specific radio module allowing more flexibility in and control, and communication, as shown in Fig. 1. The
frequency, modulation schemes and protocols. In particular, energy subsystem includes components and circuits that
comparing the implemented platform with existing similar supersede harvesting, storage and energy management.
solutions, the main significant advantages are summarized Sensors aimed to environmental monitoring are part of the
below: sensor and control subsystem. Of course, the type and number
1) the node is energetically autonomous; of sensors is dictated by the specific application. The
2) highly configurable RF connectivity; microcontroller manages the sensors and oversees the overall
3) the node is implemented on a flexible and compact PCB; system operation. Data from sensors are cyclically sampled
4) a Graphical User Interface (GUI) is developed and and sent to an external base station through the
provided to the final user. communication subsystem. Starting from these general
The first feature is obtained through indoor energy harvesting assumptions and considerations, the proposed platform has
from an embedded photovoltaic (PV) panel associated to a been designed as illustrated in Fig. 2 and as summarized in
rechargeable battery and through through innovative energy- Table I, where the main specifications and functions of the
aware power managing policy. Consequently, periodic human different subsystems are briefly reported. Each subsystem is
maintenance required by devices powered by a primary described in detail below.
battery is avoided. As far as the connectivity is concerned, the
proposed platform exhibits a high level of flexibility,
providing different transmission bands, protocols, and data
rates to the designer. In such a way the system can meet the
specified energy constraints and cost budget allowing the
designer to develop proprietary RF point-to-point and mesh
protocols. In particular, the system supports the realization of
mesh networks through IPv6 over Low-Power Wireless
Personal Area Networks (6LoWPAN) protocol in which every
node has its own IPv6 address, allowing direct connection to
the Internet by using open standards.
The use of point-to-point or mesh network architecture
depends upon the specific application. Indeed, if the area to be
monitored is very large, a mesh architecture would guarantee
a better coverage using a single gateway. The proposed
platform fits also this scenario by supporting different
© 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 2
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 06 Issue: 07 | July 2019 www.irjet.net p-ISSN: 2395-0072
III. PROTOTYPING
Two subsequent prototypes were designed and fabricated in
order to validate the proposed platform and the energy
management strategies. The first prototype is shown in Fig. 5
and was originally conceived to allow easy monitoring and Fig. 3. Second prototype: a) top view; b) bottom view
testing as well as easy comparison of different solutions and
components in terms of performance and power IV. EXPERIMENTAL VALIDATION
consumptions. It implements the architecture discussed in the Experimental measurements were performed to initially verify
previous section by distributing the various devices on two the operating states of individual sections of the node and
different PCBs: a motherboard and a daughterboard. Among their targeted current consumptions. These contributes were
the possible alternatives, a point-to-point communication aggregated to evaluate the energy weights associated to the
protocol with acknowledgement, directly accessing the link expected three operating scenarios defined in Sec. 3. Then,
layer of the SPIRIT1, was adopted. This design choice has overall system functionality was checked, and main sequences
been adopted for a proficient transmission of short messages tested to verify that an optimum trade-off between
from different nodes to a single centralized control host. The functionalities and energy constraints was met. The input
motherboard includes the components constituting the sensor scattering parameter, |S11|, of the slot antenna has been
and control subsystems as well as the main components of the measured and, although the resonance is at a higher frequency
energy subsystem. The daughterboard includes the PV panels, than that predicted by simulations, the antenna is well
ambient light sensor and the integrated monopole slot antenna. matched at 868 MHz, as it is apparent from Fig.10. The folded
It is fed by a 50-Ohm micro strip and requires transformation dipole antenna exhibits similar gain and radiation power
© 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 3
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 06 Issue: 07 | July 2019 www.irjet.net p-ISSN: 2395-0072
© 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 4
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 06 Issue: 07 | July 2019 www.irjet.net p-ISSN: 2395-0072
© 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 5
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 06 Issue: 07 | July 2019 www.irjet.net p-ISSN: 2395-0072
terms of system configurability, dimensions and standby Storage. The EFL700A39 rechargeable solid-state lithium
power that allows to satisfy many potential different thin-film battery has a capacity of 700 μAh. Its operating
applications with better performance than other similar voltage ranges from 3.6 V to 4.2 V. It can also provide
commercial solutions. maximum a continuous discharge current of 5 mA and a
maximum pulsed discharge current of 10 mA.
VI. CONCLUSION Current consumption. Current consumption of each
An innovative WSN platform expressly conceived for component has been evaluated in the three different
ambient monitoring in indoor environments, but which operating modes (sleep, run and peak) by taking into
could be efficiently applied also in other IoT applications, account the electrical characteristics included in the
has been proposed, designed and experimentally tested. datasheets and summarized in Table III. These data take
It consists of a self-powered autonomous sensor node that into account consumption of external RTC, ambient
exploits embedded PV panels to harvest the energy, a sensor, power management, microcontroller and RF
microcontroller, a RF transceiver (plus antenna) and module.
different sensors. Energy Sustainability. The best trade-off between energy
The main strength of the prototype is to achieve the sustainability and expected performance was met by
desired (complex) functionality in a small volume with selecting a suitable number of acquisition and
very low power consumption while ensuring ambient transmission cycles within the different scenarios WD, WN
monitoring even during night hours. As an example of and WE. The energy sustainability of the WSN node can be
application, the proposed system was tailored for hence ascertained. Table II shows the amount of charge
measuring ambient light, temperature, humidity and and duration in the envisaged operating scenarios.
pressure inside a typical office that alternates working Combining consumption and energy production data
hours with artificial light and dark hours during night, together, the battery charge and, consequently, the system
week-ends or holydays. energy balance was evaluated. Figure 14 shows the
The implemented node can harvest indoor ambient light battery state of charge during the four weeks, assuming
starting from 100 lux and, according to the available that the battery is fully charged when the system is
energy, adaptively sets the sensors acquisition and RF switched on. In the worst case (i.e., at the end of the
transmission rate. Moreover, it provides relatively long- weekend) the battery charge is still above 20% ensuring
distance data transmission (tens of meters) with air data an adequate lifetime. Moreover, along the week the system
rate from 1 to 500 kbps. The WSN node device is is able to fully recharge the battery. In particular, it is fully
implemented on a flexible PCB and occupies the same area recharged at the beginning of every WE, confirming a
of a credit card. positive energy balance. In case of a prolonged absence of
A comprehensive comparison with other commercial IoT light, the power manager will disconnect the battery to
systems implemented on a PCB shows that the proposed preserve its lifetime and to avoid a condition of over
platform represents a sensible advance of the state of the discharge. Later, when the energy source will be available
art thanks to its very high flexibility, low standby power again, the platform is able to restart its functionality,
consumption and small volume without the user intervention, reconnecting the battery
and requesting a new operating configuration from the
VII.APPENDIX central node, as showed in the flow diagram in Fig. 9.
The energy storage devices of the WSN node and its worst- Finally, the base station can adapt the acquisition and
case power consumption have been tailored by specifying transmission rate depending on the residual charge level
acquisition and data transmission rates to reach the of the battery.
energy balance, also on the basis of the system
architecture described in Sec. II, of the available energy
source, and of the “office” case study selected in Sec. III.
Energy Source. Each PV module provides a maximum
output power of about 46 μW under a radiation of 300 lux.
Since the PV panel is made up of 2 strings of 3 series-
connected modules (Fig. 3), the total power from the PV
panel, Ppanel, is 276 μW. Moreover, SPV1050 has a power
conversion efficiency of 77% and an efficiency of 96%
related to the Maximum Power Point Tracker (MPPT)
algorithm, thus the available output power is: Pavail =
Ppanel 0.96 0.77 = 204 μW. Assuming a nominal battery
voltage of 3.9 V, and 8 h of light per working day, the WPN
node can store a charge of: 204 μW 8 h / 3.9 V = 418.5 Fig. 14. Battery state of charge during four weeks and
μAh. different scenarios
© 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 6
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 06 Issue: 07 | July 2019 www.irjet.net p-ISSN: 2395-0072
© 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 7