0% found this document useful (0 votes)
38 views41 pages

Io T Material Unit - (1-3)

Io T Material Unit-(1-3)
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views41 pages

Io T Material Unit - (1-3)

Io T Material Unit-(1-3)
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

lOMoARcPSD|43337963

Io T Material Unit-(1-3)

Introduction to Internet of Things (JNTUA COLLEGE OF ENGINEERING


ANANTAPURAM)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Omprakash D ([email protected])
lOMoARcPSD|43337963

INTERNET OF THINGS
(20A04701b)

B.TECH
(III YEAR – II SEM)
(R20) REGULATION

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

SRINIVASA INSTITUTE OF TECHONOLOGY & SCIENCE


Chennai – Hyderabad Bypass Road, Ukkayapalli, Kadapa
www.sitskadapa.ac.in

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

UNIT – 1
Introduction to IoT: Architectural overview, Design principles and needed capabilities, IoT
Applications, Sensing, Actuation, Basics of Networking, M2M and IoT Technology
Fundamentals-Devices and gateways, Data management, Business processes in IoT, Role of
cloud in IoT.

IoT Definition:
The definition of IoT can be explained as follows:
“Internet of Things means a network of physical things (objects) sending, receiving, or
communicating information using the Internet or other communication technologies and
network just as the computers, tablets and mobiles do, and thus enabling the monitoring,
coordinating or controlling process across the Internet or another data network.”
Another source, defines the term IoT as follows:
“Internet of Things is the network of physical objects or ‘things’ embedded with
electronics, software, sensors and connectivity to enable it to achieve greater value and service
by exchanging data with the manufacturer, operator and/or other connected devices. Each thing
is uniquely identifiable through its embedded computing system but is able to interoperate
within the existing Internet infrastructure.”
IoT ARCHITECTURAL VIEW:
An IoT system has multiple levels. These levels are also known as tiers. A model
enables conceptualisation of a framework. A reference model can be used to depict building
blocks, successive interactions and integration. An example is CISCO’s presentation of a
reference model comprising seven levels (figure 1.4) as follows:

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

A reference model could be identified to specify reference architecture. Several


reference
architectures are expected to co-exist in the IoT domain. Figure1.5 shows an Oracle suggested
IoT architecture.

Figure 1.5 Oracle’s IoT architecture

An architecture has the following features:


● The architecture serves as a reference in applications of IoT in services and business
processes.

● A set of sensors which are smart, capture the data, perform necessary data element
analysis and transformation as per device application framework and connect directly
to a communication manager.

A set of sensor circuits is connected to a gateway possessing separate data capturing,


gathering, computing and communication capabilities. The gateway receives the data
in one form at one end and sends it in another form to the other end.

● The communication-management subsystem consists of protocol handlers, message


routers and message cache.

● This management subsystem has functionalities for device identity database, device
identity management and access management.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

● Data routes from the gateway through the Internet and data centre to the application
server or enterprise server which acquires that data.

● Organisation and analysis subsystems enable the services, business processes,


enterprise integration and complex processes.

Design principles and needed capabilities:

1.Design for reuse of deployed IoT resources across application domains:


This implies that devices shall be made application independent and that the basic and
atomic services they expose in terms of sensing and actuation shall be done in a uniform way.

2. Design for a set of support services that provide open service-oriented capabilities and can
be used for application development and execution:
The open environment of IOT will, for instance, require mechanisms, for authorized
usage of services and resources, authentication, and associated identity management.

3.Design for different abstraction levels that guide underlying complexities and
heterogeneities:
A system design great benefit from providing the necessary abstractions both of
underlying technologies, data and service representation, as well as granularity of information
and services.

4. Design for sensing and actors taking on different roles of providing and using services across
different business domains and value chains:
IOT solutions can be run across a set of departments within an enterprise, or across a
set of enterprises in a value system, or even be provided in a truly open environment.

5. Design for ensuring trust, security, and privacy:


Trust within IOT often implies reliability, and that data is only used for the purpose of
the end user as agreed to.

6. Design for scalability, performance, and effectiveness:


Data may be infrequent (e.g., alarms or detected abnormal events), or maybe coming
as real-time data streams, all dependent on the type of data needed or based on application
needs.

7. Design for evolvability, heterogeneity, and simplicity of integration:


Technology is constantly changing, and given the nature of IoT deployments where
devices and sensor nodes are expected to be operational and in the field for many years,
sometimes with life cycles of over 15 years, handling heterogeneity is also important since
especially device-oriented technologies used across industries are very different.

8. Design for simplicity of Management:


Autoconfiguration and auto provisioning are key and well-known means that can ease
deployment of IoT devices, and are also very important to lower operating expenditures.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

9. Designed for different service delivery models:


We already know about the clear trends to move from product offerings to a more
combined product and service offering in a number of industries, for instance, connected
vehicles, and Software as a Service (SaaS).

IoT Applications:

1. IoT Applications – Wearables

Wearable technology is a hallmark of IoT applications and probably is one of the earliest
industries to have deployed the IoT at its service. We happen to see Fit Bits, heart rate monitors
and smartwatches everywhere these days.

One of the lesser-known wearables includes the Guardian glucose monitoring device. The
device is developed to aid people suffering from diabetes. It detects glucose levels in the body,
using a tiny electrode called glucose sensor placed under the skin and relays the information
via Radio Frequency to a monitoring device.

2. IoT Applications – Smart Home Applications

When we talk about IoT Applications, Smart Homes are probably the first thing that we think
of. The best example I can think of here is Jarvis, the AI home automation employed by Mark
Zuckerberg. There is also Allen Pan’s Home Automation System where functions in the house
are actuated by use of a string of musical notes. The following video could give you a better
idea.

3. IoT Applications – Health Care

IoT applications can turn reactive medical-based systems into proactive wellness-based
systems.

The resources that current medical research uses, lack critical real-world information. It mostly
uses leftover data, controlled environments, and volunteers for medical examination. IoT opens
ways to a sea of valuable data through analysis, real-time field data, and testing.

The Internet of Things also improves the current devices in power, precision, and
availability. IoT focuses on creating systems rather than just equipment.

4. IoT Applications – Smart Cities

By now I assume, most of you must have heard about the term Smart City. The hypothesis of
the optimized traffic system I mentioned earlier, is one of the many aspects that constitute a
smart city.

The thing about the smart city concept is that it’s very specific to a city. The problems faced in
Mumbai are very different than those in Delhi. The problems in Hong Kong are different from
New York. Even global issues, like finite clean drinking water, deteriorating air quality and
increasing urban density, occur in different intensities across cities. Hence, they affect each
city differently.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

The Government and engineers can use IoT to analyse the often-complex factors of town
planning specific to each city. The use of IoT applications can aid in areas like water
management, waste control, and emergencies.

5. IoT Applications – Agriculture

Statistics estimate the ever-growing world population to reach nearly 10 billion by the year
2050. To feed such a massive population one needs to marry agriculture to technology and
obtain best results. There are numerous possibilities in this field. One of them is the Smart
Greenhouse.

A greenhouse farming technique enhances the yield of crops by controlling environmental


parameters. However, manual handling results in production loss, energy loss, and labour cost,
making the process less effective.

A greenhouse with embedded devices not only makes it easier to be monitored but also, enables
us to control the climate inside it. Sensors measure different parameters according to the plant
requirement and send it to the cloud. It, then, processes the data and applies a control action.

6. IoT Applications – Industrial Automation

This is one of the fields where both faster developments, as well as the quality of products, are
the critical factors for a higher Return on Investment. With IoT Applications, one could even
re-engineer products and their packaging to deliver better performance in both cost and
customer experience. IoT here can prove to be game changing with solutions for all the
following domains in its arsenal.

 Factory Digitalization
 Product flow Monitoring
 Inventory Management
 Safety and Security
 Quality Control
 Packaging optimization
 Logistics and Supply Chain Optimization

Sensors in Internet of Things (IoT): (Sensing)

Sensors are used for sensing things and devices etc.


A device that provides a usable output in response to a specified measurement.
The sensor attains a physical parameter and converts it into a signal suitable for processing
(e.g., electrical, mechanical, optical) the characteristics of any device or material to detect
the presence of a particular physical quantity.

Types of sensors: -

1.Electrical sensor:
Electrical proximity sensors may be contact or non-contact. Simple contact sensors
operate by making the sensor and the component complete an electrical circuit.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

Non- contact electrical proximity sensors rely on the electrical principles of either induction
for detecting metals or capacitance for detecting non-metals as well.
2.Light sensor:
Light sensor is also known as photo sensors and one of the important sensors. Light
dependent resistor or LDR is a simple light sensor available today.
The property of LDR is that its resistance is inversely proportional to the intensity of the
ambient light i.e., when the intensity of light increases, its resistance decreases and vise versa.
3.Touch sensor:
Detection of something like a touch of finger or a stylus is known as touch sensor. Its
name suggests that detection of something.
They are classified into two types:
1. Resistive type
2. Capacitive type
Today almost all modern touch sensors are of capacitive types. Because they are more
accurate and have better signal to noise ratio.
4.Range sensing:
Range sensing concerns detecting how near or far a component is from the sensing
position, although they can also be used as proximity sensors. Distance or range sensors use
non-contact analog techniques. Short range sensing, between a few millimetres and a few
hundred millimetres is carried out using electrical capacitance, inductance and magnetic
technique. Longer range sensing is carried out using transmitted energy waves of various
types e.g., radio waves, sound waves and lasers.
5.Mechanical sensor:
Any suitable mechanical / electrical switch may be adopted but because a certain
amount of force is required to operate a mechanical switch it is common to use micro-
switches.
6.Pneumatic sensor:
These proximity sensors operate by breaking or disturbing an air flow. The pneumatic
proximity sensor is an example of a contact type sensor. These cannot be used where light
components may be blown away.
7.Optical sensor:
In their simplest form, optical proximity sensors operate by breaking a light beam
which falls onto a light sensitive device such as a photocell. These are examples of non-
contact sensors. Care must be exercised with the lighting environment of these sensors for
example optical sensors can be blinded by flashes from arc welding processes, airborne dust
and smoke clouds may impede light transmission etc.
8.Speed Sensor:
Sensor used for detecting the speed of any object or vehicle which is in motion is
known as speed sensor. For example – Wind Speed Sensors, Speedometer, UDAR, Ground
Speed Radar.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

9.Temperature Sensor:
Devices which monitor and tracks the temperature and gives temperature’s
measurement as an electrical signal are termed as temperature sensors. These electrical
signals will be in the form of voltage and is directly proportional to the temperature
measurement.
10.PIR Sensor:
PIR stands for passive infrared sensor and it is an electronic sensor that is used for the
tracking and measurement of infrared (IR) light radiating from objects in its field of view and
is also known as Pyroelectric sensor .It is mainly used for detecting human motion and
movement detection .
11.Ultrasonic Sensor:
The principle of ultrasonic sensor is similar to the working principle of SONAR or
RADAR in which the interpretation of echoes from radio or sound waves to evaluate the
attributes of a target by generating the high frequency sound waves .

Actuators in IoT: (Actuation)


An actuator is a machine component or system that moves or controls the mechanism
of the system. Sensors in the device sense the environment, then control signals are generated
for the actuators according to the actions needed to perform.

Types of Actuators:
1. Hydraulic Actuators –
A hydraulic actuator uses hydraulic power to perform a mechanical operation. They are
actuated by a cylinder or fluid motor. The mechanical motion is converted to rotary, linear,
or oscillatory motion, according to the need of the IoT device. Ex- construction equipment
uses hydraulic actuators because hydraulic actuators can generate a large amount of force.
2. Pneumatic Actuators –
A pneumatic actuator uses energy formed by vacuum or compressed air at high pressure to
convert into either linear or rotary motion. Example- Used in robotics, use sensors that work
like human fingers by using compressed air.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

3. Electrical Actuators –
An electric actuator uses electrical energy, is usually actuated by a motor that converts
electrical energy into mechanical torque. An example of an electric actuator is a solenoid
based electric bell.

Basics of Networking:

Open system:
A system which is connected to the network and is ready for communication.

Closed system:
A system which is not connected to the network and can’t be communicated with.

Computer Network:
An interconnection of multiple devices, also known as hosts, that are connected using
multiple paths for the purpose of sending/receiving data or media. Computer networks can
also include multiple devices/mediums which help in the communication between two
different devices; these are known as Network devices and include things such as routers,
switches, hubs, and bridges.

Network Topology:
The layout arrangement of the different devices in a network. Common examples include:
Bus, Star, Mesh, Ring, and Daisy chain.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

OSI:
OSI stands for Open Systems Interconnection. It is a reference model that specifies
standards for communications protocols and also the functionalities of each layer. The OSI
has been developed by the International Organization For Standardization and it is 7 layer
architecture. Each layer of OSI has different functions and each layer has to follow
different protocols.
The 7 layers are:-
1. physical layer
2. Data link layer
3. Network layer
4. Transport layer
5. Session layer
6. Presentation layer
7. Application layer
Protocol:
A protocol is the set of rules or algorithms which define the way how two
entities can communicate across the network and there exists different protocol
defined at each layer of the OSI model. Few of such protocols are TCP, IP,
UDP, ARP, DHCP, FTP and so on.
UNIQUE IDENTIFIERS OF NETWORK
Host name:
Each device in the network is associated with a unique device name known as
Hostname.
Type “hostname” in the command prompt(Administrator Mode) and press
‘Enter’, this displays the hostname of your machine.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

IP Address (Internet Protocol address):


Also known as the Logical Address, the IP Address is the network address of the system
across the network.
To identify each device in the world-wide-web, the Internet Assigned Numbers Authority
(IANA) assigns an IPV4 (Version 4) address as a unique identifier to each device on the
Internet.
The length of an IPv4 address is 32-bits, hence, we have 232 IP addresses available. The
length of an IPv6 address is 128-bits.
Type “ipconfig” in the command prompt and press ‘Enter’, this gives us the IP address of
the device.
MAC Address (Media Access Control address):
Also known as physical address, the MAC Address is the unique identifier of each host and
is associated with its NIC (Network Interface Card).
A MAC address is assigned to the NIC at the time of manufacturing.
The length of the MAC address is : 12-nibble/ 6 bytes/ 48 bits
Type “ipconfig/all” in the command prompt and press ‘Enter’, this gives us the MAC
address.
Port:
A port can be referred to as a logical channel through which data can be sent/received to an
application. Any host may have multiple applications running, and each of these
applications is identified using the port number on which they are running.
Socket:
The unique combination of IP address and Port number together are termed as Socket.
Other related concepts
DNS Server:
DNS stands for Domain Name system.
DNS is basically a server which translates web addresses or URLs (ex: www.google.com)
into their corresponding IP addresses. We don’t have to remember all the IP addresses of
each and every website.
The command ‘nslookup’ gives you the IP address of the domain you are looking for. This
also provides the information of our DNS Server.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

ARP:
ARP stands for Address Resolution Protocol.
It is used to convert an IP address to its corresponding physical address(i.e., MAC
Address).
ARP is used by the Data Link Layer to identify the MAC address of the Receiver’s
machine.
RARP:
RARP stands for Reverse Address Resolution Protocol.
As the name suggests, it provides the IP address of the device given a physical address as
input. But RARP has become obsolete since the time DHCP has come into the picture.

M2M and IoT Technology Fundamentals:


Devices and gateways
A device is a hardware unit that can sense aspects of its environment and/or actuate,
i.e., perform tasks in its environment. A device can be characterized as having several
properties, including:

• Microcontroller: 8-, 16-, or 32-bit working memory and storage.


• Power Source: Fixed, battery, energy harvesting, or hybrid.
• Sensors and Actuators: Onboard sensors and actuators, or circuitry that allows them to be
connected, sampled, conditioned, and controlled.
• Communication: Cellular, wireless, or wired for LAN and WAN communication.
• Operating System (OS): Main-loop, event-based, real-time, or full featured OS.
• Applications: Simple sensor sampling or more advanced applications.
• User Interface: Display, buttons, or other functions for user interaction.
• Device Management (DM): Provisioning, firmware, bootstrapping, and monitoring.
• Execution Environment (EE): Application lifecycle management and Application
Programming Interface (API).

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

Gateways:
• A gateway serves as a translator between different protocols, e.g. Between IEEE 802.15.4 or
IEEE 802.11, to Ethernet or cellular.
• There are many different types of gateways, which can work on different levels in the protocol
layers. Most often a gateway refers to a device that performs translation of the physical and
link layer, but application layer gateways (ALGs) are also common.
• The latter is preferably avoided because it adds complexity and is a common source of error
in deployments.
• Some examples of ALGs include the ZigBee Gateway Device (ZigBee Alliance 2011), which
translates from ZigBee to SOAP and IP, or gateways that translate from Constrained
Application Protocol (CoAP) to HyperText Transfer Protocol/Representational State Transfer
(HTTP/REST).
• For some LAN technologies, such as 802.11 and Z-Wave, the gateway is used for inclusion
and exclusion of devices.
• This typically works by activating the gateway into inclusion or exclusion mode and by
pressing a button on the device to be added or removed from the network. We cover network
technologies in more detail in Section 5.2: Local and wide area networking.
• For very basic gateways, the hardware is typically focused on simplicity and low cost, but
frequently the gateway device is also used for many other tasks, such as data management,
device management, and local applications.

Data management:
Typical functions for data management include performing sensor readings and caching
this data, as well as filtering, concentrating, and aggregating the data before transmitting it to
back-end servers.
Some of the key characteristics of M2M data include:
• Big Data: Huge amounts of data are generated, capturing detailed aspects of the processes
where devices are involved.
• Heterogeneous Data: The data is produced by a huge variety of devices and is itself highly
heterogeneous, differing on sampling rate, quality of captured values, etc.
• Real-World Data: The overwhelming majority of the M2M data relates to real-world
processes and is dependent on the environment they interact with.
• Real-Time Data: M2M data is generated in real-time and overwhelmingly can be
communicated also in a very timely manner. The latter is of pivotal importance since many
times their business value depends on the real-time processing of the info they convey.
• Temporal Data: The overwhelming majority of M2M data is of temporal nature, measuring
the environment over time.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

• Spatial Data: Increasingly, the data generated by M2M interactions are not only captured by
mobile devices, but also coupled to interactions in specific locations, and their assessment may
dynamically vary depending on the location.
• Polymorphic Data: The data acquired and used by M2M processes may be complex and
involve various data, which can also obtain different meanings depending on the semantics
applied and the process they participate in.
• Proprietary Data: Up to now, due to monolithic application development, a significant amount
of M2M data is stored and captured in proprietary formats. However, increasingly due to the
interactions with heterogeneous devices and stakeholders, open approaches for data storage
and exchange are used.
• Security and Privacy Data Aspects: Due to the detailed capturing of interactions by M2M,
analysis of the obtained data has a high risk of leaking private information and usage patterns,
as well as compromising security.
Business processes in IoT:
• A business process refers to a series of activities, often a collection of interrelated processes
in a logical sequence, within an enterprise, leading to a specific result.
• There are several types of business processes such as management, operational, and
supporting, all of which aim at achieving a specific mission objective.
• Managers and business analysis model an enterprise’s processes in an effort to depict the real
way an enterprise operates and subsequently to improve efficiency and quality.

Role of cloud in IoT:

1. Enables remote computing capabilities:

With a large storage capacity, IoT eliminates the dependencies on on-site infrastructure. With
continued development and internet-based tech development such as the internet and devices
supporting advanced cloud solutions, cloud technology has become mainstream. Packed with
IoT, cloud solutions provide enterprises with the capability to access remote computing
services with a single click or command.

2. Security & Privacy:

Tasks can be handled automatically with cloud tech & IoT, organizations are able to reduce
security threats by a considerable amount. A cloud tech-enabled with IoT is a solution that
provides preventive, detective and corrective control. With effective authentication and
encryption protocols, it also provides users with strong security measures. Protocols such as
biometrics in IoT products help manage as well as safeguard user identities along with data.

3. Data Integration:

Current tech developments have not only integrated IoT and cloud smoothly but also provide
real-time connectivity and communication. This in turn makes the extraction of real-time

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

information about key business processes and performing on-spot data integration with 24/7
connectivity easy. Cloud-based solutions with powerful data integration capabilities are able
to handle a large amount of data generated from multiple sources along with its centralized
storage, processing and analysis.

4. Minimal Hardware Dependency:

Presently, several IoT solutions offer plug-and-play hosting services that are enabled by
integrating the cloud with the IoT. With cloud-enabled, IoT hosting providers need not rely
on any kind of hardware or equipment to support the agility required by IoT devices. It has
become easy for organizations to implement large scale IoT strategies seamlessly across
platforms and move to omnichannel communication.

5. Business Continuity:

Known for their agility and reliability, cloud computing solutions are able to provide business
continuity in case of any emergency, data loss or disaster. Cloud services operate via a
network of data servers located in multiple geographical locations storing multiple copies of
data backup. In case of any emergency, IoT based operations continue to work and data
recovery becomes easy.

6. Communication Between Multiple Devices & Touchpoint:

IoT devices and services need to connect with each other and communicate to perform tasks
that are enabled using cloud solutions. By supporting several robust APIs, cloud & IoT is
able to interact amongst themselves and connected devices. Having a cloud supported
communication helps fasten the interaction happen seamlessly.

7. Response Time & Data Processing:

Edge computing combined with IoT solutions usually shortens response time and speeds up
data processing capabilities. It requires the deployment of IoT with cloud computing and
edge computing solutions for maximum utilization.

Though cloud computing services can accelerate the growth of IoT, there are certain
challenges in deploying these services successfully. The combination of IoT and cloud
presents a few obstacles that need to be handled beforehand.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

UNIT II
Elements of IoT: Hardware components-computing (Arduino, Raspberry Pi),
communication, Sensing, Actuation, I/O interfaces Software Components- Programming
APIs (Using python/Arduino) for communication protocols-MQTT, Zigbee, Bluetooth,
CoAP, UDP, TCP.

Hardware components-computing (Arduino, Raspberry Pi):

INTRODUCTION TO AUDUINO AND RASPBERRYPI:


Arduino is an open-source platform used for building electronics projects. Arduino
consists of both a physical programmable circuit board (often referred to as a microcontroller)
and a piece of software, or IDE (Integrated Development Environment) that runs on your
computer, used to write and upload computer code to the physical board. Accepts analog and
digital signals as input and gives desired output.

BOARD DETAILS:

SET UP:
 Power the board by connecting it to a PC via USB cable
 Launch the Arduino IDE
 Set the board type and the port for the board
 TOOLS -> BOARD -> select your board
 TOOLS -> PORT -> select your port

TYPES:

1. Arduino Uno (R3)


2. Lilypad Arduino
3. RedBoard
4. Arduino Mega (R3)
5. Arduino Leonardo

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

Power (USB / Barrel Jack):


Every Arduino board needs a way to be connected to a power source. The Arduino
UNO can be powered from a USB cable coming from your computer or a wall power supply
(like this) that is terminated in a barrel jack. In the picture above the USB connection is labelled
(1) and the barrel jack is labelled (2). The USB connection is also how you will load code onto
your Arduino board.

NOTE: Do NOT use a power supply greater than 20 Volts as you will overpower (and
thereby destroy) Arduino. The recommended voltage for most Arduino models is between 6
and 12 Volts.

Pins (5V, 3.3V, GND, Analog, Digital, PWM, AREF):


The pins on your Arduino are the places where you connect wires to construct a circuit
(probably in conjunction with a breadboard and some wire. They usually have black plastic
headers ‘that allow you to just plug a wire right into the board. The Arduino has several
different kinds of pins, each of which is labelled on the board and used for different functions.

GND (3): Short for Ground ‘. There are several GND pins on the Arduino, any of which can
be used to ground your circuit.

5V (4) & 3.3V (5): As you might guess, the 5V pin supplies 5 volts of power, and the 3.3V pin
supplies 3.3 volts of power. Most of the simple components used with the Arduino run happily
off of 5 or 3.3 volts.

Analog (6): The area of pins under the ‗Analog In ‘label (A0 through A5 on the UNO) are
Analog In pins. These pins can read the signal from an analog sensor (like a temperature sensor)
and convert it into a digital value that we can read.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

Digital (7): Across from the analog pins are the digital pins (0 through 13 on the 19 UNO).
These pins can be used for both digital input (like telling if a button is pushed) and digital
output (like powering an LED).

PWM (8): You may have noticed the tilde (~) next to some of the digital pins (3, 5, 6, 9, 10,
and 11 on the UNO). These pins act as normal digital pins, but can also be used for something
called Pulse-Width Modulation (PWM). We have a tutorial on PWM, but for now, think of
these pins as being able to simulate analog output (like fading an LED in and out).

AREF (9): Stands for Analog Reference. Most of the time you can leave this pin alone. It is
sometimes used to set an external reference voltage (between 0 and 5 Volts) as the upper limit
for the analog input pins.

Reset Button
Just like the original Nintendo, the Arduino has a reset button (10). Pushing it will temporarily
connect the reset pin to ground and restart any code that is loaded on the Arduino. This can be
very useful if your code doesn‘t repeat, but you want to test it multiple times. Unlike the
original Nintendo however, blowing on the Arduino doesn‘t usually fix any problems.

Power LED Indicator


Just beneath and to the right of the word ―UNO on your circuit board, there‘s a tiny LED
next to the word ‗ON‘ (11). This LED should light up whenever you plug your Arduino into a
power source. If this light doesn‘t turn on, there‘s a good chance something is wrong. Time to
re-check your circuit!

TX RX LEDs
TX is short for transmit, RX is short for receive. These markings appear quite a bit in
electronics to indicate the pins responsible for serial communication. In our case, there are two
places on the Arduino UNO where TX and RX appear – once by digital pins 0 and 1, and a
second time next to the TX and RX indicator LEDs (12). These LEDs will give us some nice
visual indications whenever our Arduino is receiving or transmitting data (like when we‘re
loading a new program onto the board).

Main IC
The black thing with all the metal legs is an IC, or Integrated Circuit (13). Think of it as the
brains of our Arduino. The main IC on the Arduino is slightly different from board type to
board type, but is usually from the ATmega line of IC‘s from the ATMEL company. This can
be important, as you may need to know the IC type (along with your board type) before loading
up a new program from the Arduino software. This information can usually be found in writing
on the top side of the IC. If you want to know more about the difference between various IC‘s,
reading the datasheets is often a good idea.p

Voltage Regulator
The voltage regulator (14) is not actually something you can (or should) interact with on the
Arduino. But it is potentially useful to know that it is there and what it‘s for. The voltage
regulator does exactly what it says – it controls the amount of voltage that is let into the Arduino
board. Think of it as a kind of gatekeeper; it will turn away an extra voltage that might harm
the circuit. Of course, it has its limits, so don‘t hook up your Arduino to anything greater than
20 volts.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

ARDINO IDE OVERVIEW:


Program coded in Arduino IDE is called a SKETCH

1. To create a new sketchFile -> New


To open an existing sketch File -> open ->
There are some basic ready-to-use sketches available in the EXAMPLES section File ->
Examples -> select any program
2. Verify: Checks the code for compilation errors
3. Upload: Uploads the final code to the controller board
4. New: Creates a new blank sketch with basic structure
5. Open: Opens an existing sketch
6. Save: Saves the current sketch

Serial Monitor: Opens the serial console


 All the data printed to the console are displayed here

SKETCH STRUCTURE

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

A sketch can be divided into two parts:


 Setup ()
 Loop()

The function setup() is the point where the code starts, just like the main() function in C and
C++ I/O Variables, pin modes are initialized in the Setup() function  Loop() function, as the
name suggests, iterates the specified task in the program

DATA TYPES:
Void, Long, Int, Char, Boolean, Unsigned char, Byte, Unsigned int, Word, Unsigned
long, Float, Double, Array, String-char array, String-object, Short.

Arduino Function libraries


Input/Output Functions:
The arduino pins can be configured to act as input or output pins using the pinMode()
function Void setup ()
{
pinMode (pin , mode);
}

Pin- pin number on the Arduino board Mode- INPUT/OUTPUT.

digitalWrite() : Writes a HIGH or LOW value to a digital pin.

analogRead() : Reads from the analog input pin i.e., voltage applied across the pin.

Character functions such as isdigit(), isalpha(), isalnum(), isxdigit(), islower(), isupper(),


isspace() return 1(true) or 0(false).

Delay() function is one of the most common time manipulation function used to provide a
delay of specified time. It accepts integer value (time in milliseconds)

EXAMPLE BLINKING LED:


Requirement:
 Arduino controller board, USB connector, Bread board, LED, 1.4Kohm resistor, connecting
wires, Arduino IDE
 Connect the LED to the Arduino using the Bread board and the connecting wires
 Connect the Arduino board to the PC using the USB connector
 Select the board type and port  Write the sketch in the editor, verify and upload

Connect the positive terminal of the LED to digital pin 12 and the negative terminal to the
ground pin (GND) of Arduino Board

void setup()
{
pinMode(12, OUTPUT); // set the pin mode
}

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

void loop()
{
digitalWrite(12, HIGH); // Turn on the LED delay(1000); digitalWrite(12, LOW);
//Turn of the LED delay(1000);
}

Set the pin mode as output which is connected to the led, pin 12 in this case. Use digitalWrite()
function to set the output as HIGH and LOW.
Delay() function is used to specify the delay between HIGH-LOW transition of the output.

Connect he board to the PC


 Set the port and board type
 Verify the code and upload,
notice the TX – RX led in the board starts flashing as the code is uploaded.

RASPBERRY PI:
Raspberry Pi is a credit card sized micro processor available in different models with
different processing speed starting from 700 MHz. Whether you have a model B or model B+,
or the very old version, the installation process remains the same. People who have checked
out the official Raspberry Pi website, But using the Pi is very easy and from being a beginner,
one will turn pro in no time. So, it's better to go with the more powerful and more efficient OS,
the Raspbian. The main reason why Raspbian is extremely popular is that it has thousands of
pre built libraries to perform many tasks and optimize the OS. This forms a huge advantage
while building applications.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

Specifications and performance


As for the specifications, the Raspberry Pi is a credit card-sized computer powered by the
Broadcom BCM2835 system-on-a-chip (SoC). This SoC includes a 32-bit ARM1176JZFS
processor, clocked at 700MHz, and a Videocore IV GPU.

It also has 256MB of RAM in a POP package above the SoC. The Raspberry Pi is powered by
a 5V micro USB AC charger or at least 4 AA batteries (with a bit of hacking).

While the ARM CPU delivers real-world performance similar to that of a 300MHz Pentium 2,
the Broadcom GPU is a very capable graphics core capable of hardware decoding several high
definition video formats. The Raspberry Pi model available for purchase at the time of writing
— the Model B — features HDMI and composite video outputs, two USB 2.0 ports, a 10/100
Ethernet port, SD card slot, 25

GPIO (General Purpose I/O Expansion Board) connector, and analog audio output (3.5mm
headphone jack). The less expensive Model A strips out the Ethernet port and one of the USB
ports but otherwise has the same hardware.

Raspberry Pi Basics: installing Raspbian and getting it up and running.

1 Downloading Raspbian and Image writer.


You will be needing an image writer to write the downloaded OS into the SD card
(micro SD card in case of Raspberry Pi B+ model). So download the "win32 disk imager" from
the website.

2 Writing the image


Insert the SD card into the laptop/pc and run the image writer. Once open, browse and
select the downloaded Raspbian image file. Select the correct device, that is the drive
representing the SD card. If the drive (or device) selected is different from the SD card then
the other selected drive will become corrupted. SO be careful.
After that, click on the "Write" button in the bottom. As an example, see the image below,
where the SD card (or micro SD) drive is represented by the letter "G:\"

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

Once the write is complete, eject the SD card and insert it into the Raspberry Pi and turn it on.
It should start booting up.

3 Setting up the Pi
Please remember that after booting the Pi, there might be situations when the user credentials
like the "username" and password will be asked. Raspberry Pi comes with a default user name
and password and so always use it whenever it is being asked. The credentials are:
login: pi
password: raspberry When the Pi has been booted for the first time, a configuration screen
called the "Setup Options" should appear and it will look like the image below.

If you have missed the "Setup Options" screen, its not a problem, you can always get it by
typing the following command in the terminal.

sudoraspi-config

Once you execute this command the "Setup Options" screen will come up as shown in
the image above.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

Now that the Setup Options window is up, we will have to set a few things. After
completing each of the steps below, if it asks to reboot the Pi, please do so. After the reboot, if
you don't get the "Setup Options" screen, then follow the command given above to get the
screen/window.

 The first thing to do:

Select the first option in the list of the setup options window, that is select the "Expand
Filesystem" option and hit the enter key. We do this to make use of all the space present on
the SD card as a full partition. All this does is, expand the OS to fit the whole space on the SD
card which can then be used as the storage memory for the Pi

 The second thing to do:

Select the third option in the list of the setup options window, that is select the "Enable
BootTo Desktop/Scratch" option and hit the enter key. It will take you to another window
called the "choose boot option" window that looks like the image below.

In the "choose boot option window", select the second option, that is, "Desktop Log in as
user 'pi' at the graphical desktop" and hit the enter button. Once done you will be taken back
to the "Setup Options" page, if not select the "OK" button at the bottom of this window and
you will be taken back to the previous window. We do this because we want to boot into the
desktop environment which we are familiar with. If we don't do this step then the Raspberry Pi
boots into a terminal each time with no GUI options.Once, both the steps are done, select the
"finish" button at the bottom of the page and it should reboot automatically. If it doesn't, then
use the following command in the terminal to reboot.

sudo reboot

Updating the firmware


After the reboot from the previous step, if everything went right, then you will end up
on the desktop which looks like the image below.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

Once you are on the desktop, open a terminal and enter the following command to update the
firmware of the Pi.

sudorpi-update
Updating the firmware is necessary because certain models of the Pi might not have all
the required dependencies to run smoothly or it may have some bug. The latest firmware might
have the fix to those bugs, thus its very important to update it in the beginning itself.

5 Conclusion

So, we have covered the steps to get the Pi up and running. This method works on all
the different models of Raspberry Pi (model A, B, B+ and also RPi 2) as Raspbain was made
to be supported on all models. However, while installing other software or libraries, the
procedure might change a bit while installing depending on the model of the Pi or the version
of Raspbian itself. The concept of Raspberry is to keep trying till you get the result or build
that you want. This might involve a lot of trial and error but spending the time will be worth it.
The actual usage doesn't end here. This is just the beginning. It is up to you to go ahead to build
something amazing out of it.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

GPIO:
Act as both digital output and digital input.

Output: turn a GPIO pin high or low.


Input: detect a GPIO pin high or low
Installing GPIO library:

Open terminal

Enter the command ―sudoapt-get install python-dev” to install python development Enter
the command “sudoapt-get install python-rpi.gpio” to install GPIO library. Basic python
coding:
Open terminal enter the command

sudonanofilename.py
This will open the nano editor where you can write your code Ctrl+O : Writes the code to the
file

Ctrl+X : Exits the editor

Blinking LED Code:

import RPi.GPIO as GPIO #GPIO library import time GPIO.setmode(GPIO.BOARD) # Set


the type of board for pin numbering GPIO.setup(11, GPIO.OUT) # Set GPIO pin 11as output
pin
for i in range (0,5):
GPIO.output(11,True) # Turn on GPIO pin 11 time.sleep(1)
GPIO.output(11,False)
T ime.sleep(2) GPIO.output(11,True)
GPIO.cleanup()

Power Pins
The header provides 5V on Pin 2 and 3.3V on Pin 1. The 3.3V supply is limited to
50mA. The 5V supply draws current directly from your microUSB supply so can use whatever
is left over after the board has taken its share. A 1A power supply could supply up to 300mA
once the Board has drawn 700mA.

Basic GPIO
The header provides 17 Pins that can be configured as inputs and outputs. By default
they are all configured as inputs except GPIO 14 & 15.
In order to use these pins you must tell the system whether they are inputs or outputs. This can
be achieved a number of ways and it depends on how you intend to control them. I intend on
using Python.

SDA & SCL: The 'DA' in SDA stands for data, the 'CL' in SCL stands for clock; the S stands
for serial. You can do more reading about the significance of the clock line for various types
of computer bus, You will probably find I2C devices that come with their own userspace
drivers and the linux kernel includes some as well. Most computers have an I2C bus,
presumably for some of the purposes listed by wikipedia, such as interfacing with the RTC
(real time clock) and configuring memory. However, it is not exposed, meaning you can't attach

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

anything else to it, and there are a lot of interesting things that could be attached -- pretty much
any kind of common sensor (barometers, accelerometers, gyroscopes, luminometers, etc.) as
well as output devices and displays. You can buy a USB to I2C adapter for a normal computer,
but they cost a few hundred dollars. You can attach multiple devices to the exposed bus on the
pi.

UART, TXD & RXD: This is a traditional serial line; for decades most computers have had a
port for this and a port for parallel.1 Some pi oriented OS distros such as Raspbian by default
boot with this serial line active as a console, and you can plug the other end into another
computer and use some appropriate software to communicate with it. Note this interface does
not have a clock line; the two pins may be used for full duplex communication (simultaneous
transmit and receive).

PCM, CLK/DIN/DOUT/FS: PCM is is how uncompressed digital audio is encoded. The data
stream is serial, but interpreting this correctly is best done with a separate clock line (more
lowest level stuff).

SPI, MOSI/MISO/CE0/CE1: SPI is a serial bus protocol serving many of the same purposes
as I2C, but because there are more wires, it can operate in full duplex which makes it faster
and more flexible.

Raspberry Pi Terminal Commands


[sudo apt-get update] - Update Package Lists
[sudo apt-get upgrade] - Download and Install Updated Packages [sudoraspi-config] - The
Raspberry Pi Configuration Tool 33
[sudo apt-get clean] - Clean Old Package Files [sudo reboot] - Restart your Raspberry Pi [sudo
halt] - Shut Down your Raspberry Pi
Communication:
IoT devices require a means for transmitting the information sensed at the device
level to a Cloud-based service for subsequent processing. This is where the great value
inherent in IoT is created. This requires either WiFi (wireless LAN based communications) or
WAN (wide area network… i.e. cellular) communications. In addition, depending on the need
short range communication, other capabilities may also be needed. These could include
Bluetooth, ZigBee, Near-field or a range of other short range communication methods.
For positioning, GPS is often required as well.
Sensors in Internet of Things (IoT): (Sensing)

Sensors are used for sensing things and devices etc.


A device that provides a usable output in response to a specified measurement.
The sensor attains a physical parameter and converts it into a signal suitable for processing
(e.g., electrical, mechanical, optical) the characteristics of any device or material to detect
the presence of a particular physical quantity.

Types of sensors: -

1.Electrical sensor:
Electrical proximity sensors may be contact or non-contact. Simple contact sensors
operate by making the sensor and the component complete an electrical circuit.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

Non- contact electrical proximity sensors rely on the electrical principles of either induction
for detecting metals or capacitance for detecting non-metals as well.
2.Light sensor:
Light sensor is also known as photo sensors and one of the important sensors. Light
dependent resistor or LDR is a simple light sensor available today.
The property of LDR is that its resistance is inversely proportional to the intensity of the
ambient light i.e., when the intensity of light increases, its resistance decreases and vise versa.
3.Touch sensor:
Detection of something like a touch of finger or a stylus is known as touch sensor. Its
name suggests that detection of something.
They are classified into two types:
1. Resistive type
2. Capacitive type
Today almost all modern touch sensors are of capacitive types. Because they are more
accurate and have better signal to noise ratio.
4.Range sensing:
Range sensing concerns detecting how near or far a component is from the sensing
position, although they can also be used as proximity sensors. Distance or range sensors use
non-contact analog techniques. Short range sensing, between a few millimetres and a few
hundred millimetres is carried out using electrical capacitance, inductance and magnetic
technique. Longer range sensing is carried out using transmitted energy waves of various
types e.g., radio waves, sound waves and lasers.
5.Mechanical sensor:
Any suitable mechanical / electrical switch may be adopted but because a certain
amount of force is required to operate a mechanical switch it is common to use micro-
switches.
6.Pneumatic sensor:
These proximity sensors operate by breaking or disturbing an air flow. The pneumatic
proximity sensor is an example of a contact type sensor. These cannot be used where light
components may be blown away.
7.Optical sensor:
In their simplest form, optical proximity sensors operate by breaking a light beam
which falls onto a light sensitive device such as a photocell. These are examples of non-
contact sensors. Care must be exercised with the lighting environment of these sensors for
example optical sensors can be blinded by flashes from arc welding processes, airborne dust
and smoke clouds may impede light transmission etc.
8.Speed Sensor:
Sensor used for detecting the speed of any object or vehicle which is in motion is
known as speed sensor. For example – Wind Speed Sensors, Speedometer, UDAR, Ground
Speed Radar.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

9.Temperature Sensor:
Devices which monitor and tracks the temperature and gives temperature’s
measurement as an electrical signal are termed as temperature sensors. These electrical
signals will be in the form of voltage and is directly proportional to the temperature
measurement.
10.PIR Sensor:
PIR stands for passive infrared sensor and it is an electronic sensor that is used for the
tracking and measurement of infrared (IR) light radiating from objects in its field of view and
is also known as Pyroelectric sensor .It is mainly used for detecting human motion and
movement detection .
11.Ultrasonic Sensor:
The principle of ultrasonic sensor is similar to the working principle of SONAR or
RADAR in which the interpretation of echoes from radio or sound waves to evaluate the
attributes of a target by generating the high frequency sound waves .

Actuators in IoT: (Actuation)


An actuator is a machine component or system that moves or controls the mechanism
of the system. Sensors in the device sense the environment, then control signals are generated
for the actuators according to the actions needed to perform.

Types of Actuators:
1. Hydraulic Actuators –
A hydraulic actuator uses hydraulic power to perform a mechanical operation. They are
actuated by a cylinder or fluid motor. The mechanical motion is converted to rotary, linear,
or oscillatory motion, according to the need of the IoT device. Ex- construction equipment
uses hydraulic actuators because hydraulic actuators can generate a large amount of force.
2. Pneumatic Actuators –
A pneumatic actuator uses energy formed by vacuum or compressed air at high pressure to
convert into either linear or rotary motion. Example- Used in robotics, use sensors that work
like human fingers by using compressed air.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

3. Electrical Actuators –
An electric actuator uses electrical energy, is usually actuated by a motor that converts
electrical energy into mechanical torque. An example of an electric actuator is a solenoid
based electric bell.
I/O interfaces:
The I/O interface supports a method by which data is transferred between internal storage and
external I/O devices. All the peripherals connected to a computer require special
communication connections for interfacing them with the CPU.

I/O Bus and Interface Modules:

The I/O bus is the route used for peripheral devices to interact with the computer processor. A
typical connection of the I/O bus to I/O devices is shown in the figure.

The I/O bus includes data lines, address lines, and control lines. In any general-purpose
computer, the magnetic disk, printer, and keyboard, and display terminal are commonly
employed. Each peripheral unit has an interface unit associated with it. Each interface decodes
the control and address received from the I/O bus.
It can describe the address and control received from the peripheral and supports signals for
the peripheral controller. It also conducts the transfer of information between peripheral and
processor and also integrates the data flow.
The I/O bus is linked to all peripheral interfaces from the processor. The processor locates a
device address on the address line to interact with a specific device. Each interface contains
an address decoder attached to the I/O bus that monitors the address lines.
When the address is recognized by the interface, it activates the direction between the bus lines
and the device that it controls. The interface disables the peripherals whose address does not
equivalent to the address in the bus.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

An interface receives any of the following four commands −

 Control − A command control is given to activate the peripheral and to inform


its next task. This control command depends on the peripheral, and each
peripheral receives its sequence of control commands, depending on its mode of
operation.
 Status − A status command can test multiple test conditions in the interface and
the peripheral.
 Data Output − A data output command creates the interface counter to the
command by sending data from the bus to one of its registers.
 Data Input − The data input command is opposite to the data output command.
In data input, the interface gets an element of data from the peripheral and places
it in its buffer register.

Software Components:
Communication Protocols:
The protocol defines the rules, syntax, semantics and synchronization of
communication and possible error recovery methods.

1.Message Queuing Telemetry Transport (MQTT):


MQTT is one of the prime IoT protocols. MQTT protocol is a type of IoT
communication protocol that is famous and is gaining popularity due to its transportation of
messages through the publish/subscribe messaging. It is lightweight and easily transfers data
between two or more machines.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

2.Zigbee:
Zigbee is a wireless technology whose protocols suit the global networking standards.
It eliminates power and cost issues of the other IoT technologies. Zigbee standard works on
the IEEE 802.15.4 physical radio.

Zigbee protocol backs up mesh networking. Mesh networking connects constrained


nodes with one another to allow multiple pathways for each node.

3.Bluetooth and BLE


It is the connection between a smartphone and any other Iot device that can also connect
to the internet. Bluetooth SIG also known as the Bluetooth Special Interest Group controls
Bluetooth.
Bluetooth Low Energy or Bluetooth 4.0 is a recent discovery. It consumes less energy.
Due to less power consumption, BLE makes it possible to connect devices with small battery
lives. It exchanges small data packages.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

4.Constrained Application Protocol (CoAP):


CoAP is another promising protocol in the future of IoT. CoAP protocol transfers
documents in a way similar to HTTP, however, CoAPs design fulfills the needs of constrained
nodes. The packets in CoAP are much smaller in size when you compare it with HTTP TCP.
CoAP operates through UDP. Clients and servers retrieve information through Connectionless
datagrams.

CoAP permits UDP broadcast and multicast to address.

CoAP also acts on the client/server model. Clients generate requests to servers and servers in
return transfer responses. Clients can GET, POST, DELETE and PUT the resources.

“Confirmable” and “non confirmable” are tags for request and response messages. Non-
confirmable messages come under the label “fire and forget”. CoAP assures similar data
security methods except that the data transfer takes place through UDP and not TLS.

5.Transmission Control Protocol (TCP):


The TCP is a connection-oriented protocol, which means a connection is established
and maintained until client and server have finished exchanging the data to each other.
Whenever any message/data is sent via TCP/IP protocol, the transmitter gets proper
acknowledgement whether the packet is being delivered or not.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

The TCP/IP stack has the following features –

• TCP guarantees the ordered data delivery by acknowledgment function.


• Retransmission of lost packets.
• TCP helps to control traffic on the Internet.
• It is best suited whenever a program wants to send a lot of data because TCP does
fragmentation of data and sends it in the form of small packets.
• It supports error control and flow control.
• It supports Multiplexing and De-multiplexing of data.
• It allows to work over heterogeneous networks.

6.User Datagram Protocol (UDP):


The User Datagram Protocol (UDP) is the simplest transportation layer protocol used
primarily for establishing low-latency and loss tolerating connections between applications on
the communication network. Both TCP and UDP run on the top of Internet Protocol (IP) that
is why they are referred as TCP/IP and UDP/IP.
n IoT (and data transmission in general), User Datagram Protocol is less common than
TCP. But UDP often appeals to IoT manufacturers because it uses fewer network resources to
transmit and doesn’t have to maintain a constant connection between the two endpoints. In
other words, it uses less data and consumes less power.

Features of UDP –
The UDP protocol stack has the following features –
1) UDP can be used when acknowledgement of data does not hold any significance.
2) It is great for data flowing in one direction.
3) It is connectionless protocol.
4) It does not provide any congestion control mechanism.
5) It is a suitable protocol for streaming applications such as video conference applications,
computer games etc.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

UNIT III
Sensing and Actuation: Definition of Sensor, Sensor features, Resolution, Classes, Different
types of sensors, Actuator, Different types of Actuators, purpose of Sensors and Actuators in
IoT.

Sensors in Internet of Things (IoT):


Definition:
Sensors are used for sensing things and devices etc. A device that provides a usable
output in response to a specified measurement.

The sensor attains a physical parameter and converts it into a signal suitable for
processing (e.g., electrical, mechanical, optical) the characteristics of any device or material
to detect the presence of a particular physical quantity.

The output of the sensor is a signal which is converted to a human-readable form


like changes in characteristics, changes in resistance, capacitance, impedance, etc.

Transducer:

 A transducer converts a signal from one physical structure to another.


 It converts one type of energy into another type.
 It might be used as actuator in various systems.

Sensors characteristics:
1. Static
2. Dynamic
1.Static:
It is about how the output of a sensor changes in response to an input change after steady
state condition.
 Accuracy: Accuracy is the capability of measuring instruments to give a result
close to the true value of the measured quantity. It measures errors. It is measured
by absolute and relative errors. Express the correctness of the output compared to
a higher prior system. Absolute error = Measured value – True value
Relative error = Measured value/True value

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

 Range: Gives the highest and the lowest value of the physical quantity within
which the sensor can actually sense. Beyond these values, there is no sense or no
kind of response.
e.g. RTD for measurement of temperature has a range of -200`c to 800`c.
 Resolution: Resolution is an important specification for selection of sensors.
The higher the resolution, better the precision. When the accretion is zero to, it is
called the threshold.
Provide the smallest changes in the input that a sensor is able to sense.
 Precision: It is the capacity of a measuring instrument to give the same reading
when repetitively measuring the same quantity under the same prescribed
conditions.
It implies agreement between successive readings, NOT closeness to the true
value.
It is related to the variance of a set of measurements.
It is a necessary but not sufficient condition for accuracy.
 Sensitivity: Sensitivity indicates the ratio of incremental change in the response
of the system with respect to incremental change in input parameters. It can be
found from the slope of the output characteristics curve of a sensor. It is the
smallest amount of difference in quantity that will change the instrument’s
reading.
 Linearity: The deviation of the sensor value curve from a particularly straight
line. Linearity is determined by the calibration curve. The static calibration curve
plots the output amplitude versus the input amplitude under static conditions.
A curve’s slope resemblance to a straight line describes linearity.
 Drift: The difference in the measurement of the sensor from a specific reading
when kept at that value for a long period of time.
 Repeatability: The deviation between measurements in a sequence under the
same conditions. The measurements have to be made under a short enough time
duration so as not to allow significant long-term drift.
2.Dynamic:
Properties of the systems
 Zero-order system: The output shows a response to the input signal with no
delay. It does not include energy-storing elements.
Ex. potentiometer measure, linear and rotary displacements.
 First-order system: When the output approaches its final value gradually.
Consists of an energy storage and dissipation element.
 Second-order system: Complex output response. The output response of the
sensor oscillates before steady state.
Sensor Classification:
 Passive & Active
 Analog & digital
 Scalar & vector
1. PassiveSensor–
Can not independently sense the input. Ex- Accelerometer, soil moisture, water
level and temperature sensors.
2. ActiveSensor–
Independently sense the input. Example- Radar, sounder and laser altimeter
sensors.
3. AnalogSensor –
The response or output of the sensor is some continuous function of its input

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

parameter. Ex- Temperature sensor, LDR, analog pressure sensor and analog hall
effect.
4. DigitalSensor–
Response in binary nature. Design to overcome the disadvantages of analog
sensors. Along with the analog sensor, it also comprises extra electronics for bit
conversion. Example – Passive infrared (PIR) sensor and digital temperature
sensor (DS1620).
5. ScalarSensor–
Detects the input parameter only based on its magnitude. The answer for the
sensor is a function of magnitude of some input parameter. Not affected by the
direction of input parameters.
Example – temperature, gas, strain, color and smoke sensor.
6. VectorSensor–
The response of the sensor depends on the magnitude of the direction and
orientation of input parameter. Example – Accelerometer, gyroscope, magnetic
field and motion detector sensors.

Types of sensors –

 Electrical sensor:
Electrical proximity sensors may be contact or non contact.
Simple contact sensors operate by making the sensor and the component complete an
electrical circuit.
Non- contact electrical proximity sensors rely on the electrical principles of either induction
for detecting metals or capacitance for detecting non metals as well.
 Light sensor:
Light sensor is also known as photo sensors and one of the important sensor.
Light dependent resistor or LDR is a simple light sensor available today.
The property of LDR is that its resistance is inversely proportional to the intensity of the
ambient light i.e when the intensity of light increases, it’s resistance decreases and vise versa.
 Touch sensor:
Detection of something like a touch of finger or a stylus is known as touch sensor.
It’s name suggests that detection of something.
They are classified into two types:
1. Resistive type
2. Capacitive type
Today almost all modern touch sensors are of capacitive types.
Because they are more accurate and have better signal to noise ratio.
 Range sensing:
Range sensing concerns detecting how near or far a component is from the sensing position,
although they can also be used as proximity sensors.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

Distance or range sensors use non-contact analog techniques. Short range sensing, between
a few millimetres and a few hundred millimetres is carried out using electrical capacitance,
inductance and magnetic technique.
Longer range sensing is carried out using transmitted energy waves of various types eg radio
waves, sound waves and lasers.
 Mechanical sensor:
Any suitable mechanical / electrical switch may be adopted but because a certain amount of
force is required to operate a mechanical switch it is common to use micro-switches.
 Pneumatic sensor:
These proximity sensors operate by breaking or disturbing an air flow.
The pneumatic proximity sensor is an example of a contact type sensor. These cannot be
used where light components may be blown away.
 Optical sensor:
In there simplest form, optical proximity sensors operate by breaking a light beam which falls
onto a light sensitive device such as a photocell. These are examples of non contact sensors.
Care must be exercised with the lighting environment of these sensors for example optical
sensors can be blinded by flashes from arc welding processes, airborne dust and smoke clouds
may impede light transmission etc.
 Speed Sensor:
Sensor used for detecting the speed of any object or vehicle which is in motion is known as
speed sensor .For example – Wind Speed Sensors, Speedometer ,UDAR ,Ground Speed
Radar .
 Temperature Sensor:
Devices which monitors and tracks the temperature and gives temperature’s measurement as
an electrical signal are termed as temperature sensors .These electrical signals will be in the
form of voltage and is directly proportional to the temperature measurement .
 PIR Sensor:
PIR stands for passive infrared sensor and it is an electronic sensor that is used for the
tracking and measurement of infrared (IR) light radiating from objects in its field of view and
is also known as Pyroelectric sensor .It is mainly used for detecting human motion and
movement detection .
 Ultrasonic Sensor:
The principle of ultrasonic sensor is similar to the working principle of SONAR or RADAR
in which the interpretation of echoes from radio or sound waves to evaluate the attributes of
a target by generating the high frequency sound waves .

Actuator:
An actuator is a machine component or system that moves or controls the mechanism
of the system. Sensors in the device sense the environment, then control signals are generated
for the actuators according to the actions needed to perform.

Types of Actuators:
1. Hydraulic Actuators –
A hydraulic actuator uses hydraulic power to perform a mechanical operation. They are
actuated by a cylinder or fluid motor. The mechanical motion is converted to rotary, linear,

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

or oscillatory motion, according to the need of the IoT device. Ex- construction equipment
uses hydraulic actuators because hydraulic actuators can generate a large amount of force.
2. Pneumatic Actuators –
A pneumatic actuator uses energy formed by vacuum or compressed air at high pressure to
convert into either linear or rotary motion. Example- Used in robotics, use sensors that work
like human fingers by using compressed air.
3. Electrical Actuators –
An electric actuator uses electrical energy, is usually actuated by a motor that converts electrical
energy into mechanical torque. An example of an electric actuator is a solenoid based electric bell.

Purpose of Sensors in IoT:


The main purpose of sensors is to collect data from the surrounding environment.
Sensors, or ‘things’ of the IoT system, form the front end. These are connected directly or
indirectly to IoT networks after signal conversion and processing. But all sensors are not the
same and different IoT applications require different types of sensors.

There are many types of IoT sensors. Their input mechanisms and structure will vary
according to the industry in which they're used. While each IoT application is unique, here
are a few we see the most:

1. Monitoring Environment with Temperature Sensors and Pressure Sensors

Environmental controls are one of the most common uses of IoT sensors. Used to regulate the
temperature in heating, ventilating, and air conditioning (HVAC) systems, digital sensors
keep inhabitants comfortable, keep refrigerated products from spoiling, and keep systems
from overheating. Pressure sensors can also monitor the environment by detecting the
presence of an intruder in a secure area, and indoor air quality (IAQ) can be monitored and
regulated as well.

2. Detecting Activity Through Motion Sensors and Proximity Sensors

While pressure sensors can improve security measures, other sensory technology secures a
space by detecting motion or not allowing intruders to come near a prohibited area. Motion
detection often employs infrared sensors that receive thermal energy as an input and converts
the data to an image of the object radiating the heat. This enables security systems to detect
anything with a thermal signature above a certain threshold when it comes into a designated
area of a space, so that an unauthorized individual will be denied access to private areas.

3. Applying Smart Sensor Data and Signal Detection To Make Predictions

Some sensors are used to analyse a system's current status, but businesses are leveraging IoT
technology for their ability to make predictions about the future. Predictive analytics are
helping manufacturing facilities make the most of their equipment, as a wireless sensor
embedded in a piece of equipment will give input about its condition and alert technicians
when maintenance is needed. Other predictive applications include inventory planning,
supply chain optimization, and even integration into big data algorithms to mitigate risk and
spot the latest economic trends.

Downloaded by Omprakash D ([email protected])


lOMoARcPSD|43337963

Purpose of Actuators in IoT:

In IoT, actuators enable a physical action based on data that originates with one or
more sensors. The conversion of sensor data to activity follows this sequence:

1. Sensors detect an event in the physical environment.

2. The sensors convert that information about the event into electronic signals
that travel to a control system, which has a scheme to determine when and
what movement is needed.
3. The controller tells the actuator to take the desired action.
4. The actuator takes the action by turning energy into a physical force.

Downloaded by Omprakash D ([email protected])

You might also like