SlideShare a Scribd company logo
1 of 291
20EC503PE - INTERNET OF THINGS
by
Dr.T.YUVARAJA
ASP/ECE
KNCET
IOT-T.YUVARAJA 1
20EC503PE - INTERNET OF THINGS
Unit-1
INTRODUCTION TO IoT
Internet of Things – characteristics- Physical
Design- Logical Design - IoT Enabling
Technologies - IoT Levels & Deployment
Templates - IoT Platforms Design Methodology.
IOT-T.YUVARAJA 2
Internet of Things
• Kevin Ashton Invented the Term
"Internet of Things"
3
IOT-T.YUVARAJA
Internet of Things(Definition)
• The Internet of Things (IoT) describes the
network of physical objects—―things‖—that
are embedded with sensors, software, and
other technologies for the purpose of
connecting and exchanging data with
other devices and systems over the
internet.
4
IOT-T.YUVARAJA
5
IOT-T.YUVARAJA
Characteristics of IoT
1) Dynamic & Self-Adapting
2) Self-Configuring
3) Interoperable Communication Protocols
4) Unique Identity
5) Integrated into Information Network
6
IOT-T.YUVARAJA
Characteristics of IoT
1)Dynamic & Self-Adapting
• surveillance camera
• It should be adaptable to work in different
conditions(Normal & Infrared)
• Different(dynamic) light situations (Day &
Night).
7
IOT-T.YUVARAJA
Characteristics of IoT
2)Self-Configuring
• setup the network
• Software upgrade
8
IOT-T.YUVARAJA
Characteristics of IoT
3)Interoperable Communication Protocols
• IoT allows different devices (different in architecture) to
communicate with each other as well as with different
network.
• For ex: MI Phone is able to control the smart AC and
smart TV of different manufacturer.
9
IOT-T.YUVARAJA
Characteristics of IoT
4)Unique Identity
• The devices which are connected to the
internet have unique identities
• i.e. IP address
10
IOT-T.YUVARAJA
Characteristics of IoT
5)Integrated into Information Network
• The IoT devices are connected to the network to
share some information with other connected
devices.
• The devices can be discovered dynamically in
the network by other devices.
• Eg: If a device has wifi connectivity then that will
be shown to other nearby devices having wifi
connectivity
11
IOT-T.YUVARAJA
12
IOT-T.YUVARAJA
Physical Design of IoT
• Things/Devices and protocols that are used to
build an IoT system.
• Things/Devices are called Node Devices and
every device has a unique identity that performs
remote sensing, actuating and monitoring work.
• Protocolsestablish communication between
the Node devices and servers over the internet.
13
IOT-T.YUVARAJA
Physical Design of IoT
• Things in IoT
• IoT Protocols
14
IOT-T.YUVARAJA
Things in IoT
Generic block diagram of an IoT Device
• An IoT device may consist of several
interfaces for connections to other
devices,both wired and wireless. 15
IOT-T.YUVARAJA
Things in IoT
IoT Device
Connectivity
 Processor
Audio/Video Interfaces
Input/Output interface
Memory Interfaces
Storage Interfaces
Graphics
16
IOT-T.YUVARAJA
Things in IoT
IoT Devices
17
IOT-T.YUVARAJA
Physical Design of IoT
IoT Protocols
18
IOT-T.YUVARAJA
IoT Protocols
1)Link Layer
2)Network/Internet Layer
3)Transport Layer
4)Application Layer
19
IOT-T.YUVARAJA
IoT Protocols
1)Link Layer Protocols:
802.3-Ethernet: IEEE802.3 is collection of wired Ethernet standards
 802.3  co-axial cable
 802.3i  copper twisted pair
 802.3j  fiber optic
 802.3ae  Ethernet over fiber
802.11-WiFi: IEEE802.11 is a collection of wireless LAN(WLAN)
communication standards.
 802.11a  5GHz band
 802.11b  2.4GHz band
 802.11g 2.4GHz band
 802.11n 2.4/5GHz band
 802.11ac 5GHz band
 802.11ad 60Ghzband
20
IOT-T.YUVARAJA
IoT Protocols
1) Link Layer Protocols:
802.16 - WiMax:
IEEE802.16 is a collection of wireless broadband
standards.
WiMax provide data rates from 1.5 Mb/s to 1Gb/s.
802.15.4- LR-WPAN:
IEEE802.15.4 is a collection of standards for Low
Rate Wireless Personal Area Network(LR-WPAN).
ZigBee
Provides data rate from 40kb/s to250kb/s.
2G/3G/4G-Mobile Communication:
Data rates from 9.6kb/s(2G) to up to100Mb/s(4G) 21
IOT-T.YUVARAJA
IoT Protocols
2)Network/Internet Layer Protocols:
• IPv4:
 Internet Protocol version 4
 32 bit address.
 Total= 232addresses
• IPv6:
 Internet Protocol version6
 uses 128 bit address
 Total= 2128 addresses
• 6LOWPAN:
 IPv6 over Low power Wireless Personal Area Network
 Operates in 2.4 GHz frequency range
 Data transfer 250 kb/s.
22
IOT-T.YUVARAJA
IoT Protocols
3) Transport Layer Protocols:
TCP:
Transmission Control Protocol
Connection oriented
Reliable (Guaranteed delivery)
Feedback(Acknowledgment)
UDP:
User Datagram Protocol
connectionless protocol
 Unreliable
No Feedback(No Acknowledgment)
23
IOT-T.YUVARAJA
IoT Protocols
4)Application Layer Protocols:
HTTP:
 Hyper Text Transfer Protocol
 Follow request- response model
 Stateless protocol.
CoAP:
 Constrained Application Protocol
 M2M applications
 Uses client- server architecture.
WebSocket:
 Allows full duplex communication over a single socket connection.
MQTT:
 Message Queue Telemetry Transport
 light weight messaging protocol
 publish-subscribe model.
 Uses client server architecture.
24
IOT-T.YUVARAJA
IoT Protocols
4)Application Layer Protocols:
XMPP:
 Extensible Message and Presence Protocol
 real time communication and streaming XML data between
network entities.
 Support client-server and server-server communication.
DDS:
 Data Distribution Service
 Device-to-device or machine-to-machine communication.
 Uses publish-subscribe model.
AMQP:
 Advanced Message Queuing Protocol
 Supports both point-to-point and publish-subscribe model.
25
IOT-T.YUVARAJA
Logical Design of IoT
1) IoT Functional Blocks
2) IoT Communication Models
3) IoT Communication APIs
26
IOT-T.YUVARAJA
Logical Design of IoT
IoT functional Blocks
27
IOT-T.YUVARAJA
IoT functional Blocks
• Device
• Communication
• Services
• Management
• Security
• Application
28
IOT-T.YUVARAJA
IoT functional Blocks
Device :
 An IoT system comprises of devices
 provide sensing, actuation, monitoring and control
functions.
Communication:
 Handles the communication for the IoT system.
Services:
 Device monitoring services
 Device control services
 Data publishing services
 Device discovery services
29
IOT-T.YUVARAJA
IoT functional Blocks
Management:
 provides various functions to govern the IoT system.
Security:
 secures the IoT system
 providing functions such as
Authentication
Authorization
Message and content integrity
Data security
Application:
 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. 30
IOT-T.YUVARAJA
IoT communication models
1) Request-Response communication model
2) Publish-subscribe communication model
3) Push-pull communication model
4) Exclusive-pair communication model
31
IOT-T.YUVARAJA
IoT communication models
1) Request-Response communication model
32
IOT-T.YUVARAJA
IoT communication models
2)Publish-subscribe communication model
33
IOT-T.YUVARAJA
IoT communication models
2)Publish-subscribe communication model
 It 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.
34
IOT-T.YUVARAJA
IoT communication models
3)Push-pull communication model
35
IOT-T.YUVARAJA
IoT communication models
3)Push-pull communication model
 Publishers push the data to queues and the consumers
pull the data from the queues.
 Publishers do not need to be aware of the consumers.
 Queues also act as a buffer
36
IOT-T.YUVARAJA
IoT communication models
4)Exclusive-pair communication model
37
IOT-T.YUVARAJA
IoT communication models
4)Exclusive-pair communication model
 Bi-directional, fully duplex communication model
 Once connection is set up it remains open until
the client send a request to close the connection.
 Client and server can send messages to each
other after connection setup.
38
IOT-T.YUVARAJA
IOT Communication APIs
1) REST-based Communication API
2) Web Socket based communication API
39
IOT-T.YUVARAJA
IOT Communication APIs
1)REST-based Communication API
Representational State Transfer (REST)
Request -Response communication model
40
IOT-T.YUVARAJA
IOT Communication APIs
1)REST-based Communication API
Client-server
Stateless
Cacheable
Layered system
Uniform interface
Code on demand
41
IOT-T.YUVARAJA
IOT Communication APIs
1)REST-based Communication API
42
IOT-T.YUVARAJA
IOT Communication APIs
1)REST-based Communication API
• Representational State Transfer (REST) is
a set of architectural principles by which
you can design web services and web
APIs.
• REST APIs follow the request –response
communication model.
43
IOT-T.YUVARAJA
IOT Communication APIs
2)Web Socket based communication API
44
IOT-T.YUVARAJA
IOT Communication APIs
2)Web Socket based communication API
• WebSocket APIs allow bidirectional, full duplex
communication between clients and servers.
• WebSocket APIs follow the exclusive pair
communication model.
 Websocket handshake
 WebSocket APIs reduce the network traffic and latency
 WebSocket is suitable for IoT applications that have low
latency or high throughput requirements.
45
IOT-T.YUVARAJA
Difference between REST and
Websocket:
46
IOT-T.YUVARAJA
IoT Enabling Technologies
1) Wireless sensor networks
2) Cloud computing
3) Big Data analytics
4) Embedded systems
5) Communication protocols
47
IOT-T.YUVARAJA
IoT Enabling Technologies
1) Wireless Sensor Networks(WSN)
WSN consists of a number of
1)End-nodes
2)Routers
3)coordinator
48
IOT-T.YUVARAJA
IoT Enabling Technologies
1) Wireless Sensor Networks(WSN)
• End Nodes sensors attached to them
• RouterRouting the data packets from end-
nodes to the coordinator.
• Coordinator collects the data from all the nodes.
• Coordinator also act as a gateway that connects
the WSN to the internet.
• ProtocolZigbee
49
IOT-T.YUVARAJA
IoT Enabling Technologies
1) Wireless Sensor Networks(WSN)
50
IOT-T.YUVARAJA
IoT Enabling Technologies
Example of WSNs:
Weather Monitoring system
Indoor Air Quality monitoring system
Soil Moisture Monitoring system
Surveillance systems
Health Monitoring systems
51
IOT-T.YUVARAJA
IoT Enabling Technologies
1) Wireless sensor networks
2) Cloud computing
3) Big Data analytics
4) Embedded systems
5) Communication protocols
52
IOT-T.YUVARAJA
IoT Enabling Technologies
2)Cloud Computing
cloud computing is the delivery of
computing services—including servers,
storage, databases, networking, software,
analytics, and intelligence—over the
Internet (―the cloud‖) to offer faster
innovation, flexible resources, and
economies of scale.
53
IOT-T.YUVARAJA
IoT Enabling Technologies
2)Cloud computing
54
IOT-T.YUVARAJA
IoT Enabling Technologies
2)Cloud computing
Cloud computing is the delivery of different
services through the Internet, including
data storage, servers, databases,
networking, and software.
Cloud-based storage makes it possible to
save files to a remote database and
retrieve them on demand.
55
IOT-T.YUVARAJA
IoT Enabling Technologies
2)Cloud computing
1) Infrastructure-as-a-Service(IaaS):
Example:Google Compute
2) Platform-as-a-Service(PaaS):
Example: Google App Engine
3) Software-as-a-Service (SaaS):
Example: Microsoft Office 365
56
IOT-T.YUVARAJA
IoT Enabling Technologies
1) Wireless sensor networks
2) Cloud computing
3) Big Data analytics
4) Embedded systems
5) Communication protocols
57
IOT-T.YUVARAJA
IoT Enabling Technologies
3)Big Data analytics
Big data refers to large amount of data.
It cannot be stored, processed and
analyzed using traditional database like
(Oracle, MySQL).
58
IOT-T.YUVARAJA
IoT Enabling Technologies
3)Big Data analytics
It involve several steps starting from
Data cleaning
Data munging
Data processing
Data visualization
59
IOT-T.YUVARAJA
IoT Enabling Technologies
3)Big Data analytics
• Sensor data weather monitoring stations.
• Machine sensor data Industrial and energy
systems
• Health and fitness data
• Data location and tracking of vehicles.
• Data retail inventory monitoring systems.
60
IOT-T.YUVARAJA
IoT Enabling Technologies
3)Big Data analytics
Characteristics:(3V)
1)Volume
2) Velocity
3)Variety
61
IOT-T.YUVARAJA
IoT Enabling Technologies
1) Wireless sensor networks
2) Cloud computing
3) Big Data analytics
4) Embedded systems
5) Communication protocols
62
IOT-T.YUVARAJA
IoT Enabling Technologies
4)Embedded systems
 Embedded system =Hardware + Software
To perform Specific task
Key components are
 Microprocessor or microcontroller
Memory (RAM, ROM, Cache),
Networking units (Ethernet, Wi-Fi adapter),
 Input/output units (Display, Keyboard, etc)
 storage (flash memory)
They use some special types of processor such as
digital signal processor, graphics processor and
application specific processor). 63
IOT-T.YUVARAJA
IoT Enabling Technologies
5)Communication protocols
• Protocol is nothing but rules and
regulations.
• Backbone of the IoT system
• It allow devices to exchange data over
the network.
64
IOT-T.YUVARAJA
IoT Enabling Technologies
5)Communication protocols
65
IOT-T.YUVARAJA
66
IOT-T.YUVARAJA
IoT Levels & Deployment
Templates
• Based upon the number of monitoring
nodes used, type of data base used,
complexity/ simplicity of analysis,
computation there are 6 levels of IoT.
67
IOT-T.YUVARAJA
IoT Levels & Deployment
Templates
• Device
• Resources
• Controller Service
• Database
• Web Service
• Analysis Component
• Application
68
IOT-T.YUVARAJA
IoT Levels & Deployment
Templates
• IoT level 1
• IoT level 2
• IoT level 3
• IoT level 4
• IoT level 5
• IoT level 6
69
IOT-T.YUVARAJA
IoT Level-1
70
IOT-T.YUVARAJA
IoT Level-1
• It has single node/device
• Data involved is not big. So, data is stored in
local database.
• It is suitable for modelling design low cost and
low complexity solution.
• Analysis locally.
Eg: Home automation
71
IOT-T.YUVARAJA
72
IOT-T.YUVARAJA
IoT Level-2
• It has single node/device.
• Data involved is big. So data is stored in cloud.
• It uses cloud based application to visualize data.
• Analysis locally.
Eg: smart irrigation
73
IOT-T.YUVARAJA
IoT Level-3
74
IOT-T.YUVARAJA
IoT Level-3
• It has single node/device.
• Data involved is big. So data is stored in
cloud.
• It uses cloud based application to
visualize data.
• Analysis cloud.
Eg:Tracking package handling
75
IOT-T.YUVARAJA
IoT Level-4
76
IOT-T.YUVARAJA
IoT Level-4
• It has multiple nodes/devices
• Data involved is big. So data is stored in cloud.
• It uses cloud based application to visualize data.
• Analysis cloud.
• It has two observer nodes i.e local and cloud based.
They can subscribe to and receive information collected
in cloud from IoT device.
• They can process and use those information for various
applications
• Observer node does not perform any control function.
• Analysis cloud.
Eg: Noise monitoring
77
IOT-T.YUVARAJA
IoT Level-5
78
IOT-T.YUVARAJA
IoT Level-5
• It has multiple nodes/devices
• One coordinator node for collecting and sending the data
to cloud by controller service.
• Data involved is big. So data is stored in cloud.
• It uses cloud based application to visualize data.
• Suitable for wireless sensor network.
• Analysis cloud.
Eg: Forest Fire Detection
79
IOT-T.YUVARAJA
IoT Level-6
80
IOT-T.YUVARAJA
IoT Level-6
• It has multiple independent nodes/devices.
• It has centralized controller which is aware of the status
of all the end nodes and sends control command to the
nodes.
• Data involved is big. So data is stored in cloud.
• It uses cloud based application to visualize data.
• Analysis cloud.
Eg: Weather monitoring and structural health monitoring
81
IOT-T.YUVARAJA
20EC503PE - INTERNET OF THINGS
Unit-2
DOMAIN SPECIFIC IoTs & M2M
Domain Specific IoTs- M2M- Difference
between IoT & M2M- Software Defined
Networking-Network Function Virtualization.
07.08.2023 IOT-T.YUVARAJA 82
Domain Specific IoTs
• Home
• Cities
• Environment
• Energy Systems
• Retail
• Logistics
• Industry
• Agriculture
• Health & Lifestyle
83
Home Automation
IoT applications for smart homes:
• Smart Lighting
• Smart Appliances
• Intrusion Detection
• Smoke / Gas Detectors
84
Smart Lighting
85
Smart Appliances
86
Intrusion Detection
87
Smoke / Gas Detectors
88
89
Smart Cities
IoT applications for smart cities are,
• Smart Parking
• Smart Lighting for Roads
• Smart Road
• Structural Health Monitoring
• Surveillance
• Emergency Response
90
Smart Parking
91
Smart Lighting
92
Smart Roads
93
Structural Health Monitoring
94
Surveillance
95
Emergency Response
96
97
Environment
IoT applications for smart environments:
1. Weather Monitoring
2. Air Pollution Monitoring
3. Noise Pollution Monitoring
4. Forest Fire Detection
5. River Flood Detection
98
Weather Monitoring
99
Air Pollution Monitoring
100
Noise Pollution Monitoring
101
Forest Fire Detection
102
River Flood Detection
103
Retail
IoT applications in smart retail systems:
1. Inventory Management
2. Smart Payments
3. Smart Vending Machines
104
Retail
105
Logistics
IoT applications for smart logistic systems:
1. Route Generation & Scheduling
2. Fleet Tracking
3. Shipment Monitoring
4. Remote Vehicle Diagnostics
106
Logistics
107
Industry
IoT applications in smart industry:
1. Machine Diagnosis & Prognosis
2. Indoor Air Quality Monitoring
108
Machine Diagnosis & Prognosis
109
Indoor Air Quality Monitoring
110
Agriculture
IoT applications for smart agriculture:
1. Smart Irrigation
2. Green House Control
111
Smart Irrigation
112
Green House Control
113
Health & Lifestyle
1)Health & Fitness Monitoring
2)Wearable Electronics
114
Health & Fitness Monitoring
115
Wearable Electronics
116
Energy Systems
IoT applications for smart energy systems:
1. Smart Grid
2. Renewable Energy Systems
3. Prognostics
117
Smart Grid
118
Renewable Energy Systems
119
Prognostics
Wind Turbine
120
121
M2M
• M2M Machine to Machine
• M2M is a direct communication between
devices using wired or wireless
communication channels.
• Two machines ―communicating‖ or
exchanging data, without human
interfacing or interaction.
122
M2M
M2M systems comprises of
• M2M area networks
• M2M core networks
• M2M applications
123
M2M
3 interlinked domains:
1)M2M device domain
2)Network domain
3)Application domain
124
M2M
125
M2M
126
M2M
Communication in IoT vs M2M
127
128
Differences between IoT and
M2M
129
5) Applications
130
131
Software-Defined Networking
(SDN)
• SDN enables the control and management
of network using software applications.
• Devices are programmed in centrally
controlled manner.
132
Software-Defined Networking
(SDN)
• SDN is a networking architecture that
separates control plane from the data
plane.
133
SDN
Software Defined Network
134
SDN
Traditional Network Architecture
135
SDN Architecture
136
SDN
Key elements of SDN:
1)Centralized Network controller
2)Programmable open APIs
3)Standard communication interface (Open Flow)
137
SDN
SDN Layers
138
SDN
OpenFlow switch
• OpenFlow uses the concept of flows to identify
network traffic based on pre-defined match
rules. 139
140
Network Function Virtualization
(NFV)
• NFV is an approach to networking where
the network entities that traditionally used
dedicated hardware items are now
replaced with computers on which
software runs to provide the same
functionality.
141
Network Function Virtualization
(NFV)
• Traditional physical network hardware has
always been difficult to change and
upgrade.
• NFV is a concept that virtualizes major
elements of a network.
• In this way, rather than having a
dedicated item of hardware to provide a
given function, software running on a
computer / server is used.
142
Network Function Virtualization
(NFV)
NFV Architecture
143
Network Function Virtualization
(NFV)
Key elements of NFV:
1)Virtualized Network Function(VNF)
2)NFV Infrastructure(NFVI)
3)NFV Management and Orchestration(NFV-MANO)
144
Network Function Virtualization
(NFV)
Conventional Network architectures
145
Network Function Virtualization
(NFV)
Home network with virtualized Home Gateway
146
20EC503PE - INTERNET OF THINGS
Unit-3
IoT LOGICAL DESIGN USING PYTHON
Introduction –Python Data types & Data
structures-Control Flow-Functions-Modules-
Packages-File Handling Classes-Python
Packages of Interest for IoT.
147
Python is a general-purpose, high level
and object-oriented programming
language.
Python is an interpreted scripting language
also.
Python is a case-sensitive language
Variable and variable are not the same.
148
Characteristics of Python
• Multi-paradigm programming language
• Interpreted Language
• Interactive Language
• Easy-to-learn, read and maintain
• Object and Procedure Oriented
• Extendable
• Scalable
• Portable
• Broad Library Support
149
150
Interactive Mode
151
Interactive Mode
152
Script mode
• file with the extension .py
153
Declare a string in python
• using single quotes(‗ ‘)
• using double quotes(" ")
154
Declare a string in python
Example:
x = ‗Python‘
y = "Python"
print(x)
print(y)
155
Declare a string in python
Example:
x = ‗Python‘
y = "Python"
print(x)
print(y)
Output:
Python
Python
156
Python Operators
• Arithmetic operators
• Comparison operators
• Assignment Operators
• Logical Operators
• Bitwise Operators
• Membership Operators
• Identity Operators
157
Arithmetic operators
Operator Meaning Example
+ Addition x + y
- Subtraction x - y
* Multiplication x * y
/ Division x / y
% Modulus x % y
// Floor division x // y
** Exponent x ** y
158
Arithmetic operators
Example:
x = 15
y = 4
print('x + y =',x+y)
print('x - y =',x-y)
print('x * y =',x*y)
print('x / y =',x/y)
print('x // y =',x//y)
print('x ** y =',x**y)
159
Arithmetic operators
Example:
x = 15
y = 4
print('x + y =',x+y)
print('x - y =',x-y)
print('x * y =',x*y)
print('x / y =',x/y)
print('x // y =',x//y)
print('x ** y =',x**y)
160
Output:
x + y =
x - y =
x * y =
x / y =
x // y =
x ** y =
Arithmetic operators
Example:
x = 15
y = 4
print('x + y =',x+y)
print('x - y =',x-y)
print('x * y =',x*y)
print('x / y =',x/y)
print('x // y =',x//y)
print('x ** y =',x**y)
161
Output:
x + y = 19
x - y = 11
x * y = 60
x / y = 3.75
x // y = 3
x ** y = 50625
Comparison operators
162
Operator Name Example
> Greater than x > y
< Less than x < y
== Equal x == y
!= Not equal x != y
>= Greater than
or equal to
x >= y
<= Less than or
equal to
x <= y
Comparison operators
Example:
x = 10
y = 12
print('x > y is',x>y)
print('x < y is',x<y)
print('x == y is',x==y)
print('x != y is',x!=y)
print('x >= y is',x>=y)
print('x <= y is',x<=y)
163
Comparison operators
Example:
x = 10
y = 12
print('x > y is',x>y)
print('x < y is',x<y)
print('x == y is',x==y)
print('x != y is',x!=y)
print('x >= y is',x>=y)
print('x <= y is',x<=y)
164
Output:
Comparison operators
Example:
x = 10
y = 12
print('x > y is',x>y)
print('x < y is',x<y)
print('x == y is',x==y)
print('x != y is',x!=y)
print('x >= y is',x>=y)
print('x <= y is',x<=y)
165
Output:
x > y is
x < y is
x == y is
x != y is
x >= y is
x <= y is
Comparison operators
Example:
x = 10
y = 12
print('x > y is',x>y)
print('x < y is',x<y)
print('x == y is',x==y)
print('x != y is',x!=y)
print('x >= y is',x>=y)
print('x <= y is',x<=y)
166
Output:
x > y is False
x < y is True
x == y is False
x != y is True
x >= y is False
x <= y is True
Logical operators
Operator Meaning Example
and True if both the operands are true x and y
or True if either of the operands is true x or y
not
True if operand is false
(complements the operand)
not x
167
Logical operators
Example:
x = 5
print('x and y is',x > 3 and x < 10)
print('x or y is',x > 3 or x < 4)
print('not x is',not(x > 3))
168
Logical operators
Example:
x = 5
print('x and y is',x > 3 and x < 10)
print('x or y is',x > 3 or x < 4)
print('not x is',not(x > 3))
169
Output:
Logical operators
Example:
x = 5
print('x and y is',x > 3 and x < 10)
print('x or y is',x > 3 or x < 4)
print('not x is',not(x > 3))
170
Output:
x and y is
x or y is
not x is
Logical operators
Example:
x = 5
print('x and y is',x > 3 and x < 10)
print('x or y is',x > 3 or x < 4)
print('not x is',not(x > 3))
171
Output:
x and y is True
x or y is True
not x is False
Logical operators
Example:
x = 15
print('x and y is',x > 3 and x < 10)
print('x or y is',x > 3 or x < 4)
print('not x is',not(x > 3))
172
Output:
x and y is
x or y is
not x is
Logical operators
Example:
x = 15
print('x and y is',x > 3 and x < 10)
print('x or y is',x > 3 or x < 4)
print('not x is',not(x > 3))
173
Output:
x and y is False
x or y is True
not x is False
Logical operators
Example:
x = 5
print(x > 3 and x < 10)
print(x > 3 or x < 4)
print(not(x > 3))
174
Output:
True
True
False
Bitwise Operators
Operator Meaning Example
& Bitwise AND x & y
| Bitwise OR x | y
~ Bitwise NOT ~x
^ Bitwise XOR x ^ y
>>
Bitwise right
shift
x >> 2
<<
Bitwise left
shift
x << 2
175
Bitwise Operators
Example:
x = 10
y = 4
print('x & y is', x & y)
print('x | y is ', x | y)
print('~x is', ~x)
print('x ^ y is ', x ^ y)
print('x >> 2 is',x >> 2 )
print('x << 2 is',x << 2)
176
Example:
x = 10
y = 4
print('x & y is', x & y)
print('x | y is ', x | y)
print('~x is', ~x)
print('x ^ y is ', x ^ y)
print('x >> 2 is',x >> 2 )
print('x << 2 is',x << 2)
177
Output:
x & y is
x | y is
~x is
x ^ y is
x >> 2 is
x << 2 is
Example:
x = 10
y = 4
print('x & y is', x & y)
print('x | y is ', x | y)
print('~x is', ~x)
print('x ^ y is ', x ^ y)
print('x >> 2 is',x >> 2 )
print('x << 2 is',x << 2)
178
Output:
x & y is 0
x | y is 14
~x is -11
x ^ y is 14
x >> 2 is 2
x << 2 is 40
Example:
x = 10
y = 4
print('x & y is', x & y)
print('x | y is ', x | y)
print('~x is', ~x)
print('x ^ y is ', x ^ y)
print('x >> 2 is',x >> 2 )
print('x << 2 is',x << 2)
179
Output:
x & y is 0
x | y is 14
~x is -11
x ^ y is 14
x >> 2 is 2
x << 2 is 40
Output:
x & y is 0
x | y is 14
~x is -11
x ^ y is 14
x >> 2 is 2
x << 2 is 40
180
x & y =
x | y =
~x =
x ^ y =
x >> 2 =
x << 2 =
181
Example:
x = 100000 1010
y = 4 0000 0100
x & y = 0000 0000
x | y =
~x =
x ^ y =
x >> 2 =
x << 2 =
182
Example:
x = 100000 1010
y = 4 0000 0100
x & y = 0000 0000
x | y = 0000 1110
~x =
x ^ y =
x >> 2 =
x << 2 =
183
Example:
x = 100000 1010
y = 4 0000 0100
x & y = 0000 0000
x | y = 0000 1110
~x = 1111 0101
x ^ y =
x >> 2 =
x << 2 =
184
Example:
x = 100000 1010
y = 4 0000 0100
x & y = 0000 0000
x | y = 0000 1110
~x = 1111 0101
x ^ y = 0000 1110
x >> 2 =
x << 2 =
185
Example:
x = 100000 1010
y = 4 0000 0100
x & y = 0000 0000
x | y = 0000 1110
~x = 1111 0101
x ^ y = 0000 1110
x >> 2 = 0000 0010
x << 2 =
186
Example:
x = 100000 1010
y = 4 0000 0100
x & y = 0000 0000
x | y = 0000 1110
~x = 1111 0101
x ^ y = 0000 1110
x >> 2 = 0000 0010
x << 2 = 0010 1000
187
Example:
x = 10 (0000 1010)
y = 4 (0000 0100 )
x & y = 0000 0000 0
x | y = 0000 1110 14
~x = 1111 0101-11
x ^ y = 0000 111014
x >> 2 = 0000 00102
x << 2 = 0010 100040
188
Example:
x = 10 (0000 1010)
y = 4 (0000 0100 )
189
190
Assignment operators
Operator Example Equivalent to
= x = 5 x = 5
+= x += 5 x = x + 5
-= x -= 5 x = x - 5
*= x *= 5 x = x * 5
/= x /= 5 x = x / 5
%= x %= 5 x = x % 5
//= x //= 5 x = x // 5
**= x **= 5 x = x ** 5
&= x &= 5 x = x & 5
|= x |= 5 x = x | 5
^= x ^= 5 x = x ^ 5
>>= x >>= 5 x = x >> 5
<<= x <<= 5 x = x << 5
191
Membership operators
Operator Description Example
in True if value/variable is
found in the sequence
x in y
not in True if value/variable is
not found in the sequence
x not in y
192
Membership operators
Example:
x = ["apple", "banana"]
print("banana" in x)
print("pineapple" not in x)
193
Membership operators
Example:
x = ["apple", "banana"]
print("banana" in x)
print("pineapple" not in x)
Output:
194
Membership operators
Example:
x = ["apple", "banana"]
print("banana" in x)
print("pineapple" not in x)
Output:
True
195
Membership operators
Example:
x = ["apple", "banana"]
print("banana" in x)
print("pineapple" not in x)
Output:
True
True
196
Membership operators
Example:
x = ["apple", "banana"]
print("banana" in x)
print("apple" not in x)
Output:
197
Membership operators
Example:
x = ["apple", "banana"]
print("banana" in x)
print("apple" not in x)
Output:
True
False
198
Identity operators
Operator Description Example
is True if both variables are the same object x is y
is not True if both variables are not the same
object
X is not y
199
Identity operators
Example:
x1 = 5
y1 = 5
x2 = "Hello"
y2 = "Hello"
print(x1 is not y1)
print(x2 is y2)
200
False True
Identity operators
Example:
x1 = 5
y1 = 5
x2 = "Hello"
y2 = "Hello"
print(x1 is not y1)
print(x2 is y2)
Output:
201
False True
Identity operators
Example:
x1 = 5
y1 = 5
x2 = "Hello"
y2 = "Hello"
print(x1 is not y1)
print(x2 is y2)
Output:
False
True
202
False True
Python Data Types & Data
Structures
• Variables can hold values, and every value
has a data-type.
• Python is a dynamically typed language;
hence we do not need to define the type of
the variable while declaring it.
• Python provides us the type() function,
which returns the type of the variable
passed.
203
Python Data Types & Data
Structures
Example:
a=10
b="Hi Python"
c = 10.5
print(type(a))
print(type(b))
print(type(c))
204
NOTE:
However, in Python 3, the long data type
was removed; no matter how big the integer
is, it will be an int.
205
Python Data Types & Data
Structures
• Numbers
• Strings
• Lists
• Tuples
• Dictionaries
• Type Conversion
206
Python Data Types & Data
Structures
• Numbers
• Strings
• Lists
• Tuples
• Dictionaries
• Type Conversion
207
Numbers
• Number data type is used to store numeric
values.
1)int
2)float
3)complex
208
Numbers
Example:
a = 5
b = 2.5
c = 2+5j
print(type(a))
print(type(b))
print(type(c))
209
Output:
<class 'int'>
<class 'float'>
<class 'complex'>
Numbers
Example:
c = 2+5j
210
Numbers
Example:
c = 2+5j
print(c.real)
print(c.imag)
Output:
2.0
5.0
211
Numbers
Example:
a = 5
b = 2.5
212
Numbers
Example:
a = 5
b = 2.5
c=a+b
d=a-b
e=a*b
f=a/b
g=a**2
213
Numbers
Example:
a = 5
b = 2.5
c=a+b
d=a-b
e=a*b
f=a/b
g=a**2
print(c)
print(d)
print(e)
print(f)
print(g)
214
Output:
7.5
2.5
12.5
2.0
25
Python Data Types & Data
Structures
• Numbers
• Strings
• Lists
• Tuples
• Dictionaries
• Type Conversion
215
Strings
216
Declare a string in python
• using single quotes(‗ ‘)
• using double quotes(" ")
217
Declare a string in python
Example:
x = ‗Python‘
y = "Python"
print(x)
print(y)
218
Strings
Example:
a="Welcome!"
print(a)
print("type is",type(a))
print("Length is",len(a))
print("The string(%s)has %d characters" % (a,len(a)))
print("Upper case is",a.upper())
print("Lower case is",a.lower())
print(a[0])
print(a[2])
print(a[3:])
print(a[3:-1])
219
220
Welcome! type is <class 'str'> Length is 8 The string(Welcome!)has 8 characters Upper case is WELCOME! Lower case is welcome
Output:
Welcome!
type is <class 'str'>
Length is 8
The string(Welcome!)has 8 characters
Upper case is WELCOME!
Lower case is welcome!
W
l
come!
come
Strings
Example:
a=―Welcome!"
b= ―Kongunadu College"
221
Strings
Example:
a=―Welcome!"
b= ―Kongunadu College"
c = a+b
222
Strings
Example:
a=―Welcome!"
b= ―Kongunadu College"
c = a+b
print(c)
223
Strings
Example:
a=―Welcome!"
b= ―Kongunadu College"
c = a+b
print(c)
Output:
224
Welcome!Kongunadu College
Python Data types & Data
structures
• Numbers
• Strings
• Lists
• Tuples
• Dictionaries
• Type Conversion
225
Lists
• Lists are used to store multiple items in a
single variable.
226
Example:
list1 = ["apple", "banana", "cherry"]
list2 = [1, 5, 7, 9, 3]
list3 = [True, False, False]
227
Lists
Example:
list1 = ["apple", "banana", "cherry"]
list2 = [1, 5, 7, 9, 3]
list3 = [True, False, False]
print(type(list1))
print(type(list2))
print(type(list3))
228
Output:
<class 'list'>
<class 'list'>
<class 'list'>
Lists
Lists
Example:
fruits=['apple', 'orange', "banana", "mango"]
print(type(fruits))
print(len(fruits))
print(fruits[2])
print(fruits[0:2])
print(fruits[2:])
print(fruits)
fruits.append(‗cherry')
print(fruits)
fruits.remove(‗banana‘)
print(fruits)
fruits.insert(2,' banana ')
print(fruits)
229
Output:
<class 'list'>
4
banana
['apple', 'orange']
['banana', 'mango‘]
['apple', 'orange', 'banana', 'mango‘]
['apple', 'orange', 'banana', 'mango', 'cherry‘]
['apple', 'orange', 'mango', 'cherry‘]
['apple', 'orange', 'banana', 'mango', 'cherry']
Lists
Example:
mixed=['data‘,13, 25.14]
print(mixed)
print(type(mixed))
print(type(mixed[0]))
print(type(mixed[1]))
print(type(mixed[2]))
mixed[0]=mixed[0]+―type"
mixed[1]=mixed[1]+2.352
mixed[2]=mixed[2]+0.15
print(mixed)
230
['datatype', 15.352, 25.29]
['datatype', 15.352, 25.29]
15.352, 25.29
Lists
Example:
mixed=['data‘,13, 25.14]
print(mixed)
print(type(mixed))
print(type(mixed[0]))
print(type(mixed[1]))
print(type(mixed[2]))
mixed[0]=mixed[0]+―type"
mixed[1]=mixed[1]+2.352
mixed[2]=mixed[2]+0.15
print(mixed)
231
Output:
['data', 13, 25.14]
<class 'list‘>
<class 'str'>
<class 'int'>
<class 'float‘>
['datatype', 15.352, 25.29]
['datatype', 15.352, 25.29]
['datatype', 15.352, 25.29]
15.352, 25.29
20EC503PE - INTERNET OF THINGS
Unit-4
IoT PHYSICAL DEVICES AND ENDPOINTS
IoT Device -Building blocks -Raspberry Pi -
Board - Linux on Raspberry Pi - Raspberry Pi
Interfaces -Programming Raspberry Pi with
Python - Other IoT Devices - Arduino.
232
Raspberry Pi Interfaces
1) Serial
2) SPI
3) I2C
233
234
Raspberry Pi Interfaces
Serial :
•2 Pins
1) Receive (Rx) Pin
2) Transmit (Tx) Pin
•Communication with serial peripherals.
SPI :
•Serial Peripheral Interface (SPI) is a synchronous serial data protocol used for
communicating with one or more peripheral devices.
•5 Pins
1)MISO (Master in slave out) – Master line for sending data to the peripherals.
2)MOSI (Master out slave in) – Slave line for sending data to the master.
3)SCK (Serial Clock) – Clock generated by master to synchronize data transmission
4)CE0 (Chip Enable 0) – To enable or disable devices
5)CE0 (Chip Enable 1) – To enable or disable devices
235
Raspberry Pi Interfaces
I2C :
• I2C Inter Integrated Circuit
• The I2C interface pins on Raspberry Pi allow you to
connect hardware modules.
• I2C interface allows synchronous data transfer with just
two pins.
1)SDA (Serial Data)
2)SCL (Serial Clock)
236
Other IoT Devices
• pcDuino
• BeagleBone Black
• Cubieboard
237
pcDuino
238
pcDuino
• pcDuino is an Arduino-pin compatible single
board mini-computer
• ARM Cortex-A8 processor
• 1 GHz
• Runs PC like OS such as Ubuntu and Android
ICS.
• HDMI video/audio interface.
• C, C++ ,Java and Python.
239
BeagleBone Black
240
BeagleBone Black
• BeagleBone Black is similar to Raspberry
Pi.
• 1 GHz
• ARM Cortex-A8 processor
• supports both Linux and Android operating
systems.
• HDMI video/audio interface.
• USB and Ethernet ports.
241
Cubieboard
242
Cubieboard
• Dual core ARM Cortex A7 processor
• USB, HDMI, IR, serial, Ethernet, SATA,
and a 96 pin extended interface.
• runs both Linux and Android operating
systems.
243
Arduino
244
Arduino
• UNO means ‗one‘.
• first release of Arduino Software.
• ATmega328P microcontroller.
• Arduino UNO includes
* 6 analog pin inputs
* 14 digital I/O pins (6-PWM outputs)
* USB connector,
* power jack,
* ICSP (In-Circuit Serial Programming) header.
245
Arduino
• ATmega328 Microcontroller- It is a single chip Microcontroller of the
ATmel family. The processor code inside it is of 8-bit. It combines
Memory (SRAM, EEPROM, and Flash), Analog to Digital Converter,
SPI serial ports, I/O lines, registers, timer, external and internal
interrupts, and oscillator.
• ICSP pin - The In-Circuit Serial Programming pin allows the user to
program using the firmware of the Arduino board.
• Power LED Indicator- The ON status of LED shows the power is
activated. When the power is OFF, the LED will not light up.
• Digital I/O pins- The digital pins have the value HIGH or LOW. The
pins numbered from D0 to D13 are digital pins.
• TX and RX LED's- The successful flow of data is represented by the
lighting of these LED's.
246
Arduino
• AREF- The Analog Reference (AREF) pin is used to feed a
reference voltage to the Arduino UNO board from the external power
supply.
• Reset button- It is used to add a Reset button to the connection.
• USB- It allows the board to connect to the computer. It is essential
for the programming of the Arduino UNO board.
• Crystal Oscillator- The Crystal oscillator has a frequency of 16MHz,
which makes the Arduino UNO a powerful board.
• Voltage Regulator- The voltage regulator converts the input voltage
to 5V.
• GND- Ground pins. The ground pin acts as a pin with zero voltage.
• Vin- It is the input voltage.
• Analog Pins- The pins numbered from A0 to A5 are analog pins. The
function of Analog pins is to read the analog sensor used in the
connection. It can also act as GPIO (General Purpose Input Output)
pins. 247
Basic Commands for Arduino
1. pinMode(x, OUTPUT)
2. digitalWrite(x, HIGH
3. pinMode(x, INPUT)
4. digitalRead(digital Pin)
5. analogRead(analog pin)
248
249
250
void setup()
{
pinMode(2, OUTPUT);
}
void loop()
{
digitalWrite(2, HIGH);
delay(1000);
digitalWrite(2, LOW
delay(1000);
} 251
void setup()
{ // initialize digital pin 13 as an output.
pinMode(2, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(2, HIGH); // turn the LED on (HIGH is the
voltage level)
delay(1000); // wait for a second
digitalWrite(2, LOW); // turn the LED off by making the
voltage LOW
delay(1000); // wait for a second 252
Interfacing LED and switch with
Raspberry Pi
253
Interfacing LED and switch with
Raspberry Pi
• In this example the LED is connected to GPIO
pin 18 and switch is connected to pin 25. In the
infinite while loop the value of pin 25 is checked
and the state of LED is toggled if the switch is
pressed. This example shows how to get input
from GPIO pins and process the input and take
some action. The action in this example is
toggling the state of an LED.
254
Interfacing LED and switch with
Raspberry Pi
from time import sleep
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
#Switch Pin
GPIO.setup(25, GPIO.IN)
#LED Pin
GPIO.setup(18, GPIO.OUT)
state=false
def toggleLED(pin):
state = not state
GPIO.output(pin, state)
255
while True:
try:
if (GPIO.input(25) == True):
toggleLED(pin)
sleep(.01)
except KeyboardInterrupt:
exit()
256
Interfacing a Light Sensor (LDR)
with Raspberry Pi
import RPi.GPIO as GPIO
import time
GPIO.setmode (GPIO.BCM)
ldr_threshold = 1000
LDR PIN = 18
LIGHT_PIN = 25
def readLDR (PIN):
reading=0
GPIO. setup (LIGHT_PIN, GPIO.OUT)
GPIO.output (PIN, False)
time.sleep (0.1)
GPIO. setup (PIN, GPIO.IN)
257
Interfacing a Light Sensor (LDR) with
Raspberry Pi
while (GPIO.input (PIN) == False):
reading=reading+1
return reading
def switchOnLight (PIN) :
GPIO. setup (PIN, GP10.OUT)
GPIO.output (PIN, True)
def switchOffLight (PIN):
GPIO.setup (PIN, GPI0.OUT)
GPIO.out put (PIN, False)
while True:
ldr_reading = readLDR (LDR_PIN)
if ldr_reading < ldr_threshold :
switchOnLight (LIGHT_PIN)
else:
switchof fLi ght (LIGHT_PIN)
time.sleep (1) 258
Programming Raspberry Pi with
Python
• Controlling an LED (Blinking an LED)
• Controlling an LED with Switch
• Interfacing a Light Sensor (LDR)
259
260
261
262
Controlling an LED
• LED is connected to GPIO 18.
• LED is output
263
Python program for blinking LED
import RPi.GP10 as GPIO
import time
GPIO. setmode (GPIO.BCM)
GPIO.set up (18, GPIO.OUT)
while True:
GPIO.output (18, True)
time.sleep (1)
GPIO.output (18, False)
time.sleep (1)
264
Python program for blinking LED
import RPi.GP10 as GPIO
import time
Ledpin =18
GPIO. setmode (GPIO.BCM)
GPIO.set up (Ledpin, GPIO.OUT)
while True:
GPIO.output (Ledpin, True)
time.sleep (1)
GPIO.output (Ledpin, False)
time.sleep (1)
265
Python program for blinking LED
import RPi.GP10 as GPIO
from time import sleep
GPIO. setmode (GPIO.BCM)
GPIO.set up (18, GPIO.OUT)
while True:
GPIO.output (18, True)
sleep (1)
GPIO.output (18, False)
sleep (1)
266
267
Interfacing LED and switch with
Raspberry Pi
268
Interfacing LED and switch with
Raspberry Pi
• LED is connected to GPIO pin 18
• switch is connected to pin 25.
269
Interfacing LED and switch with Raspberry Pi
import RPi.GPIO as GPIO
import time
switch_pin=25
LED_pin=18
GPIO.setmode(GPIO.BCM)
GPIO.setup(switch_pin, GPIO.IN)
GPIO.setup(LED_pin, GPIO.OUT)
while True:
if (GPIO.input(switch_pin) == True):
GPIO.output (LED_pin, True)
time.sleep (1)
else:
GPIO.output (LEDpin, False)
time.sleep (1)
270
Interfacing LED and switch with
Raspberry Pi
import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BCM)
GPIO.setup(25, GPIO.IN)
GPIO.setup(18, GPIO.OUT)
while True:
if (GPIO.input(25) == True):
GPIO.output (18, True)
else:
GPIO.output (18, False)
271
Interfacing LED and switch with
Raspberry Pi
import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BCM)
GPIO.setup(25, GPIO.IN)
GPIO.setup(18, GPIO.OUT)
while True:
if (GPIO.input(25) == True):
GPIO.output (18, True)
sleep (1)
else:
GPIO.output (18, False)
sleep (1)
272
Interfacing a Light Sensor (LDR) with Raspberry Pi
import RPi.GPIO as GPIO
import time
GPIO.setmode (GPIO.BCM)
LDR_PIN = 18
LIGHT_PIN = 25
ldr_threshold = 1000
def readLDR (LDR_PIN):
reading=0
GPIO. setup (LDR_PIN, GPIO.OUT)
GPIO.output (LDR_PIN, False)
time.sleep (1)
GPIO. setup (LDR_PIN, GPIO.IN)
while (GPIO.input (LDR_PIN) == False):
reading=reading+1
return reading 273
20EC503PE - INTERNET OF THINGS
Unit-5
CASE STUDIES
Home Automation – Cities – Environment –
Agriculture – Structural Health monitoring –
Weather monitoring.
274
Home Automation
• Smart Lighting
• Home Intrusion Detection
275
Smart Lighting
276
Smart Lighting
277
Home Intrusion Detection
Purpose:
• to detect intrusions using sensors (such as
PIR sensors and door sensors) and raise
alerts, if necessary.
• Components:
• Raspberry Pi
• PIR sensors
• door sensors
278
Home Intrusion Detection
279
Smart Parking
• Purpose:
• to detect the number of empty parking
slots and send the information over the
Internet to smart parking application
backends.
• Components:
• Raspberry Pi
• ultrasonic sensor
280
Smart Parking
281
Environment
• Weather Monitoring System
• Weather Reporting Bot
• Air Pollution Monitoring
• Forest Fire Detection
282
Weather Monitoring System
283
Weather Reporting Bot
284
Air Pollution Monitoring
285
Forest Fire Detection
286
Smart Irrigation
287
Structural Health monitoring
288
Structural Health monitoring
289
REFERENCE BOOK
• Arshdeep Bahga, Vijay Madisetti, ―Internet
of Things – A hands–on approach‖,
Universities Press, 2015
290
THANK YOU
291

More Related Content

Similar to 20EC503PE-Internet of Things

Internet of Things.pptx
Internet of Things.pptxInternet of Things.pptx
Internet of Things.pptxEshwar Prasad
 
NetSim Webinar on IOT
NetSim Webinar on IOTNetSim Webinar on IOT
NetSim Webinar on IOTKAVITHA IYER
 
the connection of iot with lora pan which enable
the connection of iot with lora pan which enablethe connection of iot with lora pan which enable
the connection of iot with lora pan which enableneelamsanjeevkumar
 
Internet of things (iot)
Internet of things (iot)Internet of things (iot)
Internet of things (iot)sankar s
 
Internet of Things IoT
Internet of Things IoTInternet of Things IoT
Internet of Things IoTFURQAN M LODHI
 
Nodemcu and IOT.pptx
Nodemcu and IOT.pptxNodemcu and IOT.pptx
Nodemcu and IOT.pptxDixonSunny2
 
IOT introduction
IOT introductionIOT introduction
IOT introductionxinoe
 
Introduction-All 'bout IOT
Introduction-All 'bout IOTIntroduction-All 'bout IOT
Introduction-All 'bout IOTInxee
 
Definition of Internet of things and introduction
Definition of Internet of things and introductionDefinition of Internet of things and introduction
Definition of Internet of things and introductionsundeepsiddula
 
IoT challenges for Smart Manufacturing
IoT challenges for Smart ManufacturingIoT challenges for Smart Manufacturing
IoT challenges for Smart ManufacturingHeiko Koziolek
 
TM4C-IoT-Gateway-with-Security-Protection_0.pdf
TM4C-IoT-Gateway-with-Security-Protection_0.pdfTM4C-IoT-Gateway-with-Security-Protection_0.pdf
TM4C-IoT-Gateway-with-Security-Protection_0.pdfssuser8b324e
 

Similar to 20EC503PE-Internet of Things (20)

IOT ajay binay.pdf
IOT ajay binay.pdfIOT ajay binay.pdf
IOT ajay binay.pdf
 
Internet of Things.pptx
Internet of Things.pptxInternet of Things.pptx
Internet of Things.pptx
 
NetSim Webinar on IOT
NetSim Webinar on IOTNetSim Webinar on IOT
NetSim Webinar on IOT
 
Introduction to IoT - Unit I
Introduction to IoT - Unit IIntroduction to IoT - Unit I
Introduction to IoT - Unit I
 
Introduction of iot
Introduction of iotIntroduction of iot
Introduction of iot
 
the connection of iot with lora pan which enable
the connection of iot with lora pan which enablethe connection of iot with lora pan which enable
the connection of iot with lora pan which enable
 
IOT tutorial
IOT tutorialIOT tutorial
IOT tutorial
 
Internet of things (iot)
Internet of things (iot)Internet of things (iot)
Internet of things (iot)
 
Internet of Things IoT
Internet of Things IoTInternet of Things IoT
Internet of Things IoT
 
7CS4_IOT_Unit-1.pdf
7CS4_IOT_Unit-1.pdf7CS4_IOT_Unit-1.pdf
7CS4_IOT_Unit-1.pdf
 
Nodemcu and IOT.pptx
Nodemcu and IOT.pptxNodemcu and IOT.pptx
Nodemcu and IOT.pptx
 
IOT introduction
IOT introductionIOT introduction
IOT introduction
 
Introduction-All 'bout IOT
Introduction-All 'bout IOTIntroduction-All 'bout IOT
Introduction-All 'bout IOT
 
Definition of Internet of things and introduction
Definition of Internet of things and introductionDefinition of Internet of things and introduction
Definition of Internet of things and introduction
 
IoT challenges for Smart Manufacturing
IoT challenges for Smart ManufacturingIoT challenges for Smart Manufacturing
IoT challenges for Smart Manufacturing
 
TM4C-IoT-Gateway-with-Security-Protection_0.pdf
TM4C-IoT-Gateway-with-Security-Protection_0.pdfTM4C-IoT-Gateway-with-Security-Protection_0.pdf
TM4C-IoT-Gateway-with-Security-Protection_0.pdf
 
Introduction to IoT
Introduction to IoTIntroduction to IoT
Introduction to IoT
 
Chapter 1 pdf
Chapter 1 pdfChapter 1 pdf
Chapter 1 pdf
 
COMPARATIVE STUDY BETWEEN VARIOUS PROTOCOLS USED IN INTERNET OF THING
COMPARATIVE STUDY BETWEEN VARIOUS  PROTOCOLS USED IN INTERNET OF THINGCOMPARATIVE STUDY BETWEEN VARIOUS  PROTOCOLS USED IN INTERNET OF THING
COMPARATIVE STUDY BETWEEN VARIOUS PROTOCOLS USED IN INTERNET OF THING
 
Unit 4
Unit 4Unit 4
Unit 4
 

Recently uploaded

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 

Recently uploaded (20)

Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 

20EC503PE-Internet of Things

  • 1. 20EC503PE - INTERNET OF THINGS by Dr.T.YUVARAJA ASP/ECE KNCET IOT-T.YUVARAJA 1
  • 2. 20EC503PE - INTERNET OF THINGS Unit-1 INTRODUCTION TO IoT Internet of Things – characteristics- Physical Design- Logical Design - IoT Enabling Technologies - IoT Levels & Deployment Templates - IoT Platforms Design Methodology. IOT-T.YUVARAJA 2
  • 3. Internet of Things • Kevin Ashton Invented the Term "Internet of Things" 3 IOT-T.YUVARAJA
  • 4. Internet of Things(Definition) • The Internet of Things (IoT) describes the network of physical objects—―things‖—that are embedded with sensors, software, and other technologies for the purpose of connecting and exchanging data with other devices and systems over the internet. 4 IOT-T.YUVARAJA
  • 6. Characteristics of IoT 1) Dynamic & Self-Adapting 2) Self-Configuring 3) Interoperable Communication Protocols 4) Unique Identity 5) Integrated into Information Network 6 IOT-T.YUVARAJA
  • 7. Characteristics of IoT 1)Dynamic & Self-Adapting • surveillance camera • It should be adaptable to work in different conditions(Normal & Infrared) • Different(dynamic) light situations (Day & Night). 7 IOT-T.YUVARAJA
  • 8. Characteristics of IoT 2)Self-Configuring • setup the network • Software upgrade 8 IOT-T.YUVARAJA
  • 9. Characteristics of IoT 3)Interoperable Communication Protocols • IoT allows different devices (different in architecture) to communicate with each other as well as with different network. • For ex: MI Phone is able to control the smart AC and smart TV of different manufacturer. 9 IOT-T.YUVARAJA
  • 10. Characteristics of IoT 4)Unique Identity • The devices which are connected to the internet have unique identities • i.e. IP address 10 IOT-T.YUVARAJA
  • 11. Characteristics of IoT 5)Integrated into Information Network • The IoT devices are connected to the network to share some information with other connected devices. • The devices can be discovered dynamically in the network by other devices. • Eg: If a device has wifi connectivity then that will be shown to other nearby devices having wifi connectivity 11 IOT-T.YUVARAJA
  • 13. Physical Design of IoT • Things/Devices and protocols that are used to build an IoT system. • Things/Devices are called Node Devices and every device has a unique identity that performs remote sensing, actuating and monitoring work. • Protocolsestablish communication between the Node devices and servers over the internet. 13 IOT-T.YUVARAJA
  • 14. Physical Design of IoT • Things in IoT • IoT Protocols 14 IOT-T.YUVARAJA
  • 15. Things in IoT Generic block diagram of an IoT Device • An IoT device may consist of several interfaces for connections to other devices,both wired and wireless. 15 IOT-T.YUVARAJA
  • 16. Things in IoT IoT Device Connectivity  Processor Audio/Video Interfaces Input/Output interface Memory Interfaces Storage Interfaces Graphics 16 IOT-T.YUVARAJA
  • 17. Things in IoT IoT Devices 17 IOT-T.YUVARAJA
  • 18. Physical Design of IoT IoT Protocols 18 IOT-T.YUVARAJA
  • 19. IoT Protocols 1)Link Layer 2)Network/Internet Layer 3)Transport Layer 4)Application Layer 19 IOT-T.YUVARAJA
  • 20. IoT Protocols 1)Link Layer Protocols: 802.3-Ethernet: IEEE802.3 is collection of wired Ethernet standards  802.3  co-axial cable  802.3i  copper twisted pair  802.3j  fiber optic  802.3ae  Ethernet over fiber 802.11-WiFi: IEEE802.11 is a collection of wireless LAN(WLAN) communication standards.  802.11a  5GHz band  802.11b  2.4GHz band  802.11g 2.4GHz band  802.11n 2.4/5GHz band  802.11ac 5GHz band  802.11ad 60Ghzband 20 IOT-T.YUVARAJA
  • 21. IoT Protocols 1) Link Layer Protocols: 802.16 - WiMax: IEEE802.16 is a collection of wireless broadband standards. WiMax provide data rates from 1.5 Mb/s to 1Gb/s. 802.15.4- LR-WPAN: IEEE802.15.4 is a collection of standards for Low Rate Wireless Personal Area Network(LR-WPAN). ZigBee Provides data rate from 40kb/s to250kb/s. 2G/3G/4G-Mobile Communication: Data rates from 9.6kb/s(2G) to up to100Mb/s(4G) 21 IOT-T.YUVARAJA
  • 22. IoT Protocols 2)Network/Internet Layer Protocols: • IPv4:  Internet Protocol version 4  32 bit address.  Total= 232addresses • IPv6:  Internet Protocol version6  uses 128 bit address  Total= 2128 addresses • 6LOWPAN:  IPv6 over Low power Wireless Personal Area Network  Operates in 2.4 GHz frequency range  Data transfer 250 kb/s. 22 IOT-T.YUVARAJA
  • 23. IoT Protocols 3) Transport Layer Protocols: TCP: Transmission Control Protocol Connection oriented Reliable (Guaranteed delivery) Feedback(Acknowledgment) UDP: User Datagram Protocol connectionless protocol  Unreliable No Feedback(No Acknowledgment) 23 IOT-T.YUVARAJA
  • 24. IoT Protocols 4)Application Layer Protocols: HTTP:  Hyper Text Transfer Protocol  Follow request- response model  Stateless protocol. CoAP:  Constrained Application Protocol  M2M applications  Uses client- server architecture. WebSocket:  Allows full duplex communication over a single socket connection. MQTT:  Message Queue Telemetry Transport  light weight messaging protocol  publish-subscribe model.  Uses client server architecture. 24 IOT-T.YUVARAJA
  • 25. IoT Protocols 4)Application Layer Protocols: XMPP:  Extensible Message and Presence Protocol  real time communication and streaming XML data between network entities.  Support client-server and server-server communication. DDS:  Data Distribution Service  Device-to-device or machine-to-machine communication.  Uses publish-subscribe model. AMQP:  Advanced Message Queuing Protocol  Supports both point-to-point and publish-subscribe model. 25 IOT-T.YUVARAJA
  • 26. Logical Design of IoT 1) IoT Functional Blocks 2) IoT Communication Models 3) IoT Communication APIs 26 IOT-T.YUVARAJA
  • 27. Logical Design of IoT IoT functional Blocks 27 IOT-T.YUVARAJA
  • 28. IoT functional Blocks • Device • Communication • Services • Management • Security • Application 28 IOT-T.YUVARAJA
  • 29. IoT functional Blocks Device :  An IoT system comprises of devices  provide sensing, actuation, monitoring and control functions. Communication:  Handles the communication for the IoT system. Services:  Device monitoring services  Device control services  Data publishing services  Device discovery services 29 IOT-T.YUVARAJA
  • 30. IoT functional Blocks Management:  provides various functions to govern the IoT system. Security:  secures the IoT system  providing functions such as Authentication Authorization Message and content integrity Data security Application:  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. 30 IOT-T.YUVARAJA
  • 31. IoT communication models 1) Request-Response communication model 2) Publish-subscribe communication model 3) Push-pull communication model 4) Exclusive-pair communication model 31 IOT-T.YUVARAJA
  • 32. IoT communication models 1) Request-Response communication model 32 IOT-T.YUVARAJA
  • 33. IoT communication models 2)Publish-subscribe communication model 33 IOT-T.YUVARAJA
  • 34. IoT communication models 2)Publish-subscribe communication model  It 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. 34 IOT-T.YUVARAJA
  • 35. IoT communication models 3)Push-pull communication model 35 IOT-T.YUVARAJA
  • 36. IoT communication models 3)Push-pull communication model  Publishers push the data to queues and the consumers pull the data from the queues.  Publishers do not need to be aware of the consumers.  Queues also act as a buffer 36 IOT-T.YUVARAJA
  • 37. IoT communication models 4)Exclusive-pair communication model 37 IOT-T.YUVARAJA
  • 38. IoT communication models 4)Exclusive-pair communication model  Bi-directional, fully duplex communication model  Once connection is set up it remains open until the client send a request to close the connection.  Client and server can send messages to each other after connection setup. 38 IOT-T.YUVARAJA
  • 39. IOT Communication APIs 1) REST-based Communication API 2) Web Socket based communication API 39 IOT-T.YUVARAJA
  • 40. IOT Communication APIs 1)REST-based Communication API Representational State Transfer (REST) Request -Response communication model 40 IOT-T.YUVARAJA
  • 41. IOT Communication APIs 1)REST-based Communication API Client-server Stateless Cacheable Layered system Uniform interface Code on demand 41 IOT-T.YUVARAJA
  • 42. IOT Communication APIs 1)REST-based Communication API 42 IOT-T.YUVARAJA
  • 43. IOT Communication APIs 1)REST-based Communication API • Representational State Transfer (REST) is a set of architectural principles by which you can design web services and web APIs. • REST APIs follow the request –response communication model. 43 IOT-T.YUVARAJA
  • 44. IOT Communication APIs 2)Web Socket based communication API 44 IOT-T.YUVARAJA
  • 45. IOT Communication APIs 2)Web Socket based communication API • WebSocket APIs allow bidirectional, full duplex communication between clients and servers. • WebSocket APIs follow the exclusive pair communication model.  Websocket handshake  WebSocket APIs reduce the network traffic and latency  WebSocket is suitable for IoT applications that have low latency or high throughput requirements. 45 IOT-T.YUVARAJA
  • 46. Difference between REST and Websocket: 46 IOT-T.YUVARAJA
  • 47. IoT Enabling Technologies 1) Wireless sensor networks 2) Cloud computing 3) Big Data analytics 4) Embedded systems 5) Communication protocols 47 IOT-T.YUVARAJA
  • 48. IoT Enabling Technologies 1) Wireless Sensor Networks(WSN) WSN consists of a number of 1)End-nodes 2)Routers 3)coordinator 48 IOT-T.YUVARAJA
  • 49. IoT Enabling Technologies 1) Wireless Sensor Networks(WSN) • End Nodes sensors attached to them • RouterRouting the data packets from end- nodes to the coordinator. • Coordinator collects the data from all the nodes. • Coordinator also act as a gateway that connects the WSN to the internet. • ProtocolZigbee 49 IOT-T.YUVARAJA
  • 50. IoT Enabling Technologies 1) Wireless Sensor Networks(WSN) 50 IOT-T.YUVARAJA
  • 51. IoT Enabling Technologies Example of WSNs: Weather Monitoring system Indoor Air Quality monitoring system Soil Moisture Monitoring system Surveillance systems Health Monitoring systems 51 IOT-T.YUVARAJA
  • 52. IoT Enabling Technologies 1) Wireless sensor networks 2) Cloud computing 3) Big Data analytics 4) Embedded systems 5) Communication protocols 52 IOT-T.YUVARAJA
  • 53. IoT Enabling Technologies 2)Cloud Computing cloud computing is the delivery of computing services—including servers, storage, databases, networking, software, analytics, and intelligence—over the Internet (―the cloud‖) to offer faster innovation, flexible resources, and economies of scale. 53 IOT-T.YUVARAJA
  • 54. IoT Enabling Technologies 2)Cloud computing 54 IOT-T.YUVARAJA
  • 55. IoT Enabling Technologies 2)Cloud computing Cloud computing is the delivery of different services through the Internet, including data storage, servers, databases, networking, and software. Cloud-based storage makes it possible to save files to a remote database and retrieve them on demand. 55 IOT-T.YUVARAJA
  • 56. IoT Enabling Technologies 2)Cloud computing 1) Infrastructure-as-a-Service(IaaS): Example:Google Compute 2) Platform-as-a-Service(PaaS): Example: Google App Engine 3) Software-as-a-Service (SaaS): Example: Microsoft Office 365 56 IOT-T.YUVARAJA
  • 57. IoT Enabling Technologies 1) Wireless sensor networks 2) Cloud computing 3) Big Data analytics 4) Embedded systems 5) Communication protocols 57 IOT-T.YUVARAJA
  • 58. IoT Enabling Technologies 3)Big Data analytics Big data refers to large amount of data. It cannot be stored, processed and analyzed using traditional database like (Oracle, MySQL). 58 IOT-T.YUVARAJA
  • 59. IoT Enabling Technologies 3)Big Data analytics It involve several steps starting from Data cleaning Data munging Data processing Data visualization 59 IOT-T.YUVARAJA
  • 60. IoT Enabling Technologies 3)Big Data analytics • Sensor data weather monitoring stations. • Machine sensor data Industrial and energy systems • Health and fitness data • Data location and tracking of vehicles. • Data retail inventory monitoring systems. 60 IOT-T.YUVARAJA
  • 61. IoT Enabling Technologies 3)Big Data analytics Characteristics:(3V) 1)Volume 2) Velocity 3)Variety 61 IOT-T.YUVARAJA
  • 62. IoT Enabling Technologies 1) Wireless sensor networks 2) Cloud computing 3) Big Data analytics 4) Embedded systems 5) Communication protocols 62 IOT-T.YUVARAJA
  • 63. IoT Enabling Technologies 4)Embedded systems  Embedded system =Hardware + Software To perform Specific task Key components are  Microprocessor or microcontroller Memory (RAM, ROM, Cache), Networking units (Ethernet, Wi-Fi adapter),  Input/output units (Display, Keyboard, etc)  storage (flash memory) They use some special types of processor such as digital signal processor, graphics processor and application specific processor). 63 IOT-T.YUVARAJA
  • 64. IoT Enabling Technologies 5)Communication protocols • Protocol is nothing but rules and regulations. • Backbone of the IoT system • It allow devices to exchange data over the network. 64 IOT-T.YUVARAJA
  • 65. IoT Enabling Technologies 5)Communication protocols 65 IOT-T.YUVARAJA
  • 67. IoT Levels & Deployment Templates • Based upon the number of monitoring nodes used, type of data base used, complexity/ simplicity of analysis, computation there are 6 levels of IoT. 67 IOT-T.YUVARAJA
  • 68. IoT Levels & Deployment Templates • Device • Resources • Controller Service • Database • Web Service • Analysis Component • Application 68 IOT-T.YUVARAJA
  • 69. IoT Levels & Deployment Templates • IoT level 1 • IoT level 2 • IoT level 3 • IoT level 4 • IoT level 5 • IoT level 6 69 IOT-T.YUVARAJA
  • 71. IoT Level-1 • It has single node/device • Data involved is not big. So, data is stored in local database. • It is suitable for modelling design low cost and low complexity solution. • Analysis locally. Eg: Home automation 71 IOT-T.YUVARAJA
  • 73. IoT Level-2 • It has single node/device. • Data involved is big. So data is stored in cloud. • It uses cloud based application to visualize data. • Analysis locally. Eg: smart irrigation 73 IOT-T.YUVARAJA
  • 75. IoT Level-3 • It has single node/device. • Data involved is big. So data is stored in cloud. • It uses cloud based application to visualize data. • Analysis cloud. Eg:Tracking package handling 75 IOT-T.YUVARAJA
  • 77. IoT Level-4 • It has multiple nodes/devices • Data involved is big. So data is stored in cloud. • It uses cloud based application to visualize data. • Analysis cloud. • It has two observer nodes i.e local and cloud based. They can subscribe to and receive information collected in cloud from IoT device. • They can process and use those information for various applications • Observer node does not perform any control function. • Analysis cloud. Eg: Noise monitoring 77 IOT-T.YUVARAJA
  • 79. IoT Level-5 • It has multiple nodes/devices • One coordinator node for collecting and sending the data to cloud by controller service. • Data involved is big. So data is stored in cloud. • It uses cloud based application to visualize data. • Suitable for wireless sensor network. • Analysis cloud. Eg: Forest Fire Detection 79 IOT-T.YUVARAJA
  • 81. IoT Level-6 • It has multiple independent nodes/devices. • It has centralized controller which is aware of the status of all the end nodes and sends control command to the nodes. • Data involved is big. So data is stored in cloud. • It uses cloud based application to visualize data. • Analysis cloud. Eg: Weather monitoring and structural health monitoring 81 IOT-T.YUVARAJA
  • 82. 20EC503PE - INTERNET OF THINGS Unit-2 DOMAIN SPECIFIC IoTs & M2M Domain Specific IoTs- M2M- Difference between IoT & M2M- Software Defined Networking-Network Function Virtualization. 07.08.2023 IOT-T.YUVARAJA 82
  • 83. Domain Specific IoTs • Home • Cities • Environment • Energy Systems • Retail • Logistics • Industry • Agriculture • Health & Lifestyle 83
  • 84. Home Automation IoT applications for smart homes: • Smart Lighting • Smart Appliances • Intrusion Detection • Smoke / Gas Detectors 84
  • 88. Smoke / Gas Detectors 88
  • 89. 89
  • 90. Smart Cities IoT applications for smart cities are, • Smart Parking • Smart Lighting for Roads • Smart Road • Structural Health Monitoring • Surveillance • Emergency Response 90
  • 97. 97
  • 98. Environment IoT applications for smart environments: 1. Weather Monitoring 2. Air Pollution Monitoring 3. Noise Pollution Monitoring 4. Forest Fire Detection 5. River Flood Detection 98
  • 104. Retail IoT applications in smart retail systems: 1. Inventory Management 2. Smart Payments 3. Smart Vending Machines 104
  • 106. Logistics IoT applications for smart logistic systems: 1. Route Generation & Scheduling 2. Fleet Tracking 3. Shipment Monitoring 4. Remote Vehicle Diagnostics 106
  • 108. Industry IoT applications in smart industry: 1. Machine Diagnosis & Prognosis 2. Indoor Air Quality Monitoring 108
  • 109. Machine Diagnosis & Prognosis 109
  • 110. Indoor Air Quality Monitoring 110
  • 111. Agriculture IoT applications for smart agriculture: 1. Smart Irrigation 2. Green House Control 111
  • 114. Health & Lifestyle 1)Health & Fitness Monitoring 2)Wearable Electronics 114
  • 115. Health & Fitness Monitoring 115
  • 117. Energy Systems IoT applications for smart energy systems: 1. Smart Grid 2. Renewable Energy Systems 3. Prognostics 117
  • 121. 121
  • 122. M2M • M2M Machine to Machine • M2M is a direct communication between devices using wired or wireless communication channels. • Two machines ―communicating‖ or exchanging data, without human interfacing or interaction. 122
  • 123. M2M M2M systems comprises of • M2M area networks • M2M core networks • M2M applications 123
  • 124. M2M 3 interlinked domains: 1)M2M device domain 2)Network domain 3)Application domain 124
  • 128. 128
  • 129. Differences between IoT and M2M 129
  • 131. 131
  • 132. Software-Defined Networking (SDN) • SDN enables the control and management of network using software applications. • Devices are programmed in centrally controlled manner. 132
  • 133. Software-Defined Networking (SDN) • SDN is a networking architecture that separates control plane from the data plane. 133
  • 137. SDN Key elements of SDN: 1)Centralized Network controller 2)Programmable open APIs 3)Standard communication interface (Open Flow) 137
  • 139. SDN OpenFlow switch • OpenFlow uses the concept of flows to identify network traffic based on pre-defined match rules. 139
  • 140. 140
  • 141. Network Function Virtualization (NFV) • NFV is an approach to networking where the network entities that traditionally used dedicated hardware items are now replaced with computers on which software runs to provide the same functionality. 141
  • 142. Network Function Virtualization (NFV) • Traditional physical network hardware has always been difficult to change and upgrade. • NFV is a concept that virtualizes major elements of a network. • In this way, rather than having a dedicated item of hardware to provide a given function, software running on a computer / server is used. 142
  • 144. Network Function Virtualization (NFV) Key elements of NFV: 1)Virtualized Network Function(VNF) 2)NFV Infrastructure(NFVI) 3)NFV Management and Orchestration(NFV-MANO) 144
  • 146. Network Function Virtualization (NFV) Home network with virtualized Home Gateway 146
  • 147. 20EC503PE - INTERNET OF THINGS Unit-3 IoT LOGICAL DESIGN USING PYTHON Introduction –Python Data types & Data structures-Control Flow-Functions-Modules- Packages-File Handling Classes-Python Packages of Interest for IoT. 147
  • 148. Python is a general-purpose, high level and object-oriented programming language. Python is an interpreted scripting language also. Python is a case-sensitive language Variable and variable are not the same. 148
  • 149. Characteristics of Python • Multi-paradigm programming language • Interpreted Language • Interactive Language • Easy-to-learn, read and maintain • Object and Procedure Oriented • Extendable • Scalable • Portable • Broad Library Support 149
  • 150. 150
  • 153. Script mode • file with the extension .py 153
  • 154. Declare a string in python • using single quotes(‗ ‘) • using double quotes(" ") 154
  • 155. Declare a string in python Example: x = ‗Python‘ y = "Python" print(x) print(y) 155
  • 156. Declare a string in python Example: x = ‗Python‘ y = "Python" print(x) print(y) Output: Python Python 156
  • 157. Python Operators • Arithmetic operators • Comparison operators • Assignment Operators • Logical Operators • Bitwise Operators • Membership Operators • Identity Operators 157
  • 158. Arithmetic operators Operator Meaning Example + Addition x + y - Subtraction x - y * Multiplication x * y / Division x / y % Modulus x % y // Floor division x // y ** Exponent x ** y 158
  • 159. Arithmetic operators Example: x = 15 y = 4 print('x + y =',x+y) print('x - y =',x-y) print('x * y =',x*y) print('x / y =',x/y) print('x // y =',x//y) print('x ** y =',x**y) 159
  • 160. Arithmetic operators Example: x = 15 y = 4 print('x + y =',x+y) print('x - y =',x-y) print('x * y =',x*y) print('x / y =',x/y) print('x // y =',x//y) print('x ** y =',x**y) 160 Output: x + y = x - y = x * y = x / y = x // y = x ** y =
  • 161. Arithmetic operators Example: x = 15 y = 4 print('x + y =',x+y) print('x - y =',x-y) print('x * y =',x*y) print('x / y =',x/y) print('x // y =',x//y) print('x ** y =',x**y) 161 Output: x + y = 19 x - y = 11 x * y = 60 x / y = 3.75 x // y = 3 x ** y = 50625
  • 162. Comparison operators 162 Operator Name Example > Greater than x > y < Less than x < y == Equal x == y != Not equal x != y >= Greater than or equal to x >= y <= Less than or equal to x <= y
  • 163. Comparison operators Example: x = 10 y = 12 print('x > y is',x>y) print('x < y is',x<y) print('x == y is',x==y) print('x != y is',x!=y) print('x >= y is',x>=y) print('x <= y is',x<=y) 163
  • 164. Comparison operators Example: x = 10 y = 12 print('x > y is',x>y) print('x < y is',x<y) print('x == y is',x==y) print('x != y is',x!=y) print('x >= y is',x>=y) print('x <= y is',x<=y) 164 Output:
  • 165. Comparison operators Example: x = 10 y = 12 print('x > y is',x>y) print('x < y is',x<y) print('x == y is',x==y) print('x != y is',x!=y) print('x >= y is',x>=y) print('x <= y is',x<=y) 165 Output: x > y is x < y is x == y is x != y is x >= y is x <= y is
  • 166. Comparison operators Example: x = 10 y = 12 print('x > y is',x>y) print('x < y is',x<y) print('x == y is',x==y) print('x != y is',x!=y) print('x >= y is',x>=y) print('x <= y is',x<=y) 166 Output: x > y is False x < y is True x == y is False x != y is True x >= y is False x <= y is True
  • 167. Logical operators Operator Meaning Example and True if both the operands are true x and y or True if either of the operands is true x or y not True if operand is false (complements the operand) not x 167
  • 168. Logical operators Example: x = 5 print('x and y is',x > 3 and x < 10) print('x or y is',x > 3 or x < 4) print('not x is',not(x > 3)) 168
  • 169. Logical operators Example: x = 5 print('x and y is',x > 3 and x < 10) print('x or y is',x > 3 or x < 4) print('not x is',not(x > 3)) 169 Output:
  • 170. Logical operators Example: x = 5 print('x and y is',x > 3 and x < 10) print('x or y is',x > 3 or x < 4) print('not x is',not(x > 3)) 170 Output: x and y is x or y is not x is
  • 171. Logical operators Example: x = 5 print('x and y is',x > 3 and x < 10) print('x or y is',x > 3 or x < 4) print('not x is',not(x > 3)) 171 Output: x and y is True x or y is True not x is False
  • 172. Logical operators Example: x = 15 print('x and y is',x > 3 and x < 10) print('x or y is',x > 3 or x < 4) print('not x is',not(x > 3)) 172 Output: x and y is x or y is not x is
  • 173. Logical operators Example: x = 15 print('x and y is',x > 3 and x < 10) print('x or y is',x > 3 or x < 4) print('not x is',not(x > 3)) 173 Output: x and y is False x or y is True not x is False
  • 174. Logical operators Example: x = 5 print(x > 3 and x < 10) print(x > 3 or x < 4) print(not(x > 3)) 174 Output: True True False
  • 175. Bitwise Operators Operator Meaning Example & Bitwise AND x & y | Bitwise OR x | y ~ Bitwise NOT ~x ^ Bitwise XOR x ^ y >> Bitwise right shift x >> 2 << Bitwise left shift x << 2 175
  • 176. Bitwise Operators Example: x = 10 y = 4 print('x & y is', x & y) print('x | y is ', x | y) print('~x is', ~x) print('x ^ y is ', x ^ y) print('x >> 2 is',x >> 2 ) print('x << 2 is',x << 2) 176
  • 177. Example: x = 10 y = 4 print('x & y is', x & y) print('x | y is ', x | y) print('~x is', ~x) print('x ^ y is ', x ^ y) print('x >> 2 is',x >> 2 ) print('x << 2 is',x << 2) 177 Output: x & y is x | y is ~x is x ^ y is x >> 2 is x << 2 is
  • 178. Example: x = 10 y = 4 print('x & y is', x & y) print('x | y is ', x | y) print('~x is', ~x) print('x ^ y is ', x ^ y) print('x >> 2 is',x >> 2 ) print('x << 2 is',x << 2) 178 Output: x & y is 0 x | y is 14 ~x is -11 x ^ y is 14 x >> 2 is 2 x << 2 is 40
  • 179. Example: x = 10 y = 4 print('x & y is', x & y) print('x | y is ', x | y) print('~x is', ~x) print('x ^ y is ', x ^ y) print('x >> 2 is',x >> 2 ) print('x << 2 is',x << 2) 179 Output: x & y is 0 x | y is 14 ~x is -11 x ^ y is 14 x >> 2 is 2 x << 2 is 40
  • 180. Output: x & y is 0 x | y is 14 ~x is -11 x ^ y is 14 x >> 2 is 2 x << 2 is 40 180
  • 181. x & y = x | y = ~x = x ^ y = x >> 2 = x << 2 = 181 Example: x = 100000 1010 y = 4 0000 0100
  • 182. x & y = 0000 0000 x | y = ~x = x ^ y = x >> 2 = x << 2 = 182 Example: x = 100000 1010 y = 4 0000 0100
  • 183. x & y = 0000 0000 x | y = 0000 1110 ~x = x ^ y = x >> 2 = x << 2 = 183 Example: x = 100000 1010 y = 4 0000 0100
  • 184. x & y = 0000 0000 x | y = 0000 1110 ~x = 1111 0101 x ^ y = x >> 2 = x << 2 = 184 Example: x = 100000 1010 y = 4 0000 0100
  • 185. x & y = 0000 0000 x | y = 0000 1110 ~x = 1111 0101 x ^ y = 0000 1110 x >> 2 = x << 2 = 185 Example: x = 100000 1010 y = 4 0000 0100
  • 186. x & y = 0000 0000 x | y = 0000 1110 ~x = 1111 0101 x ^ y = 0000 1110 x >> 2 = 0000 0010 x << 2 = 186 Example: x = 100000 1010 y = 4 0000 0100
  • 187. x & y = 0000 0000 x | y = 0000 1110 ~x = 1111 0101 x ^ y = 0000 1110 x >> 2 = 0000 0010 x << 2 = 0010 1000 187 Example: x = 10 (0000 1010) y = 4 (0000 0100 )
  • 188. x & y = 0000 0000 0 x | y = 0000 1110 14 ~x = 1111 0101-11 x ^ y = 0000 111014 x >> 2 = 0000 00102 x << 2 = 0010 100040 188 Example: x = 10 (0000 1010) y = 4 (0000 0100 )
  • 189. 189
  • 190. 190
  • 191. Assignment operators Operator Example Equivalent to = x = 5 x = 5 += x += 5 x = x + 5 -= x -= 5 x = x - 5 *= x *= 5 x = x * 5 /= x /= 5 x = x / 5 %= x %= 5 x = x % 5 //= x //= 5 x = x // 5 **= x **= 5 x = x ** 5 &= x &= 5 x = x & 5 |= x |= 5 x = x | 5 ^= x ^= 5 x = x ^ 5 >>= x >>= 5 x = x >> 5 <<= x <<= 5 x = x << 5 191
  • 192. Membership operators Operator Description Example in True if value/variable is found in the sequence x in y not in True if value/variable is not found in the sequence x not in y 192
  • 193. Membership operators Example: x = ["apple", "banana"] print("banana" in x) print("pineapple" not in x) 193
  • 194. Membership operators Example: x = ["apple", "banana"] print("banana" in x) print("pineapple" not in x) Output: 194
  • 195. Membership operators Example: x = ["apple", "banana"] print("banana" in x) print("pineapple" not in x) Output: True 195
  • 196. Membership operators Example: x = ["apple", "banana"] print("banana" in x) print("pineapple" not in x) Output: True True 196
  • 197. Membership operators Example: x = ["apple", "banana"] print("banana" in x) print("apple" not in x) Output: 197
  • 198. Membership operators Example: x = ["apple", "banana"] print("banana" in x) print("apple" not in x) Output: True False 198
  • 199. Identity operators Operator Description Example is True if both variables are the same object x is y is not True if both variables are not the same object X is not y 199
  • 200. Identity operators Example: x1 = 5 y1 = 5 x2 = "Hello" y2 = "Hello" print(x1 is not y1) print(x2 is y2) 200 False True
  • 201. Identity operators Example: x1 = 5 y1 = 5 x2 = "Hello" y2 = "Hello" print(x1 is not y1) print(x2 is y2) Output: 201 False True
  • 202. Identity operators Example: x1 = 5 y1 = 5 x2 = "Hello" y2 = "Hello" print(x1 is not y1) print(x2 is y2) Output: False True 202 False True
  • 203. Python Data Types & Data Structures • Variables can hold values, and every value has a data-type. • Python is a dynamically typed language; hence we do not need to define the type of the variable while declaring it. • Python provides us the type() function, which returns the type of the variable passed. 203
  • 204. Python Data Types & Data Structures Example: a=10 b="Hi Python" c = 10.5 print(type(a)) print(type(b)) print(type(c)) 204
  • 205. NOTE: However, in Python 3, the long data type was removed; no matter how big the integer is, it will be an int. 205
  • 206. Python Data Types & Data Structures • Numbers • Strings • Lists • Tuples • Dictionaries • Type Conversion 206
  • 207. Python Data Types & Data Structures • Numbers • Strings • Lists • Tuples • Dictionaries • Type Conversion 207
  • 208. Numbers • Number data type is used to store numeric values. 1)int 2)float 3)complex 208
  • 209. Numbers Example: a = 5 b = 2.5 c = 2+5j print(type(a)) print(type(b)) print(type(c)) 209 Output: <class 'int'> <class 'float'> <class 'complex'>
  • 213. Numbers Example: a = 5 b = 2.5 c=a+b d=a-b e=a*b f=a/b g=a**2 213
  • 214. Numbers Example: a = 5 b = 2.5 c=a+b d=a-b e=a*b f=a/b g=a**2 print(c) print(d) print(e) print(f) print(g) 214 Output: 7.5 2.5 12.5 2.0 25
  • 215. Python Data Types & Data Structures • Numbers • Strings • Lists • Tuples • Dictionaries • Type Conversion 215
  • 217. Declare a string in python • using single quotes(‗ ‘) • using double quotes(" ") 217
  • 218. Declare a string in python Example: x = ‗Python‘ y = "Python" print(x) print(y) 218
  • 219. Strings Example: a="Welcome!" print(a) print("type is",type(a)) print("Length is",len(a)) print("The string(%s)has %d characters" % (a,len(a))) print("Upper case is",a.upper()) print("Lower case is",a.lower()) print(a[0]) print(a[2]) print(a[3:]) print(a[3:-1]) 219
  • 220. 220 Welcome! type is <class 'str'> Length is 8 The string(Welcome!)has 8 characters Upper case is WELCOME! Lower case is welcome Output: Welcome! type is <class 'str'> Length is 8 The string(Welcome!)has 8 characters Upper case is WELCOME! Lower case is welcome! W l come! come
  • 224. Strings Example: a=―Welcome!" b= ―Kongunadu College" c = a+b print(c) Output: 224 Welcome!Kongunadu College
  • 225. Python Data types & Data structures • Numbers • Strings • Lists • Tuples • Dictionaries • Type Conversion 225
  • 226. Lists • Lists are used to store multiple items in a single variable. 226
  • 227. Example: list1 = ["apple", "banana", "cherry"] list2 = [1, 5, 7, 9, 3] list3 = [True, False, False] 227 Lists
  • 228. Example: list1 = ["apple", "banana", "cherry"] list2 = [1, 5, 7, 9, 3] list3 = [True, False, False] print(type(list1)) print(type(list2)) print(type(list3)) 228 Output: <class 'list'> <class 'list'> <class 'list'> Lists
  • 229. Lists Example: fruits=['apple', 'orange', "banana", "mango"] print(type(fruits)) print(len(fruits)) print(fruits[2]) print(fruits[0:2]) print(fruits[2:]) print(fruits) fruits.append(‗cherry') print(fruits) fruits.remove(‗banana‘) print(fruits) fruits.insert(2,' banana ') print(fruits) 229 Output: <class 'list'> 4 banana ['apple', 'orange'] ['banana', 'mango‘] ['apple', 'orange', 'banana', 'mango‘] ['apple', 'orange', 'banana', 'mango', 'cherry‘] ['apple', 'orange', 'mango', 'cherry‘] ['apple', 'orange', 'banana', 'mango', 'cherry']
  • 231. Lists Example: mixed=['data‘,13, 25.14] print(mixed) print(type(mixed)) print(type(mixed[0])) print(type(mixed[1])) print(type(mixed[2])) mixed[0]=mixed[0]+―type" mixed[1]=mixed[1]+2.352 mixed[2]=mixed[2]+0.15 print(mixed) 231 Output: ['data', 13, 25.14] <class 'list‘> <class 'str'> <class 'int'> <class 'float‘> ['datatype', 15.352, 25.29] ['datatype', 15.352, 25.29] ['datatype', 15.352, 25.29] 15.352, 25.29
  • 232. 20EC503PE - INTERNET OF THINGS Unit-4 IoT PHYSICAL DEVICES AND ENDPOINTS IoT Device -Building blocks -Raspberry Pi - Board - Linux on Raspberry Pi - Raspberry Pi Interfaces -Programming Raspberry Pi with Python - Other IoT Devices - Arduino. 232
  • 233. Raspberry Pi Interfaces 1) Serial 2) SPI 3) I2C 233
  • 234. 234
  • 235. Raspberry Pi Interfaces Serial : •2 Pins 1) Receive (Rx) Pin 2) Transmit (Tx) Pin •Communication with serial peripherals. SPI : •Serial Peripheral Interface (SPI) is a synchronous serial data protocol used for communicating with one or more peripheral devices. •5 Pins 1)MISO (Master in slave out) – Master line for sending data to the peripherals. 2)MOSI (Master out slave in) – Slave line for sending data to the master. 3)SCK (Serial Clock) – Clock generated by master to synchronize data transmission 4)CE0 (Chip Enable 0) – To enable or disable devices 5)CE0 (Chip Enable 1) – To enable or disable devices 235
  • 236. Raspberry Pi Interfaces I2C : • I2C Inter Integrated Circuit • The I2C interface pins on Raspberry Pi allow you to connect hardware modules. • I2C interface allows synchronous data transfer with just two pins. 1)SDA (Serial Data) 2)SCL (Serial Clock) 236
  • 237. Other IoT Devices • pcDuino • BeagleBone Black • Cubieboard 237
  • 239. pcDuino • pcDuino is an Arduino-pin compatible single board mini-computer • ARM Cortex-A8 processor • 1 GHz • Runs PC like OS such as Ubuntu and Android ICS. • HDMI video/audio interface. • C, C++ ,Java and Python. 239
  • 241. BeagleBone Black • BeagleBone Black is similar to Raspberry Pi. • 1 GHz • ARM Cortex-A8 processor • supports both Linux and Android operating systems. • HDMI video/audio interface. • USB and Ethernet ports. 241
  • 243. Cubieboard • Dual core ARM Cortex A7 processor • USB, HDMI, IR, serial, Ethernet, SATA, and a 96 pin extended interface. • runs both Linux and Android operating systems. 243
  • 245. Arduino • UNO means ‗one‘. • first release of Arduino Software. • ATmega328P microcontroller. • Arduino UNO includes * 6 analog pin inputs * 14 digital I/O pins (6-PWM outputs) * USB connector, * power jack, * ICSP (In-Circuit Serial Programming) header. 245
  • 246. Arduino • ATmega328 Microcontroller- It is a single chip Microcontroller of the ATmel family. The processor code inside it is of 8-bit. It combines Memory (SRAM, EEPROM, and Flash), Analog to Digital Converter, SPI serial ports, I/O lines, registers, timer, external and internal interrupts, and oscillator. • ICSP pin - The In-Circuit Serial Programming pin allows the user to program using the firmware of the Arduino board. • Power LED Indicator- The ON status of LED shows the power is activated. When the power is OFF, the LED will not light up. • Digital I/O pins- The digital pins have the value HIGH or LOW. The pins numbered from D0 to D13 are digital pins. • TX and RX LED's- The successful flow of data is represented by the lighting of these LED's. 246
  • 247. Arduino • AREF- The Analog Reference (AREF) pin is used to feed a reference voltage to the Arduino UNO board from the external power supply. • Reset button- It is used to add a Reset button to the connection. • USB- It allows the board to connect to the computer. It is essential for the programming of the Arduino UNO board. • Crystal Oscillator- The Crystal oscillator has a frequency of 16MHz, which makes the Arduino UNO a powerful board. • Voltage Regulator- The voltage regulator converts the input voltage to 5V. • GND- Ground pins. The ground pin acts as a pin with zero voltage. • Vin- It is the input voltage. • Analog Pins- The pins numbered from A0 to A5 are analog pins. The function of Analog pins is to read the analog sensor used in the connection. It can also act as GPIO (General Purpose Input Output) pins. 247
  • 248. Basic Commands for Arduino 1. pinMode(x, OUTPUT) 2. digitalWrite(x, HIGH 3. pinMode(x, INPUT) 4. digitalRead(digital Pin) 5. analogRead(analog pin) 248
  • 249. 249
  • 250. 250
  • 251. void setup() { pinMode(2, OUTPUT); } void loop() { digitalWrite(2, HIGH); delay(1000); digitalWrite(2, LOW delay(1000); } 251
  • 252. void setup() { // initialize digital pin 13 as an output. pinMode(2, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(2, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(2, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second 252
  • 253. Interfacing LED and switch with Raspberry Pi 253
  • 254. Interfacing LED and switch with Raspberry Pi • In this example the LED is connected to GPIO pin 18 and switch is connected to pin 25. In the infinite while loop the value of pin 25 is checked and the state of LED is toggled if the switch is pressed. This example shows how to get input from GPIO pins and process the input and take some action. The action in this example is toggling the state of an LED. 254
  • 255. Interfacing LED and switch with Raspberry Pi from time import sleep import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) #Switch Pin GPIO.setup(25, GPIO.IN) #LED Pin GPIO.setup(18, GPIO.OUT) state=false def toggleLED(pin): state = not state GPIO.output(pin, state) 255
  • 256. while True: try: if (GPIO.input(25) == True): toggleLED(pin) sleep(.01) except KeyboardInterrupt: exit() 256
  • 257. Interfacing a Light Sensor (LDR) with Raspberry Pi import RPi.GPIO as GPIO import time GPIO.setmode (GPIO.BCM) ldr_threshold = 1000 LDR PIN = 18 LIGHT_PIN = 25 def readLDR (PIN): reading=0 GPIO. setup (LIGHT_PIN, GPIO.OUT) GPIO.output (PIN, False) time.sleep (0.1) GPIO. setup (PIN, GPIO.IN) 257
  • 258. Interfacing a Light Sensor (LDR) with Raspberry Pi while (GPIO.input (PIN) == False): reading=reading+1 return reading def switchOnLight (PIN) : GPIO. setup (PIN, GP10.OUT) GPIO.output (PIN, True) def switchOffLight (PIN): GPIO.setup (PIN, GPI0.OUT) GPIO.out put (PIN, False) while True: ldr_reading = readLDR (LDR_PIN) if ldr_reading < ldr_threshold : switchOnLight (LIGHT_PIN) else: switchof fLi ght (LIGHT_PIN) time.sleep (1) 258
  • 259. Programming Raspberry Pi with Python • Controlling an LED (Blinking an LED) • Controlling an LED with Switch • Interfacing a Light Sensor (LDR) 259
  • 260. 260
  • 261. 261
  • 262. 262
  • 263. Controlling an LED • LED is connected to GPIO 18. • LED is output 263
  • 264. Python program for blinking LED import RPi.GP10 as GPIO import time GPIO. setmode (GPIO.BCM) GPIO.set up (18, GPIO.OUT) while True: GPIO.output (18, True) time.sleep (1) GPIO.output (18, False) time.sleep (1) 264
  • 265. Python program for blinking LED import RPi.GP10 as GPIO import time Ledpin =18 GPIO. setmode (GPIO.BCM) GPIO.set up (Ledpin, GPIO.OUT) while True: GPIO.output (Ledpin, True) time.sleep (1) GPIO.output (Ledpin, False) time.sleep (1) 265
  • 266. Python program for blinking LED import RPi.GP10 as GPIO from time import sleep GPIO. setmode (GPIO.BCM) GPIO.set up (18, GPIO.OUT) while True: GPIO.output (18, True) sleep (1) GPIO.output (18, False) sleep (1) 266
  • 267. 267
  • 268. Interfacing LED and switch with Raspberry Pi 268
  • 269. Interfacing LED and switch with Raspberry Pi • LED is connected to GPIO pin 18 • switch is connected to pin 25. 269
  • 270. Interfacing LED and switch with Raspberry Pi import RPi.GPIO as GPIO import time switch_pin=25 LED_pin=18 GPIO.setmode(GPIO.BCM) GPIO.setup(switch_pin, GPIO.IN) GPIO.setup(LED_pin, GPIO.OUT) while True: if (GPIO.input(switch_pin) == True): GPIO.output (LED_pin, True) time.sleep (1) else: GPIO.output (LEDpin, False) time.sleep (1) 270
  • 271. Interfacing LED and switch with Raspberry Pi import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BCM) GPIO.setup(25, GPIO.IN) GPIO.setup(18, GPIO.OUT) while True: if (GPIO.input(25) == True): GPIO.output (18, True) else: GPIO.output (18, False) 271
  • 272. Interfacing LED and switch with Raspberry Pi import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BCM) GPIO.setup(25, GPIO.IN) GPIO.setup(18, GPIO.OUT) while True: if (GPIO.input(25) == True): GPIO.output (18, True) sleep (1) else: GPIO.output (18, False) sleep (1) 272
  • 273. Interfacing a Light Sensor (LDR) with Raspberry Pi import RPi.GPIO as GPIO import time GPIO.setmode (GPIO.BCM) LDR_PIN = 18 LIGHT_PIN = 25 ldr_threshold = 1000 def readLDR (LDR_PIN): reading=0 GPIO. setup (LDR_PIN, GPIO.OUT) GPIO.output (LDR_PIN, False) time.sleep (1) GPIO. setup (LDR_PIN, GPIO.IN) while (GPIO.input (LDR_PIN) == False): reading=reading+1 return reading 273
  • 274. 20EC503PE - INTERNET OF THINGS Unit-5 CASE STUDIES Home Automation – Cities – Environment – Agriculture – Structural Health monitoring – Weather monitoring. 274
  • 275. Home Automation • Smart Lighting • Home Intrusion Detection 275
  • 278. Home Intrusion Detection Purpose: • to detect intrusions using sensors (such as PIR sensors and door sensors) and raise alerts, if necessary. • Components: • Raspberry Pi • PIR sensors • door sensors 278
  • 280. Smart Parking • Purpose: • to detect the number of empty parking slots and send the information over the Internet to smart parking application backends. • Components: • Raspberry Pi • ultrasonic sensor 280
  • 282. Environment • Weather Monitoring System • Weather Reporting Bot • Air Pollution Monitoring • Forest Fire Detection 282
  • 290. REFERENCE BOOK • Arshdeep Bahga, Vijay Madisetti, ―Internet of Things – A hands–on approach‖, Universities Press, 2015 290