Unit 3 Notes
Unit 3 Notes
Unit 3 Notes
Department of CSE
Introduction:
Designing IoT systems can be a complex and challenging task as these systems involve
interactions between various components such as IoT devices and network resources,
web Services, analytics component, application and database server. Due to wide range
of choices available for each of these components, IoT system designers may find it
difficult to evaluate the available alternatives. IoT system designers often tend to design
IoT systems keeping specific products/ services in mind. Therefore, these designs are tied
to specific product/ service choices made. This leads to product, service, or vendor lock-
in, which while satisfactory to the dominant vendor, is unacceptable to the customer. For
such systems, updating the system design to add new features or replacing a particular
product/ service toys for a component becomes very complex, and in many cases may
require a complete redesign of the system.
Here we propose a generic design methodology for IoT system design which is
independent of specific product, service or programming language.
The first step in IoT system design methodology is to define the purpose and
requirements of the system. In this step, the system purpose, behavior and requirements
(such as data collection requirements, data analysis requirements, system management
requirements, data privacy and security requirements, user interface requirements,) are
captured.
Applying this to our example of a smart home automation system, the purpose and
requirements for the system may be described as follows:
• Purpose: A home automation system that allows controlling of the lights in a home
remotely using a web application.
• Behaviour: The home automation system should have auto and manual modes. In auto
mode, the system measures the light level in the room and switches on the light when it
gets dark. In manual mode, the system provides the option of manually and remotely
switching on/off the light.
• System Management Requirement: The system should provide remote monitoring
and control functions.
• Data Analysis Requirement: The system should perform local analysis of the data.
• Application Deployment Requirement: The application should be deployed locally
on the device, but should be accessible remotely.
• Security Requirement: The system should have basic user authentication capability.
The second step in the IoT design methodology is to define the process specification. In
this step, the use cases of the IoT system are formally described based on and derived
from the purpose and requirement specifications.
Below figure shows the process diagram for the home automation system. The process
diagram shows the two modes of the system - auto and manual. In a process diagram, the
circle denotes the start of a process, diamond denotes decision box and rectangle denotes
a state or attribute. When the auto mode is chosen, the system monitors the light level. If
the light level is low, the system changes the state of the light to "on". Whereas, if the light
level is high, the system changes the state of the light to "off". When the manual mode is
chosen, the system checks the light state set by the user. If the light state set by the user is
"on", the system changes the state of light to "on". Whereas if the light state set by the user
is "off", the system changes the state of light to "off".
The third step in the IoT design methodology is to define the Domain Model. The domain
model describes the main concepts, entities and objects in the domain of IoT system to be
designed. Domain model defines the attributes of the objects and relationships between
Objects. Domain model provides an abstract representation of the concepts, objects and
entities in the IoT domain, independent of any specific technology or platform. With the
domain model, the IoT system designers can get an understanding of the IoT domain for
which the system is to be designed. Below figure shows the domain model for the home
automation system example. The entities, objects and concepts defined in the domain
model include:
Physical Entity: Physical entity is a discrete and identifiable entity in the physical
environment (e.g. a room, a light, a car, an appliance etc.). The IoT system provide
information about physical entity (e.g. switching on a light). In the Home automation
example, there are two entities involved one is the room in the home (of which the lighting
conditions are to be monitored) and the other is the light appliance to be controlled.
Virtual Entity: VE is a representation of the physical entity in the digital world. For each
physical entity there is a virtual entity. In the domain model in the home automation
example, there is one virtual entity for the room to be monitored, another for the appliance
to be controlled.
Device: Device provides a medium for interactions between physical entities and virtual
entities. Devices are either attached or near physical entities or placed near physical
entities. Devices are used to gather information about physical entities (e.g., from
sensors), perform actuation upon physical entities (e.g., using tags). In the home
automation example, the device is a single-board Minicomputer which has light sensor
and actuator (relay switch) attached to it.
Resource: Resources are software components which can be either 'on-device ' or '
network- resources'. On- device resources are hosted on the device and include software
components that either provide information on or enable actuation upon the physical
entity to which device is attached. Network resources include the software components
that are available in network (such as a database). In the home automation example, the
on-device resource is the operating system that runs on the single-board minicomputer.
Services: Services provide an interface for interacting with the physical entity. Services
access the sources hosted on the device or the network resources to obtain information
about the physics entity or perform actuation upon the physical entity.
In the home automation example, there are 3 services:
1. A service that sets mode to auto or manual, or retrieves the current mode.
2. A service that sets the light appliance state to on/ off, or retrieves the current light
state.
3. A controller service that runs as a native service on the device. When in auto mode,
the controller service monitors the light level switches the light on/ off, and updates
the status in the state database. When in manual mode, the controller service
retrieves the current state from the database and switches the light on\off.
The fifth step in the IoT design methodology is to define the service specifications. Service
specifications define the services in the IoT system like service types, service inputs/
output, service endpoints, service schedules, service preconditions, and service effects.
Figure: Deriving services from process specification and information model for home
automation IoT system
The above figure shows an example of deriving the services from the process specification
and information model for the home automation IoT system. From the process
specification and information model, we identify the states and attributes. For each state
and attribute, we define a service. These services either change the state or attributes. for
each state and attribute, we define a service. These services either change the state or
attribute values or retrieve the current values. For example, the mode service sets the
mode to auto or manual or retrieves the current mode. The state service sets the light
appliance state on/off or retrieves the current light state. The controller service monitors
the light level in auto mode and switches the light on/off and updates the status in the
status database. In manual mode, the controller service retrieves the current state from
the database and switches the light on/off.
Below figure shows the specification of the controller, mode, and state services of the home
automation system. The mode service is a RESTful web service that sets mode to auto or
manual (PUT request) or retrieves the current light state (GET request). The state is
updated to/ retrieved from the status database. The controller service runs as a native
service on the device. When in auto mode, the controller service monitors the light level
and switches the light on/off, and updates the status in the status database. when in
manual mode, the controller service, retrieves the current state from the database and
switches the light on/off.
Figure: Controller service of the home automation IoT system, Mode service and State
service
The sixth step in the IoT design methodology is to define the IoT level for the system. The
below figure shows the deployment level of the home automation IoT system, which is
level-1.
Here the system consists of a single node that allows controlling the lights and appliances
in a home remotely. The device used in the system interfaces with the lights and
appliances using electronic relay switches. The status information of each light or
appliance is maintained in a local database. REST services deployed locally allow
retrieving and updating the state of each light or appliance in the status database. The
controller service continuously monitors the state of each light or appliance and triggers
the relay switches accordingly. The application which is deployed locally has a user
interface for controlling the lights or appliances. Since the device is connected to the
internet, the application can be accessed remotely as well.
The seventh step in the IoT design methodology is to define the functional view. The
functional view (FV) defines the functions of the IoT system grouped onto various
functional groups (FG's). Each functional group either provides functionalities for
Figure: Mapping deployment level to FG’s for Home Automation IoT system.
IoT device maps to the device FG (sensors, actuators, computing devices) and the
management FG (device management). Resources map to the device FG (on-device
resource) and communication FG (communication APIs and protocols). Controller service
maps to the services FG (native service). Web Services map to services FG. The database
maps to the management FG (DB Management) and security FG (DB security).
Application maps to the application FG (web application and DB servers), Management
FG (app management), and security FG (app security).
Operational view specifications for the home automation examples are as follows:
Devices: Computing device (raspberry Pi), light dependent resistor (sensor).
Relay switch (actuator).
Communication API’s : REST API’s
Communication protocols: Link layer - 802.11, Network Layer - IPv4/IPv6,
Transport-TCP, Application - HTTP.
Services:
1. Controller service- Hosted on device, implemented in python and runs as a
native service.
2. Mode service - REST-ful web service, hosted on device implemented with
Django-REST Framework.
Application :
Web application- Django web application,
Application server- Django app server,
Database server- MySQL.
Security:
Authentication: Web app, Database
Authorization: Web app database
Management:
Application management - Django app management
Database management - MySQL DB Management
Device management - Raspberry Pi device Management
The ninth step in the IoT design methodology is the integration of the devices and
components.
Figure shows a schematic diagram of the home automation IoT system. The devices and
components used in this example are raspberry Pi minicomputer, LDR sensor and relay switch
actuator.
Figure: Schematic diagram of the home automation IoT system showing the device,
sensor and Actuator integrated.
The final step in the IoT design methodology is to develop the IoT application. Figure
shows a screenshot of the home automation web application. The application has controls
for the mode (auto on or auto off) and the light (on or off). In the auto mode, the IoT
system controls the light appliance automatically based on the lighting conditions in the
room. When auto mode is enabled the light control in the application is disabled and it
reflects the current state of the light. When the auto mode is disabled, the light control is
enabled and it is used for manually controlling the light.
Below figure shows the domain model for the weather monitoring system. In this domain
model the physical entity is the environment which is being monitored. There is a virtual
entity for the environment. Devices include temperature sensor, pressure sensor,
humidity sensor, light sensor and single-board minicomputer.
The below figure shows the information model for the weather monitoring system. In this
example, there is one virtual entity for the environment being sensed. The virtual entity
has attributes - temperature, pressure, humidity and light.
The below figure shows an example of deriving the services from the process
specification and information model for the weather monitoring system.
PROCESS SPECIFICATION
Figure: Deriving services from process specification and information model for WM IoT system
The below figure shows the specification of the controller service for the weather
monitoring system. The controller service runs as a native service on the device and
monitors temperature, pressure, humidity and light on every 15 seconds. The controller
service calls the REST service to store these measurements in the cloud.
The below figure shows the deployment design for the system consists of multiple nodes
placed in different locations for monitoring temperature, humidity and pressure in an
area. The end nodes are equipped with various sensors (such as temperature, pressure,
humidity and light). The end nodes send the data to the cloud and the data is stored in a
cloud database. The analysis of data is done in the cloud to aggregate the data and make
predictions. A cloud-based application is used for visualizing the data.
The below figure shows an example of mapping deployment level to functional groups
for the weather monitoring system.
The below figure shows a schematic diagram of the weather monitoring system. The
devices and components used in this example are raspberry Pi minicomputer,
temperature sensor, humidity sensor, pressure sensor and LDR sensor.
Figure: Mapping functional Groups to operational view specifications for the WMS.
Smart objects are any physical objects that contain embedded technology to sense and/or
interact with their environment in a meaningful way by being interconnected and
enabling communication among themselves or an external agent.
Sensors: A sensor does exactly as its name indicates: It senses. A sensor measures some
physical quantity and converts that measurement reading into a digital representation.
That digital representation is typically passed to another device for transformation into
useful data that can be consumed by intelligent devices or humans.
Sensors are not limited to human-like sensory data. They can measure anything worth
measuring. In fact, they are able to provide an extremely wide spectrum of rich and
diverse measurement data with far greater precision than human senses; sensors provide
Superhuman sensory capabilities. Sensors can be readily embedded in any physical
objects that are easily connected to the Internet by wired or wireless networks.
o Sense: The devices that sense its surrounding environment in the form of
temperature, movement, and appearance of things, etc.
o Send and receive data: IoT devices are able to send and receive the data
over the network connection.
o Analyse: The devices can able to analyse the data that received from the
other device over the internet networks.
o Controlled: IoT devices may control from some endpoint also. Otherwise,
the IoT devices are themselves communicate with each other endlessly leads
to the system failure.
There are number of ways to group and cluster sensors into different categories
Sensors come in all shapes and sizes. A fascinating use case to highlight the power of
sensors and loT is in the area of precision agriculture (sometimes referred to as smart
farming). Which uses a variety of technical advances to improve the efficiency,
sustainability, and profitability of traditional farming practices.
This includes the use of GPS and satellite aerial imagery for determining field viability:
robots for high-precision planting, harvesting, irrigation, and so on: and real-time
analytics and artificial intelligence to predict optimal crop yield, weather impacts, and
soil quality.
Among the most significant impacts of precision agriculture are those dealing with
of a variety of soil characteristics. These include real-time measurement of soil quality,
pH levels, salinity, toxicity levels, moisture levels for measure irrigation planning,
nutrient levels tor fertilization planning, and so on. All this detailed sensor data can be
analysed to provide highly valuable and actionable insight to boost productivity and crop
yield. Below figure shows biodegradable, passive micro sensors to measure soil and crop
and conditions. These sensors, developed at North Dakota State University (NDS0), can
be planted directly in the soil and left in the ground to biodegrade without any harm to
soil quality.
Below figure shows the explosive year-over-year increase over the past several years and
some bold predictions for sensor numbers in the upcoming years. There is a strong belief
in the sensor industry that this number will eclipse a trillion in the next few years. In fact,
many large players in the sensor industry have come together to form industry consortia,
such as the TSensors Summits (www.tsensorssummit.org), to create a strategy and
roadmap for a trillion-sensor economy. The trillion-sensor economy will be of such an
unprecedented and unimaginable scale that it will change the world forever. This is the power of
loT.
Actuators:
Actuators are natural complements to sensors. Below figure demonstrates the symmetry
and complementary nature of these two types of devices. Sensors are designed to sense
and measure practically any measurable variable in the physical world. They convert
their measurements (typically analog) into electric signals or digital representations that
can be consumed by an intelligent agent (a device or a human). Actuators, on the others
hand, receive some type of control signal (commonly an electric signal or digital
command) that triggers a physical effect, usually some type of motion, force, and so on.
Humans use their five senses to sense and measure their environment. The sensory
organs convert this sensory information into electrical impulses that the nervous system
sends to the brain for processing. Likewise, IoT sensors are devices that sense and
measure the physical World and (typically) signal their measurements as electric signals
sent to some type of microprocessor or microcontroller for additional processing. The
human brain signals motor function and movement, and the nervous system carries that
information to the appropriate part of the muscular system. Correspondingly, a processor
can send an electric signal to an actuator that translates the signal into some type of
movement (linear, rotational, and so on) or useful work that changes or has a measurable
impact on the physical world. This interaction between sensors, actuators, and
processors and the similar functionality in biological systems is the basis for various
technical fields, including robotics and biometrics.
Much like sensors, actuators also vary greatly in function, size, design, and so on. Some
common ways that they can be classified in
Type of motion: Actuators can be classified based on the type of motion they
produce (for example, linear, rotary, one/two/three-axes).
Power: Actuators can be classified based on their power, output (for example, high
power, low power, micro power)
Binary or continuous: Actuators can be classified based on the number of stable-
state outputs.
Area of application: Actuators can be classified based on the specific industry or
vertical where they are used.
Type of energy: Actuators can be classified based on their energy type.
Torsional ratcheting actuator (TRA) MEMS that was developed by Sandia National
Laboratory as a low voltage alternative to a micro-engine.
This MEMS is only a few hundred micrometres across; a scanning electron microscope
is needed to show the level of detail visible in the above figure.
Micro-scale sensors and actuators are immensely embeddable in everyday objects,
which is a defining characteristic of IoT.
MEMS can be so small, they’re not visible to the human eye. A MEMS, or micro-
electromechanical system, can range in size from microscopic to the size of a fingernail.
It’s comprised of both electrical and mechanical components, and though small, plays a
huge role in almost everything. MEMS are what deploy airbags, ensure insulin pump
accuracy, control thermostats, adjust screen orientation on smartphones, control ink flow
in printers, and so much more. As MEMS become smaller, require less power, and less
expensive, they’re expected to play an important part in the wireless internet of things
and home automation.
Smart Objects
Processing unit: A smart object has some type of processing unit for acquiring
data, processing and analysing sensing information received by the sensor(s),
coordinating control signals to any actuators, and controlling a variety of
functions on the smart object, including the communication and power
systems. The most common is a microcontroller because of its small form
factor, flexibility, programming simplicity, ubiquity, low power consumption,
and low cost.
Sensor(s) and/or actuator(s): A smart object is capable of interacting with
the physical world through sensors and actuators. Ø A sensor learns and
measures its environment, whereas an actuator is able to produce some
change in the physical world. A smart object does not need to contain both
sensors and actuators. In fact, a smart object can contain one or multiple
sensors and/or actuators, depending upon the application.
Sensor Networks
Wireless sensor networks are made up of wirelessly connected smart objects, which
sometimes referred to as motes. The fact that there is no infrastructure to consider with
WSNs is surely powerful advantage for flexible deployments, but there are a variety of
design constraint to consider these wirelessly connected smart objects. The below figure
illustrates some of these assumptions and constraints usually involved in WSN.
The following are some of the most significant limitations of the smart objects in WSNs:
Limited processing power
Limited memory
Lossy communication
Limited transmission speeds
Limited power
These limitations greatly influence how WSNS are designed, deployed, and utilized. The
fact that individual sensor nodes are typically so limited is a reason that they are often
deployed in very large numbers. As the cost of sensor nodes continues to decline, the
ability to deploy highly redundant sensors becomes increasingly feasible, because many
sensors are very inexpensive and correspondingly inaccurate, the ability to deploy smart
objects redundantly allows for increased accuracy.
Such large numbers of sensors permit the introduction of hierarchies of smart objects.
Such a hierarchy provides, among other organizational advantages, the ability to each
aggregate similar sensor readings from sensor nodes that are in close proximity to each.
Other. The below figure shows an example of such a data aggregation function in a WSN
where temperature readings from a logical grouping of temperature sensors are
aggregated as an average temperature reading. These data aggregation techniques are
helpful in reducing the amount of overall traffic (and energy) in WSNs with very large
numbers of deployed smart objects.
Wirelessly connected smart objects generally have one of the following two
communication patterns
Event-driven: Transmission of sensory information is triggered only when a smart
object detects a particular event or predetermined threshold.
Periodic: Transmission of sensory information occurs only at periodic intervals.
The decision of which of these communication schemes is used depends greatly on the
specific application. For example, in some medical use cases, sensors periodically send
postoperative vitals, such as temperature or blood pressure readings. In other medical
use cases, the same blood pressure or temperature readings are triggered to be when
certain critically sent only low or high readings are measured.
Likewise, when selecting a communication protocol, you must carefully take into account
the requirements of the specific application and consider any trade-offs the
communication protocol offers between power consumption, maximum transmission
speed, range, tolerance for packet loss, topology optimization, security, and so on. The
fact that WSNs are often deployed outdoors in harsh and unpredictable environments
adds yet another variable to consider because obviously not all communication protocols
are designed to be equally rugged. In addition to the aforementioned technical
capabilities, they must also enable, as needed, the overlay of autonomous techniques (for
example, self-organization, self-healing, self-configuration)