[go: up one dir, main page]

0% found this document useful (0 votes)
18 views80 pages

POIT Lecture Notes

The document is a set of lecture notes on the Principles of IoT, detailing its definition, characteristics, physical and logical designs, and enabling technologies. It covers various aspects of IoT networks, management, hardware control, and cloud offerings, along with practical applications and case studies. The notes aim to equip students with the necessary knowledge to understand and apply IoT concepts in real-world scenarios.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views80 pages

POIT Lecture Notes

The document is a set of lecture notes on the Principles of IoT, detailing its definition, characteristics, physical and logical designs, and enabling technologies. It covers various aspects of IoT networks, management, hardware control, and cloud offerings, along with practical applications and case studies. The notes aim to equip students with the necessary knowledge to understand and apply IoT concepts in real-world scenarios.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

INSTITUTE OF AERONAUTICAL ENGINEERING

(AUTONOMOUS)
Dundigal, Hyderabad - 500 043

LECTURE NOTES:

Principles of IoT (ACIC10)

DRAFTED BY:
Ms. B. Lakshmi Prasanna (IARE10706)
Assistant Professor

DEPARTMENT OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY


INSTITUTE OF AERONAUTICAL ENGINEERING
AUGUST, 2024
Contents 1

Contents ............................................................................................................................. I
List of Figures ....................................................................................................................... III
1 INTRODUCTION TO INTERNET OF THINGS (IoT).......................................... 1
1.1 Definition & Characteristics of IoT..................................................................................
1.2 Physical Design of IoT ....................................................................................................
1.3 Logical design of IoT .....................................................................................................
1.4 IoT Enabling Technologies..............................................................................................
1.5 IoT Levels and Deployment Templates............................................................................
1.6 Domain specific of IoTs................................................................................................... 16

2 IoT Networks and management 17


2.1 Machine-to-Machine (M2M) ...........................................................................................
2.2 Differences between IoT and M2M .................................................................................
2.3 Software Defined Networking (SDN) and Network Function Virtualization (NFV)
2.4 Basics of IoT System Management with NETCONF-YANG .............................................. 22
3 Controlling Hardware And Sensors 23
3.1 Controlling Hardware-Connecting LED, buzzer ,..............................................................
3.1.1 Switching high power devices with transistors . ...........................................................
3.1.2 controlling servo motor................................................................................................
3.1.3 speed control of DC motor...........................................................................................
3.1.4 Switching high power devices with transistors .............................................................
3.2 Sensors.........................................................................................................................
3.2.1 Light sensor, Temperature sensor with thermistor .........................................................
3.2.2 Voltage sensor, ADC and DAC .....................................................................................
3.2.3. Temperature and Humidity sensor DHT11, motion detection sensors ...........................
3.2.4 wireless Bluetooth sensors, level sensors, USB Sensors .................................................
3.2.5 embedded sensors, distance measurement with ultrasound sensor .................................. 43

I
Contents 2

4 IoT PHYSICAL DEVICES AND ENDPOINTS ............................................................... 44


4.1 IoT Device
4.2 Raspberry Pi GPIO..........................................................................................................
4.2 1 Introduction to Raspberry Pi interfaces (Serial, SPI, I2C), ................................................
4.2.2 Serial Peripheral Interface Protocol .................................................................................
4.2.3 SPI Modes ............................................................................................................
4.2.4 I2C-Inter-Integrated Circuit.................................................................................................
4.2.5 Applications ............................................................................................................
4.3 Introduction of IoT Devices.............................................................................................
4.4 List of Top 18 IoT Devices Examples ..............................................................................
4.5 IoT Life Cycle....................................................................................................................
4.5.1 Advantages of IoT Devices..............................................................................................
4.5.2 Disadvantages .............................................................................................................. 53

5 IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 54


5.1 Introduction to Cloud Storage Models and Communication APIs ............................................
5.1.1 Introduction to Cloud Computing ...........................................................................................
5.1.2 Concept .....................................................................................................
5.1.3 Characteristics .....................................................................................................
5.2 Service and Deployment .....................................................................................................
5.2.1 Deployment models.....................................................................................................
5.2.2 Cloud storage API..................................................................................................................
5.2.3 Three basic types of APIs .....................................................................................................
5.3 IoT / Cloud Convergence........................................................................................................
5.4 WAMP -AutoBahn for IoT .....................................................................................................
5.4.1 WAMP for IoT .....................................................................................................................
5.4.2 WAMP -AutoBahn for IoT .....................................................................................................
5.4.3 Xively Cloud for IoT..............................................................................................................
5.5 How to use Xively? ................................................................................................................
Case Studies illustrating IoT Design - Home Automation,Smart Cities,Smart En- vironment .
Case studies illustrating IoT design Case Study in IoT: Home Automation
Case studies illustrating IoT design Case Study in IoT: Smart Cities ........................................ 73

Bibliography 74

II
List of Figures

1.1 Iot Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3


1.2 Things in IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Things included in IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 IoT Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 IoT Functional Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.6 Request-Response Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.7 Publish-Subscibe Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.8 Push-Pull Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.9 Exclusive Pair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
The REST architectural constraints . . . . . . . . . . . . . . . . . . . . . . . . 8
Request-Response model used by REST . . . . . . . . . . . . . . . . . . . . . . 9
WebSocket Based Communication APIs ................................................................................ 10
IoT Level1 ............................................................................................................................. 12
IoT Level2 ............................................................................................................................. 12
IoT Level3 ............................................................................................................................. 12
IoT Level4 ............................................................................................................................. 13
IoT Level5 ............................................................................................................................. 13
IoT Level6 ............................................................................................................................. 14

Block diagram of an IoT Device ............................................................................................. 44


Raspberry Pi .......................................................................................................................... 45
Raspberry Pi GPIO................................................................................................................. 45

Cloud Computing ................................................................................................................... 54


WAMP for IoT ...................................................................................................................... 60
publish/subscribe model provided by PubNub......................................................................... 67
the system architecture used in this home automation project ................................................... 68
the system architecture used in this smart city project .............................................................. 69
Representation of IoT based smart city taxonomy ................................................................... 69
IoT based smart environment ................................................................................................. 71
Representation of IoT based smart environment taxonomy ..................................................... 72

III
Chapter 1
INTRODUCTION TO INTERNET OFTHINGS (IoT)

Course Outcomes
After successful completion of this module, students should be able to:
CO 1 Relate the characteristics and appropriate Remember
levels of IoT for reusing of deployed IoT
resources across application domains.
CO 2 Identify the necessity of communication Apply
models, protocols and API’s for accessing
data from sensors and actuators to overcome
issues like failure of any connected devices

Definition & Characteristics of IoT

Introduction

IoT comprises things that have unique identities and are connected to internet. By 2020 there
will be a total of 50 billion devices /things connected to internet. IoT is not limited to just
connectingthings to the internet but also allow things to communicate and exchange data.

Definition

A dynamic global n/w infrastructure with self-configuring capabilities based on standard and
in- teroperable communication protocols where physical and virtual things have identities,
physical attributes and virtual personalities and use intelligent interfaces, and are seamlessly
integrated into information n/w, often communicate data associated with users and their
environments.

1
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 2

Characteristics

1) Dynamic and Self Adapting: IoT devices and systems may have the capability to
dynamically adapt with the changing contexts and take actions based on their operating
conditions, users con-text or sensed environment.
Eg: the surveillance system is adapting itself based on context and changing conditions.
2) Self-Configuring: allowing a large number of devices to work together to provide certain
functionality.
3) Inter Operable Communication Protocols: support a number of interoperable
communication protocols and can communicate with other devices and also with
infrastructure.
4) Unique Identity: Each IoT device has a unique identity and a unique identifier (IP address).
5) Integrated into Information Network: that allow them to communicate and exchange data
with other devices and systems.

Applications of IoT

1) Home
2) Cities
3) Environment
4) Energy
5) Retail
6) Logistics
7) Agriculture
8) Industry
9) Health and Life Style

Physical Design of IoT

1) Things in IoT:
The things in IoT refers to IoT devices which have unique identities and perform remote
sensing, actuating and monitoring capabilities. IoT devices can exchange data with other connected
devices applications. It collects data from other devices and process data either locally or
remotely. An IoT device may consist of several interfaces for communication to other devices
both wired and wireless.
These includes
(i) I/O interfaces for sensors,
(ii) Interfaces for internet connectivity
(iii) memory and storage interfaces and
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 3

FIGURE 1.1: Iot Applications

(iv) audio/video interfaces. 2) IoT Protocols


A) Link Layer: Protocols determine how data is physically sent over the networks
physical layer or medium. Local network connect to which host is attached. Hosts on the same
link exchange data packets over the link layer using link layer protocols. Link layer determines
how packets are coded and signaled by the h/w device over the medium to which the host is
attached.
Protocols:
• 802.3-Ethernet: IEEE802.3 is collection of wired Ethernet standards for the link layer.
Eg: 802.3 uses co-axial cable; 802.3i uses copper twisted pair connection; 802.3j uses fiber
optic connection; 802.3ae uses Ethernet over fiber.
• 802.11-WiFi: IEEE802.11 is a collection of wireless LAN (WLAN) communication
standards including extensive description of link layer.
Eg: 802.11a operates in 5GHz band, 802.11b and 802.11g operates in 2.4GHz band, 802.11n
operates in 2.4/5GHz band, 802.11ac operates in 5GHz band, 802.11ad operates in 60Ghzband.

• 802.16 - WiMAX: IEEE802.16 is a collection of wireless broadband standards including ex-


clusive description of link layer. WiMax provide data rates from 1.5 Mb/s to 1Gb/s.
• 802.15.4-LR-WPAN: IEEE802.15.4 is a collection of standards for low-rate wireless
personal area network (LR-WPAN). Basis for high level communication protocols such as ZigBee.
Provides data rate from 40kb/s to250kb/s.
• 2G/3G/4G-Mobile Communication: Data rates from 9.6kb/s(2G) to up to100Mb/s(4G).
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 4

FIGURE 1.2: Things in IoT

B) Network/Internet Layer: Responsible for sending IP datagrams from source n/w to


desti- nation n/w. Performs the host addressing and packet routing. Datagrams contains source
and destination address.
Protocols:
• IPv4: Internet Protocol version4 is used to identify the devices on a n/w using a hierarchical
addressing scheme. 32 bit address. Allows total of 2**32addresses.
• IPv6: Internet Protocol version6 uses 128 bit address scheme and allows 2**128 addresses.
• 6LOWPAN:(IPv6overLowpowerWirelessPersonalAreaNetwork) operates in 2.4 GHz frequency
range and data transfer 250 kb/s.
C) Transport Layer: Provides end-to-end message transfer capability independent of
the under-lying n/w. Set up on connection with ACK as in TCP and without ACK as in UDP.
Provides functions such as error control, segmentation, flow control and congestion control.
Protocols:
• TCP: Transmission Control Protocol used by web browsers (along with HTTP and HTTPS),
email (along with SMTP, FTP). Connection oriented and stateless protocol. IP Protocol deals
with sending packets, TCP ensures reliable transmission of protocols in order. Avoids n/w
congestionand congestion collapse.
• UDP: User Datagram Protocol is connectionless protocol. Useful in time sensitive
applications, very small data units to exchange. Transaction oriented and stateless protocol.
Does not provide guaranteed delivery.
D) Application Layer: Defines how the applications interface with lower layer
protocols to send data over the n/w. Enables process-to-process communication using ports.
Protocols:
• HTTP: Hyper Text Transfer Protocol that forms foundation of WWW. Follow request- response
model Stateless protocol.
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 5

FIGURE 1.3: Things included in IoT

FIGURE 1.4: IoT Protocols

• CoAP: Constrained Application Protocol for machine-to-machine (M2M) applications with


con- strained devices, constrained environment and constrained n/w. Uses client- server
architecture.
• WebSocket: allows full duplex communication over a single socket connection.
• MQTT: Message Queue Telemetry Transport is light weight messaging protocol based on
publish- subscribe model. Uses client server architecture. Well suited for constrained
environment.
• XMPP: Extensible Message and Presence Protocol for real time communication and streaming
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 6

XML data between network entities. Support client-server and server-server communication.
• DDS: Data Distribution Service is data centric middleware standards for device-to-device
or machine-to-machine communication. Uses publish-subscribe model.
• AMQP: Advanced Message Queuing Protocol is open application layer protocol for
business messaging. Supports both point-to-point and publish-subscribe model.

Logical design of IoT

Refers to an abstract represent of entities and processes without going into the low level
specifies of implementation. 1) IoT Functional Blocks
2) IoT Communication Models
3) IoT Comm. APIs
1) IoT Functional Blocks

FIGURE 1.5: IoT Functional Blocks

It Provides the system the capabilities for identification, sensing, actuation, communication and
management.
• Device: An IoT system comprises of devices that provide sensing, actuation, monitoring and
control functions.
• Communication: handles the communication for IoT system. • Services: for device
monitoring, device control services, data publishing services and services for device
discovery.
• Management: Provides various functions to govern the IoT system. • Security: Secures IoT
system and priority functions such as authentication, authorization, message and context
integrity and data security. • Application: IoT application provide an interface that the users
can use to control and monitor various aspects of IoT system. 2) IoT Communication Models
1) Request-Response
2) Publish-Subscibe3) Push-Pull
4) ExclusivePair
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 7

1. Request-Response Model:

FIGURE 1.6: Request-Response Model

FIGURE 1.7: Publish-Subscibe Model

FIGURE 1.8: Push-Pull Model

In which the client sends request to the server and the server replies to requests. Is a stateless
communication model and each request-response pair is independent of others.
2) Publish-Subscibe Model: Involves publishers, brokers and consumers. Publishers are
sourceof data. Publishers send data to the topics which are managed by the broker. Publishers
are not aware of the consumers. Consumers subscribe to the topics which are managed by the
broker. When the broker receives data for a topic from the publisher, it sends the data to all the
subscribed consumers. 3) Push-Pull Model:
Push-Pull Model in which data producers push data to queues and consumers pull data from
the
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 8

FIGURE 1.9: Exclusive Pair

queues. Producers do not need to aware of the consumers. Queues help in decoupling the
message between the producers and consumers.
4) Exclusive Pair:
Exclusive Pair is bi-directional, fully duplex communication model that uses a persistent
connection between the client and server. Once connection is set up it remains open until the
client send a request to close the connection. Is a stateful communication model and server is
aware of all the open connections.
3) IoT Communication APIs:
a) REST based communication APIs (Request-Response Based Model)
b) WebSocket based Communication APIs (Exclusive Pair Based Model)
a) REST based communication APIs:
Representational State Transfer (REST) is a set of architectural principles by which we can
design web services and web APIs that focus on a systems resource and have resource states
are ad- dressed and transferred.
The REST architectural constraints: Fig. shows communication between client server with
REST APIs.

FIGURE 1.10: The REST architectural constraints


Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 9

Client-Server: The principle behind client-server constraint is the separation of concerns.


Separation allows client and server to be independently developed and updated.
Stateless: Each request from client to server must contain all the info. Necessary to understand
the request, and cannot take advantage of any stored context on the server.
Cache-able: Cache constraint requires that the data within a response to a request be implicitly
or explicitly labeled as cache-able or non-cacheable. If a response is cache-able, then a client
cacheis given the right to reuse that response data for later, equivalent requests.
Layered System: constraints the behavior of components such that each component cannot see
beyond the immediate layer with which they are interacting.
User Interface: constraint requires that the method of communication between a client and a
server must be uniform. Code on Demand: Servers can provide executable code or scripts for
clients to execute in their context. This constraint is the only one that is optional.
Request-Response model used by REST:
RESTful web service is a collection of resources which are represented by URIs. RESTful
web

FIGURE 1.11: Request-Response model used by REST

API has a base URI (e.g: http://example.com/api/tasks/). The clients and requests to these URIs
using the methods defined by the HTTP protocol (e.g: GET, PUT, POST or DELETE). A
Restful web service can support various internet media types.
b) WebSocket Based Communication APIs:
WebSocket APIs allow bi-directional, full duplex communication between clients and servers.
WebSocket APIs follow the exclusive pair communication model.

IoT Enabling Technologies

IoT is enabled by several technologies including Wireless Sensor Networks, Cloud Computing,
Big Data Analytics, Embedded Systems, Security Protocols and architectures, Communication
Protocols, Web Services, Mobile internet and semantic search engines.
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 10

1) Wireless Sensor Network(WSN):

FIGURE 1.12: WebSocket Based Communication APIs

Wireless Sensor Network Comprises of distributed devices with sensors which are used to
monitor the environmental and physical conditions. Zig Bee is one of the most popular wireless
technologies used by WSNs.
WSNs used in IoT systems are described as follows:
• Weather Monitoring System: in which nodes collect temp, humidity and other data, which
is aggregated and analyzed.
• Indoor air quality monitoring systems: to collect data on the indoor air quality and
concentration of various gases.
• Soil Moisture Monitoring Systems: to monitor soil moisture at various locations.
• Surveillance Systems: use WSNs for collecting surveillance data (motion data detection).
• Smart Grids: use WSNs for monitoring grids at various points.
• Structural Health Monitoring Systems: Use WSNs to monitor the health of
structures (building, bridges) by collecting vibrations from sensor nodes deployed at
variouspoints in the structure.
2) Cloud Computing:
Cloud Computing Services are offered to users in different forms.
• Infrastructure-as-a-service(IaaS):provides users the ability to provision computing and
stor-age resources. These resources are provided to the users as a virtual machine instances and
virtual storage.
• Platform-as-a-Service(PaaS): provides users the ability to develop and deploy application
in cloud using the development tools, APIs, software libraries and services provided by the
cloud service provider.
• Software-as-a-Service(SaaS): provides the user a complete software application or the user
interface to the application itself.
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 11

3) Big Data Analytics:

Some examples of big data generated by IoT are


• Sensor data generated by IoT systems.
• Machine sensor data collected from sensors established in industrial and energy systems
• Health and fitness data generated IoT devices.
• Data generated by IoT systems for location and tracking vehicles.
• Data generated by retail inventory monitoring systems.

4) Communication Protocols:

Communication Protocols form the back-bone of IoT systems and enable network
connectivity and coupling to applications.
• Allow devices to exchange data over network.
• Define the exchange formats, data encoding addressing schemes for device and routing of
pack-ets from source to destination.
• It includes sequence control, flow control and retransmission of lost packets.

5) Embedded Systems:

Embedded Systems is a computer system that has computer hardware and software embedded
to perform specific tasks. Embedded System range from low cost miniaturized devices such as
digital watches to devices such as digital cameras, POS terminals, vending machines, appliances
etc.,

IoT Levels and Deployment Templates

1) IoT Level1: System has a single node that performs sensing and/or actuation, stores data,
performs analysis and host the application as shown in fig. Suitable for modeling low cost and
low complexity solutions where the data involved is not big and analysis requirement are not
computationally intensive.
An e.g., of IoT Level1 is Home automation. 2) IoT Level2: has a single node that performs
sensing and/or actuating and local analysis as shown in fig. Data is stored in cloud and
application is usually cloud based. Level2 IoT systems are suitable for solutions where data are
involved is big, however, the primary analysis requirement is not computationally intensive
and can be done locally itself.
An e,g., of Level2 IoT system for Smart Irrigation.
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 12

FIGURE 1.13: IoT Level1

FIGURE 1.14: IoT Level2

3) IoT Level3: system has a single node. Data is stored and analyzed in the cloud application is
cloud based as shown in fig. Level3 IoT systems are suitable for solutions where the data
involvedis big and analysis requirements are computationally intensive.
An example of IoT level3 system for tracking package handling. 4) IoT Level4: System
has

FIGURE 1.15: IoT Level3

multiple nodes that perform local analysis. Data is stored in the cloud and application is
cloud
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 13

based as shown in fig. Level4 contains local and cloud-based observer nodes which can
subscribe to and receive information collected in the cloud from IoT devices.
An example of a Level4 IoT system for Noise Monitoring. 5) IoT Level5: System has
multiple

FIGURE 1.16: IoT Level4

end nodes and one coordinator node as shown in fig. The end nodes that perform sensing
and/or actuation. Coordinator node collects data from the end nodes and sends to the cloud.
Data is stored and analyzed in the cloud and application is cloud based. Level5 IoT systems are
suitable for solution based on wireless sensor network, in which data involved is big and analysis
requirements are computationally intensive.
An example of Level5 system for Forest Fire Detection.

FIGURE 1.17: IoT Level5

6) IoT Level6: System has multiple independent end nodes that perform sensing and/or
actuation and sensed data to the cloud. Data is stored in the cloud and application is cloud
basedas shown in fig. The analytics component analyses the data and stores the result in the
cloud data base. The
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 14

results are visualized with cloud-based application. The centralized controller is aware of the
statusof all the end nodes and sends control commands to nodes. An example of a Level6 IoT
system for Weather Monitoring System.

FIGURE 1.18: IoT Level6

Domain specific of IoTs

1) Home Automation:
a) Smart Lighting: helps in saving energy by adapting the lighting to the ambient conditions
and switching on/off or diming the light when needed.
b) Smart Appliances: make the management easier and also provide status information to the
users remotely.
c) Intrusion Detection: use security cameras and sensors (PIR sensors and door sensors) to
detect intrusion and raise alerts. Alerts can be in the form of SMS or email sent to the user.
d) Smoke/Gas Detectors: Smoke detectors are installed in homes and buildings to detect
smoke that is typically an early sign of fire. Alerts raised by smoke detectors can be in the form
of signals to a fire alarm system. Gas detectors can detect the presence of harmful gases such as
CO, LPG etc.,
2) Cities:
a) Smart Parking: make the search for parking space easier and convenient for drivers. Smart
parking are powered by IoT systems that detect the no. of empty parking slots and send information
over internet to smart application backends.
b) Smart Lighting: for roads, parks and buildings can help in saving energy.
c) Smart Roads: Equipped with sensors can provide information on driving condition, travel
time estimating and alert in case of poor driving conditions, traffic condition and accidents.
d) Structural Health Monitoring: uses a network of sensors to monitor the vibration levels
in the structures such as bridges and buildings.
e) Surveillance: The video feeds from surveillance cameras can be aggregated in cloud based
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 15

scalable storage solution.


f) Emergency Response: IoT systems for fire detection, gas and water leakage detection can
help in generating alerts and minimizing their effects on the critical infrastructures.

3) Environment: a) Weather Monitoring: Systems collect data from a no. of sensors attached
and send the data to cloud-based applications and storage back ends. The data collected in
cloud can then be analyzed and visualized by cloud-based applications.
b) Air Pollution Monitoring: System can monitor emission of harmful gases(CO2, CO, NO,
NO2 etc.,) by factories and automobiles using gaseous and meteorological sensors. The
collected data can be analyzed to make informed decisions on pollutions control approaches.
c) Noise Pollution Monitoring: Due to growing urban development, noise levels in cities have
increased and even become alarmingly high in some cities. IoT based noise pollution
monitoring systems use a no. of noise monitoring systems that are deployed at different
placesin a city. The data on noise levels from the station is collected on servers or in the cloud.
The collected data is then aggregated to generate noise maps.
d) Forest Fire Detection: Forest fire can cause damage to natural resources, property and
human life. Early detection of forest fire can help in minimizing damage.
e) River Flood Detection: River floods can cause damage to natural and human resources and
human life. Early warnings of floods can be given by monitoring the water level and flow rate.
IoT based river flood monitoring system uses a no. of sensor nodes that monitor the water level
and flow rate sensors.
4) Energy:
a) Smart Grids: is a data communication network integrated with the electrical grids that
collects and analyze data captured in near-real-time about power transmission, distribution and
consumption. Smart grid technology provides predictive information and recommendations to
utilities, their suppliers, and their customers on how best to manage power. By using IoT based
sensing and measurement technologies, the health of equipment and integrity of the grid can be
evaluated.
b) Renewable Energy Systems: IoT based systems integrated with the transformers at the
point of interconnection measure the electrical variables and how much power is fed into the
grid. For wind energy systems, closed-loop controls can be used to regulate the voltage at point
of interconnection which coordinate wind turbine outputs and provides power support.
c) Prognostics: In systems such as power grids, real-time information is collected using
specialized electrical sensors called Phasor Measurement Units (PMUs) at the substations. The
information received from PMUs must be monitored in real-time for estimating the state of the
systemand for predicting failures.
5) Retail:
a) Inventory Management: IoT systems enable remote monitoring of inventory using data
collected by RFID readers.
b Solutions such as contact-less payments powered by technologies such as Near Field
Communication (NFC) and Bluetooth. c) Smart Vending Machines: Sensors in a smart
vending machine
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 16

monitors its operations and send the data to cloud which can be used for predictive
maintenance.
6) Logistics:
a) Route generation and scheduling: IoT based system backed by cloud can provide first re-
sponse to the route generation queries and can be scaled upto serve a large transportation
network.
b) Fleet Tracking: Use GPS to track locations of vehicles inreal-time.
c) Shipment Monitoring: IoT based shipment monitoring systems use sensors such as temp,
hu-midity, to monitor the conditions and send data to cloud, where it can be analyzed to detect
food spoilage.
d) Remote Vehicle Diagnostics: Systems use on-board IoT devices for collecting data on
Vehicle operations (speed, RPMetc.,) and status of various vehicle subsystems.
7) Agriculture:
a) Smart Irrigation: to determine moisture amount in soil.
b) Green House Control: to improveproductivity.
8) Industry:
a) Machine diagnosis and prognosis
b) Indoor Air Quality Monitoring
9) Health and LifeStyle:
a) Health and Fitness Monitoring
b) Wearable Electronics
Chapter 2
IoT Network and Management

Course Outcomes
After successful completion of this module, students should be able to:
CO3 Compare Machine to Machine with IoT and identifying Understand
the role of SDN,NFV, NETCONFG-YANG for data
exchange between devices and management on network.

Machine-to-Machine (M2M)

Machine-to-Machine (M2M) refers to networking of machines (or devices) for the purpose
ofre-mote monitoring and control and data exchange.
• Term which is often synonymous with IoT is Machine-to-Machine (M2M).
• IoT and M2M are often used interchangeably.

Fig2.1 . Shows the end-to-end architecture of M2M systems comprises of M2M area
networks,communication networks and application domain.

An M2M area network comprises of machines( or M2M nodes) which have embedded network

17
Chapter 2. IoT network and Management 18

modules for sensing, actuation and communicating various communication protocols can be
usedfor M2M LAN such as ZigBee, Bluetooth, M-bus, Wireless M-Bus etc., These protocols
provideconnectivity between M2M nodes within an M2M area network.
• The communication network provides connectivity to remote M2M area networks. The com-
munication network provides connectivity to remote M2M area network. The communication
network can use either wired or wireless network(IP based). While the M2M are networks use
either properietorary or non-IP based communication protocols, the communication network
uses IP-based network. Since non-IP based protocols are used within M2M area network, the
M2M nodes within one network cannot communicate with nodes in an external network.
• To enable the communication between remote M2M are network, M2M gateways are used.

Fig.2.2 Shows a block diagram of an M2M gateway.

The communication between M2M nodes and the M2M gateway is based on the
communication protocols which are naive to the M2M are network. M2M gateway performs
protocol translations to enable Ip-connectivity for M2M are networks. M2M gateway acts as a
proxy performing translations from/to native protocols to/from Internet Protocol (IP). With an
M2M gateway, each mode in an M2M area network appears as a virtualized node for external
M2M area networks.

Differences between IoT and M2M

1) Communication Protocols:
• Commonly uses M2M protocols include ZigBee, Bluetooth, ModBus, M-Bus, Wireless M-
Busetc.,
• In IoT uses HTTP, CoAP, WebSocket , MQTT ,XMPP ,DDS ,AMQP etc.,
2) Machines in M2M Vs Things in IoT:
• Machines in M2M will be homogenous whereas Things in IoT will be heterogeneous.
3) Hardware Vs Software Emphasis:
• the emphasis of M2M is more on hardware with embedded modules, the emphasis of IoT is
moreon software.
4) Data Collection and Analysis
• M2M data is collected in point solutions and often in on-premises storage infrastructure.
Chapter 2. IoT network and Management 19

• The data in IoT is collected in the cloud (can be public, private orhybrid cloud).
5) Applications
• M2M data is collected in point solutions and can be accessed by on-premises applications such
asdiagnosis applications, service management applications, and on- premisis enterprise
applications.
• IoT data is collected in the cloud and can be accessed by cloud applications such as
analyticsapplications, enterprise applications, remote diagnosis and management applications,
etc.

Software Defined Networking (SDN) and Network Function Vir-tualization (NFV) for
IoT

Software Defined Networking(SDN):


• Software-Defined Networking (SDN) is a networking architecture that separates the control
planefrom the data plane and centralizes the network controller.
• Software-based SDN controllers maintain a united view of the network
• The underlying infrastructure in SDN uses simple packet forwarding hardware as opposed
tospecialized hardware in conventional networks.
SDN Architecture

Fig 2.3: SDN Architecture

Key elements of SDN:


1) Centralized Network Controller
With decoupled control and data planes and centralized network controller, the network
adminis-trators can rapidly configure the network.
Chapter 2. IoT network and Management 20

2) Programmable Open APIs


SDN architecture supports programmable open APIs for interface between the SDN
application and control layers (Northbound interface).
3) Standard Communication Interface(OpenFlow)
SDN architecture uses a standard communication interface between the control and
infrastructure layers (Southbound interface). OpenFlow, which is defined by the Open
Networking Foundation (ONF) is the broadly accepted SDN protocol for the Southbound
interface.
Network Function Virtualization (NFV)
• Network Function Virtualization (NFV) is a technology that leverages virtualization to
consoli- date the heterogeneous network devices onto industry standard high volume servers,
switches andstorage.
• NFV is complementary to SDN as NFV can provide the infrastructure on which SDN can run.

Fig 2.4: Network Function Virtualization


NFV Architecture Key elements of NFV:
1) Virtualized Network Function (VNF):
VNF is a software implementation of a network function which is capable of running over
the NFV Infrastructure (NFVI).
2) NFV Infrastructure (NFVI):
NFVI includes compute, network and storage resources that are virtualized.
3) NFV Management and Orchestration:
NFV Management and Orchestration focuses on all virtualization-specific management tasks
and covers the orchestration and life-cycle management of physical and/or software resources
that support the infrastructure virtualization, and the life-cycle management of VNFs.
Need for IoT Systems Management
Managing multiple devices within a single system requires advanced management capabilities.
1) Automating Configuration: IoT system management capabilities can help in automating the
Chapter 2. IoT network and Management 21

systemconfiguration.
2) Monitoring Operational and Statistical Data: Management systems can help in
monitoring operational and statistical data of a system. This data can be used for fault diagnosis
or prognosis.
3) Improved Reliability: A management system that allows validating the system
configurations before they are put into effect can help in improving the system reliability.
4) System Wide Configurations: For IoT systems that consists of multiple devices or nodes,
ensuring system wide configuration can be critical for the correct functioning of the system.
5) Multiple System Configurations: For some systems it may be desirable to have multiple valid
configurations which are applied at different times or in certain conditions.
6) Retrieving and Reusing Configurations: Management systems which have the capability
of retrieving configurations from devices can help in reusing the configurations for other
devices ofthe same type.

Basics of IoT System Management with NETCONF-YANG

IoT Systems Management with NETCONF-YANG


YANG is a data modeling language used to model configuration and state data manupulated by the
NETCONF protocol.
The generic approach of IoT device management with NETCONF-YANG.
Roles of various components are:
1) Management System
2) Management API
3) Transaction Manager
4) Rollback Manager
5) Data Model Manager
6) Configuration Validator
7) Configuration Database
8) Configuration API
9) Data Provider API 1) Management System : The operator uses a management system to
send NETCONF messages to configure the IoT device and receives state information and
notificationsfrom the device as NETCONF messages.
2) Management API : allows management application to start NETCONF sessions.
3) Transaction Manager: executes all the NETCONF transactions and ensures that ACID
prop-erties hold true for the transactions.
4) Rollback Manager : is responsible for generating all the transactions necessary to rollback a
current configuration to its original state.
5) Data Model Manager : Keeps track of all the YANG data models and the corresponding
managed objects. Also keeps track of the applications which provide data for each part of a
data model.
Chapter 2. IoT network and Management 22

Fig 2.5: Management system

6) Configuration Validator: checks if the resulting configuration after applying a transaction


would be a valid configuration.
7) Configuration Database: contains both configuration and operational data.
8) Configuration API: Using the configuration API the application on the IoT device can be
read configuration data from the configuration datastore and write operational data to the
operational datastore.
9) Data Provider API: Applications on the IoT device can register for callbacks for various events
using the Data Provider API. Through the Data Provider API, the applications can report
statistics and operational data.
10) Steps for IoT device Management with NETCONF-YANG
1) Create a YANG model of the system that defines the configuration and state data of the system.
2) Complete the YANG model with the Inctool which comes with Lib Netconf.
3) Fill in the IoT device management code in the TransAPI module.
4) Build the callbacks C file to generate the library file.
5) Load the YANG module and the TransAPI module into the Neto peer server using Neto
peer manager tool.
6) The operator can now connect from the management system to the Netopeer server using
the Netopeer CLI.
7) Operator can issue NETCONF commands from the Netopeer CLI. Command can be issued
to change the configuration data, get operational data or execute an RPC on the IoTdevice.
Chapter 3. IoT ARCHITECTURE AND PYTHON 23

Chapter 3
IoT ARCHITECTURE AND PYTHON

Course Outcomes
After successful completion of this module, students should be able to:
CO 4 Select an appropriate sensor to make sensitive Understand
measurements of physical parameters.

3.1 Connecting LED and Buzzer


Chapter 3. IoT ARCHITECTURE AND PYTHON 24

3.2 Speed Control of DC Motor

#define TEMPERATURE A0

#define MOTOR 6

void setup()

Serial.begin(9600);

pinMode(MOTOR, OUTPUT);

}
Chapter 3. IoT ARCHITECTURE AND PYTHON 25

int speed_decider(int temp)

if(temp<35)

return 0;

else if(temp>40)

return 255;

else

return map(temp, 35, 40, 0, 255); }

void loop()

int temperature = analogRead(TEMPERATURE);

temperature = map(temperature, 20, 358, -40, 125);

Serial.println(speed_decider(temperature));

analogWrite(MOTOR, speed_decider(temperature));

}
3.3 Control AC power with relays:
Chapter 3. IoT ARCHITECTURE AND PYTHON 26
Chapter 3. IoT ARCHITECTURE AND PYTHON 27

3.4 Potentiometer controlling


servometer
Chapter 3. IoT ARCHITECTURE AND PYTHON 28

3.5 LEDblink and Buzzer With Ultrasonic


Chapter 3. IoT ARCHITECTURE AND PYTHON 29

3.6 LED Control with Potentiometer


Chapter 3. IoT ARCHITECTURE AND PYTHON 30

#define potPin A5
#define led1Pin 6
#define led2Pin 5
#define led3Pin 4
#define led4Pin 3

void setup()
{
pinMode (potPin, INPUT);
pinMode (led1Pin, OUTPUT);
pinMode (led2Pin, OUTPUT);
pinMode (led3Pin, OUTPUT);
pinMode (led4Pin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
int potMeasure = analogRead(A5);
Serial.println(potMeasure);
if (potMeasure < 256)
{
digitalWrite(led1Pin, HIGH);
digitalWrite(led2Pin, LOW);
digitalWrite(led3Pin, LOW);
digitalWrite(led4Pin, LOW);
}
else if (potMeasure < 512)
{
digitalWrite(led1Pin, LOW);
digitalWrite(led2Pin, HIGH);
digitalWrite(led3Pin, LOW);
digitalWrite(led4Pin, LOW);
}
else if (potMeasure < 768)
{
digitalWrite(led1Pin, LOW);
digitalWrite(led2Pin, LOW);
digitalWrite(led3Pin, HIGH);
digitalWrite(led4Pin, LOW);
}
else if(potMeasure < 1023)
{
digitalWrite(led1Pin, LOW);
digitalWrite(led2Pin, LOW);
digitalWrite(led3Pin, LOW);
digitalWrite(led4Pin, HIGH);
}
}

Sensors:
• Temperature sensing is one of the most sensitive properties or parameters for industries like
petrochemical, automotive, aerospace and defense, consumer electronics, and so on.
• These sensors are installed into devices with the purpose of measuring the temperature of a
medium accurately and efficiently in a given set of requirements.
Chapter 3. IoT ARCHITECTURE AND PYTHON 31

Resistance Temperature Detector (RTD)


• It changes the resistance of the RTD element with temperature.
• An RTD consists of a film or, for greater accuracy, a wire wrapped around a ceramic or glass
core.
• Platinum makes up the most accurate RTDs while nickel and copper make RTDs that are
lower cost;
• however, nickel and copper are not as stable or repeatable as platinum.
• Platinum RTDs offer a highly accurate linear output across -200 to 600 °C.

Thermocouples
• A thermocouple consists of two wires of different metals electrically bonded at two points.
• The varying voltage created between these two dissimilar metals reflects proportional
changes in temperature.
• Thermocouples are nonlinear and require a conversion with a table when used for
temperature control and compensation, typically accomplished using a lookup table.
• Accuracy is low, from 0.5 °C to 5 °C but thermocouples operate across the widest
temperature range, from -200 °C to 1750 °C.

Semiconductor-based temperature sensors


• They usually incorporated into integrated circuits (ICs).
• These sensors utilize two identical diodes with temperature-sensitive voltage Vs current
characteristics that are used to monitor changes in temperature.
• They offer a linear response but have the lowest accuracy of the basic sensor types.
• These temperature sensors also have the slowest responsiveness across the narrowest
temperature range (-70 °C to 150 °C).

Negative Temperature Coefficient (NTC) thermistor


• A thermistor is a thermally sensitive resistor that exhibits a continuous, small, incremental
change in resistance correlated to variations in temperature.
• It provide higher resistance at lower temperature. As temperature increases, the resistance
drops incrementally, according to its R-T table. Small changes reflect accurately due to large
changes in resistance per °C.
• The output of an NTC thermistor is non-linear due to its exponential nature; The effective
operating range is -50 to 250 °C for glass encapsulated thermistors or 150°C for standard
thermistors.

Thermistor:
The word “Thermistor” is a combination of the words “Thermal” and “resistor“.
• A thermistor is a type of resistor whose resistance changes with the change in temperature. It
is a passive component that does not require an extra power source to operate.
• They are inexpensive and accurate in measuring temperature. But they do not operate well in
extreme conditions such as very high or very low temperatures.

• Depending on the material used, the resistance may either increase or decrease.
• This change in resistance can be calibrated and measured to calculate the exact temperature
of the environment in a circuit
Chapter 3. IoT ARCHITECTURE AND PYTHON 32
Types of Thermistor
PTC (Positive Temperature Coefficient) Thermistor
NTC (Negative Temperature Coefficient) Thermistor

PTC Thermistor
• It is a type of thermistor whose resistance is directly proportional to the surrounding
temperature.
• Its resistance increases with an increase in the temperature and decreases with a decrease in
the temperature.
• It is made of polycrystalline ceramic material. Its resistance increases non-linearly in a
curve.
• The increase in resistance is very small at low temperatures which increases rapidly when
the temperature reaches above the switching point (TR).
Chapter 3. IoT ARCHITECTURE AND PYTHON 33

Advantages of PTC Thermistor


• It provides better protection against overloading
• It can efficiently and safely start an electrical motor.
• Its resistance varies linearly with temperature.
• It is compact in size.
• It is cheaper

Disadvantages of PTC Thermistor


• They are not very sensitive to as compared NTC thermistors.
• Its reading is affected by the self-heating effect.
• It has a limited temperature range as compared to the NTC thermistor

PTC Applications
Over-Current Protection: When the current exceeds a certain limit, it generates heat that can
damage the wiring as well as the components. The resistance of the PTC thermistor increases
with the temperature that can be used to prevent the current from increasing.
Inrush Current Protection: Inrush current is the starting current drawn by a motor during its
startup that is very high and it can damage its windings. A PTC thermistor heats up and its
resistance increases that limits the inrush current.

Motor Starting: Some motors include an auxiliary startup winding that is only used for
starting the motor. Initially, the PTC resistance is very low and it allows the current to pass
through this auxiliary winding. The temperature gradually increases as well as the PTC
resistance. Once the motor attains certain speed, the PTC resistance increases to a point that
blocks the current flow to the startup windings.
Time Delay: The PTC can switch from a low resistance state to a high resistance state after
some time delay. The time can depend on the change in temperature or the voltage in use. It
can be used in circuits to achieve a calculated time delay function such as in circuit breakers,
timers, relays.
Temperature Control: The PTC thermistor can control a heater to maintain a temperature
from raising a certain limit. The PTC breaks the supply when the temperature exceeds certain
limits and switches back on when the temperature falls below a certain limit.
Electrical Fuse: The resistance can also increase with an increase in its internal temperature
due to the current flowing through it. It can act as a fuse to stop the current flow in case
of over current.

NTC Thermistor
• As its name suggests, NTC or Negative temperature coefficient thermistor has a negative
coefficient k. therefore, its resistance varies inversely with the temperature. The resistance
decreases with an increase in temperature and vice versa.
• They are made of oxides of nickel, cobalt, copper, iron and titanium.
Chapter 3. IoT ARCHITECTURE AND PYTHON 34
• They usually operate at a very large range of temperature with very precise temperature
monitoring.
• They are mostly used in temperature sensing devices as opposed to PTC that are mostly used
as current limiters.

Where:
T1 is the first temperature point in Kelvin
T2 is the second temperature point in Kelvin
R1 is the thermistors resistance at temperature T1 in Ohms
R2 is the thermistors resistance at temperature T2 in Ohms
Chapter 3. IoT ARCHITECTURE AND PYTHON 35

Advantages of NTC Thermistor


• They are far more sensitive than PTC.
• It operates at a wider range of temperatures.
• It has a quicker response time with high accuracy.
• They provide a precise temperature reading.
• They are compact and take less space on a circuit board.
Disadvantages of NTC Thermistor
• The self-heating effect can cause errors in temperature measurement.
• The resistance varies non-linearly with the temperature.

NTC Applications

• Digital Thermometer: NTC resistance significantly changes with a small change in


temperature and it can sense a wide range of temperatures with high accuracy. This is why
NTC thermistor is used in a digital thermometer.
Temperature Monitoring and Control: the operation of electronic components especially
semiconductor-based components greatly depends on the ambient temperature. The NTC
thermistors are used for monitoring and maintaining temperature to ensure uninterrupted
operation of the equipment
• Fire Alarm: Fire alarms are used in every building to detect the first sign of fire and alert
the personnel inside the building as well as the concerned authorities. NTC thermistors are
used in fire alarms to sense the temperature.
• Inrush current protection: The inrush current is a very high motor starting current. The
NTC thermistor offers high initial resistance that limits the starting current. it is far more
effective than using a fixed resistor for limiting the inrush current.

Types of Thermistor based on Material


Chapter 3. IoT ARCHITECTURE AND PYTHON 36

Disc and chip: Due to its larger surface, they have a slower response time and have higher
current handling capabilities than the bead type.
Bead : They offer better stability with a quick response time. Their structure allows it to
operate at very high temperatures. To further protect it from mechanical damage, they are
encapsulated in glass.

Glass encapsulated: The thermistors are sealed in a glass body to improve their operating
temperature range. It is an air-tight glass body that improves its stability and protects it from
mechanical damage. Glass encapsulated thermistors can operate at above 150.
Cylindrical : They have a larger size as compared to other types. They are robust and reliable.

Voltage sensor
• It is used to calculate and monitor the amount of voltage in an object. Voltage sensors can
determine the AC voltage or DC voltage level.
• The input of this sensor is the voltage, whereas the output is the switches, analog voltage
signal, a current signal, or an audible signal.
Two main types of voltage sensors
• Capacitive type voltage sensor and
• Resistive type voltage sensor.

Capacitive Voltage Sensor


• A capacitor comprises of two conductors (or two plates); between these plates, a non-
conductor is kept. That non-conducting material is termed dielectric.
• When an AC voltage is provided across these plates, current will start to pass due to either
the electrons’ attraction or repulsion via the opposite plate’s voltage.
The field among the plates will create a complete AC circuit without any hardware connection
Resistive Voltage Sensor
Two ways exist to convert the resistance of the sensing element to the voltage. The first one is
Chapter 3. IoT ARCHITECTURE AND PYTHON 37
the simplest method, which is to provide a voltage to the resistor divider circuit comprised of a
sensor and a reference resistor,

Advantages of Voltage Sensors


• Small in weight and size
• Personnel safety is high
• The degree of accuracy is very high
• Non-saturable
• Wide dynamic range
• Eco-friendly

Applications
• Power failure detection
• Load sensing
• Safety switching
• Temperature control
• Power demand control
• Fault detection
ADC-Analog to Digital Converter
• An electronic integrated circuit that transforms a signal from analog(continuous) form to
digital(discrete) form is known as ADC.
• Analog signals are directly measurable quantities while digital signals only have two
states(binary 0 and binary 1).
• The heart of the data acquisition system is ADC.
• Digital systems require discrete digital data.
• Processors perform arithmetic operations on digital signals.
• Signals in digital form are less susceptible to the effects of noise.
• ADC provides a link between the analog world (of transducers) and the digital world (of data
and signal processing).
• Types of ADC
➨Counter type(simplest)
➨Successive Approximation
➨Flash ADC
➨Sigma Delta

1. Digital Voltmeter: measures the voltage in analog and converts to digital form using ADC
for digital representation form.
2. Mobile phone: Analog voice is converted to digital form for further processing(speech
compression, encoding, etc.)
3. Scanner: When we take photos, the scanner uses ADC internally to convert analog
information provided by pictures into digital information.
4. Voice Recorder: It uses ADC to convert analog voice information to digital information. The
Chapter 3. IoT ARCHITECTURE AND PYTHON 38
latest VOIP solutions utilize the same concept.

DAC-Digital to Analog Converter


To convert digital values to analog voltage DAC is used.
It performs the inverse operation of analog to digital converter.
Analog output = (Digital Input/ (2N -1) )* Reference Input
Types of
DACs:
•Weighted Resistor
• Resistive Divider

specifications are considered for the design, development, and selection of DAC(Digital to
Analog Converter).
➨Resolution
➨Reference voltages
➨SettlingTime
➨Linearity
➨Speed
➨Errors
Modems need DAC to convert data to analog form to carry it over telephone wires.
• Video adapters also need DACs known as RAMDACs to convert the digital form of data to
analog form.
• Digital Motor Control
• Printers
• Sound Equipment
• Function Generators or Oscilloscopes
• Digital Audio

DHT11 Sensor
• HT11 is a low-cost digital sensor for sensing temperature and humidity values serially with
the one-wire protocol.
• This sensor can be easily interfaced with any microcontroller such as Arduino, Raspberry Pi,
etc.
• It is available as a sensor and as a module.
• The difference between this sensor and the module is the pull-up resistor and a power-on
LED.
• It provides relative humidity values in percentage (20 to 90% RH) and temperature values in
degrees Celsius (0 to 50 °C).
• It uses a resistive humidity measurement component and NTC temperature measurement
component.
• Working Principle of DHT11 Sensor
• DHT11 sensor consists of a capacitive humidity sensing element and a thermistor for sensing
temperature.
• The humidity sensing capacitor has two electrodes with a moisture-holding substrate as a
dielectric between them. Change in the capacitance value occurs with the change in humidity
Chapter 3. IoT ARCHITECTURE AND PYTHON 39
levels. The IC measure processes these changed resistance values and changes them into digital
form.
• For measuring temperature this sensor uses a Negative Temperature coefficient thermistor,
which causes a decrease in its resistance value with an increase in temperature To get a larger
resistance value even for the smallest change in temperature, this sensor is usually made up of
semiconductor ceramics or polymers.
• The sampling rate of this sensor is 1Hz .
• DHT11 is small in size with operating voltage from 3 to 5 volts.
• The maximum current used while measuring is 2.5 mA.
• A pull-up resistor of 5k to 10k ohms is provided for communication between the sensor and
microcontroller.

Applications
• Measuring humidity and temperature values in heating, ventilation, and air conditioning
systems. Weather stations also use these sensors to predict weather conditions.
• Homes, offices, cars, museums, greenhouses, and industries use this sensor for measuring
humidity values and as a safety measure

#include"DHT.h" DHT dht;


Chapter 3. IoT ARCHITECTURE AND PYTHON 40
Void setup()
{ Serial.begin(9600);
Serial.println();
Serial.println("Status\tHumidity (%)\tTemperature (C)\t(F)");
dht.setup(2); /* set pin for data communication */ }
voidloop()
{ delay(dht.getMinimumSamplingPeriod()); /* Delay of amount equal to sampling period
*/
float humidity = dht.getHumidity(); /* Get humidity value */
float temperature = dht.getTemperature(); /* Get temperature value */
Serial.print(dht.getStatusString()); /* Print status of communication */ Serial.print("\t");
Serial.print(humidity, 1); Serial.print("\t\t"); Serial.print(temperature, 1); Serial.print("\t\t");
Serial.println(dht.toFahrenheit(temperature), 1); /* Convert temperature to Fahrenheit units*/
}

Motion Sensor

• A motion sensor is an electronic device that designed to detect and measure movement.
• It is incorporated as a component of a system that routinely performs a task or else alerts a
user of motion in a region.
• These sensors form a very important component of security, home control, energy
efficiency, automated lighting control, and other helpful systems.
• There are two types of motion sensors:
1. Active motion sensors
2. Passive motion sensors.
• Active sensors have both a transmitter and a receiver. This type of sensor detects motion by
measuring changes in the amount of sound or radiation reflecting back into the receiver.
• When an object interrupts or alters the sensor’s field, an electric pulse is sent to the
embedded computer, which in turn interacts with the mechanical component.

• A passive motion sensor does not have a transmitter.


• Instead of measuring a constant reflection, the sensor detects motion based on a perceived
increase of radiation in its environment.

• The most widely used type of passive motion sensor in home security systems is the passive
infrared sensor
• The PIR sensor is designed to detect the infrared radiation emitted naturally from the human
body.
• The receiver is contained in a filter that only allows infrared to pass through it.
• When a person walks into the PIR sensor’s field of detection, the difference in radiation
creates a positive charge within the receiver;
• this perceived change causes the sensing unit to send electrical data to the embedded
computer and hardware component.
• Types of Motion Sensors
• All warm-blooded animals produce IR radiation. Passive infrared sensors include a thin
Chapter 3. IoT ARCHITECTURE AND PYTHON 41
Pyroelectric film material, that responds to IR radiation by emitting electricity.
• This sensor will activate a burglar alarm whenever this influx of electricity takes
place. These sensors are economical, don’t use more energy, and last forever. These sensors are
commonly used in indoor alarms.

Ultrasonic Sensor

• It can be active (or) passive, where passive ones pay attention to particular sounds like metal
on metal, or glass breaking.
• These sensors are very sensitive, but they are frequently expensive and prone to fake alarms.
Active ones generate ultrasonic wave (sound wave) pulses and then determine the reflection of
these waves off a moving object.
• Animals like cats, dogs, and fishes can hear these sound waves, so an active ultrasonic alarm
might unsettle them.

Microwave Sensor

• These sensors generate microwave pulses and then calculate their reflection off of objects, in
order to know whether objects are moving or not.
• They are very sensitive, but sometimes these can be seen in nonmetallic objects which can
be detected moving objects on the outside of the target range.
• It consumes a lot of power, so these sensors are frequently designed to cycle ON & OFF.
Electronic guard dogs utilize microwave sensors.
Chapter 3. IoT ARCHITECTURE AND PYTHON 42

Tomographic Sensor
• These sensors generate radio waves and detect when those waves are troubled.
• They can notice through walls and objects and are frequently placed in a way that makes a
radio wave net that covers up large areas.
• These sensors are expensive, so they are normally used in warehouses, storage units, and
also in other situations that need a commercial level of security.
• Some types of motion detectors mix some sensors in order to decrease fake alarms. But,
dual sensors are only activated when both kinds sense motion.
• For instance, a dual microwave or PIR sensor will start out on the passive infrared sensor
setting, because that consumes less energy.
• When the passive infrared sensor is tripped, the microwave division will turn ON; then, if
the remaining sensor is also tripped, the alarm will generate a sound. This combined type is
great for neglecting fake alarms but tuns the possibility of missing real ones.

#include<SoftwareSerial.h>
/* Create object named bt of the class SoftwareSerial */
SoftwareSerial bt(2,3); /* (Rx,Tx) */
voidsetup(){
bt.begin(9600); /* Define baud rate for software serial communication */
Serial.begin(9600); /* Define baud rate for serial communication */
}
voidloop()
{
if (bt.available()) /* If data is available on serial port */ { Serial.write(bt.read()); /* Print
character received on to the serial monitor */ }
} The output is data that is received on the software serial port, and printed on the serial
monitor.
Chapter 3. IoT ARCHITECTURE AND PYTHON 43
Chapter 4
IoT PHYSICAL DEVICES ANDENDPOINTS
Course Outcomes
After successful completion of this module, students should be able to:
CO 5 Choose raspberry Pi device and set up the Apply
environment for connecting other devices/sensors to
communicate with raspberry pi using Python language

IoT Device

A ”Thing” in Internet of Things (IoT) can be any object that has a unique identifier and which
can send/receive data (including user data) over a network (e.g., smart phone, smartTV,
computer,refrigerator, car, etc.).
• IoT devices are connected to the Internet and send information about themselves or about
theirsurroundings (e.g. information sensed by the connected sensors) over a network (to other
de- vices or servers/storage) or allow actuation upon the physical entities/environment around
them remotely.

IoT Device Examples

• A home automation device that allows remotely monitoring the status of appliances and
control-ling the appliances.
• An industrial machine which sends information abouts its operation and health monitoring
datato a server.

44
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53

• A car which sends information about its location to a cloud-based service.


• A wireless-enabled wearable device that measures data about a person such as the number of
steps walked and sends the data to a cloud-basedservice.

Basic building blocks of an IoT Device

1. Sensing: Sensors can be either on-board the IoT device or attached to thedevice.
2. Actuation: IoT devices can have various types of actuators attached that allow taking
actionsupon the physical entities in the vicinity of thedevice.
3. Communication: Communication modules are responsible for sending collected data to
other devices or cloud-based servers/storage and receiving data from other devices and
commands fromremote applications.
4. Analysis and Processing: Analysis and processing modules are responsible for making
senseof the collected data.

FIGURE 4.1: Block diagram of an IoT Device

Block diagram of an IoT Device

Exemplary Device: Raspberry Pi Raspberry Pi is a low-cost mini-computer with the physical


size of a credit card. Raspberry Pi runs various flavors of Linux and can perform almost all
tasks that a normal desktop computer can do. Raspberry Pi also allows interfacing sensors and
actuatorsthrough the general purpose I/O pins. Since Raspberry Pi runs Linux operating system,
it supports Python ”out of the box”. Raspberry Pi is a low-cost mini-computer with the
physical size of a
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53

credit card. Raspberry Pi runs various flavors of Linux and can perform almost all tasks that a
nor- mal desktop computer can do. Raspberry Pi also allows interfacing sensors and actuators
through the general purpose I/O pins. Since Raspberry Pi runs Linux operating system, it
supports Python”out of the box”. Raspberry Pi Linux on Raspberry Pi

FIGURE 4.2: Raspberry Pi

1. Raspbian: Raspbian Linux is a Debian Wheezy port optimized for Raspberry Pi.
2. Arch: Arch is an Arch Linux port for AMD devices.
3. Pidora: Pidora Linux is a Fedora Linux optimized for Raspberry Pi.
4. RaspBMC: RaspBMC is an XBMC media-center distribution for Raspberry Pi.
5. OpenELEC: OpenELEC is a fast and user-friendly XBMC media-center distribution.
6. RISC OS: RISC OS is a very fast and compact operating system.

Raspberry Pi GPIO

FIGURE 4.3: Raspberry Pi GPIO

Raspberry Pi
Interfaces
1. Serial: The serial interface on Raspberry Pi has receive (Rx) and transmit (Tx) pins for
com-munication with serial peripherals.
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53

2. SPI: Serial Peripheral Interface (SPI) is a synchronous serial data protocol used for
communi-cating with one or more peripheral devices.
3. I2C: The I2C interface pins on Raspberry Pi allow you to connect hardware modules. I2C
in-terface allows synchronous data transfer with just two pins - SDA (data line) and SCL
(clockline).
Raspberry Pi Example: Interfacing LED and switch with Raspberry Pi
from time import sleep

import RPi.GPIO asGPIO GPIO.setmode(GPIO.BCM)


# Switch Pin GPIO.setup(25,GPIO.IN)# LEDPin
GPIO.setup(18,GPIO.OUT)
state=false
deftoggle LED (pin): state = not state GPIO.output(pin,state) whileTrue:try:
if (GPIO.input(25) == True):except Keyboard Interrupt: exit()

Other Devices
1. pcDuino
2. BeagleBoneBlack
3. Cubieboard
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53

Introduction to Raspberry Pi interfaces (Serial, SPI, I2C),

Serial Peripheral Interface Protocol

SPI is one of the most popular serial communication protocols. SPI – Serial Peripheral
Interface is an interface bus commonly used to transmit and receive the data between
microcontrollers andsmall peripherals such as shift registers, sensors, displays, flash memory,
etc. Since it is syn- chronous communication, it uses a separate clock line and data lines. The
interface was developedby Motorola in the mid-1980s.
An SPI – Serial Peripheral Interface protocol system consists of one master device and one
or more slave devices. But in I2C, we can have one or more master devices and one or more
slave devices. The master is providing the SPI clock and the slave is receiving the SPI clock
from the master.
SPI needs 4 wires at least. But some of the recent day devices support 3 pin mode and 4 pin
modesalso.
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53

1. MOSI – Master Out Slave In

2. MISO – Master In Slave Out

3. SCLK – Serial Clock

4. SS/CS/CE – Salve Select/Chip Select/Chip Enable

MOSI – Master Out Slave In is used to send the data from the master to the slave device.
MISO – Master In Slave Out is used to receive the data from the slave to the master device.
SCLK – Serial Clock is the clock that is generated by the master device.
SS/CS/CE – Salve Select/Chip Select/Chip Enable line is used to select the slave device in the
SPIbus interface.
SPI protocol is a Full-duplex as this protocol has separate pins for incoming data and
outgoingdata. So, we can transmit and receive the data at the same time.

4.5.1.1SPI Modes

The SPI interface defines no protocol for data exchange, limiting overhead and allowing for
high- speed data streaming. We saw how the data is being transferred to the slave from the
master. As we have an understanding of data communication, let’s go a little bit deeper. In
addition to settingthe clock frequency, the master must also configure the clock polarity and
phase with respect to the data. Clock polarity (CPOL) and clock phase (CPHA) are the two
parameters that are used to form four unique modes to provide flexibility in communication
between master and slave.
Everything is going well in SPI. But, why did they create these modes? If you see in I2C, whenever
the clock (SCL) is going low, that time data will be changed, and when the clock (SCL) is
high, that time data will be sampled. Right? Not understood? Okay, refer to the below image.
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53

I2C-Inter-Integrated Circuit

It is a synchronous, multi controller or multi target (controlle or target), packet switched, single
ended, serial communication bus invented in 1982 by Philips Semiconductors. It is widely used
for attaching lower speed peripheral ICs to processors and microcontrollers in short distance,
intraboard communication.
Several competitors, such as Siemens, NEC, Texas Instruments, STMicroelectronics,
Motorola, Nordic Semiconductor and Intersil, have introduced compatible I2C products to the
market sincethe mid-1990s.
System Management Bus (SMBus), defined by Intel in 1995, is a subset of I2C, defining a
stricterusage. One purpose of SMBus is to promote robustness and interoperability. Accordingly,
modern I2C systems incorporate some policies and rules from SMBus, sometimes supporting
both I2C and SMBus, requiring only minimal reconfiguration either by commanding or output
pin use.

4.5.2.1Applications

I2C is appropriate for peripherals where simplicity and low manufacturing cost are more important
than speed. Common applications of the I2C bus are:
Describing connectable devices via small ROM configuration tables to enable plug and play
op- eration, such as in serial presence detect (SPD) EEPROMs on dual in-line memory
modules (DIMMs), and Extended Display Identification Data (EDID) for monitors via VGA,
DVI and HDMI connectors.
System management for PC systems via SMBus; SMBus pins are allocated in both
conventionalPCI and PCI Express connectors.
Accessing real-time clocks and NVRAM chips that keep user settings.Accessing low-speed
DACs and ADCs.
Changing backlight, contrast, hue, color balance settings etc in monitors (via Display Data
Chan-nel).
Changing sound volume in intelligent speakers.
Controlling small (e.g. feature phone) LCD or OLED displays. Reading hardware monitors and
diagnostic sensors, e.g. a fan’s speed.Turning on and off the power supply of system
components.
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53

Introduction of IoT Devices

Approximately there are around 7.62 billion humans on our planet, but to your surprise, by the year
2022 with an increasing graph of IoT devices, there may be around 20 billion IoT smart
devices up and running with an increase in the demand of 5g network. If an average is made
then after

some years each and every individual in America would be having more than 10 IoT devices of
their own. Please refer this post to more about this statistical data.
Nowadays, the production and usage of the Internet of Things devices are increasing very
rapidly. IoT products and devices basically include laptops, smartphones, smart gadgets, smart
watches, smart and digitalized vehicles and almost all of these are used majorly today.

List of Top 18 IoT Devices Examples

1) Google Home Voice Controller


2) Amazon Echo Plus Voice Controller
3) Amazon Dash Button
4) August Doorbell Cam
5) August Smart Lock
6) Kuri Mobile Robot
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53

7) Belkin WeMo Smart Light Switch


8) Footbot Air Quality Monitor
9) Flow by Plume Labs Air Pollution Monitor
10) Nest Smoke Alarm

IoT Life Cycle

IoT has a very simple lifecycle of development.


Deployment followed by monitoring, servicing, managing, which is followed by regular
updatesand decommissioning at the end. IoT Product Lifecycle is described in the below
diagram.
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53

Advantages of IoT Devices

1. IoT encourages the interaction between devices called as a machine to machine interaction.
2. It provides good automation and control.
3. Integrated with more technical information, so it is better to operate.
4. IoT possesses strong monitoring feature.
5. It saves a lot of time.
6. IoT helps to save more money by reducing manual task and time.
7. Automating daily life tasks makes good monitoring of devices.
8. Increased efficiency and time-saving.
9. With good features make a better quality of life.

Disadvantages

1. Internet of Things devices does not have any international compatibility standard.
2. They may become highly complex resulting in failure.
3. Internet of Things devices may get affected by privacy and security breach.
4. Reduced safety for users.
5. Reduction in the employment of manual tasks thus resulting in job reductions.
6. Internet of Things device may take control of life in due course of time with increasing
AItechnology
Chapter 5
IoT PHYSICAL SERVERS ANDCLOUD OFFERINGS

Course Outcomes
After successful completion of this module, students should be able to:
CO 6 Analyze different cloud storage models and Analyze
protocols that are scalable & available on demand
for designing IoT applications

Introduction to Cloud Storage Models and Communication APIs

Introduction to Cloud Computing

The Internet of Things (IoT) involves the internet-connected devices we use to perform the
pro- cesses and services that support our way of life. Another component set to help IoT
succeed is cloud computing, which acts as a sort of front end. Cloud computing is an
increasingly popular service that offers several advantages to IOT, and is based on the concept
of allowing users to perform normal computing tasks using services delivered entirely over the
internet. A worker mayneed to finish a major project that must be submitted to a manager, but
perhaps they encounter problems with memory or space constraints on their computing device.
Memory and space con- straints can be minimized if an application is instead hosted on the
internet. The worker can usea cloud computing service to finish their work because the data is
managed remotely by a server.Another example: you have a problem with your mobile device
and you need to reformat it or reinstall the operating system. You can use Google Photos to upload
your photos to internet-based storage. After the reformat or reinstall, you can then either move
the photos back to you device oryou can view the photos on your device from the internet when
you want.

54
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 54

FIGURE 5.1: Cloud Computing

Concept

In truth, cloud computing and IoT are tightly coupled. The growth of IoT and the rapid
develop- ment of associated technologiescreate a widespread connection of —things.||This has
lead to the production of large amounts of data, which needs to be stored, processed and
accessed. Cloud computing as a paradigm for big data storage and analytics. While IoT is
exciting on its own, thereal innovation will come from combining it with cloud computing. The
combination of cloud computing and IoT will enable new monitoring services and powerful
processing of sensory datastreams. For example, sensory data can be uploaded and stored with
cloud computing, later to be used intelligently for smart monitoring and actuation with other
smart devices. Ultimately, the goal is to be able to transform data to insight and drive
productive, cost-effective action fromthose insights. The cloud effectively serves as the brain
to improved decision-making and opti- mized internet-based interactions. However, when IoT
meets cloud, new challenges arise. There is an urgent need for novel network architectures that
seamlessly integrate them. The critical con-cerns during integration are quality of service (QoS)
and quality of experience (QoE), as well as data security, privacy and reliability. The virtual
infrastructure for practical mobile computing and interfacing includes integrating applications,
storage devices, monitoring devices, visualiza-tion platforms, analytics tools and client delivery.
Cloud computing offers a practical utility-based
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 55

model that will enable businesses and users to access applications on demand anytime and
fromany where.

Characteristics

1. First, the cloud computing of IoT is an on-demand self service, meaning its there when you
need it. Cloud computing is a web-based service that can be accessed without any special
assistance or permission from other people; however, you need at minimum some sort of
internet access.

2. Second, the cloud computing of IoT involves broad network access, meaning it offers several
connectivity options. Cloud computing resources can be accessed through a wide variety of
internet-connected devices such as tablets, mobile devices and laptops. This level of
convenience means users can access those resources in a wide variety of manners, even from
older devices. Again, though, this emphasizes the need for network access points.

3. Third, cloud computing allows for resource pooling, meaning information can be shared
with those who know where and how (have permission) to access the resource, anytime and
anywhere. This lends to broader collaboration or closer connections with other users. Froman
IoT perspective, just as we can easily assign an IP address to every ”thing” on theplanet,we can
share the ”address” of the cloud-based protected and stored information with others and pool
resources.

4. Fourth, cloud computing features rapid elasticity, meaning users can readily scale the service to
their needs. You can easily and quickly edit your software setup, add or remove users, increase
storage space, etc. This characteristic will further empower IoT by providing elastic computing
power, storage and networking.

5. Finally, the cloud computing of IoT is a measured service, meaning you get what you pay
for. Providers can easily measure usage statistics such as storage, processing, bandwidth and active
user accounts inside your cloud instance. This pay per use (PPU) model means yourcosts scale
with your usage. In IoT terms, it’s comparable to the ever-growing network of physical objects
that feature an IP address for internet connectivity, and the communicationthat occurs between
these objects and other internet-enabled devices and systems; just likeyour cloud service, the
service rates for that IoT infrastructure may also scale with use.

Service and DeploymentService models


Service delivery in cloud computing comprises three different service models:software as a
service (SaaS),
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 56

platform as a service (PaaS), infrastructure as a service (IaaS)


Software as a service (SaaS) provides applications to the clouds end user that are mainly accessed
via a web portal or service-oriented architecture-based web service technology. These services
can be seen as ASP (application service provider) on the application layer. Usually, a specific
company that uses the service would run, maintain and give support so that it can be reliably
used over a long period of time.
Platform as a service (PaaS) consists of the actual environment for developing and
provisioningcloud applications. The main users of this layer are developers that want to develop
and run a cloud application for a particular purpose. A proprietary language was supported and
provided by the platform (a set of important basic services) to ease communication,
monitoring, billing and other aspects such as startup as well as to ensure an applications
scalability and flexibility. Limitations regarding the programming languages supported, the
programming model, the ability to access resources, and the long-term persistence are possible
disadvantages.
Infrastructure as a service (IaaS) provides the necessary hardware and software upon
whicha customer can build a customized computing environment. Computing resources, data
storage resources and the communications channel are linked together with these essential IT
resources toensure the stability of applications being used on the cloud. Those stack models can
be referred toas the medium for IoT, being used and conveyed by the users in different methods
for the greatest chance of interoperability. This includes connecting cars, wearables, TVs,
smartphones, fitness equipment, robots, ATMs, and vending machines as well as the vertical
applications, security andprofessional services, and analytics platforms that come with them.

Deployment models

Deployment in cloud computing comprises four deployment models:private cloud,


public cloud, community cloud,hybrid cloud.
A private cloud has infrastructure thats provisioned for exclusive use by a single organization
comprising multiple consumers such as business units. It may be owned, managed and
operated by the organization, a third party or some combination of them, and it may exist on or
off premises. A public cloud is created for open use by the general public. Public cloud sells
services to anyoneon the internet. (Amazon Web Services is an example of a large public cloud
provider.) This model is suitable for business requirements that require management of load
spikes and the applicationsused by the business, activities that would otherwise require greater
investment in infrastructure for the business. As such, public cloud also helps reduce capital
expenditure and bring down op-erational IT costs.
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 57

A community cloud is managed and used by a particular group or organizations that have
sharedinterests, such as specific security requirements or a common mission.
Finally, A hybrid cloud combines two or more distinct private, community or public cloud in-
frastructures such that they remain unique entities but are bound together by standardized or
pro- prietary technology that enables data and application portability. Normally, information
thats not critical is outsourced to the public cloud, while business-critical services and data are
kept withinthe control of the organization.

Cloud storage API

A cloud storage API is an application program interface that connects a locally-based


applicationto a cloud-based storage system, so that a user can send data to it and access and
work with data stored in it. To the application, the cloud storage system is just another target
device, like tape or disk-based storage. An application program interface (API) is code that
allows two software programs to communicate with each other. The API defines the correct
way for a developer to write a program that requests services from an operating system (OS) or
other application. APIs are implemented by function calls composed of verbs and nouns. The
required syntax is describedin the documentation of the application being called.

How APIs work APIs are made up of two related elements. The first is a specification that
describes how information is exchanged between programs, done in the form of a request for
processing and a return of the necessary data. The second is a software interface written to that
specification and published in some way for use. The software that wants to access the features
and capabilities of the API is said to call it, and the software that creates the API is said to
publishit.

Why APIs are important for business The web, software designed exchange information via
the internet and cloud computing have all combined to increase the interest in APIs in general
and services in particular. Software that was once custom-developed for a specific purpose is
nowoften written referencing APIs that provide broadly useful features, reducing development
time and cost and mitigating the risk of errors.APIs have steadily improved software quality
over the last decade, and the growing number of web services exposed through APIs by cloud
providers is also encouraging the creation of cloud-specific applications, internet of things (IoT)
efforts andapps to support mobile devices and users.
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 58
Three basic types of APIs
APIs take three basic forms: local, web-like and program-like.

1. Local APIs are the original form, from which the name came. They offer OS or
middleware services to application programs. Microsoft’s .NET APIs, the TAPI (Telephony
API) for voice applications, and database access APIs are examples of the local APIform.

2. Web APIs are designed to represent widely used resources like HTML pages and
are ac- cessed using a simple HTTP protocol. Any web URL activates a web API. Web APIs
are often called REST (representational state transfer) or RESTful because the publisher of
REST inter- faces doesn’t save any data internally between requests. As such, requests from
many users can beintermingled as they would be on the internet.

3. Program APIs are based on remote procedure call (RPC) technology that makes a
remote program component appear to be local to the rest of the software. Service oriented
architecture (SOA) APIs, such as Microsoft’s WS-series of APIs, are program APIs.

IoT / Cloud Convergence

Internet-of-Things can benefit from the scalability, performance and pay-as-you-go nature of cloud
computing infrastructures. Indeed, as IoT applications produce large volumes of data and comprise
multiple computational components (e.g., data processing and analytics algorithms), their
integra- tion with cloud computing infrastructures could provide them with opportunities for
cost-effectiveon-demand scaling.

As prominent examples consider the following settings:

A Small Medium Enterprise (SME) developing an energy management IoT product, targeting
smart homes and smart buildings. By streaming the data of the product (e.g., sensors and WSN
data) into the cloud it can accommodate its growth needs in a scalable and cost effective
fashion.As the SMEs acquires more customers and performs more deployments of its product,
it is able to collect and manage growing volumes of data in a scalable way, thus taking
advantage of a pay-as-you-grow model. Moreover,cloud integration allows the SME to store and
process massivedatasets collected from multiple (rather than a single)deployments.

A smart city can benefit from the cloud-based deployment of its IoT systems and applications.
A city is likely to deploy many IoT applications, such as applications for smart energy
management, smart water management, smart transport management, urban mobility of the
citizens and more. These applications comprise multiple sensors and devices, along with
computational components. Furthermore, they are likely to produce very large data volumes.
Cloud integration enables the city to host these data and applications in a cost-effective way.
Furthermore, the elasticity of the cloud can directly support expansions to these applications,
but also the rapid deployment of newones without major concerns about the provisioning of the
required cloud computing resources.
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 59

A cloud computing provider offering pubic cloud services can extend them to the IoT area, through
enabling third-parties to access its infrastructure in order to integrate IoT data and/or computational
components operating over IoT devices. The provider can offer IoT data access and services
ina pay-as-you-fashion, through enabling third-parties to access resources of its infrastructure
and accordingly to charge them in a utility-based fashion.

These motivating examples illustrate the merit and need for converging IoT and cloud
computinginfrastructure. Despite these merits, this convergence has always been challenging
mainly due to the conflicting properties of IoT and cloud infrastructures, in particular, IoT
devices tend to be location specific, resource constrained, expensive (in terms of development/
deployment cost)and generally inflexible (in terms of resource access and availability). On the
other hand, cloud computing resources are typically location independent and inexpensive,
while at the same time providing rapid and flexibly elasticity. In order to alleviate these
incompatibilities, sensors and de-vices are virtualized prior to integrating their data and services
in the cloud, in order to enable theirdistribution across any cloud resources. Furthermore, service
and sensor discovery functionalities are implementing on the cloud in order to enable the
discovery of services and sensors that residein different locations.

Based on these principles the IoT/cloud convergence efforts have started since over a decade
i.e. since they very early days of IoT and cloud computing. Early efforts in the research
community (i.e. during 2005-2009) have focused on streaming sensor and WSN data in a cloud
infrastructure. Since 2007 we have also witnessed the emergence of public IoT clouds,
including commercial efforts. One of the earliest efforts has been the famous Pachube.com
infrastructure (used ex- tensively for radiation detection and production of radiation maps
during earthquakes in Japan). Pachube.com has evolved (following several evolutions and
acquisitions of this infrastructure) toXively.com, which is nowadays one of the most prominent
public IoT clouds. Nevertheless, there are tens of other public IoT clouds as well, such as
ThingsWorx, ThingsSpeak, Sensor-Cloud, Realtime.io and more. The list is certainly non-
exhaustive. These public IoT clouds offer com- mercial pay-as-you-go access to end-users
wishing to deploying IoT applications on the cloud. Most of them come with developer
friendly tools, which enable the development of cloud appli- cations, thus acting like a PaaS for
IoT in the cloud. Similarly to cloud computing infrastructures, IoT/cloud infrastructures and
related services can be classified to the following models:

1. Infrastructure-as-a-Service (IaaS) IoT/Clouds: These services provide the means for ac-
cessing sensors and actuator in the cloud. The associated business model involves the
IoT/Cloudprovide to act either as data or sensor provider. IaaS services for IoT provide access
control to resources as a prerequisite for the offering of related pay-as-you-go services.

2. Platform-as-a-Service (PaaS) IoT/Clouds: This is the most widespread model for


IoT/cloud services, given that it is the model provided by all public IoT/cloud infrastructures
outlined above. As already illustrate most public IoT clouds come with a range of tools and
related environmentsfor applications development and deployment in a cloud environment. A
main characteristic of
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 60

PaaS IoT services is that they provide access to data, not to hardware. This is a clear
differentiatorcomparing to IaaS.

3. Software-as-a-Service (SaaS) IoT/Clouds: SaaS IoT services are the ones enabling their
usesto access complete IoT-based software applications through the cloud, on-demand and in a
pay- as-you-go fashion. As soon as sensors and IoT devices are not visible, SaaS IoT
applications resemble very much conventional cloud-based SaaS applications. There are
however cases wherethe IoT dimension is strong and evident, such as applications involving
selection of sensors and combination of data from the selected sensors in an integrated
applications. Several of these ap- plications are commonly called Sensing-as-a- Service, given
that they provide on-demand access to the services of multiple sensors. Note that SaaS IoT
applications are typically built over a PaaS infrastructure and enable utility based business
models involving IoT software and services.

These definitions and examples provide an overview of IoT and cloud convergence and why it
is important and useful. More and more IoT applications are nowadays integrated with the
cloud in order to benefit from its performance, business agility and pay-as-you-go
characteristics. In following chapters of the tutorial, we will present how to maximize the
benefits of the cloud for IoT, through ensuring semantic interoperability of IoT data and services in
the cloud, thus enabling advanced data analytics applications, but also integration of a wide
range of vertical (silo) IoT applications that are nowadays available in areas such as smart
energy, smart transport and smart cities. We will also illustrate the benefits of IoT/cloud
integration for specific areas and segmentsof IoT, such as IoT-based wearable computing.

WAMP -AutoBahn for IoT

FIGURE 5.2: WAMP for IoT

WAMP for IoT

Web Application Messaging Protocol (WAMP) is a sub-protocol of Websocket which


providespublish-subscribe and remote procedure call (RPC) messaging patterns.

WAMP
1. Transport: Transport is channel that connects two peers.
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 61

2. Session: Session is a conversation between two peers that runs over a transport.
3. Client: Clients are peers that can have one or more roles. In publish-subscribe model client
canhave following roles:
a) Publisher: Publisher publishes events (including payload) to the topic maintained by the broker.
b) Subscriber: Subscriber subscribes to the topics and receives the events including the payload.

In RPC model client can have following roles: –


1. Caller: Caller issues calls to the remote procedures along with call arguments. – Caller:
Callerexecutes the procedures to which the calls are issued by the caller and returns the results
back to the caller.
• Router: Routers are peers that perform generic call and event routing.
In publish-subscribe model Router has the role of a Broker: – Broker: Broker acts as a router
androutes messages published to a topic to all subscribers subscribed to thetopic.

In RPC model Router has the role of a Broker: –

1. Dealer: Dealer acts a router and routes RPC calls from the Caller to the Callee and
routes re-sults from Callee toCaller. 2. Application Code: Application code runs on the Clients
(Publisher,Subscriber, Callee or Caller).

Amazon EC2 – Python Example Boto is a Python package that provides interfaces to
AmazonWeb Services (AWS). In this example, a connection to EC2 service is fi rst established
by callingboto.ec2.connect to region. The EC2 region, AWS access key and AWS secret key
are passed to this function. After connecting to EC2 , a new instance is launched using the
conn.run instances function. The AMI- ID, instance type, EC2 key handle and security group
are passed to this function.

WAMP -AutoBahn for IoT


Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 62

Amazon Auto Scaling – Python Example 1. AutoScaling Service: A connection to


AutoScal- ing service is first established by calling boto.ec2.autoscale.connect to
regionfunction.
2. Launch Configuration: After connecting to AutoScaling service, a new launch
configuration is created by calling conn.create launch configuration. Launch configuration
contains instructions on how to launch new instances including the AMI- ID, instance type,
security groups,etc.
3. AutoScaling Group : After creating a launch configuration, it is then associated with a new Au-
toScaling group. AutoScaling group is created by calling conn.create auto scaling group. The set-
tings for AutoScaling group such as the maximum and minimum number of instances in the
group, the launch configuration, availability zones, optional load balancer to use with the
group,etc.
Amazon AutoScaling – Python Example # Creating auto-scaling policies scale up policy

= ScalingPolicy(name=’scale up’, adjustment type=’Change In Capacity’, as name=’My-


Group’,scaling adjustment=1, cooldown=180)
scale down policy =ScalingPolicy(name=’scale down’, adjustment type=’Change In
Capacity’,as name=’My-Group’, scaling adjustment=-1, cool down=180)
conn.create scaling policy(scale up policy) conn.create scaling policy(scale down policy)

AutoScaling Policies: 1. After creating an AutoScaling group, the policies for scaling up and
scaling down are defined. 2. In this example, a scale up policy with adjustment type ChangeIn-
Capacity and scaling ad justment = 1 isdefined. 3. Similarly a scale down policy with
adjustmenttype ChangeInCapacity and scaling ad justment = -1 isdefined.

Cloud Watch Alarms Connecting to CloudWatch

cloudwatch = boto.ec2.cloudwatch.connect to region(REGION,aws access key id=ACCESS

KEY,

aws secret access key=SECRET KEY) alarm dimensions = ”Auto Scaling Group Name”:
’My-Group’ # Creating scale-up alarm scale up alarm = Metric Alarm( name=’scale up on
cpu’, name
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 63

space=’AWS/EC2’, metric=’CPU Utilization’, statistic=’Average’, comparison=’>’,


threshold=’70’,period=’60’, evaluation periods=2, alarm actions=[scale up policy.policy arn],
dimensions = alarm dimensions)
cloud watch.create alarm (scale up alarm)
#Creating scale-down alarm scale down alarm = Metric Alarm(name=’scale down on cpu’,
name space=’AWS/EC2’,
metric=’CPU Utilization’, statistic=’Average’, comparison=’<’,threshold=’40’, period=’60’,
eval-
uation periods=2,
alarm actions=[scale down policy.policy arn],
dimensions=alarm dimensions) cloudwatch.create alarm(scale down alarm)
1. With the scaling policies defined, the next step is to create Amazon Cloud Watch alarms that
trigger thesepolicies.
2. The scale up alarm is defined using the CPUUtilization metric with the Average statistic and
threshold greater 70% for a period of 60 sec. The scale up policy created previously is
associated with this alarm. This alarm is triggered when the average CPU utilization of the
instances in the group becomes greater than 70% for more than 60seconds.
3. The scale down alarm is defined in a similar manner with a threshold less than50%.

Python for MapReduce #Inverted Index Mapper in Python

#!/usr/bin/env python import sys for line in sys.stdin: doc id, content = line.split() words = con-
tent.split() for word in words: print %s%s % (word, doc id) The example shows inverted index
mapper program. The map function reads the data from the standard input (stdin) and splits the
tab-limited data into document- ID and contents of the document. The map function emits key-
value pairs where key is each word in the document and value is the document-ID.

Python for Map Reduce

#Inverted Index Reducer in Python

#!/usr/bin/env python import sys current word = None current docids = [] word = None for line
insys.stdin: # remove leading and trailing whitespace line = line.strip()
# parse the input we got from mapper.py word, doc id = line.split()if current word== word:
current docids.append(doc id)
else: if current word: print %s %s %s (current word, current docids) current docids = [] current
docids.append(doc id) current word = word
The example shows inverted index reducer program. The key-value pairs emitted by the map phase
are shuffled to the reducers and grouped by the key. The reducer reads the key-value pairs
groupedby the same key from the standard input (stdin) and creates a list of document-IDs in
which the word occurs. The output of reducer contains key value pairs where key is a unique
word and valueis the list of document-IDs in which the word occurs.
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 64

Python Packages of Interest


1. JSON: JavaScript Object Notation (JSON) is an easy to read and write data- interchange format.
JSON is used as an alternative to XML and is is easy for machines to parse and generate. JSON
is built on two structures - a collection of name-value pairs (e.g. a Python dictionary) and
orderedlists of values (e.g.. a Python list).
2. XML: XML (Extensible Markup Language) is a data format for structured document inter-
change. The Python minion library provides a minimal implementation of the Document
Object Model interface and has an API similar to that in other languages.
3. HTTPLib and URLLib: HTTPLib2 and URLLib2 are Python libraries used in
network/internetprogramming
4. SMTPLib: Simple Mail Transfer Protocol (SMTP) is a protocol which handles sending
emailand routing e-mail between mail servers. The Python smtplib module provides an SMTP
client session object that can be used to send email.
5. NumPy:NumPy is a package for scientific computing in Python. NumPy provides support
forlarge multi-dimensional arrays andmatrices
6. Scikit-learn: Scikit-learn is an open source machine learning library for Python that provides
implementations of various machine learning algorithms for classification, clustering,
regressionand dimension reduction problems.

Python Web Application Framework - Django

Django is an open source web application framework for developing web applications in
Python.A web application framework in general is a collection of solutions, packages and best
practices that allows development of web applications and dynamic websites. Django is based on
the Model- Template-View architecture and provides a separation of the data model from the
business rules and the user interface. Django provides a unified API to a database backend.
Thus web appli- cations built with Django can work with different databases without requiring
any code changes. With this flexibility in web application design combined with the powerful
capabilities of the Python language and the Python ecosystem,

Django is best suited for cloud applications. Django consists of an object-relational mapper, a
webtemplating system and a regular-expression based URL dispatcher. Django Architecture
Django is Model-Template-View (MTV) framework.

1. Model: The model acts as a definition of some stored data and handles the interactions with
the database. In a web application, the data can be stored in a relational database, non-
relational database, an XML file, etc. A Django model is a Python class that outlines the
variables and methods for a particular type ofdata. 2. Template: In a typical Django web
application, the template is simply an HTML page with a few extra placeholders. Djangos
template language canbe used to create various forms of text files (XML, email, CSS, Javascript,
CSV,etc.) 3. View :Theview ties the model to the template. The view is where you write the
code that actually generates
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 65

the web pages. View determines what data is to be displayed, retrieves the data from the
databaseand passes the data to the template.

Xively Cloud for IoT

1. Xively is a system for deploying IoT applications on the cloud. It is offered as PaaS. Xively
is basically a data collection, management, and distribution infrastructure. It also provides APIs
to connect and develop IoT applications.

2. Xively comes under the category of Connected Product Management (CPM) platform. Xively
also provides tools to model your connected business. This capability is highly beneficial to
build any IoT based product. Other than that Xively also provides Management as well as
operational tools. Xively can be connected to most of the IoT frameworks and microcon-
trollers in the market to create a ‘smart’ project or product.

3. Xively Python Libraries can also be used to embed python code as per the Xively APIs. A
Xively Web interface is provided to be used for easy implementation of front end interface.
Xively also comes with multiple language and platform support. We can implement HTTP
protocols, APIs, MQTT. This makes the device connectivity a lot easier with Xively cloud.

4. All the devices can be connected to Xively Cloud for real-time processing and archiving to
cloud. IOT application developers can write the frontend for IoT applications as per their
requirements. This helps in convenient management of apps with Xively cloud and other APIs.
Xively is very popular with companies which deal with IoT based device manufac- turing and
development. Companies using Xively can rely on the secure connectivity of devices as well as
the seamless data management capability.

How to use Xively?

1. Programmers or Developers have to register with Xively to use cloud services. After reg-
istration and account creation, developers can create different devices for which he has to
create an IoT app. It can be easily done using the templates provided in the Web Interface of
Xively.

2. Each connected devices is allocated a unique FEED ID.

3. It specifies the data stream and metadata of the connected device.

4. Once this is done permissions on the IoT devices are assigned using the available APIs.

5. The available permissions are Create, Update, Delete and Read.


Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 66

6. One or more bidirectional channels are created after we connect a device with Xively.

7. Each channel is unique to the device connected.

8. Xively cloud is connected with the help of these channels.

9. Xively APIs are used by IoT devices to create communication enabled products.

Case Studies illustrating IoT Design - Home Automation,SmartCities,Smart


Environment

Case studies illustrating IoT design Case Study in IoT: Home Automation

An IoT software-based approach on the field of Home Automation. Common use-cases include
measuring home conditions, controlling home appliances and controlling home access through
RFID cards as an example and windows through servo locks. However, the main focus of this paper
is to maximize the security of homes through IoT. More specifically, monitoring and
controlling servo door locks, door sensors, surveillance cameras, surveillance car and smoke
detectors, whichhelp ensuring and maximizing safety and security of homes.
A user has the following features through a mobile application in which he/she:
1. can turn on or o LED lights and monitor the state of the LED.
2. can lock and unlock doors through servo motors and monitor if the doors are locked or unlocked.
3. can monitor if the doors are closed or opened through IR sensors.
4. is notified through email if the door is left open for too long.
5. is notified of who entered through the door as the camera captures the face image and send it
tohim/her via email.
6. is notified through email if the re detector detect ssmoke.
7. is able to control the surveillance car from anywhere to monitor his/herhome.

As the field of Home Automation through IoT is a wide application in a very wide and
challengingfield due to the reasons mentioned in the previous paragraphs, I chose to work on
that field as partof this thesis, specifically in maintaining and ensuring security and safety inside
home.

IoT aims in creating a network between objects embedded with sensors, that can store, analyze,
communicate and exchange data together over the internet. This leads to efficient industry,
manu- facturing, efficient energy management, resource management, accurate health care,
smarter busi- ness decisions based on analyzed data, safer driving through smart cars that are
able to communi-cate together, smart home automation and countless more applications.

The system designed for the home automation project presented in this paper needs a control
unit,a computer, to be able to control the different electrical devices connected to it. Raspberry
Pi, is
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 67

a credit-card tiny computer, that can be plugged to a monitor, uses standard keyboard and
mouse,that enables people of different ages learn how to program.
To simplify the publish/subscribe model along with the system architecture used in this Home Au-
tomation project, here is the explanation of the steps of constructing it: Different sensors,
cameras and servo motors were connected to the Raspberry Pi. It was programmed to collect
and publish the data, in the form of JSON string, acquired from these devices to PubNub. Data
is published from the Raspberry Pi by providing it with the ”publish key” and the ”channel
name”. The data issent to the channel provided by PubNub servers, and forwarded by PubNub
to the subscribers ofthis channel.
Illustrates the publish/subscribe model provided by PubNub

FIGURE 5.3: publish/subscribe model provided by PubNub

Illustrates the system architecture used in this home automation project. The subscriber in
this
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 68

FIGURE 5.4: the system architecture used in this home automation project

scenario, of a user acquiring data and readings by the sensors and monitoring devices, is the
we- b/mobile application. The ”subscription key” and ”channel name” is embedded in the
web/mobileapplication’s code. Allowing it to receive messages forwarded by PubNub. On the
other hand, in a scenario where the user wants to send a command to home appliances,
controlling the LED lights for example, the web/mobile application is the publisher provided by
the ”publish key” andthe ”channel name”.The commend is sent in the form of JSON string to
PubNub servers, while the ”subscription key” and ”channel name” is embedded in the
Raspberry Pi code. This allows theRaspberry Pi to receive any published strings on the channel
it is subscribed to. Upon receiving the JSON string, the Raspberry Pi take the action specified
by that string. This allows full controland monitoring of all devices connected to the Raspberry
Pi by theuser.

Case studies illustrating IoT design Case Study in IoT: Smart Cities

The Internet-of-Things (IoT) is the novel cutting-edge technology which proffers to connect
plethoraof digital devices endowed with several sensing, actuation and computing capabilities
with the In-ternet, thus offers manifold new services in the context of a smart city. The
appealing IoT services and big data analytics are enabling smart city initiatives all over the
world. These services are transforming cities by improving infrastructure, transportation
systems, reduced traffic conges- tion, waste management and the quality of human life. In
this paper, we devise a taxonomy to best bring forth a generic overview of IoT paradigm for
smart cities, integrated information and communication technologies (ICT), network types,
possible opportunities and major requirements. Moreover, an overview of the up-to-date efforts
from standard bodies is presented. Later, we givean overview of existing open source IoT
platforms for realizing smart city applications followed by several exemplary case studies. In
addition, we summarize the latest synergies and initiatives
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 69

worldwide taken to promote IoT in the context of smart cities. Finally, we highlight several
chal- lenges in order to give future research directions. IOT BASED SMART CITY
TAXONOMY

FIGURE 5.5: the system architecture used in this smart city project

This section presents a taxonomy of IoT based smart cities which categorizes the literature on
the basis of existing communication protocols, major service providers, network types,
standardiza- tion efforts, offered services, and crucial requirements.

FIGURE 5.6: Representation of IoT based smart city taxonomy

Communication Protocols
IoT based smart city realization significantly relies on numerous short and wide range communica-
tion protocols to transport data between devices and backend servers. Most prominent short
rangewireless technologies include Zig-Bee, Bluetooth, Wi-Fi, Wireless Metropolitan Area
Network
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 70

(WiMAX) and IEEE 802.11p which are primarily used in smart metering, e-healthcare and
vehic- ular communication. Wide range technologies such as Global System for Mobile
communication (GSM) and GPRS, Long-Term Evolution (LTE), LTE- Advanced are
commonly utilized in ITS such as vehicle-to infrastructure (V2I), mobile e- healthcare, smart
grid and infotainment services. Additionally, LTE-M is considered as an evolution for cellular
IoT (C-IoT). In Release 13, 3GPPplans to further improve coverage, battery lifetime as well as
device complexity [7]. Besides well- known existing protocols, LoRa alliance standardizes the
LoRaWAN protocol to support smart city applications to primarily ensure interoperability
between several operators. Moreover, SIGFOX is an ultra narrowband radio technology with
full star-based infrastructure offers a high scalable global network for realizing smart city
applications with extremely low power consumption. A comparative summary2 of the major
communication protocols.

Service Providers
Pike Research on smart cities estimated this market will grow to hundreds of billion dollars by
2020, with an annual growth of nearly 16 billion. IoT is recognized as a potential source to in-
crease revenue of service providers. Thus, well-known worldwide service providers have
already started exploring this novel cutting-edge communication paradigm. Major service
providers in- clude Telefonica, SK telecom, Nokia, Ericsson, Vodafone, NTT Docomo, Orange,
Telenor groupand ATT which offer variety of services and platforms for smart city applications
such as ITS andlogistics, smart metering, home automation and e-healthcare.

Network Types
IoT based smart city applications rely on numerous network topologies to accomplish a fully
autonomous environment. The capillary IoT networks offer services over a short range. Exam-
ples include wireless local area networks (WLANs), BANs and wireless personal area
networks (WPANs). The application areas include indoor e-healthcare services, home
automation, street lighting. On the other hand, applications such as ITS, mobile e-healthcare and
waste managementuse wide area networks (WANs), metropolitan area networks (MANs),and
mobile communica- tion networks. The above networks pose distinct features in terms of data,
size, coverage, latencyrequirements, and capacity.

Case Study in IoT: Smart Environment

The rapid advancements in communication technologies and the explosive growth of Internet
of Things (IoT) have enabled the physical world to invisibly interweave with actuators, sensors,
and other computational elements while maintaining continuous network connectivity. The
continu- ously connected physical world with computational elements forms a smart
environment. A smart environment aims to support and enhance the abilities of its dwellers in
executing their tasks, suchas navigating through unfamiliar space and moving heavy objects for
the elderly, to name a few. Researchers have conducted a number of efforts to use IoT to
facilitate our lives and to investigatethe effect of IoTbased smart environments on human life.
This paper surveys the state-of-the-art
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 71

research efforts to enable the IoT-based smart environments. We categorize and classify the lit-
erature by devising a taxonomy based on communication enablers, network types,
technologies, local area wireless standards, objectives, and characteristics. Moreover, the paper
highlights the unprecedented opportunities brought about by IoT-based smart environments
and their effect on human life. Some reported case studies from different enterprises are also
presented. Finally, we discuss open research challenges for enabling IoT-based smart
environments.

FIGURE 5.7: IoT based smart environment

Immense developments and increasing miniaturization of computer technology have enabled


tinysensors and processors to be integrated into everyday objects. This advancement is further
sup- ported by tremendous developments in areas such as portable appliances and devices,
pervasive computing, wireless sensor networking, wireless mobile communications, machine
learning-based decision making, IPv6 support, human computer interfaces, and agent
technologies to make the dream of smart environment a reality. A smart environment is a
connected small world where sensor-enabled connected devices work collaboratively to make
the lives of dwellers comfortable. The term smart refers to the ability to autonomouslyobtain
and applies knowledge; and the term environment refers to the surroundings. Therefore, a
smart environment is one that is capable of obtaining knowledge and applying it to adapt
according to its inhabitants needs to ameliorate theirexperience of thatenvironment.
The functional capabilities of smart objects are further enhanced by interconnecting them with
other objects using different wireless technologies. In this context, IPv6 plays a vital role
becauseof several features, including better security mechanisms, scalability in case of billion of
connected devices, and the elimination of NAT barriers1. This concept of connecting smart
objects with theInternet was first coined by Kevin Ashton as —Internet of Things|| (IoT).
Nowadays, IoT is receiving attention in a number of fields such as healthcare, transport, and in-
dustry, among others. Several research efforts have been conducted to integrate IoT with
smart
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 72

environments. The integration of IoT with a smart environment extends the capabilities of
smart objects by enabling the user to monitor the environment from remote sites. IoT can be
integrated with different smart environments based on the application requirements. The work
on IoT-basedsmart environments can generally be classified into the following areas: a) smart
cities, b) smart homes, c) smart grid, d) smart buildings, e) smart transportation, f) smart
health, and g) smart industry.illustrates the IoT-based smartenvironments.

FIGURE 5.8: Representation of IoT based smart environment taxonomy

The taxonomy of the IoT based smart environment. The devised taxonomy is based on the
follow- ing parameters: communication enablers, network types, technologies, wireless
standards, objec-tives, and characteristics

Communication Enablers
Communication enablers refer to wireless technologies used to communicate across the Inter-
net. The key wireless Internet technologies are WiFi, 3G, 4G, and satellite. WiFi is mainly used
in smart homes, smart cities, smart transportation, smart industries, and smart building environ-
ments; whereas, 3G and 4G are mainly used in smart cities and smart grid environments.
Satellites are used in smart transportation, smart cities, and smart grid environments. Table
presents the comparative summary of the communication technologies used in IoT based smart
environments.

Network Types
IoT-based smart environments rely on different types of networks to perform the collaborative
tasks for making the lives of inhabitants more comfortable. The main networks are wireless
local area networks (WLANs), wireless personal area networks (WPANs), wide area networks
(WANs), metropolitan area networks (MANs), and wireless regional area networks (WRANs).
These net- works have different characteristics in terms of size, data transfer, and supported
reach ability.

Technologies
IoT-based smart environments leverage various technologies to form a comfortable and
suitable
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 73

ecosystem. These technologies are include sensing, communication, data fusion, emerging
com-puting, and information security. Sensing technologies are commonly used to acquire data
from various locations and transmit it using communication technologies to a central location.
The emerging computing technologies, such as cloud computing and fog computing, deployed
in thecentral location, leverage the data fusion technologies for integrating the data coming from
hetero- geneous resources. In addition, smart environments also use information security
technologies toensure data integrity and user privacy.

Local Area Wireless Standards The commonly used local area wireless standards in IoT-
basedsmart environments are IEEE 802.11, IEEE 802.15.1, and IEEE 802.15.4. These standard
tech- nologies are used inside the smart environment to transfer the collected data among
different de-vices. IEEE 802.11 is used in smart homes, smart buildings, and smart cities. IEEE
802.15.1 and IEEE 802.15.4 have relatively shorter coverage than IEEE 802.11 and are used
mainly in sensorsand other objects deployed in the smartenvironments.
Bibliography

[1] ABAQUS (2011). Abaqus 6.11 Online Documentation. Dassault Systemes.

[2] Armentrout, D. R. (1981). An analysis of the behavior of steel liner anchorages. PhD thesis,
University of Tennessee.

[3] Bower, A. (2011). Applied Mechanics of Solids. Taylor & Francis.

[4] Brown, R. H. and Whitlock, A. R. (1983). Strength of anchor bolts in grouted concrete ma-
sonry. Journal of Structural Engineering, 109(6):1362–1374.

[5] Celep, Z. (1988). Rectangular plates resting on tensionless elastic foundation. Journal of
Engineering mechanics, 114(12):2083–2092.

[6] Chakraborty, S. (2006). An experimental study on the beehaviour of steel plate-anchor assem-
bly embedded in concrete under biaxial loading. M.tech thesis, Indian Institute of Technology
Kanpur.

[7] Cook, R. A. and Klingner, R. E. (1992). Ductile multiple-anchor steel-to-concrete connec-


tions. Journal of structural engineering, 118(6):1645–1665.

[8] Damarla, V. N. (1999). An experimental investigation of performance of steel plate-concrete


interfaces under combined action of shear and normal forces. Master’s thesis, Indian Institute
of Technology Kanpur.

[9] Doghri, I. (1993). Fully implicit integration and consistent tangent modulus in elasto-
plasticity. International Journal for Numerical Methods in Engineering, 36(22):3915–3932.

[10] FEMA (June, 2007). Interim testing protocols for determining the seismic performance char-
acteristics of structural and nonstructural components. Report 461, Federal Emergency Man-
agement Agency.

[11] Furche, J. and Elingehausen, R. (1991). Lateral blow-out failure of headed studs near a free
edge. Anchors in Concrete-Design and Behavior, SP-130.

[12] Kallolil, J. J., Chakrabarti, S. K., and Mishra, R. C. (1998). Experimental investigation of
embedded steel plates in reinforced concrete structures. Engineering structures, 20(1):105–112.
74
Bibliography 75

[13] Krawinkler, H., Zohrei, M., Lashkari-Irvani, B., Cofie, N., and Hadidi-Tamjed, H. (1983).
Recommendations for experimental studies on the seismic behavior of steel components and
materials. Report, Department of Civil and Environmental Engineering, Stanford Unniversity.

[14] Lemaitre, J. and Chaboche, J. L. (1994). Mechanics of Solid Materials. Cambridge Univer-
sity Press.

[15] Maya, S. (2008). An experimental study on the effect of anchor diameter on the behavior of
steel plate-anchor assembly embedded in concrete under biaxial loading. M.tech thesis, Indian
Institute of Technology Kanpur.

[16] Sahu, D. K. (2004). Experimental study on the behavior of steel plate-anchor assembly em-
bedded in concrete under cyclic loading. M.tech thesis, Indian Institute of Technology Kanpur.

[17] Sonkar, V. (2007). An experimental study on the behaviour of steel plate-anchor assembly
embedded in concrete under constant compressive axial load and cyclic shear. M.tech thesis,
Indian Institute of Technology Kanpur.

[18] Thambiratnam, D. P. and Paramasivam, P. (1986). Base plates under axial loads and mo-
ments. Journal of Structural Engineering, 112(5):1166–1181.

You might also like