Unit-I
Introduction to Wireless Sensor Networks
1.1 Introduction to Wireless Sensor Networks:
• A Sensor is a device used to gather information about a physical process and translate into
electrical signals that can be processed, measured and analyzed
• The physical process can be any real world information like temperature, pressure, light,
sound, motion, position, flow, humidity, radiation etc
• A Sensor Network is a structure consisting of sensors, computational units and communication
elements for the purpose of recording, observing and reacting to an event or a phenomenon
• The events can like physical world, an industrial environment, a biological system while the
controlling or observing body can be a consumer application, government, civil, military, or
an industrial entity
• Such Sensor Networks can be used for remote sensing, medical telemetry, surveillance,
monitoring, data collection etc.
Wireless Sensor Networks:
• A typical sensor network consists of sensors, controller and a communication system. If the
communication system in a Sensor Network is implemented using a Wireless protocol, then the networks
are known as Wireless Sensor Networks.
Fig 1/ Wireless Sensor Network
• According to technologists, Wireless Sensor Networks is an important technology for the twenty first century.
• Recent developments in MEMS Sensors (Micro Electro Mechanical System) and Wireless Communication
has enabled cheap, low power, tiny and smart sensors, deployed in a wide area and interconnected through
wireless links for various civilian and military applications.
• A Wireless Sensor Network consists of Sensor Nodes deployed in large quantities and support sensing, data
processing, embedded computing and connectivity.
➢ Elements of WSN
A typical wireless sensor network can be divided into two elements. They are:
1) Sensor Node
2) Network Architecture
1) A Sensor Node in a WSN consists of four basic components. They are:
– Power Supply
– Sensor
– Processing Unit
– Communication System
CHAPTER-1 F G PATEL ICT DEPARTMENT
Fig 2 / Basic Components of WSN
• The sensor collects the analog data from the physical world and an ADC converts this data to
digital data.
• The main processing unit a microprocessor or a microcontroller, performs an intelligent data
processing and manipulation. Communication system consists of radio system, a short-range radio for
data transmission and reception.
• As all the components are low-power devices, a small battery like CR-2032, is used to power the
entire system.
• A Sensor Node consists of not only the sensing component but also other important features like
processing, communication and storage units.
• With all these features, components and enhancements, a Sensor Node is responsible for physical
world data collection, network analysis, data correlation and fusion of data from other sensor with its own
data.
2) Network Architecture:
• When a large number of sensor nodes are deployed in a large area to monitor a physical
environment, the networking of these sensor nodes is equally important. A sensor node in a WSN not
only communicates with other sensor nodes but also with a Base Station (BS) using wireless
communication.
Fig 3/ Network Architecture
CHAPTER-1 F G PATEL ICT DEPARTMENT
• The base station sends commands to the sensor nodes and the sensor node perform the task by
collaborating with each other.
• The sensor nodes in turn send the data back to the base station. A base station also acts as a gateway
to other networks through the internet.
• After receiving the data from the sensor nodes, a base station performs simple data processing and
sends the updated information to the user using internet.
• If each sensor node is connected to the base station, it is known as Single-hop network architecture.
• Although long distance transmission is possible, the energy consumption for communication
will be significantly higher than data collection and computation.
1
Fig 4 / Single Hop Architecture Fig 5/ Multi-hop Architecture
– Single-hop network architecture are typically simpler and easier to manage since all devices are
connected to a central point, facilitating straightforward communication.
– Multi-hop network architecture is usually used. Instead of one single link between the sensor node
and the base station, the data is transmitted through one or more intermediate node.
This can be implemented in two ways. Flat network architecture and Hierarchical network
architecture.
• In flat architecture, the base station sends commands to all the sensor nodes but the sensor node with
matching query will respond using its peer nodes via a multi-hop path.
• In hierarchical architecture, a group of sensor nodes are formed as a cluster and the sensor nodes
transmit data to corresponding cluster heads.
• The cluster heads can then relay the data to the base station.
Fig 6 / Flat and Hierarchical Network Architecture
CHAPTER-1 F G PATEL ICT DEPARTMENT
3) Network Topologies in WSN:
• A WSN can be either a single-hop network or a multi- hop network. The following are a few
different network topologies that are used in WSNs.
a) Star Topology:
• In star topology, there is a single central node known as hub or switch and every node in the
network is connected to this hub. Star topology is very easy to implement, design and expand. The data
flows through the hub and plays an important role in the network and a failure in the hub can result in
failure of entire network.
b) Tree Topology:
• A tree topology is a hierarchical network where there is a single root node at the top and this node
is connected to many nodes in the next level and continues. The processing power and energy consumption
is highest at the root node and keeps on decreasing as we go down the hierarchical order.
c) Mesh Topology:
• In mesh topology, apart from transmitting its own data, each node also acts as a relay for
transmitting data of other connected nodes. Mesh topologies are further divided into Fully Connected
Mesh and Partially Connected Mesh. In fully connected mesh topology, each node is connected to every
other node while in partially connected mesh topology, a node is connected one or more neighboring
nodes.
Fig 7 / Network Topologies in WSN
➢ Enabling Technologies for WSN:
• It has only become possible to build wireless sensor networks with some fundamental advances in
enabling technologies.
• First and foremost among these technologies is the miniaturization of hardware.
• Smaller feature sizes in chips have driven down the power consumption of the basic components of
a sensor node to a level that the constructions of WSNs can be contemplated.
• This is particularly relevant to microcontrollers and memory chips and the radio modems responsible
for wireless communication.
• Reduced chip size and improved energy efficiency is accompanied by reduced cost, which is
necessary to make redundant deployment of nodes affordable.
• The actual sensing equipment is the third relevant technology next to processing and communication.
• However, it is difficult to generalize because of the vast range of possible sensors.
CHAPTER-1 F G PATEL ICT DEPARTMENT
Fig 7A / Enabling Technologies for WSN
➢ Energy Scavenging:
• The sensor nodes consume the power for important three functional domains such as sensing,
communication, and data processing. These three basic parts of a sensor node have to be accompanied
by power supply.This requirement depends on application, high-capacity batteries lasting for long times
and can efficiently provide small amounts of current.
• A sensor node also has a device for energy scavenging. Energy Scavenging (also known as power
harvesting or energy harvesting or ambient power) is the process by which energy is derived from external
sources (e.g., solar power, thermal energy, wind energy, salinity gradients, and kinetic energy, also known
as ambient energy), captured, and stored for small, wireless autonomous devices, like those used in
wearable electronics and wireless sensor networks. Such a concept requires the battery to be efficiently
chargeable with small amounts of current, which is not a standard ability.
• The counterpart to the basic hardware technologies is software.
• The architecture of the operating system or runtime environment has to support simple re tasking, cross
layer information exchange and modularity to allow for simple maintenance.
• This software architecture on a single node has to be extended to a network architecture, where the
division of tasks between nodes is considered.
• The third part to solve is how to design appropriate communication protocols.
➢ Characteristic of Wireless Sensor Network:
• Power consumption constraints for nodes using batteries or energy harvesting
• Chance to cope with node failures (resilience)
• Mobility of nodes
• Heterogeneity of nodes
• Scalability to large scale of deployment
• Capability to withstand harsh environmental conditions
• Simplicity of use
• Cross layer design
➢ Advantages:
• Network setups can be carried out without fixed infrastructure.
• Suitable for the non-reachable places such as over the sea, mountains, rural areas or deep
forests
• Suitable for the non-reachable places such as over the sea, mountains, battlefield surveillance,
rural areas or deep forests
CHAPTER-1 F G PATEL ICT DEPARTMENT
• Flexible if there is random situation when additional workstation is needed
• Implementation pricing is cheap.
• It avoids plenty of wiring
• It might accommodate new devices at any time
• It's flexible to undergo physical partitions.
➢ Disadvantages:
• WSN is it is not fully secure. Hackers hack the network easily. It is easy for
• hackers to hack it we couldn’t control propagation of waves.
• Works in short communication range – consumes a lot of power
• Short battery life. Sensor nodes need to be charged at after few times at
• intervals.
• Communication speed is very poor, on the other hand, wired networks have
• good speed of communication.
• More complicated to configure compared to a wired network
1.2 Single-Node Architecture:
Wireless sensor nodes are the central element in a wireless sensor network (WSN). It is through a node
that sensing, processing, and communication take place. It stores and executes the communication
protocols and the data-processing algorithms. The quality, size, and frequency of the sensed data that can
be extracted from the network are influenced by the physical resources available to the node. Therefore,
the design and implementation of a wireless sensor node is a critical step.
The node consists of sensing, processing, communication, and power subsystems. The designer has a
plethora of options in deciding how to build and put together these subsystems into a unified,
programmable node. The processor subsystem is the central element of the node and the choice of a
processor determines the tradeoff between flexibility and efficiency – in terms of both energy and
performance. There are several processors as options: microcontrollers, digital signal processors,
application-specific integrated circuits, and field programmable gate arrays.
There are a number of ways to connect the sensing subsystem with the processer. Connecting two or more
analog sensors with a multichannel ADC system that integrates multiple high-speed ADCs into a single
IC design is one way. However, these types of ADCs are known to produce crosstalk and to increase
uncorrelated noise, reducing the signal-to-noise ratio (SNR) on individual channels. Moreover, the
coupled signals can create spurs that are similar to harmonic terms, reducing spurious free dynamic range
(SFDR) and total harmonic distortion (THD). For low-frequency signals, however, the effect is not
significant. Some sensors have their own built-in ADC which can be directly connected with the processor
through a standard chip-to-chip protocol. Most microcontrollers have one or more internal ADCs to
interface analog devices.
Likewise, the communication subsystem can be interfaced with the processor subsystem in different ways.
One way is to use the SPI serial bus. Some transceivers have their own processor board to perform low-
level signal processing pertaining to the physical and the data link layer, thereby relieving the main
processor from these concerns. The communication subsystem is the most energy intensive subsystem
and its power consumption should be regulated. Almost all commercially available transceivers provide a
controlling functionality to switch the transceiver between various active operation levels; idle and sleep
state. The power subsystem provides DC power to all the other subsystems to bias their active components
such as crystal oscillators, amplifiers, registers, and counters. Moreover, it provides DC–DC converters
so that each subsystem can obtain the right amount of bias voltage.
CHAPTER-1 F G PATEL ICT DEPARTMENT
Fig 8/ Architecture of a wireless sensor node.
1.3 Hardware Components:
1.3.1 The Sensing Subsystem:
Sensors can be categorized into the following three categories:
1. Passive Omni directional sensors: They can measure a physical quantity at the point of the
sensor node without manipulating the environment by active probing They obtain the energy
directly from the environment energy is only needed to amplify their analog signal There is no
notion of direction in these measurements Typical examples include thermometer, light sensors,
vibration, microphones, humidity, chemical sensors etc.
2. Passive narrow beam sensors: They are passive but have a well defined notion of direction of
measurement A typical example is a camera, which can “take measurements” in a given direction,
but has to be rotated if need be.
3. Active sensors: They probe the environment, for example, a sonar or radar sensor or some types
of seismic sensors, which generate shock waves by small explosions.
➢ Analog-to-Digital Converter:
The analog-to-digital converter (ADC) converts the output of a sensor – which is a continuous, analog
signal – into a digital signal. This process requires two steps:
1. The analog signal has to be quantized (i.e., converted from a continuous valued signal into a
discrete valued signal; discrete both in time and magnitude). The most important decision at this
stage is to determine the number of allowable discrete values. This decision in turn is influenced
by two factors: (a) the frequency and magnitude of the signal; and (b) the available processing
and storage resources.
2. The sampling frequency. In communication engineering and digital signal processing, this
frequency is decided by the Nyquist rate.1 In wireless sensor networks, however, the Nyquist rate
does not suffice. Oversampling is required because of noise.
CHAPTER-1 F G PATEL ICT DEPARTMENT
1.3.2 The Processor Subsystem:
The processor subsystem brings together all the other subsystems and some additional peripherals. Its
main purpose is to process (execute) instructions pertaining to sensing, communication, and self-
organization. It consists of a processor chip, a nonvolatile memory (usually an internal flash memory) for
storing program instructions, an active memory for temporarily storing the sensed data, and an internal
clock, among other things.
Whereas a wide range of off-the-shelf processors are available for building a wireless sensor node, one
has to make a careful choice, as it affects the cost, flexibility, performance, and energy consumption of
the node. If the sensing task is well defined from the outset and does not change over time, a designer may
choose either a field programmable gate array or a digital signal processor. These processors are very
efficient in terms of their energy consumption; and for most simple sensing tasks, they are quite adequate.
However, as these are not general-purpose processors, the design and implementation process can be
complex and costly.
CHAPTER-1 F G PATEL ICT DEPARTMENT
Controllers:
• The controller is the core of a wireless sensor node.
• It is the Central Processing Unit (CPU) of the node.
• It collects data from sensors, processes this data, receives data from other sensor nodes, and decides on
the actuator’s behavior.
• It has to execute various programs, ranging from time critical signal processing and communication
protocols to application programs.
• Such a variety of processing tasks can be performed on various controller architectures, representing
tradeoffs between flexibility, performance, energy efficiency, and costs.
• Microcontrollers are suitable for WSNs since they can reduce their power consumption by going into
sleep states where only parts of the controller are active.
• One of the main differences to general purpose systems is that microcontroller-based systems do not
include a memory management unit -for example, protected or virtual memory is difficult.
• In a wireless sensor node, DSP can be used to process incoming data but the advantages of a DSP are
not required in a WSN node and they are usually not used.
• Another option for the controller is to use Field Programmable Gate Arrays (FPGA) or Application
Specific Integrated Circuits (ASICs) instead of microcontrollers.
• An FPGA can be reprogrammed in the field to adapt to a changing set of requirements, but this can take
time and energy.
• An ASIC is a specialized processor, designed for a given application such as high-speed routers and
switches.
• The typical trade off here is loss of flexibility in return for considerably better energy efficiency and
Performance.
Memory:
• There is a need for Random Access Memory to store intermediate sensor readings, packets from other
nodes etc.
• RAM is fast, but it loses its contents if power supply is interrupted.
• The program code can be stored in Read Only Memory or in Electrically Erasable Programmable Read
Only Memory (EEPROM) or flash memory.
• Flash memory can also serve as intermediate storage of data when the power supply goes off for some
time.
• The long read and write access delays of flash memory should be taken into account as well as the high
required energy.
1.3.3 Communication Interfaces:
Choice of transmission medium:
• The first choice is the transmission medium and usual choices include radio frequencies, optical
communication, and ultrasound.
• Radio Frequency (RF)- based communication is vital requirement of most WSN applications.
• It provides long range and high data rates, acceptable error rates at reasonable energy expenditure, and
does not require line of sight between sender and receiver.
• For a practical wireless, RF based system, the carrier frequency has to be carefully chosen. The wireless
sensor networks use communication frequencies between about 433 MHz and 2.4 GHz.
➢ Transceivers:
• For actual communication, both a transmitter and a receiver are required in a sensor node to convert a
bit stream coming from a microcontroller and convert them to and from radio waves Such combined
devices are called transceivers.
CHAPTER-1 F G PATEL ICT DEPARTMENT
• Usually, half duplex operation is realized since transmitting and receiving at the same time on a wireless
medium is impractical in most cases A range of low cost transceivers is available that incorporate all the
circuitry required for transmitting and receiving, modulation, demodulation, amplifiers, filters, mixers etc.
Transceiver tasks and characteristics:
• The following are the some of the important characteristics of a transceiver which should be taken into
account
– Service to upper layer
– Power Consumption and Energy Efficiency
– Carrier Frequency Multiple channels
– Transmission Power Control
– Data Rates
– Modulation
– Noise Figure
– Power Efficiency
– Frequency Stability etc.
Transceiver States:
• Transmit State: The transmit part of the transceiver is active and the antenna radiates energy.
• Receive State: The receive part is active.
• Idle State: A transceiver that is ready to receive but not currently receiving anything is said to be in an
idle state.
• Sleep State: The significant parts of the transceiver are switched off There are transceivers offering
several different sleep states.
➢ Serial Peripheral Interface:
The Serial Peripheral Interface (SPI – pronounced as “spy”) is a high-speed, full-duplex synchronous
serial bus.
The SPI bus defines four pins: (Master-Out/Slave-In) MOSI, (Master-In/Slave-Out) MISO, (Serial Clock)
SCLK, and (Chip Select) CS. Some manufacturers refer to MOSI as SIMO and to MISO as SOMI, but
the semantics is the same. Likewise, CS is sometimes referred to as (Slave Select) SS.
As the name suggests, MOSI is used to transmit data from the master to the slave when a device is
configured as a master. In case it is configured as a slave, this port is used to receive data from the
corresponding master. The semantics are reversed for the MISO port. SCLK is used by the master to send
the clock signal that is needed to synchronize transmission; and by the slave to read this signal.
Figure.9/ Connecting devices with the SPI bus. (a) A single master connecting with a single slave.
(b) A single master connecting with multiple slaves.
CHAPTER-1 F G PATEL ICT DEPARTMENT
➢ Inter-Integrated Circuit:
The inter-integrated circuit (I2C) is a multi-master half-duplex synchronous serial). I2C uses only two
bidirectional lines (unlike SPI, which uses four). The aim of I2C is to minimize costs for connecting
devices within a system by accommodating lower transmission speeds.
I2C defines two speed modes: A Fast-mode, with a bit rate of up to 400 kbps and a High-speed-mode
(referred to as Hs-mode) that supports a transmission rate of up to 3.4 Mbps. The 100 kbps rate (Standard-
mode) was defined in earlier versions.
Figure 10/ Connecting devices with the I2C serial bus.
As the standard does not specify a CS or SS port, every device type that uses I2C must have a unique
address that will be used to communicate with a device.
I2C provides two lines; these are Serial Clock (SCL) and Serial Data Analyzer (SDA). Hs-mode devices
have additional ports called SDAH and SCLH.
CHAPTER-1 F G PATEL ICT DEPARTMENT
1.4 Energy Consumption of Sensor Nodes:
In Wireless Sensor Networks (WSNs), saving energy is extremely important because:
• Sensor nodes usually run on small batteries.
• Recharging or replacing batteries is difficult or even impossible.
• So, every part of the node must use as little power as possible.
Major Parts That Use Power in a Sensor Node:
1. Controller (Processor)
2. Radio (Transmitter/Receiver)
3. Memory
4. Sensors (especially active ones)
One important contribution to reduce power consumption of these components comes from chip-level and
lower technologies:
Low-Power Chip Design
– Using chips designed for low power use helps save energy.
– But that’s not enough. Even low-power chips can waste energy if not used properly.
– Most of the time, sensor nodes have nothing to do — they should go to sleep when idle
and wake up only when needed.
1. Microcontroller energy consumption:
a) Embedded controllers commonly implement the concept of multiple operational states:
For a controller, typical states are “active”, “idle”, and “sleep”; a radio modem could turn
transmitter, receiver, or both on or off; sensors and memory could also be turned on or off. The
usual terminology is to speak of a “deeper” sleep state if less power is consumed. While such a
graded sleep state model is straightforward enough, it is complicated by the fact that transitions
between states take both time and energy. The usual assumption is that the deeper the sleep state,
the more time and energy it takes to wake up again to fully operational state (or to another, less
deep sleep state). Hence, it may be worthwhile to remain in an idle state instead of going to deeper
sleep states even from an energy consumption point of view.
b) Dynamic voltage scaling:
– Instead of always running at full speed, a node can slow down its processor to save energy.
– DVS lowers the speed and voltage to reduce power usage.
– If the task doesn’t need high speed, it can be done slowly using less energy.
2. Energy consumption of Memory:
Two main types of memory:
1. On-chip memory (RAM, Flash) → uses less power
2. Off-chip RAM → rarely used because it uses more power
– Reading from flash uses similar energy across types.
– Writing to flash is more complex and consumes much more power.
– Example: Writing the whole memory can use 900x more energy than others!
– So, avoid writing to flash too often if possible.
Hence, writing to FLASH memory can be a time- and energy-consuming task that is best avoided
if somehow possible.
CHAPTER-1 F G PATEL ICT DEPARTMENT
3. Energy consumption of Radio transceivers:
A radio transceiver has essentially two tasks: 1) Transmitting and 2) receiving data between a pair
of nodes.
Similar to microcontrollers, radio transceivers can operate in different modes, the simplest ones are
being turned on or turned off. To accommodate the necessary low total energy consumption, the
transceivers should be turned off most of the time and only be activated when necessary – they work
at a low duty cycle. But this incurs additional complexity, time and power overhead that has to be
taken into account.
A. energy consumption during transmission:
In principle, the energy consumed by a transmitter is due to two sources :
– one part is due to RF signal generation, which mostly depends on chosen modulation and
target distance and hence on the transmission power Ptx, that is, the power radiated by the
antenna.
– The second part is due to electronic components necessary for frequency synthesis,
frequency conversion, filters, and so on. These costs are basically constant.
B. energy consumption during reception:
- Similar to the transmitter, the receiver can be either turned off or turned on. While being
turned on, it can either actively receive a packet or can be idle, observing the channel and
ready to receive.
- Evidently, the power consumption while it is turned off is negligible. Even the difference
between idling and actually receiving is very small and can, for most purposes, be assumed
to be zero.
6. Power consumption of sensors and actuators:
Providing any guidelines about the power consumption of the actual sensors and actuators is next to
impossible because of the wide diversity of these devices.
For some of them – for example, Passive sensors light or temperature sensors – the power
consumption can perhaps be ignored in comparison to other devices on a wireless node.
For others, in particular, Active sensors devices like sonar, power consumption can be quite
considerable and must even be considered in the dimensioning of power sources on the sensor node,
not to overstress batteries, for example.
Depends On:
– Sensor type
– How often it's used (sampling rate)
– Whether the data is sent or stored
So, applications must choose sensors wisely and avoid unnecessary sampling.
1.5 Operating Systems and Execution Environments:
a) Embedded Operating Systems:
In general-purpose computers, the operating system (OS) does many things:
– Manages resources (CPU, memory, etc.)
– Runs many apps at once (multitasking)
– Handles input/output (keyboard, files, etc.)
CHAPTER-1 F G PATEL ICT DEPARTMENT
But in Wireless Sensor Networks (WSNs):
– The tasks are very specific and energy-limited
– Nodes are tiny, with very limited memory, processing, and battery
So, we don’t need a big OS. Instead, we use a lightweight OS (or just an execution environment) designed
specifically for:
– Saving energy (e.g., using sleep modes, Dynamic Voltage Scaling)
– Reacting to events like sensor readings or data packet arrival
– Handling small tasks with minimal resource use
All this requires an appropriate programming model, a clear way to structure a protocol stack, and
explicit support for energy management – without imposing too heavy a burden on scarce system
resources like memory or execution time.
b) Programming paradigms and application programming interfaces:
1. Concurrent Programming: (Doing many things at once)
Sensor nodes may need to:
– Read sensors
– Send/receive data
– Run timers
All at the same time.
A simple sequential program (one task after another) can miss important events. Such a simple
sequential model would run the risk of missing data while a packet is processed or missing a packet
when sensor information is processed. This risk is particularly large if the processing of sensor
data or incoming packets takes substantial amounts of time, which can easily be the case.
Hence, a simple, sequential programming model is clearly insufficient.
Figure 11/ Two inadequate programming models for WSN operating systems: purely sequential
execution (a) and process-based execution (b)
2. Process-based concurrency: (Like PC Operating Systems)
Most modern, general-purpose operating systems support concurrent (seemingly parallel) execution
of multiple processes on a single CPU. Hence, such a process-based approach would be a first
candidate to support concurrency in a sensor node as well; it is illustrated in (b) of Figure.
CHAPTER-1 F G PATEL ICT DEPARTMENT
This approach works in principle, mapping such an execution model of concurrent processes to a
sensor node shows, however, that there are some granularity mismatches:
Problem:
– Too much overhead switching between processes: Equating individual protocol functions or
layers with individual processes would entail a high overhead in switching from one process to
another. This problem is particularly severe if often tasks have to be executed that are small with
respect to the overhead incurred for switching between tasks – which is typically the case in sensor
networks.
– Needs separate memory for each process → not suitable for tiny sensor nodes
3. Event-based programming:
Instead of running many processes, we wait for events. The system essentially waits for any event to
happen, where an event typically can be the availability of data from a sensor, the arrival of a packet,
or the expiration of a timer. Such an event is then handled by a short sequence of instructions that only
stores the fact that this event has occurred and stores the necessary information – for example, a byte
arriving for a packet or the sensor’s value – somewhere. The actual processing of this information is
not done in these event handler routines, but separately, decoupled from the actual appearance of
events. This event-based model is sketched in Figure below.
Figure 12/ Event-based programming model
– Event handlers are short and can’t interrupt each other
– Very efficient for sensor nodes with low memory and low power
Once the event happens:
– A short piece of code (called an event handler) runs and stores the info.
– Later, another part of the program processes it.
As a consequence, this event-based programming model distinguishes between two different “contexts”:
– one for the time-critical event handlers, where execution cannot be interrupted
– a second context for the processing of normal code, which is only triggered by the event handlers.
• Structure of operating system and protocol stack:
Traditionally, communication systems use layered architecture:
• Physical Layer (bottom)
• MAC Layer
• Network Layer
• Application Layer (top)
Each layer only talks to the one above or below it.
CHAPTER-1 F G PATEL ICT DEPARTMENT
But in WSNs:
• Some information (like signal strength) can be useful for many layers
• Strict layering may limit performance
Cross-Layer Design & Component-Based Approach
To overcome layering problems, WSN operating systems use a component model:
- Break large layers into small, reusable blocks
- Each block (component) does one specific task (e.g., route finding, packet transmission)
- Components can communicate freely, not just with their neighbors in the stack
Example: TinyOS. TinyOS is a popular OS for WSNs. It supports:
- Component-based programming
- Event-driven model
TinyOS Components:
- Handle a specific function (e.g., read sensor, send radio signal)
- Have:
o State info
o Normal task code
o Event handlers
o Command handlers
Components Working:
- Events (like receiving data) come from hardware → go upward
- Commands (like "send data") come from user app → go downward
This makes TinyOS modular, efficient, and perfect for tiny sensor nodes.
1.6 Network Architecture-Sensor Network Scenarios:
Wireless Sensor Networks (WSNs) use many tiny devices (nodes) that communicate to collect and send
information. The structure of these networks—how they are organized and how data flows—is called the
network architecture.
a) Types of Sources and Sinks
Source:
o A node that generates information (usually a sensor).
o Example: A temperature sensor measuring room heat.
Sink:
o A node or device where information is needed or collected.
o Types of sinks:
1.Another sensor or actuator inside the network
2.A device like a mobile phone, PDA, or computer
3. A gateway to the internet or a larger system
b) Single-hop versus multihop networks:
Single-hop network:
Every sensor node sends its data directly to the sink (or base station).
This works well only if:
• The distance between the sensor and the sink is short.
• There are no obstacles in between (like walls or trees).
• (Figure 13/) shows how sensors talk directly to the sink in a simple, single-hop setup.
CHAPTER-1 F G PATEL ICT DEPARTMENT
Limitation: Radio communication has limited range. If the sink is too far or there are barriers, the signal
won’t reach.
Example: Small indoor applications (e.g., a room with temperature sensors).
Figure 13/ Three types of sinks in a very simple, single-hop sensor network
Multihop Networks:
When the distance is too long or obstacles block signals, multihop communication is used.
In this method, the data is sent from one sensor to another — like passing a message down a line — until
it reaches the sink.
Figure 14/ Multihop networks: As direct communication is impossible because of distance and/or
obstacles, multihop communication can circumvent the problem
• Sensors act as relays (no need for extra devices).
• Helps to cover large areas (like farms or forests).
• Can be more energy-efficient than sending over long distances directly.
• No guarantee that a proper route always exists.
• Some routes may be longer or less efficient.
• (Figure 14/) shows how sensors pass data through each other in a multihop network.
Example:
• Environmental monitoring over a large forest.
• Sensors spread across a large building.
CHAPTER-1 F G PATEL ICT DEPARTMENT
c) Multiple sinks and sources:
So far, only networks with a single source and a single sink have been illustrated. In many cases, there are
multiple sources and/or multiple sinks present. In the most challenging case, multiple sources should send
information to multiple sinks, where either all or some of the information has to reach all or some of the
sinks. Example: In a farm, multiple sensors monitor soil, water, and light. The data goes to multiple
controllers or monitoring devices. Figure below illustrates these combinations.
Figure 15/ Multiple sources and/or multiple sinks. Note how in the scenario in the lower half, both sinks
and active sources are used to forward data to the sinks at the left and right end of the network
d) Three types of mobility:
WSNs can include moving elements, and this affects how the network behaves. There are 3 types:
Node mobility:
– Sensor nodes themselves move.
– Example: Sensors attached to animals (livestock monitoring) or vehicles.
– The network must reorganize frequently to keep working.
– More mobility = more energy use for reconnecting nodes.
Sink mobility:
- The sink (receiver) is not fixed. The information sinks can be mobile (Figure below).
- Example: A person with a PDA walking through a smart building to collect sensor data.
The network should:
- Track the sink’s movement
- Ensure data reaches the sink, even if it changes location
A mobile requester is particularly interesting, however, if the requested data is not locally available but
must be retrieved from some remote part of the network. Hence, while the requester would likely
communicate only with nodes in its vicinity, it might have moved to some other place. The network,
possibly with the assistance of the mobile requester, must make provisions that the requested data actually
follows and reaches the requester despite its movements.
CHAPTER-1 F G PATEL ICT DEPARTMENT
Figure 16/ A mobile sink moves through a sensor network as information is being retrieved on its behalf
Event mobility:
In applications like event detection and in particular in tracking applications, the cause of the events or
the objects to be tracked can be mobile. In such scenarios, it is (usually) important that the observed event
is covered by a sufficient number of sensors at all time. Hence, sensors will wake up around the object,
engaged in higher activity to observe the present object, and then go back to sleep. As the event source
moves through the network, it is accompanied by an area of activity within the network – this has been
called the frisbee model (because the area of activity moves like a flying disc). This notion is described
by Figure below, where the task is to detect a moving elephant and to observe it as it moves around. Nodes
that do not actively detect anything are intended to switch to lower sleep states unless they are required to
convey information from the zone of activity to some remote sink.
- Nodes near the moving object become active to track it.
- Nodes behind the object go back to sleep to save power.
Figure 17/ Area of sensor nodes detecting an event – an elephant [378] – that moves through the
network along with the event source (dashed line indicate the elephant’s trajectory; shaded ellipse the
activity area following or even preceding the elephant)
CHAPTER-1 F G PATEL ICT DEPARTMENT
1.7 Optimization Goals and Figures of Merit:
WSNs are designed for different types of applications like environment monitoring, surveillance,
agriculture, etc. To build efficient and useful networks, we must optimize their design based on key
goals and performance measures (called figures of merit).For all these scenarios and application types,
different forms of networking solutions can be found.
a) Quality of service:
Quality of Service refers to how well a network performs. It can be:
Low-level (measured by the system):
– Bandwidth, delay, jitter, packet loss
High-level (felt by users):
– How clearly a video plays, how fast an alert arrives
High-level QoS attributes in WSN highly depend on the application. Some generic possibilities are:
1. Event Detection Probability:
• What are the chances that an actual event (like fire) goes undetected?
• Low detection = big problem
2. Event Classification Error:
• If the network detects an event, can it correctly identify it (fire vs. smoke)?
• Fewer errors = better performance
3. Event Detection Delay:
• Time taken to detect and report the event to the sink.
• Shorter delays = more responsive network
4. Missing Reports:
• In periodic data collection, how often are updates lost?
5. Approximation Accuracy:
• For sensors measuring continuous data (like temperature), how close are the reports to
the real values?
6. Tracking Accuracy:
• In tracking applications, how precise is the location info? Are objects missed?
b) Energy efficiency:
Energy is a precious resource in wireless sensor networks and that energy efficiency should
therefore make an evident optimization goal. The most commonly considered aspects for energy
efficiency are:
1. Energy per Received Bit:
How much energy is used to successfully send one bit of useful data?
2. Energy per Unique Event:
Total energy used to report one unique event, ignoring repeated reports.
3. Delay-Energy Trade-off:
Is it worth using more energy to report an urgent event quickly?
4. Network Lifetime:
How long the network can operate properly before it breaks down.
Ways to measure lifetime:
- Time to First Node Death: First sensor dies
- Network Half-Life: 50% of nodes die
- Time to Partition: Network splits into disconnected parts
- Time to Loss of Coverage: Any spot in the area is no longer covered
- Time to First Missed Event: A critical event is missed due to sensor/node failure
CHAPTER-1 F G PATEL ICT DEPARTMENT
c) Scalability :
• Definition: The ability of a WSN to work well even if it grows larger (more nodes).
• Good scalable systems:
- Maintain consistent performance as network grows
- Manage memory and routing info efficiently
- Use protocols that adapt well to many nodes
- Scalability is not automatic—protocols need to be designed with it in mind.
d) Robustness:
• Definition: The ability to keep working even when some things fail.
• Sensor nodes may run out of energy, or links may go down
• A robust WSN should:
- Find alternative paths
- Keep collecting and sending data
- Handle changing environments
• Measuring robustness depends on: How we expect nodes and links to fail (called the failure model)
1.8 Design principles for WSNs:
1. Distributed Organization:
• Both the scalability and the robustness optimization goal are required to organize the network in a
distributed fashion.
• In WSNs, there is no central controller. All nodes work together in a distributed way. This makes
the network more scalable (can grow easily) and robust (can keep working if one node fails).
• But it's challenging, because:
– Each node has limited communication range.
– It's hard to coordinate in radio networks.
• In the case of WSN, centralized approach usually not feasible as it hinders scalability and
robustness.
• One possibility is to use centralized principles in a localized fashion by, electing leader nodes from
time to time. These nodes take temporary charge to save energy and are changed once they lose
power.
2. In Network Processing Techniques:
a) Aggregation:
The simplest In network processing technique is aggregation. The term aggregation means that
information is aggregated into a condensed form in nodes intermediate between sources and sinks out of
information provided by nodes further away from the sink. [Combine data from different sensors along
the way to the sink]. The aggregation function must be applied in the intermediate nodes as shown in
Figure below. For example, instead of sending each temperature reading, send an average.
Figure 18/ Aggregation as an Example
CHAPTER-1 F G PATEL ICT DEPARTMENT
b) Distributed Source Coding and Distributed Compression:
• The objective is to encode the information provided by several sensors by using traditional coding
schemes, which may be complex for simple sensor nodes. i.e., Sensors close to each other record similar
data. [The readings of adjacent sensors are going to be quite similar and correlated.]
• Use this correlation to compress data, reducing the number of bits sent.
c) Distributed and collaborative signal processing:
When complex computations on a certain amount of data is to be done, it can be more energy efficient to
compute these functions on the sensor nodes using Fast Fourier Transform (FFT). i.e., If heavy data
processing is needed (like FFT), split the job across several nodes.
In principle, this is similar to algorithm design for parallel computers. However, the energy consumption
of communication and computation are relevant parameters to decide between various algorithms.
d) Mobile code/Agent based networking:
The idea of mobile code is to have a small, compact representation of program code to be sent from node
to node. This code is executed locally for collecting measurements and then decides where to be sent next.
This idea has been used in various environments
3. Adaptive Fidelity & Accuracy:
• Fidelity = quality or detail of information.
• The idea of making fidelity of computation depends upon the amount of energy available for that
particular computation. [ More detail = more sensors = more energy.]
• This concept can be extended from a single node to an entire network. As an example, consider a
function approximation application.
• When more sensors participate in the approximation, the function is sampled at more points and the
approximation is better. But more energy has to be invested. [i.e., The system should adjust accuracy
depending on how much energy is available.]
• Hence it is up to an application to define the degree of accuracy of the results and the task of the
communication protocols to achieve this accuracy. [i.e., Applications should define how accurate the
result should be.]
4. Data Eccentricity:
• In WSNs, the focus is on the data, not the sender or receiver. This method of concentrating on
the data rather than identity of nodes is called data centric networking.
• For example, if multiple sensors detect smoke, we only care about the fact that there’s smoke, not
which sensor said it. This is called data-centric networking.
• In a wireless sensor network, the interest of an application is actual information reported about
the physical environment. This is applicable when a WSN is redundantly deployed such that any
given event can be reported by multiple nodes.
5. Exploit Local Information:
• Another useful technique is to exploit location information in the communication protocols
whenever such information is present.
• If nodes know their location, they can:
– Route data more efficiently.
– Save energy.
– Help applications (e.g., reporting where a fire is).
CHAPTER-1 F G PATEL ICT DEPARTMENT
6. Exploit Activity Patterns:
• WSNs are often quiet, but suddenly become active (e.g., when an event happens).
• The network must handle bursts of activity well.
• So, protocols should switch between:
– Sleep mode (saving energy)
– Active mode (handling traffic)
7. Exploit Heterogeneity:
• Not all nodes are equal/ heterogeneous:
– Some have bigger batteries, faster processors, or stronger radios.
• We can assign heavy tasks to the stronger nodes.
• But this setup must be dynamic—nodes change over time.
8. Component Based Protocol Stacks:
• WSN software is built from modular components.
• Like building blocks: physical layer, MAC, routing, etc.
• Each sensor may have different components active, depending on the application.
• Components also need to communicate with each other, not just pass data, but also share status
or control info.
1.9 Unique challenges and constraints in WSN:
• A centralized system, a sensor network is subject to a unique set of resource constraints such as :
– finite on-board battery power and limited network communication bandwidth.
– In a typical sensor network, each sensor node operates untethered and has a microprocessor
and a small amount of memory for signal processing and task scheduling.
– Each node is also equipped with one or more sensing devices such as acoustic microphone
arrays, video or still cameras, infrared (IR), seismic, or magnetic sensors.
– Each sensor node communicates wirelessly with a few other local nodes within its radio
communication range.
– Sensor networks extend the existing Internet deep into the physical environment.
– Information collected by and transmitted on a sensor network describes conditions of physical
environments—for example, temperature, humidity, or vibration— and requires advanced
query interfaces and search engines to effectively support user-level functions.
CHAPTER-1 F G PATEL ICT DEPARTMENT
Key Challenges in WSN Design:
Limited hardware: Each sensor node is small and low-cost, so it has:
– A tiny processor
– Very little memory
– Limited battery power
– Weak wireless communication
Because of this, WSNs can't use heavy applications or long-distance communication like smartphones or
computers.
Limited support for networking:
• WSNs have no central server.
• The network is peer-to-peer: all nodes talk to each other directly.
• The structure of the network is usually a mesh — nodes connect randomly with neighbors.
• There is no fixed routing path, and connections can be unreliable.
• Each node must act like:
– A sensor
– A router (passing messages)
– An application host (doing some tasks)
Limited support for software development:
• WSN software is real-time and distributed:
– Sensors must work together, not alone.
– Events can happen suddenly and randomly (like a fire or motion).
• There is no global view — only local instructions control behavior.
• Because software and hardware are so connected, they must be designed together.
1.10 Applications of WSNs:
1) Disaster relief applications: One of the most often mentioned application types for WSN are disaster
relief operations. A typical scenario is wildfire detection: Sensor nodes are equipped with thermometers
and can determine their own location (relative to each other or in absolute coordinates). These sensors are
deployed over a wildfire, for example, a forest, from an airplane. They collectively produce a “temperature
map” of the area or determine the perimeter of areas with high temperature that can be accessed from the
outside, for example, by firefighters equipped with Personal Digital Assistants (PDAs). Similar scenarios
are possible for the control of accidents in chemical factories, for example.
Some of these disaster relief applications have commonalities with military applications, where sensors
should detect, for example, enemy troops rather than wildfires. In such an application, sensors should be
cheap enough to be considered disposable since a large number is necessary; lifetime requirements are
not particularly high.
2) Environment control and biodiversity mapping: WSNs can be used to control the environment, for
example, with respect to chemical pollutants – a possible application is garbage dump sites. Another
example is the surveillance of the marine ground floor; an understanding of its erosion processes is
important for the construction of offshore wind farms. Closely related to environmental control is the use
of WSNs to gain an understanding of the number of plant and animal species that live in a given habitat
(biodiversity mapping).
The main advantages of WSNs here are the long-term, unattended, wire free operation of sensors close to
the objects that have to be observed; since sensors can be made small enough to be unobtrusive, they only
negligibly disturb the observed animals and plants. Often, a large number of sensors is required with rather
high requirements regarding lifetime.
3) Intelligent buildings: Buildings waste vast amounts of energy by inefficient Humidity, Ventilation,
Air Conditioning (HVAC) usage. A better, real-time, high-resolution monitoring of temperature, airflow,
humidity, and other physical parameters in a building by means of a WSN can considerably increase the
comfort level of inhabitants and reduce the energy consumption.
CHAPTER-1 F G PATEL ICT DEPARTMENT
4) Facility management: In the management of facilities larger than a single building, WSNs also have
a wide range of possible applications. Simple examples include keyless entry applications where people
wear badges that allow a WSN to check which person is allowed to enter which areas of a larger company
site. This example can be extended to the detection of intruders, for example of vehicles that pass a street
outside of normal business hours.
A wide area WSN could track such a vehicle’s position and alert security personnel – this application
shares many commonalities with corresponding military applications. Along another line, a WSN could
be used in a chemical plant to scan for leaking chemicals.
5) Machine surveillance and preventive maintenance: One idea is to fix sensor nodes to difficult to-
reach areas of machinery where they can detect vibration patterns that indicate the need for maintenance.
Examples for such machinery could be robotics or the axles of trains. Other applications in manufacturing
are easily conceivable.
The main advantage of WSNs here is the cable free operation, avoiding a maintenance problem in itself
and allowing a cheap, often retrofitted installation of such sensors. Wired power supply may or may not
be available depending on the scenario; if it is not available, sensors should last a long time on a finite
supply of energy since exchanging batteries is usually impractical and costly. On the other hand, the size
of nodes is often not a crucial issue, nor is the price very heavily constrained.
6) Precision agriculture: Applying WSN to agriculture allows precise irrigation and fertilizing by placing
humidity/soil composition sensors into the fields. A relatively small number is claimed to be sufficient,
about one sensor per 100 m × 100 m area. Similarly, pest control can profit from a high-resolution
surveillance of farmland. Also, livestock breeding can benefit from attaching a sensor to each pig or cow,
which controls the health status of the animal (by checking body temperature, step counting, or similar
means) and raises alarms if given thresholds are exceeded.
7) Medicine and health care: Along somewhat similar lines, the use of WSN in health care applications
is a potentially very beneficial, but also ethically controversial, application. Possibilitiesrange from
postoperative and intensive care, where sensors are directly attached to patients – the advantage of doing
away with cables is considerable here – to the long-term surveillance of (typically elderly) patients and to
automatic drug administration (embedding sensors into drug packaging, raising alarms when applied to
the wrong patient, is conceivable).
Also, patient and doctor tracking systems within hospitals can be literally lifesaving.
8) Logistics: In several different logistics applications, it is conceivable to equip goods (individual
parcels, for example) with simple sensors that allow simple tracking of these objects during transportation
or facilitate inventory tracking in stores or warehouses.
In these applications, there is often no need for a sensor node to actively communicate; passive readout
of data is often sufficient, for example, when a suitcase is moved around on conveyor belts in an airport
and passes certain checkpoints. Such passive readout is much simpler and cheaper than the active
communication and information processing concept discussed in the other examples; it is realized by so-
called Radio Frequency Identifier (RF ID) tags.
On the other hand, a simple RFID tag cannot support more advanced applications. It is very difficult to
imagine how a passive system can be used to locate an item in a warehouse; it can also not easily store
information about the history of its attached object – questions like “where has this parcel been?” are
interesting in many applications but require some active participation of the sensor node.
9) Telematics: Partially related to logistics applications are applications for the telematics context, where
sensors embedded in the streets or roadsides can gather information about traffic conditions at a much
finer grained resolution than what is possible today. Such a so called “intelligent roadside” could also
interact with the cars to exchange danger warnings about road conditions or traffic jams ahead.
In addition to these, other application types for WSNs that have been mentioned in the literature include
airplane wings and support for smart spaces, applications in waste water treatment plants, instrumentation
of semiconductor processing chambers and wind tunnels, in “smart kindergartens” where toys interact
with children, the detection of floods, interactive museums, monitoring a bird habitat on a remote island,
and implanting sensors into the human body (for glucose monitoring or as retina prosthesis).
CHAPTER-1 F G PATEL ICT DEPARTMENT