Io T Material Unit - (1-3)
Io T Material Unit - (1-3)
Io T Material Unit-(1-3)
INTERNET OF THINGS
(20A04701b)
B.TECH
(III YEAR – II SEM)
(R20) REGULATION
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:
● 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.
● This management subsystem has functionalities for device identity database, device
identity management and access management.
● Data routes from the gateway through the Internet and data centre to the application
server or enterprise server which acquires that data.
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.
IoT Applications:
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.
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.
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.
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.
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.
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 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.
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
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.
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.
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 .
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.
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.
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.
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.
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.
• 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.
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.
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
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.
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.
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.
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.
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.
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:
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.
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.
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.
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.
SKETCH STRUCTURE
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.
analogRead() : Reads from the analog input pin i.e., voltage applied across the pin.
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)
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
}
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.
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.
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.
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.
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.
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
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
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.
GPIO:
Act as both digital output and digital input.
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
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
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.
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.
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.
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 .
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.
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.
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.
Software Components:
Communication Protocols:
The protocol defines the rules, syntax, semantics and synchronization of
communication and possible error recovery methods.
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.
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.
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.
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.
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.
Transducer:
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
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
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.
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,
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.
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:
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.
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.
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.
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:
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.