0% found this document useful (0 votes)
37 views

IOT

The document provides an overview of the Internet of Things (IoT), defining it as a global network of interconnected devices that collect and exchange data. It discusses key components such as smart devices, sensors, and actuators, as well as the characteristics and protocols that enable IoT communication. Additionally, it outlines various communication models and APIs used in IoT systems, emphasizing their roles in facilitating data transfer and interaction between devices.

Uploaded by

22b81a05y0.2
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)
37 views

IOT

The document provides an overview of the Internet of Things (IoT), defining it as a global network of interconnected devices that collect and exchange data. It discusses key components such as smart devices, sensors, and actuators, as well as the characteristics and protocols that enable IoT communication. Additionally, it outlines various communication models and APIs used in IoT systems, emphasizing their roles in facilitating data transfer and interaction between devices.

Uploaded by

22b81a05y0.2
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/ 231

CVR COLLEGE OF ENGINEERING

An UGC Autonomous Institution - Affiliated to JNTUH


Handout – 1
Unit - 1
Year and Semester: IV yr & II Sem Subject: Internet of Technologies
Branch: CSE Faculty: Dr. D. Durga Bhavani, Professor CSE

UNIT-1(CO1)
Introduction to Internet of Things
IOT definition
The Internet of Things is a global network of computers, sensors, and actuators connected
through Internet protocols.

 almost all every area, every device, every sensor, every software are connected to
each other and those devices we can able to access remotely through a smart phone or
through a computer is called IoT.

 Connecting everyday things embedded with electronics, software, and sensors to


the internet enabling them to collect and exchange data.

 IoT is simply connecting all the surrounding smart devices(things) to internet.


these devices use sensors& actuators to communicate with each other across the internet.

• A dynamic global network infrastructure with self- configuring capabilities based on


standard and interoperable communication protocols where physical and virtual "things"
have identities, physical attributes, and virtual personalities and use intelligent interfaces,

• And are seamlessly integrated into the information network, often communicate data
associated with users and their environments.

some basic terms of IoT:

1)Smart device: Any mechanical or electronic device that can take intelligent decisions on its
own.

2)Sensor: A small chip that senses the surrounding activities. A sensor detects(senses) changes
in the ambient conditions or in the state of another device or a system and forwards or processes
this information in a certain manner. sensors are electronic devices that senses the physical
environments.

Sensor types:
 Light

 Temp

 Flow

 Position

 Speed

 voltage

 humidity

3)Actuator: Another chip that responds to the sensed activities.

 An actuator is a component of a machine or system that is responsible for moving or


controlling a mechanism or system.

 An actuator requires a control signal and source of energy.

Characteristics of IoT:
• Dynamic & Self-Adapting

• Self-Configuring

• Interoperable Communication Protocols

• Unique Identity

• Integrated into Information Network

Dynamic & Self-Adopting: may have the capability to dynamically adopt with changing
contexts and take actions based on their operating conditions, user’s context or sensed
environment. Ex: surveillance system comprising number of cameras.

Self-configuring: may have self-configuring capability allowing a large number of devices


working together to provide certain functionality. Devices have ability to configure themselves.

Interoperable Communication Protocols: support number of interoperable


communication protocols and communicate with other devices and also with infrastructure.
Unique Identity: Each IOT has a unique identity as IP address or a Uri. IOT interfaces may
have intelligent interfaces-based on the context allow communicating wit users and environment
context. Allow users to query the devices, monitor status and control remotely.

Integrated in to Information Network-easily integrated network to communicate and exchange


data with other devices and systems. Systems can be dynamically discovered in the network and
have ability to discover other devices and/or the network and capability to describe themselves.

Physical Design of IoT


The "Things" in IoT usually refers to IoT devices which have unique identities and can
perform remote sensing, actuating and monitoring capabilities.

IoT devices can:

• Exchange data with other connected devices and applications (directly or indirectly), or

• Collect data from other devices and process the data locally or

• Send the data to centralized servers or cloud-based application back-ends for processing the
data, or

• Perform some tasks locally and other tasks within the IoT infrastructure, based on temporal and
space constraints.

Generic block diagram of an IoT Device:


An IoT device may consist of several interfaces for connections to other devices, both wired and
wireless.

• I/O interfaces for sensors

• Interfaces for Internet connectivity

• Memory and storage interfaces

• Audio/video interfaces

An IoT device can collect various types of data from onboard or attached sensors such as
temperature, humidity, light intensity.

The device can be connected to actuators that allow them to interact with other physical
entities (including non IoT device and system) in the vicinity of the device.

IoT devices can be varied types, sensor data generated by a soil moisture gathering device
can in a garden, when processed determining optimum watering schedule.
Fig:Generic block diagram of an IoT Device

IoT Protocols:

Link Layer:
• 802.3 – Ethernet

• 802.11 – WiFi

• 802.16 – WiMax

• 802.15.4 – LR-WPAN

• 2G/3G/4G

Network/Internet Layer :
• IPv4

• IPv6

• 6LoWPAN

Transport Layer
• TCP

• UDP
Application Layer :
• HTTP

• CoAP

WebSocket:
• MQTT

• XMPP

• DDS

• AMQP

Fig:IoT Protocols

Link Layer protocols: determine how the data is physically sent over the network’s
physical layer or medium. The scope of the link layer is the local connection to which host is
attached.
• Link layer determines how the packets are coded and signaled by hardware device over r
medium to which host is attached.

802.3 Ethernet: Is a collection of wired ethernet standards for the link layer, standards
provide data rates from 10Mb/s to 40Gb/s and higher.

802.11 Wifi—is a collection of wireless local area network(WLAN) communication standards,


including extensive description of the link layer. 802.1a operates in the 5GHz,802.11a and
802.11g operate in 2.54GHz band.

802.16—WiMax:is collection of wireless broadband standards, including extensive


description of the link layer.Wimax standard provides rates from 1.5 Mb/s to 1 Gb/s.802.16m
provides data rates of 100Mb/s for mobile stations and 1 Gb/s for fixed stations.

802.15.4-LR-WPAN—collection of standards for low-rate wireless personal area


networks(LR-WPANs). These form basis for high level communication protocols such as
ZigBee. Provides data rates from 40 Kb/s -250Kb/s. Low-cost and low-speed communication for
power constrained devices.

2G/3G/4G--Mobile communication: IoT devices based on these standards can


communicate over cellular networks. Data rates from 9.6Kb/s upto 100Mb/s are available from
3GP websites.

2G-digital communications.

3G-multimedia services.

4G-wireless(means broad band connectivity)

Network/Inter network Layer—Network Layer is responsible for sending of IP


datagrams from source to destination. Performs host addressing and packet rerouting. Datagram
contains source and destination addresses used to route them from source to destination across
multiple routes. Host identification is done using IPv4 or Ipv6 IP addressing schemes. IPv4-IPv6
addressing schemes .

 6LoWAPAN(IPv6 over Low Power Wireless Personal Area Networks )


:brings IP protocol to the low-power devices have limited processing capability.
6LoWAPAN operates in the 2.4GHz and provides data transfer rates of 250Kb/s.
6LoWAPAN works with 802.15.4 link layer protocol and defines compression
mechanisms for IPV6 datagram over 802.15.4-based networks.

Transport Layer—Protocols in this layer provide end-to-end message transfer capability


independent of underlying network. Message transfer can be setup on connections using
with/without using handshakes. Functions in transport layer include error control, segmentation,
flow control and congestion control.

 Transmission Control Protocol(TCP )—widely used transport protocol, used by


web browsers, is a connection oriented protocol and stateful protocol. While IP protocol
deals with sending, TCP ensures reliable transmission of packets in-order.
 UDP—UDP is connectionless protocol. UDP is useful for time-sensitive applications
that have very small data units to exchange and do not want the overhead connection
setup. UDP is a transaction oriented and stateless protocol. UDP does not provide
guaranteed delivery, ordering of messages and duplicate elimination.

Application Layer—protocols define how the applications interface with the lower layer
protocols to send the data over network.

• HTTP:Hyper Text Transfer Protocol--forms foundation of WWW. Commands


include GET,PUT,POST,DELETE,HEAD,TRACE,options. Protocol follows request-
response model where client sends a request to a server using the HTTP commands.
HTTP is a stateless protocol and each request is independent of other requests.

• COAPP:Constrained Application Protocol—application layer protocol for


machine to machine(M2M) applications, meant for constrained environments with
constrained devices and constrained networks. Uses request-response model , runs on top
of Udp instead of TCP.CoAP uses a client server architecture where clients communicate
with servers using connectionless datagrams.

The Constrained Application Protocol (CoAP) is a specialized web transfer protocol for
use with constrained nodes and constrained (e.g., low-power, lossy) networks. The nodes often
have 8-bit microcontrollers with small amounts of ROM and RAM, while constrained networks
such as 6LoWPAN often have high packet error rates and a typical throughput of 10s of kbit/s.
The protocol is designed for machine-to-machine (M2M) applications such as smart energy and
building automation.

CoAP provides a request/response interaction model between application endpoints,


supports built-in discovery of services and resources, and includes key concepts of the Web such
as URIs and Internet media types. CoAP is designed to easily interface with HTTP for
integration with the Web while meeting specialized requirements such as multicast support, very
low overhead and simplicity for constrained environments.
CoAP has the following main features:

 Constrained web protocol fulfilling M2M requirements.


 UDP [RFC0768] binding with optional reliability supporting unicast and multicast
requests.

 Asynchronous message exchanges.

 Low header overhead and parsing complexity.

 URI and Content-type support.

 Simple proxy and caching capabilities.

 A stateless HTTP mapping, allowing proxies to be built providing access to CoAP


resources via HTTP in a uniform way or for HTTP simple interfaces to be realized
alternatively over CoAP.

 Security binding to Datagram Transport Layer Security (DTLS) [RFC6347].

 Web Socket—Allows full duplex communication over a single socket connection for
sending messages between client and server. Websocket is based on TCP and allows
streams of messages to be sent back and forth between the client and server while
keeping TCP connection open.

The WebSocket Protocol enables two-way communication between a client running untrusted
code in a controlled environment to a remote host that has opted-in to communications from that
code. The security model used for this is the origin-based security model commonly used by
web browsers. The protocol consists of an opening handshake followed by basic message
framing, layered over TCP. The goal of this technology is to provide a mechanism for browser-
based applications that need two-way communication with servers that does not rely on opening
multiple HTTP connections (e.g., using XMLHttpRequest or <iframe>s and long polling).

• MQTT(Message Que Telemetry Transport)—is a light-weight messaging


protocol based on publish-subscribe model. Uses client server architecture –client(IoT
device) connects to server(MQTT broker) and publishes messages to topics on server.
The broker forwards messages to clients subscribed to topics. Well suited for constrained
environments-devices have limited processing and memory resources and low network
bandwidh.
• XMPP(Extensible Messaging and Presence Protocol)—protocol for realtime
communication and streaming XML data between network entities. XMPP powers
messaging and presence, data syndication,gaming, multi-party chat and voice/video calls.
Allows sending small chunks of XML data from one network entity to another in real
time. XMPP supports client to server and server to server communication paths.XMPP
allows rel time omunication between IoT devices.

DDS(Data Distribution Service)—Data centric middleware standard for device-


to-device or machine to machine communication. Uses publish subscribe service
model.Publisher is an object responsible for data distribution and the subscriber is
responsible for receiving published data. DDS provides quality-of-service(QoS) control
and configurable reliability.

• AMQP(Advanced Message Queuing Protocol)—is an open application layer


protocol for business messaging. Supports both point-to-point and publisher/subsciber
models, routing and queuing.

Logical Design of IoT:


• Logical design of an IoT system refers to an abstract representation of the entities and
processes without going into the low-level specifics of the implementation.

• An IoT system comprises of a number of functional blocks that provide the system the
capabilities for identification, sensing, actuation, communication, and management .

Fig: Functional Blocks of IoT


These functional blocks are described as follows:

 Device: An IoT system comprises of devices that provide sensing, actuation, monitoring
and control functions.

 Communication: The communication block handles the communication for the Iot
system. the various protocols used for communication by Iot Systems.

 Services: An IoT System uses various types of IoT services such as services for device
monitoring, device control services, data publishing services and services for device
discovery.

 Management:Management functional block provides various functions to govern the


IoT System.

 Security: Security functional block secures the IoT system and by providing functions
such as authentication, authorization, message and content integrity, and data security.

 Application: IoT applications provide an interface that the users can use to control and
monitor various aspects of the IoT system. Applications also allow users to view the
system status and view or analyze the processed data.

IOT COMMUNICATION MODELS


Request-Response communication model:
Request-Response is a communication model in which the client sends requests to the
server and the server responds to the requests.

• When the server receives a request, it decides how to respond, fetches the data, retrieves
resource representations, prepares the response, and then sends the response to the client.
Fig: Request-Response communication model

Publish-Subscribe communication model:


Publish-Subscribe is a communication model that involves publishers, brokers and consumers.

• Publishers are the source of data. Publishers send the 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.

Fig: Publish-Subscribe communication model

Push-Pull communication model:


Push-Pull is a communication model in which the data producers push the data to queues and the
consumers pull the data from the queues. Producers do not need to be aware of the consumers.

• Queues help in decoupling the messaging between the producers and consumers.

• Queues also act as a buffer which helps in situations when there is a mismatch between the rate
at which the producers push data and the rate at which the consumers pull data.
Fig:Push-Pull communication model

Exclusive Pair communication model:


Exclusive Pair is a bidirectional, fully duplex communication model that uses a persistent
connection between the client and server.

• Once the connection is setup it remains open until the client sends a request to close the
connection.

• Client and server can send messages to each other after connection setup.

Fig: Exclusive Pair communication model


IOT Communication APIs:

REST-based Communication APIs: Representational State Transfer (REST) is a


set of architectural principles by which you can design web services and web APIs that focus on a
system’s resources and how resource states are addressed and transferred. • REST APIs follow
the request response communication model. • The REST architectural constraints apply to the
components, connectors, and data elements, within a distributed hypermedia system.

Fig:Communication with REST APIs

REST (Representational State Transfer) is a concept, not a protocol. But it is the basis of the most
widely used form of API today. RESTful APIs are widely used in the modern web, and data
transfer usually takes place using JSON or XML over HTTP.REST is a stateless concept — e.g.
that the client will connect and consumethe API on demand, passing any data which is relevant to
the request at time of use. It does not maintain a constantly open connection so it is very scalable.
REST APIs typically use methods of the HTTP specification to perform different actions.
For example — POST, GET, PUT, DELETE can be logically mapped to SQL CREATE, SELECT
(READ), UPDATE and DELETE functions. This is known as CRUD and it means that
everything you might want to do to a piece of data stored on a remote server can be done
predictably through a REST API. Requests originate from the client, and the common HTTP
verbs include GET, POST, PUT, DELETE but there are several others. They correspond to
expected operations, retrieving data, submitting data, updating data, and deleting data.

As it uses HTTP, any device which can connect to the web and request a web page can use
a REST API. REST is a good model for IoT because each device can easily make its state
information available, and can standardize on a way to create, read, update, and delete that data.
Developers can quickly build (or leverage from DreamFactory) a REST model for many IoT
devices. You can then, for example, easily get the state of the lightbulb: it is off. Then, send a
request to turn it on. Get the current temperature from the space heater: it is too hot. Send a lower
target temperature. This model intuitively matches the problem space.

REST addresses:

1. Performance

2. Scalability

3. Simplicity of interfaces

4. Modifiability

5. Visibility

6. Portability

7. Reliability

APIs allow developers to build context based applications that can interact with
the physical world instead of purely through UI (proximity and location aware). To
truly achieve IoT we need a REST API for every device. REST allows data to flow
over internet protocols and to delegate and manage authorization.
Web Socket API:
WebSocket APIs allow bidirectional, full duplex communication between clients and
servers.
• WebSocket APIs follow the exclusive pair communication model.

Fig:Exclusive Pair Model used by Web Socket APIs

Web Socket allows communication among two devices. Web Sockets send data using a
continuous connection that is established between the client and the server. The user builds up a
Web Socket connection through a process known as the Web Socket handshake. The user then
sends a normal HTTP request to the server. An Upgrade header is incorporated into this request
informing the server that the user wishes to build up a Web Socket connection. When the
handshake is finished, it replaces the HTTP connection to the Web Socket connection which uses
the same hidden TCP/IP connection. This allows both parties to send data among each other.

Web Sockets require the browser side to run a java script library that can identify Web
Socket handshake, establish and maintain a Web Socket connection.
IOT Enabling Technologies:
Cloud Computing:is the on-demand delivery of compute power, database storage,
applications, and other IT resources through a cloud services platform via the internet with pay-
as-you-go pricing.

Cloud Computing Models Cloud Providers offer services that can be grouped into three
categories.

1. Software as a Service (SaaS):In this model, a complete application is offered to


the customer, as a service on demand. A single instance of the service runs on the cloud &
multiple end users are serviced. On the customers‟ side, there is no need for upfront investment
in servers or software licenses, while for the provider, the costs are lowered, since only a single
application needs to be hosted & maintained. Today SaaS is offered by companies such as
Google, Sales force, Microsoft, Zoho, etc.

2. Platform as a Service (Paas):Here, a layer of software, or development


environment is encapsulated & offered as a service, upon which other higher levels of service
can be built. The customer has the freedom to build his own applications, which run on the
provider’s infrastructure. To meet manageability and scalability requirements of the applications,
PaaS providers offer a predefined combination of OS and application servers, such as LAMP
platform (Linux, Apache, MySql and PHP), restricted J2EE, Ruby etc. Google’s App Engine,
Force.com, etc are some of the popular PaaS examples.
3. Infrastructure as a Service (Iaas): IaaS provides basic storage and computing
capabilities as standardized services over the network. Servers, storage systems, networking
equipment, data centre space etc. are pooled and made available to handle workloads. The
customer would typically deploy his own software on the infrastructure. Some common
examples are Amazon, GoGrid, 3 Tera, etc.

Big Data Analytics:


 Big Data Analytics largely involves collecting data from different sources,
munge it in a way that it becomes available to be consumed by analysts and finally
deliver data products useful to the organization business. The process of converting large
amounts of unstructured raw data, retrieved from different sources to a data product
useful for organizations forms the core of Big Data Analytics.

 Bigdata is the term for collection of data sets so large and complex that it
becomes difficult to process using on-hand database system tools or traditional data
processing applications.
Volume:
We currently see the exponential growth in the data storage as the data is now more than
text data. We can find data in the format of videos, music’s and large images on our social media
channels. It is very common to have Terabytes and Peta-bytes of the storage system for
enterprises. As the database grows the applications and architecture built to support the data
needs to be reevaluated quite often. Sometimes the same data is re-evaluated with multiple
angles and even though the original data is the same the new found intelligence
creates explosion of the data. The big volume indeed represents Big Data.

Velocity:
Velocity is another important characteristic of big data and the primary reason for
exponential growth of data. Velocity of data refers to how fast the data is generated and how
frequently it varies. Modern IT, industrial and other systems are generating data at increasingly
higher speeds.

Variety:
Variety refers to the forms of the data. Big data come in different forms such as
structured or unstructured data, including text data, image, audio, video and sensor data.
A wireless sensor network (WSN):
A Wireless Sensor Network is a self-configuring network of small sensor nodes
communicating among themselves using radio signals, and deployed in quantity to sense,
monitor and understand the physical world.

A wireless sensor network (WSN) in its simplest form can be defined as a network of
(possibly low-size and low-complex) devices denoted as nodes that can sense the environment
and communicate the information gathered from the monitored field through wireless links; the
data is forwarded, possibly via multiple hops relaying, to a sink that can use it locally, or is
connected to other networks (e.g., the Internet) through a gateway.

• The nodes can be stationary or moving.

• They can be aware of their location or not.

• They can be homogeneous or not.

WSN are enabled by wireless communication protocols such as IEEE 802.15.4. ZigBee is
one of the most popular wireless technologies used by WSNs. ZigBee specifications are based on
IEE 802.15.4.ZigBee operates at 2.4 GHz frequency and offers data rates up to 250 KB/s and
range from 10 to 100 meters depending on the power output and environmental conditions.

ZigBee:
ZigBee is an open global standard built on the IEEE 802.15.4 MAC/PHY.

• ZigBee defines a network layer above the 802.15.4 layers to support advanced mesh routing
capabilities.

• The ZigBee specification is developed by a growing consortium of companies that make up the
ZigBee Alliance. The Alliance is made up of over 300 members, including semiconductor,
module, stack, and software developers.
WSNs Applications:
WSNs may consist of many different types of sensor. As a result, a wide range of
applications are possible.

IoT Levels & Deployment Templates


An IoT system comprises of the following components:
• Device: An IoT device allows identification, remote sensing, actuating and remote monitoring
capabilities.

• Resource: Resources are software components on the IoT device for accessing, processing, and
storing sensor information, or controlling actuators connected to the device. Resources also
include the software components that enable network access for the device.

• Controller Service: Controller service is a native service that runs on the device and interacts
with the web services. Controller service sends data from the device to the web service and
receives commands from the application (via web services) for controlling the device.

Database: Database can be either local or in the cloud and stores the data generated by the IoT
device.
• Web Service: Web services serve as a link between the IoT device, application, database and
analysis components. Web service can be either implemented using HTTP and REST principles
(REST service) or using WebSocket protocol (WebSocket service).

• Analysis Component: The Analysis Component is responsible for analyzing the IoT data and
generate results in a form which are easy for the user to understand.

• Application: IoT applications provide an interface that the users can use to control and monitor
various aspects of the IoT system. Applications also allow users to view the system status and
view the processed data.
IoT Level-1:
A level-1 IoT system has a single node/device that performs sensing and/or actuation, stores
data,

performs analysis and hosts the application

• Level-1 IoT systems are suitable for modeling lowcost and low-complexity solutions where the
data involved is not big and the analysis requirements are not computationally intensive.

IoT
Level-2:
•A level-2 IoT system has a single node that performs sensing and/or actuation and local
analysis.

• Data is stored in the cloud and application is usually cloudbased.

• Level-2 IoT systems are suitable for solutions where the data involved is big, however, the
primary analysis requirement is not computationally intensive and can be done locally itself.

IoT
Level-3
• A level-3 IoT system has a single node. Data is stored and analyzed in the cloud and
application is cloudbased.

• Level-3 IoT systems are suitable for solutions where the data involved is big and the analysis

requirements are computationally intensive.


IoT Level-4:

A level-4 IoT system has multiple nodes that perform local analysis. Data is stored in the cloud
and application is cloud-based.

• Level-4 contains local and cloudbased observer nodes which can subscribe to and receive

information collected in the cloud from IoT devices.

• Level-4 IoT systems are suitable for solutions where multiple nodes are required, the data

involved is big and the analysis requirements are computationally intensive.


IoT Level-5
A level-5 IoT system has multiple end nodes and one coordinator node.

• 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.

• Level-5 IoT systems are suitable for solutions based on wireless sensor networks, in which the
data involved is big and the analysis requirements are computationally intensive.
IoT Level-6
A level-6 IoT system has multiple independent end nodes that perform sensing and/or actuation

and send data to the cloud.

• Data is stored in the cloud and application is cloud-based.

• The analytics component analyzes the data and stores the results in the cloud database.

• The results are visualized with the cloud-based application.

• The centralized controller is aware of the status of all the end nodes and sends control
commands to the nodes.
I2C
Raghava M, PhD
Schematic Diagram
Internals
• I2C is a low speed two wire serial protocol to connect devices using
the I2C standard.
• Devices using the I2C standard have a master slave relationship.
• There can be more than one master, but each slave device requires a
unique address, obtained by the manufacturer from NXP, formerly
known as Philips Semiconductors.
• This means that we can talk to multiple devices on a single I2C
connection as each device is unique and discoverable by the user and
the computer using Linux commands such as i2cdetect.
• The Raspberry Pi has two I2C1 connections at 3 and 5 (SDA and SCL)
are for I2C1 (master) and
• I2C0- Physical pins 27 and 28 are I2C pins that enable the Pi to talk to
compatible HAT (Hardware Attached on Top) add on boards.
I2C BUS

I2C Interface
• I2C uses only two wires: SCL (serial clock) and SDA (serial data). Both need
to be pulled up with a resistor to +Vdd. There are also I2C level shifters
which can be used to connect to two I2C buses with different voltages.
I2C Addresses
• Basic I2C communication is using transfers of 8 bits or bytes. Each I2C slave
device has a 7-bit address that needs to be unique on the bus. Some
devices have fixed I2C address while others have few address lines which
determine lower bits of the I2C address. This makes it very easy to have all
I2C devices on the bus with unique I2C address. There are also devices
which have 10-bit address as allowed by the specification.
Protocol Structure
I2C Address
• 7-bit address represents bits 7 to 1 while bit 0 is used to signal
reading from or writing to the device. If bit 0 (in the address byte) is
set to 1 then the master device will read from the slave I2C device.
• Master device needs no address since it generates the clock (via SCL)
and addresses individual I2C slave devices.
Address Structure
I2C Protocol Structure

• In normal state both lines (SCL and SDA) are high.


• The communication is initiated by the master device. It generates the Start
condition (S) followed by the address of the slave device (B1).
• If the bit 0 of the address byte was set to 0 the master device will write to
the slave device (B2). Otherwise, the next byte will be read from the slave
device.
• Once all bytes are read or written (Bn) the master device generates Stop
condition (P). This signals to other devices on the bus that the
communication has ended and another device may use the bus.
Protocol Structure
Serial Communication
SPI
Raghava M, PhD
• SPI, I2C, and UART are ideal for
communication between microcontrollers
and sensors where large amounts of high
speed data don’t need to be transferred.
SPI
• SPI is a common communication protocol used by many different
devices. For example, SD card modules, RFID card reader modules,
and 2.4 GHz wireless transmitter/receivers all use SPI to communicate
with microcontrollers.
• One unique benefit of SPI is the fact that data can be
transferred without interruption. Any number of bits can be sent or
received in a continuous stream.
• With I2C and UART, data is sent in packets, limited to a specific
number of bits. Start and stop conditions define the beginning and
end of each packet, so the data is interrupted during transmission.
Structure
• To begin communication, the bus master configures the clock, using a frequency
supported by the slave device, typically up to a few MHz. The master then selects
the slave device with a logic level 0 on the select line. If a waiting period is
required, such as for an analog-to-digital conversion, the master must wait for at
least that period of time before issuing clock cycles
• During each SPI clock cycle, a full-duplex data transmission occurs. The master
sends a bit on the MOSI line and the slave reads it, while the slave sends a bit on
the MISO line and the master reads it. This sequence is maintained even when
only one-directional data transfer is intended
HOW SPI WORKS

• THE CLOCK
• The clock signal synchronizes the output of data bits from the master to
the sampling of bits by the slave. One bit of data is transferred in each
clock cycle, so the speed of data transfer is determined by the frequency of
the clock signal. SPI communication is always initiated by the master since
the master configures and generates the clock signal.
• Any communication protocol where devices share a clock signal is known
as synchronous. SPI is a synchronous communication protocol. There are
also asynchronous methods that don’t use a clock signal. For example, in
UART communication, both sides are set to a pre-configured baud rate that
dictates the speed and timing of data transmission.
Transmission Internals
• Transmissions normally involve two shift registers of some given word-size,
such as eight bits, one in the master and one in the slave; they are
connected in a virtual ring topology.
• Data is usually shifted out with the most significant bit first.
• On the clock edge, both master and slave shift out a bit and output it on
the transmission line to the counterpart.
• On the next clock edge, at each receiver the bit is sampled from the
transmission line and set as a new least-significant bit of the shift register.
• After the register bits have been shifted out and in, the master and slave
have exchanged register values. If more data needs to be exchanged, the
shift registers are reloaded and the process repeats. Transmission may
continue for any number of clock cycles. When complete, the master stops
toggling the clock signal, and typically deselects the slave.
4 Pin mode
• MOSI AND MISO
• The master sends data to the slave bit by bit, in serial through the
MOSI line. The slave receives the data sent from the master at the
MOSI pin. Data sent from the master to the slave is usually sent with
the most significant bit first.
• The slave can also send data back to the master through the MISO
line in serial. The data sent from the slave back to the master is
usually sent with the least significant bit first.
SPI
• Devices communicating via SPI are in a master-slave relationship. The master is the controlling device
(usually a microcontroller), while the slave (usually a sensor, display, or memory chip) takes instruction
from the master. The simplest configuration of SPI is a single master, single slave system, but one master
can control more than one slave.

MOSI (Master Output/Slave Input) – Line for the master SCLK (Clock) – Line for the clock signal.
to send data to the slave.
MISO (Master Input/Slave Output) – Line for the slave to SS/CS (Slave Select/Chip Select) – Line for the master
send data to the master. to select which slave to send data to.
STEPS OF SPI DATA TRANSMISSION
• 1. The master outputs the clock signal:

2. The master switches the SS/CS pin to a low voltage state,


which activates the slave:
• 3. The master sends the data one bit at a time to the slave along the MOSI
line. The slave reads the bits as they are received:

• 4. If a response is needed, the slave returns data one bit at a time to the
master along the MISO line. The master reads the bits as they are received:
• SLAVE SELECT
• The master can choose which slave it wants to talk to by setting the slave’s CS/SS
line to a low voltage level. In the idle, non-transmitting state, the slave select line
is kept at a high voltage level. Multiple CS/SS pins may be available on the master,
which allows for multiple slaves to be wired in parallel. If only one CS/SS pin is
present, multiple slaves can be wired to the master by daisy-chaining.
• MULTIPLE SLAVES
• SPI can be set up to operate with a single master and a single slave, and it can be
set up with multiple slaves controlled by a single master. There are two ways to
connect multiple slaves to the master. If the master has multiple slave select pins,
the slaves can be wired in parallel like this:

Multiple slaves
• ADVANTAGES
• No start and stop bits, so the data can be streamed continuously
without interruption
• No complicated slave addressing system like I2C
• Higher data transfer rate than I2C (almost twice as fast)
• Separate MISO and MOSI lines, so data can be sent and received at
the same time
• DISADVANTAGES
• Uses four wires (I2C and UARTs use two)
• No acknowledgement that the data has been successfully received
(I2C has this)
• No form of error checking like the parity bit in UART
• Only allows for a single master
GPIO Programming
• RPi.GPIO
• GPIOZERO
Polarity- longer leg- +ve
Shorter one- -ve
Python Program- LED
GOPIZERO
Turn an LED on and off
repeatedly:

from gpiozero import LED


from time import sleep
red = LED(17)
Alternative Method:
while True:
from gpiozero import LED
red.on() from signal import pause
sleep(1)
red = LED(17)
red.off()
red.blink()
sleep(1)
pause()
Button
Check if a Button is
pressed:
from gpiozero import Button
from signal import pause
def say_hello():
print("Hello!")
button = Button(2)
button.when_pressed = say_hello
pause()
from gpiozero import Button

button = Button(2)

while True:
if button.is_pressed:
print("Button is pressed")
else:
print("Button is not pressed")
Turn on an LED when a Button is pressed:
from gpiozero import LED, Button
from signal import pause

led = LED(17)
button = Button(2)

button.when_pressed = led.on
button.when_released = led.off

pause()
from gpiozero import LED, Button
from signal import pause

led = LED(17)
button = Button(2)

led.source = button

pause()
Camera Modules
Video Recording
END
IoT AND M2M
UNIT -III

G Bhaskar Phani Ram


Email:[email protected]
VARDHAMAN COLLEGE OF
ENGINEERING
Shamshabad, Hyderabad – 501218, India.
Contents
 IoT AND M2M:
 Introduction
 M2M
 Difference between IoT and M2M
 SDN and NFV for IoT
 IoT System Management with NETCONF- YANG-Need
for IoT Systems Management
 SNMP
 Network Operator Requirements
 NETCONF, YANG,
 IoT Systems Management with NETCONF-YANG
Introduction
 The term which is often used synonymously with IoT is
Machine to Machine(M2M)
 This Module mainly focuses on some of the similarities
between IoT and M2M.
Machine-to-Machine (M2M)
 Machine-to-Machine (M2M) refers to networking of machines (or
devices) for the purpose of remote monitoring and control and data
exchange.
Contd..
 An M2M area network comprises of machines( or M2M nodes) which
have embedded network modules for sensing, actuation and
communication various communication protocols can be used for
M2M LAN such as ZigBee, Bluetooth, M-bus, Wireless M-Bus etc.,
These protocols provide connectivity between M2M nodes within an
M2M area network.
 To enable the communication between remote M2M are network,
M2M gateways are used.
M2M Gate Way
Difference between IoT and M2M
 Though both M2M and IoT involve networking of machines or
devices, they differ in the underlying technologies, system
architectures and types of applications
 Communication Protocols
 M2M and IoT can differ in how the communication between the
machines or devices happens.
 M2M uses either proprietary or non-IP based communication
protocols for communication within the M2M area networks.
 Machines in M2M vs Things in IoT
 The "Things" in IoT refers to physical objects that have unique
identifiers and can sense and communicate with their external
environment
 M2M systems, in contrast to IoT, typically have homogeneous
machine types within an M2M area network
Difference between IoT and M2M
 Hardware vs Software Emphasis
 While the emphasis of M2M is more on hardware with embedded
modules, the emphasis of IoT is more on software.
 Data Collection & Analysis
 M2M data is collected in point solutions and often in on-premises storage
infrastructure.
 In contrast to M2M, the data in IoT is collected in the cloud
 Applications
 M2M data is collected in point solutions and can be accessed by on-
premises applications such as diagnosis applications, service management
applications, and onpremisis enterprise applications.
 IoT data is collected in the cloud and can be accessed by cloud applications
such as analytics applications, enterprise applications, remote diagnosis and
management applications, etc.
SDN and NFV for IoT
SDN:
 Software-Defined Networking (SDN) is a networking architecture that separates
the control plane from the data plane and centralizes the network controller.
 The below Figure shows the conventional network architecture built with a
specialized hardware(switches,routers etc.,)
Limitations of conventional network
architecture
 Complex Network Devices: Complex networks are getting
increasingly complex with more and more protocols being
implemented to improve link speeds and reliability.
 Management Overhead: Network Managers find it increasingly
difficult to manage multiple network devices and interfaces from
multiple vendors.
 Limited Scalability: The Analysis of computing environments
require highly scalable and network architectures, becoming
increasingly difficult with conventional networks.
SDN Architecture:
Key elements of SDN
 Centralized Network Controller
 With decoupled control and data planes and centralized network
controller, the network administrators can rapidly configure the
network
 Programmable Open APIs
 SDN architecture supports programmable open APIs for interface
between the SDN application and control layers (Northbound
interface).
 Standard Communication Interface
 SDN architecture uses a standard communication interface between
the control and infrastructure layers (Southbound interface)
Network Function Virtualization(NFV)
 Network Function Virtualization (NFV) is a technology that leverages
virtualization to consolidate the heterogeneous network devices onto
industry standard high volume servers, switches and storage.
 NFV is complementary to SDN as NFV can provide the infrastructure on
which SDN can run.
Key elements of NFV:
 Virtualized Network Function(VNF):
 VNF is a software implementation of a network function which is
capable of running over the NFV Infrastructure (NFVI).
 NFV Infrastructure(NFVI):
 NFVI includes compute, network and storage resources that are
virtualized.
 NFV Management and Orchestration:
 NFV Management on all virtualization-specific management tasks
 Orchestration is the automated configuration, management, and
coordination of computer systems, applications, and services
IoT System Management with
NETCONF- YANG
G Bhaskar Phani Ram
Email:[email protected]
VARDHAMAN COLLEGE OF ENGINEERING
Shamshabad, Hyderabad – 501218, India.
Need for IoT Systems Management
 Managing multiple devices within a single system requires advanced
management capabilities
1. Automating Configuration : IoT system management
capabilities can helpin automating the system configuration.
2. Monitoring Operational & Statistical Data : Management
systems can help in monitoring opeartional and statistical data of a
system. This data can be used for fault diagnosis or
prognosis(Medical Condition).
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.
Contd..
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 & Reusing Configurations : Management
systems which have the capability of retrieving
configurations from devices can help in reusing the
configurations for other devices of the same type.
Simple Network Management Protocol(SNMP)
Contd..
 NMS executes SNMP commands to monitor and configure the
managed device.
 The Managed Device contains MIB which has all the information of
the device attributes to be managed.
 The SNMP agent runs on the device.
Limitations of SNMP
1. SNMP is stateless in nature and each SNMP request contains all the
information to process the request. The application needs to be
intelligent to manage the device.
2. SNMP is a connectionless protocol which uses UDP as the
transport protocol, making it unreliable as there was no support for
acknowledgement of requests.
3. It is difficult to differentiate between configuration and state data in
MIBs.
4. Retrieving the current configuration from a device can be difficult
with SNMP.
5. Earlier versions of SNMP did not have strong security features.
Network Operator Requirements
 Ease of use: From the operators point of view, Ease of use is the
key requirements for any network management topology.
 Distinction between configuration and state data
 Fetch configuration and state data separately
 Configuration of the network as a whole: It is possible for
operators to configure the network as a whole rather than individual
devices.
 Configuration transactions across devices: Configuration
transactions across multiple devices must be supported
 Dump and restore configurations: It is possible to Dump
configurations from devices and restore configurations from devices
 Configuration validation: It is possible to validate
configurations.
Contd..
 Configuration database schemas: There is a need for
standardized database schemas or data models across operators.
 Comparing configurations: Devices should not arbitrarily
reorder data, so that it is possible to compare configurations.
 Role-based access control: Devices should support Role-based
access control model, so that a user is given the minimum access
necessary to perform a required task.
 Consistency of access control lists: It is possible to do
Consistency checks of access control across devices.
 Multiple configuration sets: It is possible to support Multiple
configuration sets of devices
 Support for both data-oriented and task oriented access
control: SNMP supports only data-oriented access control
NETCONF: Network Configuration
 It is Network Configuration Protocol
 A session based network management protocol
 Allows retrieving state or configuration data and manipulating data
on network devices
 It is a Layered Architecture
NETCONF
NETCONF RPC Commands
NETCONF
YANG
YANG MODULE Example
YANG Node Types
IoT Systems Management with NETCONF-
YANG
Unit-4

IoT Physical Servers, Cloud


Offerings
Introduction to Cloud Storage Models
and Communication APIs
• The Internet of Things (IoT) involves the internet-
connected devices that we use to perform the
processes 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.
Characteristics
• First, the cloud computing of IoT is an on-demand
self service, meaning it‘s there when you need it.
• Second, the cloud computing of IoT involves
broad network access, meaning it offers several
connectivity options.
• 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.
• Fourth, cloud computing features rapid
elasticity, meaning users can readily scale the
service to their needs.
• Finally, the cloud computing of IoT is a
measured service, meaning you get what you
pay for.
• No maintenance
• Security
Service models
• Software as a service (SaaS),
• Platform as a service (PaaS), and
• Infrastructure as a service (IaaS).
Deployment models
• private cloud
• public cloud
• community cloud
Three basic types of APIs : local, web and program.
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 API form.

2. Web APIs are designed to represent widely used resources like HTML
pages and are accessed 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 interfaces
doesn't save any data internally between requests. As such, requests
from many users can be intermingled as they would be on theinternet.

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
• Infrastructure-as-a-Service (IaaS) IoT/Clouds: These services provide the
means for accessing sensors and actuator in the cloud. The associated
business model involves the IoT/Cloud provide 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.
• 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
• Software-as-a-Service (SaaS) IoT/Clouds: SaaS IoT services are the ones
enabling their uses to access complete IoT-based software applications
through the cloud, on-demand and in a pay-as-you-go fashion.
WAMP Protocol
Unit 5
IoT Physical Servers, Cloud
Offerings
Content
• Introduction to Cloud Storage Models
• Communication API
• WAMP: AutoBahn for IoT
• Xively Cloud for IoT
• Python Web Application Framework:
Djanjo
• Amazon Web Services for IoT
• SkyNet IoT Messaging Platform.
Introduction to Cloud StorageModels
• Popular Models are
• Amazon Web Service
(AWS)
• Xively Cloud (PAAS)
Communication API
• Cloud Models are relied on Communication API
• Communication API facilitate data transfer, control
information transfer from application to cloud, one service
to another
• It also exist in the form of Communication Protocols
• It supports RPC, PUBSUB and WAMP
• Eg. Popular API is RESTful API (communication in cloud
model)
• Django web framework is used to implement
Communication API
WAMP: AutoBahn forIoT
• WAMP : Web Application Messaging Protocol
• Mainly used in cloud storage model for IoT & other messaging services
• WAMP is a routed protocol, with all components connecting to a WAMP
Router,
where the WAMP Router performs message routing between the component
• It is protocol for Web Socket (PUBSUB based protocol) : uses RPC
Messaging Pattern
• Some Important Key Terminologies
• Transport
• Session
• Clients (Publisher & Subscriber)
• Router
• Broker
• Dealer
• Application Code
WAMP for IoT

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


WebSocket which provides publish–subscribe and remote procedure
call (RPC) messaging patterns.

Book website: http://www.internet-of-things-book.com Bahga & Madisetti, © 2015


WAMP – Concepts
• Transport: Transport is a channel that connects two peers.
• Session: Session is a conversation between two peers that runs over a transport.
• Client: Clients are peers that can have one or more roles.
• In the publish–subscribe model, the Client can have the following roles:
– Publisher: Publisher publishes events (including payload) to the topic maintained by the Broker.
– Subscriber: Subscriber subscribes to the topics and receives the events including the payload.
• In the RPC model, the Client can have the following roles:
– Caller: Caller issues calls to the remote procedures along with call arguments.
– Callee: Callee executes the procedures to which the calls are issued by the Caller and returns the results to
the Caller.
• Router: Routers are peers that perform generic call and event routing.
• In the publish–subscribe model, the Router has the role of a Broker.
– Broker: Broker acts as a Router and routes messages published to a topic to all the subscribers subscribed
to the topic.
• In the RPC model, the Router has the role of a Dealer.
– Dealer: Dealer acts a router and routes RPC calls from the Caller to the Callee and routes results from the
Callee to the Caller.
• Application code: Application code runs on the Clients (Publisher, Subscriber, Callee or Caller).
Book website: http://www.internet-of-things-book.com Bahga & Madisetti, © 2015
Xively Cloud Services™
Commercial Platform as a Service for the Internet of Things

• Supports hundreds of platforms, millions of


gateways and billions of smart devices

• Comprehensive and secure infrastructure


services
• Online development tools and dev center
• Best of breed approach

Built on LogMeIn’s Gravity platform connecting


255+ m devices for 55+ m users
Xively …Contd…
• Xively is an IoT Cloud Platform
• It is an enterprise platform for building, managing, and
deriving business value from connected products.
• It also provides the cloud base API with an SDK
• It supports platforms and technologies like Android, Arduino,
C etc.
• Xively is a PaaS (Platform as a Service) which exposes its
service via RESTful API
• It supports messaging service based on MQTT
Case Study: “Smart Plant System“[3]
Details
• This IoT project uses Arduino Uno and a set of sensors:
• DHT11: Temperature and humidity sensor
• TEMT6000: Light intensity sensor
• YL-38 + YL-69: Soil moisture sensor
• We want to send all values read from these sensors to
Xively and create a dashboard so we can monitor these
parameters.
• Code : Download
Results by Xively
Amazon EC2 (Elastic Compute
Cloud) Python Example
• Boto is a Python package that provides interfaces to Amazon Web
Services (AWS)
#Python program for launching an EC2 instance
• In this example, a connection to EC2 import boto.ec2
service is first established by calling the from time import sleep
boto.ec2.connect_to_region function. ACCESS_KEY="<enter access
key>" SECRET_KEY="<enter
secret key>"
• The EC2 region, AWS access key and AWS
secret key are passed to this function. After REGION="us-east-1"
AMI_ID = "ami-
connecting to EC2 , a new instance is d0f89fb9"
launched using the conn.run_instances EC2_KEY_HANDLE = "<enter key
function. handle>"
INSTANCE_TYPE="t1.micro"
• The AMI-ID, instance type, EC2 key SECGROUP_HANDLE="default"
handle and security group are passed to
this function. conn = boto.ec2.connect_to_region(REGION,
aws_access_key_id=ACCESS_KEY,
aws_secret_access_key=SECRET_KEY)

reservation = conn.run_instances(image_id=AMI_ID,
key_name=EC2_KEY_HANDLE,
instance_type=INSTANCE_TYPE,
Book website: http://www.internet-of-things-book.com security_groups = [ Bahga & Madisetti, © 2015
Amazon AutoScaling – Python
Example #Python program for creating an AutoScaling group (code
• AutoScaling Service excerpt)
import boto.ec2.autoscale
• A connection to the AutoScaling service is first :
established by calling the print "Connecting to Autoscaling Service"
boto.ec2.autoscale.connect_to_region function. conn =
boto.ec2.autoscale.connect_to_region(REGION,
aws_access_key_id=ACCESS_KEY,
• Launch Configuration aws_secret_access_key=SECRET_KEY)
• After connecting to the AutoScaling service, a new
launch configuration is created by calling print "Creating launch configuration"
conn.create_launch_con f iguration. Launch
configuration contains instructions on how to launch lc = LaunchConfiguration(name='My-Launch-Config-2',
new instances including the AMI-ID, instance type, image_id=AMI_ID,
security groups, etc. key_name=EC2_KEY_HAND

• AutoScaling Group LE,

• After creating a launch configuration, it is then instance_type=INSTANCE_T


associated with a new AutoScaling group. The
AutoScaling group is created by calling YPE,
conn.create_auto_scaling_group. There are settings security_groups = [
for the AutoScaling group such as the maximum and SECGROUP_HANDLE, ])
minimum number of instances in the group, the conn.create_launch_configuration(lc)
launch_config=lc, min_size=1,
launch configuration, availability zones, optional load connection=conn)
max_size=2,
balancer to use with the group, etc. print "Creating auto-scaling group"
conn.create_auto_scaling_group(
Book website: http://www.internet-of-things-book.com ag)
Amazon AutoScaling – Python
Example
• AutoScaling #Creating AutoScaling policies

• After creating an AutoScaling group, the policies


Policies scale_up_policy = ScalingPolicy(name='scale_up',
for adjustment_type='ChangeInCapaci
scaling up and scaling down are defined.
ty', as_name='My-Group',
• In this example, a scale up policy with adjustment
type ChangeInCapacity and scaling_ad justment scaling_adjustment=1,

= 1 is defined. cooldown=180)
• Similarly, a scale down policy with adjustment
scale_down_policy =
type ChangeInCapacity and scaling_ad
justment = −1 is defined. ScalingPolicy(name='scale_down',

adjustment_type='ChangeInCapacity'
scaling_adjustment=-
,1,
cooldown=180) as_name='My-Group',

conn.create_scaling_policy(scale_up_policy
)
conn.create_scaling_policy(scale_down_pol
icy)
Book website: http://www.internet-of-things-book.com Bahga & Madisetti, © 2015
Amazon AutoScaling – Python
Example #Connecting to CloudWatch
• CloudWatch cloudwatch = boto.ec2.cloudwatch.connect_to_region(REGION,
aws_access_key_id=ACCESS_KE
• With the scaling policies defined, the next step is
Alarms Y,
aws_secret_access_key=SECRET
to create Amazon CloudWatch alarms that _KEY)
trigger these policies. alarm_dimensions = {"AutoScalingGroupName": 'My-Group'}
• The scale up alarm is defined using the #Creating scale-up alarm
CPUUtilization metric with the Average statistic scale_up_alarm = MetricAlarm(
and threshold greater 70% for a period of 60 sec. name='scale_up_on_cpu',
namespace='AWS/EC2',
The scale up policy created previously is metric='CPUUtilization', statistic='Average',
associated with this alarm. This alarm is triggered comparison='>', threshold='70',
period='60', evaluation_periods=2,
when the average CPU utilization of the instances alarm_actions=[scale_up_policy.policy_a
in the group becomes greater than 70% for more rn], dimensions=alarm_dimensions)
than 60 seconds. cloudwatch.create_alarm(scale_up_alarm)

• The scale down alarm is defined in a similar #Creating scale-down alarm


manner with a threshold less than 50%. scale_down_alarm = MetricAlarm(
name='scale_down_on_cpu',
namespace='AWS/EC2', metric='CPUUtilization',
statistic='Average', comparison='<',
threshold='40',
period='60', evaluation_periods=2,
alarm_actions=[scale_down_policy.policy_a
Book website: http://www.internet-of-things-book.com rn], dimensions=alarm_dimensions)
Bahga & Madisetti, © 2015
Amazon S3 (Simple Storage
Service) Python Example
• In this example, a connection to the S3 service is first established by calling the
boto.connect_s3
function.
• The
path upload_to_s3_bucket_path function uploads the file to the S3 bucket specified at the
# Python program for uploading a file to an S3 bucket
.specified import boto.s3

conn =
boto.connect_s3(aws_access_key_id='<enter>',
aws_secret_access_key='<enter>')

def percent_cb(complete,
total): print ('.')

def upload_to_s3_bucket_path(bucketname, path,


filename): mybucket =
conn.get_bucket(bucketname)
fullkeyname=os.path.join(path,filename)
num_cb=1 key = mybucket.new_key(fullkeyname)
0) key.set_contents_from_filename(filename,
cb=percent_cb,

Book website: http://www.internet-of-things-book.com Bahga & Madisetti, © 2015


Amazon RDS (Relational Database
Service) Python Example
#Python program for launching an RDS instance (excerpt)
• In this example, a connection to the RDS import boto.rds

service is first established by calling the ACCESS_KEY="<enter>"


SECRET_KEY="<enter>"
boto.rds.connect_to_region function. REGION="us-east-1"
INSTANCE_TYPE="db.t1.mi
• The RDS region, AWS access key and AWS cro" ID = "MySQL-db-
instance-3" USERNAME =
secret key are passed to this function. 'root'
• After connecting to the RDS service, the PASSWORD =
'password' DB_PORT
conn.create_dbinstance function is called to = 3306
DB_SIZE = 5
launch a new RDS instance. DB_ENGINE = 'MySQL5.1'
DB_NAME = 'mytestdb'
• The input parameters to this function include SECGROUP_HANDLE="def
ault"
the instance ID, database size, instance type,
database username, database password, #Connecting to RDS
conn =
database port, database engine (e.g., boto.rds.connect_to_region(REGION,
MySQL5.1), database name, security groups, aws_access_key_id=ACCESS_KEY,
aws_secret_access_key=SECRET_KE
etc. Y)

Book website: http://www.internet-of-things-book.com #Creating an RDS instance Bahga & Madisetti, © 2015
Amazon DynamoDB –Non Relational
Databases Python Example
# Python program for creating a DynamoDB table (excerpt)
• In this example, a connection to the import boto.dynamodb

DynamoDB service is first established by ACCESS_KEY="<ent


er>"
calling boto.dynamodb.connect_to_region. SECRET_KEY="<ent
er>" REGION="us-
• After connecting to the DynamoDB service, a east-1"
schema for the new table is created by calling #Connecting to DynamoDB
conn.create_schema. conn =
boto.dynamodb.connect_to_region(REGION,
• The schema includes the hash key and range aws_access_key_id=ACCESS_KEY,
aws_secret_access_key=SECRET_KEY)
key
names and types. table_schema =
conn.create_schema(
• A DynamoDB table is then created by calling hash_key_name='msgid',
hash_key_proto_value=str,
the conn.create_table function with the table range_key_name='date',
range_key_proto_value=str
schema, read units and write units as input )
parameters.
#Creating table with schema
table =
conn.create_table(
name='my-test-table',
Book website: http://www.internet-of-things-book.com schema=table_sche Bahga & Madisetti, © 2015
Python Packages of
Interest
• 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 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 ordered lists of values (e.g., a Python list).
• XML
• XML (Extensible Markup Language) is a data format for structured document interchange. The Python minidom
library provides a minimal implementation of the Document Object Model interface and has an API similar to that in
other languages.
• HTTPLib & URLLib
• HTTPLib2 and URLLib2 are Python libraries used in network/internet programming.
• SMTPLib
• Simple Mail Transfer Protocol (SMTP) is a protocol which handles sending email and routing email between mail
servers. The Python SMTPLib module provides an SMTP client session object that can be used to send email.
• NumPy
• NumPy is a package for scientific computing in Python. NumPy provides support for large multi-dimensional
arrays and matrices.
• Scikit-learn
• Scikit-learn is an open source machine learning library for Python that provides implementations of various
machine learning algorithms for classification, clustering, regression and dimension reduction problems.

Book website: http://www.internet-of-things-book.com Bahga & Madisetti, © 2015


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 separation of
the data model from the business rules and the user interface.
• Django provides a unified API to a database backend.
• Thus, web applications 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 web templating system and a regular-
Bookexpression- based URL dispatcher.
website: http://www.internet-of-things-book.com Bahga & Madisetti, © 2015
Django Architecture

• Django uses a Model–Template–View (MTV) framework.

• 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 of data.
• Template
• In a typical Django web application, the template is simply an HTML page with a few extra placeholders.
Django’s template language can be used to create various forms of text files (XML, email, CSS,
Javascript, CSV, etc.).
• View
• The view ties the model to the template. The view is where you write the code that actually generates the
web pages. View determines what data is to be displayed, retrieves the data from the database and passes
the data to the template.

Book website: http://www.internet-of-things-book.com Bahga & Madisetti, © 2015


Django Project Layout
django-admin.py startproject
<PROJECT_ROOT>
manage.py
<PROJECT_DIR>
init .py settings.py urls.py
wsgi.py
settings.py
• Defines settings used by a Django application
• Referenced by wsgi.py to bootstrap the project loading
• Techniques for managing dev vs prod settings:
• Create settings-dev.py and settings-prod.py and use symlink to link
settings.py to the correct settings
• Factor out common settings into base-settings.py and import.
Use conditionals to load correct settings based on DEBUG or
other setting
Sample Settings…

DEBUG = True TEMPLATE_DEBUG = True


ALLOWED_HOSTS = []
# Application definition INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.messages',
'django.contrib.staticfiles',
)
Django Apps
• Reusable modules
• django-admin.py startapp <app_name>
• Creates stub layout:
<APP_ROOT>
admin.py models.py
templates (directory)
tests.py views.py urls.py
Django Models
• Defined in models.py
•Typically inherit from
django.db.models.Model Example Model:
from django.db import
models class
TestModel(models.Model):
name = models.CharField(max_length
= 20) age = models.IntegerField()
Models (cont’d)
• Default is to set NOT NULL on all fields. Override by
adding null = True to field definition:
name = models.CharField(max_length=20, null = True)
• Relationships defined through special field
types: models.OneToOneField(model)
models.ForeignKey(model)
models.ManyToManyField(mod
el)
Models (cont’)
• Need Nulls in a Boolean Field? Use
models.NullBooleanField()
• Set Default value with “default”:
count = models.IntegerField(default = 0)
• Use a inner Meta class to define additional options, especially
useful for abstract classes:
class
TestModel(models.Model):
class Meta:
abstract = True
Model Methods
• model.save(self, *args, **kwargs)
• model.delete(self, *args, **kwargs)
• model.get_absolute_url(self)
• model. str (self) [Python 3]
model. unicode (self) [Python
2]
• Override with super(MODEL, self).save(*args,
**kwargs)
Activating a Model
• Add the app to INSTALLED_APPS in
settings.py
• Run manage.py validate
• Run manage.py syncdb
• Migrations
• Write custom script or manually handle
migrations
• Use South
Selecting Objects
• Models include a default manager called objects
• Manager methods allow selecting all or some
instances Question.objects.all()
Question.objects.get(pk = 1)
Use try block, throws DoesNotExist exception if no
match Question.objects.filter(created_date lt = ‘2014-
01-01’)
• Returns QuerySet
Introspecting Legacy Models
• manage.py inspectdb
• Cut and paste generated code into models.py –
Easy!!
Full Sample
from django.db import models from
datetime import datetime
class TimestampedModel(models.Model):
created_datetime = models.DateTimeField()
updated_datetime = models.DateTimeField()
def save(self, *args, **kwargs): if self.id is
None:
self.created_datetime = datetime.now() updated_datetime =
datetime.now() super(TimestampedModel,self).save(*args,
**kwargs)
class Meta: abstract = True
Full Sample (cont’d)
class Question(TimestampedModel):
question_text = models.CharField(max_length =
200)
def str (self):
return self.question_text
Function vs. Class Views
• Django allows two styles of views – functions or class based
views
• Functions – take a request object as the first parameter and
must return a response object
• Class based views – allow CRUD operations with minimal
code.
Can inherit from multiple generic view classes (i.e. Mixins)
Sample – Viewing a List of Questions
• Function based:
from .models import Question
from django.shortcuts import
render_to_response

def question_list(request):
questions =
Question.objects.all()
return
render_to_response(‘question_list.html’, {
‘questions’:questions})
Quick CRUD Operations with GenericViews
• ListView
• UpdateView
• CreateView
• If Model is specified, automagically creates a matching
ModelForm
• Form will save the Model if data passes validation
• Override form_valid() method to provide custom logic (i.e
sending email or setting additional fields)
Sample – As Class Based View
from .models import Question
from django.views.generic import
ListView

class
QuestionList(ListView):
model = Question
context_object_name = ‘questions’
Django Templates
• Very simple syntax:
variables =
{{variable_name}}
template tags = {%tag%}
• Flexible – can be used to render html, text, csv, email, you
name it!
• Dot notation – template engine attempts to resolve by
looking for matching attributes, hashes and methods
Question List Template
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>List of Questions</title>
</head>
<body>
{%if questions%}
<ul>
{%for q in questions%}
<li>{{q.question_text}}</li>
{%endfor%}
</ul>
{%else%}
<p>No questions have been
defined</p>
{%endif%}
</body>
</html>
urls.py
• Defines routes to send urls to various views
• Can use regular expressions
• Extract parameters from a url and pass to the view as a
named parameter:
r(‘^question/(?P<question_id>\d+)/$’,’views.question_det
ail’)
• Extensible – urls.py can include additional url files from
apps: r(‘^question/’,include(question.urls))
Hooking up the QuestionList
from django.conf.urls import patterns, url,
include urlpatterns = patterns(‘’,
(r’^questions/$’,’views.QuestionList’)
)
OR:
from django.conf.urls import
patterns from views import
QuestionListView
urlpatterns = patterns(‘’,
(r’^questions/$’,’views.QuestionList.as_vie
w())
)
Forms in Django
• django.forms provides a class to build HTML forms and
validation. Example:
from django import forms
class EditQuestionForm(forms.Form):
question_text = forms.CharField(max_length = 200)

• Often redundant when creating forms that work on a single


model
ModelForms
• Automatically generate a form from a model.
• Handles saving a bound model
• Can specify fields to be included or excluded in the
form
• Sample:
from django.forms import
ModelForm from .models import
Question
class
QuestionForm(ModelForm):
class Meta:
model = Question
fields = [‘question_text’]
Using a ModelForm
• Create an instance of an empty
form: form = QuestionForm()
• Create a form to update an existing instance of a
model: question = Question.objects.get(pk = 1)
form = QuestionForm(instance = question)
• Pass the form into the template and use the form methods to
render the form:
form.as_p
form.as_ul
form.<field_name
>
form.<field_name>.errors
Request & Response
• Request object encapsulate the request and provide access to a
number of attributes and methods for accessing cookies, sessions,
the logged in user object, meta data (i.e environment variables),
• Response objects are returned to the browser. Can set content
type, content length, response does not
have to return HTML or a rendered template
• Special response types allow for common
functionality: HttpResponeRedirect
Http404
HttpStreamingRespon
se
Django Extras
• CRSF Middleware – enabled by default. Include
template tag in all forms:
{%csrf_token%}
• Authentication
• Caching
• Sessions
• Messages
• Email
• Logging
Authentication
• Django’s out of the box Auth system uses database
authentication.
• Changed extensively in Django 1.6 to allow custom User
objects.
• AUTHENTICATION_BACKENDS setting in settings.py allows
overriding how User objects are authenticated
• If using the Authentication middleware and
context_processors the current user is available to code as
request.user and {{user}} is defined in all templates
Auth Decorators
• Live in django.contrib.auth.decorators
• login_required
@login_required
def function_view(request):
….
• user_passes_test (can be used with lambda functions for real
power)

@user_passes_test(lambda u:
u.is_staff) def
function_view(request):

• has_perms – test for user permissions
Decorating CBVs
• Decorator is applied to the dispatch method
• Must be converted to a method_decorator – use
django.utils.decorators.method_decorator
function:
class MyView(ListView):

@method_decorator(login_requir
ed) def dispatch(self, *args,
**kwargs):
super(MyView,self).dispatch(*args, **kwargs)
Custom Auth Backend for theBubble
Sending Email
• django.core.mail includes functions and classes for handling
email
• Set EMAIL_HOST in settings.py to outgoing mailserver
• Import send_mail for simple mail:
send_mail(subject, message, from,
to_emails)
• Use django.template.render_to_string to format a message
using a template
• Use EmailMultiAlternatives to create a text message and
attach a html version as well.
Unit-5
Domain Specific IoTs
Applications
• Home
• Cities
• Environment
• Energy systems
• Retail
• Logistics
• Industry
• Agriculture
• Health and lifestyle
Home Automation
• Smart Lighting

• Smart Appliances

• Intrusion Detection

• Smoke/Gas Detectors
Smart Lighting
 Helps in saving energy by adapting the lighting to the ambient conditions
and switching on/off or diming the light when needed.

 Key enabling technologies for smart lighting include solid state lighting and
IP-enabled lights.

 Smart lighting solutions for home achieve energy saving by sensing the
human movements and their environments and controlling the lights
accordingly.

 Wireless –enabled and internet connected lights can be controlled


remotely from IoT applications such as a mobile or web application
Smart Appliances
 Smart appliances make the management easier and provide status
information of appliances to the users remotely. E.g: smart washer/dryer
that can be controlled remotely and notify when the washing/drying cycle
is complete.

 Open Remote is an open source automation platform for smart home and
building that can control various appliances using mobile and web
applications.

 It comprises of three components: -


1. a Controller manages scheduling and runtime integration between
devices.
2. a Designer  allows to create both configuration for the controller and
user interface designs.
3. Control Panel  allows to interact with devices and control them.
Intrusion Detection
 Home intrusion detection systems use
security cameras and sensors to detect
intrusions and raise alerts.
 The form of the alerts can be in form:
1. SMS
2. Email
3. Image grab or a short video clip as an email
attachment
Smoke / Gas Detectors
• Smoke detectors are installed in homes and
buildings to detect smoke that is typically an early
sign of fire.
• It uses optical detection, ionization or air sampling
techniques to detect smoke
•Alerts raised by smoke detectors can be in the
form of signals to a fire alarm system.
• Gas detector can detect the presence of harmful
gases such as carbon monoxide (CO), liquid
petroleum gas (LPG), etc.
Cities
1. Smart Parking
2. Smart Lighting for Road
3. Smart Road
4. Structural Health Monitoring
5. Surveillance
6. Emergency Response
Smart Parking
• Finding the parking space in the crowded city can be time consuming and
frustrating

• Smart parking makes the search for parking space easier and convenient
for driver.

• It can detect the number of empty parking slots and send the information
over the Internet to the smart parking applications which can be accessed
by the drivers using their smart phones, tablets, and in car navigation
systems.

• Sensors are used for each parking slot to detect whether the slot is empty
or not, and this information is aggregated by local controller and then sent
over the Internet to database.
Smart Lighting for Roads
 It can help in saving energy

 Smart lighting for roads allows lighting to be dynamically


controlled and also adaptive to ambient conditions.

 Smart light connected to the Internet can be controlled


remotely to configure lighting schedules and lighting intensity.

 Custom lighting configurations can be set for different


situations such as a foggy day, a festival, etc.
Smart Roads
• Smart Roads provides information on driving conditions, travel
time estimates and alerts in case of poor driving conditions,
traffic congestions and accidents.

• Such information can help in making the roads safer and help
in reducing traffic jams

• Information sensed from the roads can be communicated via


internet to cloud-based applications and social media and
disseminated to the drivers who subscribe to such
applications.
Structural Health Monitoring
• It uses a network of sensors to monitor the vibration levels
in the structures such as bridges and buildings.

• The data collected from these sensors is analyzed to assess


the health of the structures.

• By analyzing the data it is possible to detect cracks and


mechanical breakdowns, locate the damages to a structure
and also calculate the remaining life of the structure.

• Using such systems, advance warnings can be given in the


case of imminent failure of the structure.
Surveillance
• Surveillance of infrastructure, public transport and events in
cities is required to ensure safety and security.

• City wide surveillance infrastructure comprising of large


number of distributed and Internet connected video
surveillance cameras can be created.

• The video feeds from surveillance cameras can be


aggregated in cloud-based scalable storage solutions.

• Cloud-based video analytics applications can be developed


to search for patterns of specific events from the video
feeds.
Emergency Response
 IoT systems can be used for monitoring the critical infrastructure cities
such as buildings, gas, and water pipelines, public transport and power
substations.

 IoT systems for critical infrastructure monitoring enable aggregation and


sharing of information collected from lager number of sensors.

 Using cloud-based architectures, multi-modal information such as sensor


data, audio, video feeds can be analyzed I near real-time to detect adverse
events.

 The alert can be in the form :


1. Alerts sent to the public
2. Re-rerouting of traffic
3. Evacuations of the affected areas
Environment
1. Weather Monitoring
2. Air Pollution Monitoring
3. Noise Pollution Monitoring
4. Forest Fire Detection
5. River Flood Detection
Weather Monitoring
• It collects data from a number of sensor attached such
as temperature, humidity, pressure, etc and send the
data to cloud-based applications and store back-ends.
• The data collected in the cloud can then be analyzed
and visualized by cloud-based applications.
• Weather alert can be sent to the subscribed users from
such applications.
• Air Pi is a weather and air quality monitoring kit capable
of recording and uploading information about
temperature, humidity, air pressure, light levels, UV
levels, carbon monoxide, nitrogen dioxide and smoke
level to the Internet.
Air Pollution Monitoring
• IoT based air pollution monitoring system can
monitor emission of harmful gases by
factories and automobiles using gaseous and
meteorological sensors.

• The collected data can be analyzed to make


informed decisions on pollutions control
approaches.
Noise Pollution Monitoring
• Noise pollution monitoring can help in generating noise
maps for cities.

• It can help the policy maker in making policies to control


noise levels near residential areas, school and parks.

• It uses a number of noise monitoring stations that are


deployed at different places in a city.

• The data on noise levels from the stations is collected on


servers or in the cloud and then the collected data is
aggregate to generate noise maps.
Forest Fire Detection
• IoT based forest fire detection system use a
number of monitoring nodes deployed at
different location in a forest.

• Each monitoring node collects measurements on


ambient condition including temperature,
humidity, light levels, etc.

• Early detection of forest fires can help in


minimizing the damage.
River Flood Detection
• IoT based river flood monitoring system uses a
number of sensor nodes that monitor the
water level using ultrasonic sensors and flow
rate using velocity sensors.

• Data from these sensors is aggregated in a


server or in the cloud, monitoring applications
raise alerts when rapid increase in water level
and flow rate is detected.
Energy
1. Smart Grid
2. Renewable Energy Systems
3. Prognostics
Smart Grids
 Smart grid technology provides predictive information and
recommendation s to utilize, their suppliers, and their customers on how
best to manage power.
 Smart grid collect the data regarding :
1. Electricity generation
2. Electricity consumption
3. Storage
4. Distribution and equipment health data
 By analyzing the data on power generation, transmission and consumption
of smart grids can improve efficiency throughout the electric system.
Storage collection and analysis of smarts grids data in the cloud can help
in dynamic optimization of system operations, maintenance, and planning.
Cont.
 Cloud-based monitoring of smart grids data can improve
energy usage levels via energy feedback to users coupled with
real-time pricing information.

 Condition monitoring data collected from power generation


and transmission systems can help in detecting faults and
predicting outages.
Renewable Energy System
• Due to the variability in the output from renewable
energy sources (such as solar and wind), integrating
them into the grid can cause grid stability and
reliability problems.

• IoT based systems integrated with the transformer at


the point of interconnection measure the electrical
variables and how much power is fed into the grid

• To ensure the grid stability, one solution is to simply cut


off the overproductions
Prognostics
• IoT based prognostic real-time health management systems can predict
performance of machines of energy systems by analyzing the extent of
deviation of a system from its normal operating profiles.

• In the system such as power grids, real time information is collected using
specialized electrical sensors called Phasor Measurement Units (PMU)

• Analyzing massive amounts of maintenance data collected from sensors in


energy systems and equipment can provide predictions for impending
failures.

• OpenPDC is a set of applications for processing of streaming time-series


data collected from Phasor Measurements Units (PMUs) in real-time.
Retail
1. Inventory Management

2. Smart Payments

3. Smart Vending Machines


Inventory Management
 IoT system using Radio Frequency Identification (RFID) tags
can help inventory management and maintaining the right
inventory levels.

 RFID tags attached to the products allow them to be tracked


in the real-time so that the inventory levels can be
determined accurately and products which are low on stock
can be replenished.

 Tracking can be done using RFID readers attached to the retail


store shelves or in the warehouse
Smart Payments
 Smart payments solutions such as contact-less payments powered
technologies such as Near field communication (NFC) and Bluetooth.

 NFC is a set of standards for smart-phones and other devices to


communicate with each other by bringing them into proximity or by
touching them

 Customer can store the credit card information in their NFC-enabled


smart-phones and make payments by bringing the smart-phone near the
point of sale terminals.

 NFC maybe used in combination with Bluetooth, where NFC initiates initial
pairing of devices to establish a Bluetooth connection while the actual
data transfer takes place over Bluetooth.
Smart Vending Machines
 Smart vending machines connected to the Internet allow remote
monitoring of inventory levels, elastic pricing of products, promotions, and
contact-less payments using NFC.

 Smart-phone applications that communicate with smart vending


machines allow user preferences to be remembered and learned with
time.
 E.g: when a user moves from one vending machine to the other and pair
the smart-phone, the user preference and favorite product will be saved
and then that data is used for predictive maintenance.

 Smart vending machines can communicated each others, so if a product


out of stock in a machine, the user can be routed to nearest machine

 For perishable items, the smart vending machines can reduce the price as
the expiry date nears.
Logistics

a) Route generation & scheduling

b) Fleet Tracking

c) Shipment Monitoring

d) Remote Vehicle Diagnostics


Route generation & scheduling
 Modern transportation systems are driven to provide new services to
stakeholders

 The new services are :


1. Advance route guidance
2. Dynamic vehicle routing
3. Anticipating customer demands for picking up and delivery problem

 It can generate end-to-end routes using combination of route patterns and


transportation modes and feasible schedules based on the availability of
vehicles.

 IoT based systems backed by cloud can provide fast response to route
generation queries and scale up to serve a large transportation network
Fleet Tracking
Use GPS to track locations of vehicles in real-time.

Cloud-based fleet tracking systems can be scaled up on demand to


handle large number of vehicles by sending alerts if needed.

The vehicle locations and routes data can be aggregated and analysed
for detecting Traffic congestions on routes, assignments and generation of
alternate routes and Supply chain optimization.

The system can analyze messages sent from vehicles to identify


unexpected incidents and differences between actual and planned data, so
that the remedial action can be taken.
Shipping Monitoring
 IoT based shipment monitoring systems allows to monitor the conditions
inside the container

 The systems use sensors such as temp, humidity, to monitor the


conditions and send data to cloud, where it can be analyzed to detect food
spoilage.

 The analysis and interpretation of data can enable more effective routing
decisions in real time

 It is possible to take remedial measures.


Remote Vehicle Diagnostics
• The systems can detect faults in the vehicles or warn of impending faults

• These diagnostic systems use on-board IoT devices for collecting data on
vehicle operations and status of various vehicle subsystems.

• Modern commercial vehicles support on-board diagnostic (OBD) standards


such as OBD-II

• OBD systems provide real-time data on status of vehicle sub-systems and


diagnostics trouble codes which allow rapidly identifying the faults in the
vehicles.
Agriculture
a) Smart Irrigation

b) Green House Control


Smart Irrigation
• Smart irrigation systems can improve crop yields while saving water

• The systems use IoT devices with soil moisture sensors to determine the
amount of moisture in the soil and release flow of water through the
irrigation pipes only when the moisture levels go below a predefined
threshold

• The system also collect the moisture level measurements on a server or in


the cloud where data can be analysed to plan the watering scheduling

• Cultivator’s rain cloud


Green House Control

• It controls temperature ,humidity, soil moisture , light and carbon dioxide


levels are monitored using sensors and climatological conditions are
controlled automatically using actuation devices

• IoT systems plays an important role in green house control and help in
improving productivity.

• The data collected from various sensors is stored on centralized servers or


in the cloud where analysis is performed to optimize the control strategies
and also correlate the productivity with different control strategies.
Industry
a) Machine diagnosis and prognosis

b) Indoor Air Quality Monitoring


Machine diagnosis and prognosis
• The system predict the performance of a machine by analyzing the
data on the current operating conditions and how much deviations
exist from the normal operating conditions

• It will determine the cause of machine fault

• Sensors in machines will monitor the operating conditions

• Case-based Reasoning (CBR) is a commonly used method that finds


solutions to new problems based on past experience
Indoor Air Quality Monitoring
• It is very important for health and safety of workers

• Harmful and toxic gases can cause serious health problems

• The system can help to monitor using various gas sensors

• Wireless sensor networks based IoT devices can identify the


hazardous zones , so that corrective can be taken to ensure
proper ventilation
Health and Life Style
a) Health & Fitness Monitoring

b) Wearable Electronics
Health & Fitness Monitoring
• Wearable IoT devices that allow continuous monitoring of
physiological parameters can help in continuous heath and
fitness monitoring

• The wearable devices can be belts , wrist-bands , etc.

• The providers can analyze the collected data to determine any


health conditions
Wearable Electronics
• Wearable electronics such as wearable gadgets and fashion
electronics provide various functions and features to assist us
in daily activities and making us live healthy lifestyle

• With smart watches , the users can search internet, play


audio/video files, make calls ,etc.

• Smart glasses allows user to take photos ,record videos ,etc


• Smart shoes monitor the walking or running speed
• Smart wrist bands can track the daily exercise and burnt
calories

• All these data visualize in your smart-phone by pairing it .

You might also like