Unit 1 - Introduction To IoT (Internet of Things)
Unit 1 - Introduction To IoT (Internet of Things)
Definition of IoT
IoT (Internet of Things) means connecting physical devices to the internet so they can
collect, send, and receive data. These devices can be everyday objects like a fan, refrigerator,
watch, or light bulb — if they can talk to each other using the internet, they are part of IoT.
Example: A smart bulb can be turned on or off using your mobile phone — this is
IoT.
Characteristics of IoT
1. Connectivity
Devices are connected to the internet and to each other.
2. Sensing
IoT devices use sensors to collect information like temperature, motion, light, etc.
3. Data
Devices collect and share real-time data.
4. Automation
Some IoT systems can make decisions on their own using data (like turning on lights
when it’s dark).
5. Remote Access
Users can control devices from anywhere using mobile phones or computers.
1. Past: In the beginning, only computers and phones were connected to the internet.
2. Present: Now, many other devices (TVs, watches, cars, machines) are connected to the
internet.
3. Future: In the future, more smart devices will be used everywhere — homes, schools,
hospitals, farms, etc.
Trends in IoT:
Here are some current trends in IoT:
● Smart homes – Using smart TVs, smart speakers (like Alexa), smart lights.
● Wearable tech – Smartwatches and fitness bands.
● AI + IoT (AIoT) – Using Artificial Intelligence with IoT to make better decisions.
● 5G Networks – Faster internet helps IoT devices work quicker and better.
● Industrial IoT (IIoT) – Machines in factories using IoT to improve work.
1. Smart Cities
2. Healthcare
3. Industry
4. Agriculture
1. Smart Cities
Sensor Use
2. Healthcare
Sensor Use
3. Industry
Sensor Use
4. Agriculture
Sensor Use
2. Network Layer
Service Layer Processes the data and offers services (like alert,
report).
Simple View:
Devices → Network → Processing → App for users.
🔹 Example:
● A temperature sensor measuring room temperature.
● A camera capturing a live video feed.
2. Network Layer
● This is the second layer.
● Main job: Transfer data collected by the perception layer to other devices, cloud
servers, or storage centers.
● It uses communication technologies like Wi-Fi, Bluetooth, 4G, 5G, Zigbee etc.
🔹 Example:
● Sending temperature data from a sensor to a cloud server over Wi-Fi.
3. Service Layer
● This is the third layer.
● Main job: Process the received data and provide useful services based on it.
● It decides what action needs to be taken based on the data.
● It may generate alerts, reports, control signals, etc.
🔹 Example:
● Processing temperature data and sending an alert if the temperature is too high.
● Storing data for future reports.
4. Application Layer
● This is the topmost (fourth) layer.
● Main job: Provide user-facing applications that people interact with.
● Converts the processed data into useful information shown through apps, dashboards,
or websites.
🔹 Example:
● A mobile app showing live temperature.
● A web dashboard showing the history of room temperatures.
✅ Summary Table:
Layer Function
Layer Function
🔹 Example:
● A smart home temperature sensor measuring room
heat.
2. Network Layer
● This is the second layer.
● Main job: Transfer the collected data from devices
to cloud servers, apps, or storage systems.
● Uses communication technologies like Wi-Fi,
Bluetooth, Zigbee, 4G/5G, Ethernet.
🔹 Example:
● Sending data from a sensor to a cloud platform using
Wi-Fi.
3. Middleware Layer
● This is the third layer.
● Main job: Store, process, and manage data coming
from devices.
● It acts like a bridge between hardware (devices) and
software (apps).
● It may also make decisions based on processed data.
🔹 Example:
● A cloud server storing temperature readings and
processing them to find the average temperature.
4. Application Layer
● This is the fourth layer.
● Main job: Provide specific applications to users
based on the processed data.
● Apps can show data, give alerts, or control devices.
🔹 Example:
● A smart home app showing the temperature and
letting users turn the air conditioner ON or OFF.
5. Business Layer
● This is the fifth layer.
● Main job: Manage business goals, models, and
profits based on IoT data and services.
● It analyzes how IoT technology can help businesses
grow or save costs.
🔹 Example:
● A company using smart farming IoT data to increase
crop production and profits.
6. Security Layer
● This is the sixth layer.
● Main job: Protect data, devices, and networks from
attacks or misuse.
● It ensures data privacy, device authentication, and
safe communication.
🔹 Example:
● Using encryption to protect user data sent from a
smart watch to a server.
7. Management Layer
● This is the seventh (top) layer.
● Main job: Control and manage all devices,
applications, and networks.
● It handles device updates, monitoring, error handling,
and optimization.
🔹 Example:
● An IoT platform automatically updating the software
of smart home devices.
Simple View:
More focus on business, security, and management besides just devices and networks.
2. Level 2: Connectivity
● This layer provides the communication network.
● Main job: Transfer data from devices to other parts of the system.
● Uses technologies like Wi-Fi, Bluetooth, Zigbee, 4G/5G.
🔹 Example:
● A smart bulb connecting to a home router via Wi-Fi.
🔹 Example:
● A CCTV camera analyzing video at a local server to detect motion.
🔹 Example:
● A cloud database collecting all temperature readings from sensors over days.
🔹 Example:
● Showing "average room temperature per day" instead of thousands of raw temperature
readings.
6. Level 6: Application
● This is where user applications are built on top of data and insights.
● Main job: Present information and allow users to interact with IoT systems.
🔹 Example:
● A smart home app showing all sensor readings and letting users control devices.
🔹 Example:
● A smart city system where traffic lights automatically adjust based on real-time traffic
data.
✅ Summary Table:
Level Function
Level 3: Edge (Fog) Computing Process data near the device to reduce delay.
Level 4: Data Accumulation Collect and store data (Data at Rest and Data in
Motion).
Level 5: Data Abstraction Organize and filter data into useful information.
1. Request-Response Model
● One device sends a request, and the other sends back a response.
● Like asking a question and getting an answer.
● Example:
○ You request temperature from a sensor → the sensor sends temperature data
back.
2. Publish-Subscribe Model
● Devices publish data to a central system (called a broker), and others subscribe to get
updates.
● No direct asking; updates come automatically.
● Example:
○ A sensor publishes temperature data to a server → your mobile app subscribes
to receive live updates.
In this way, devices do not send data directly to each other. They only talk to the Broker. This
makes communication easier and faster.
In farming, smart sensors are placed in the soil to measure moisture levels (how wet or dry the
soil is).
Because the sensor uses little data and energy, it can work for a long time without needing
much internet or battery.
Keywords: Broker, Publisher, Subscriber.
It works in a similar way to HTTP (which is used on websites), but CoAP is much lighter and
faster. This makes it perfect for tiny devices like sensors and smart meters.
How it works:
Conclusion
CoAP is an excellent protocol for small, low-power IoT devices. It provides a simple and
efficient way for devices to communicate with each other, using very little resources. It is
often used in smart homes, healthcare devices, environment monitoring, and many other
IoT areas.
● Example:
A tiny temperature sensor in a smart home system.
Although HTTP is heavier compared to MQTT and CoAP, it is easy to use and understand.
Many IoT devices also use HTTP because it works very well with web applications.
How it works:
● The Client sends an HTTP Request to the Server (for example, to get a webpage or
turn a device ON).
● The Server processes the request and sends an HTTP Response (like sending back
the webpage or confirming that the device is ON).
However, compared to MQTT and CoAP, HTTP uses more internet data and more battery. It
is heavier because it carries more information in each request and response.
Example: IoT Devices Controlled by Web Apps
This simple process is possible because HTTP can connect websites and IoT devices easily.
Conclusion
HTTP is the backbone of the World Wide Web and is also used in many IoT applications.
Even though it is heavierthan MQTT and CoAP, it is simple, powerful, and very commonly
used. It is perfect for IoT projects where internet speed and battery life are not a big
problem, but easy control using web apps is important.
●
WebSocket
Introduction
WebSocket is a communication protocol that allows a two-way (full-duplex) connection
between a client (like a mobile app or browser) and a server.
Once a WebSocket connection is made, both the client and server can send messages to
each other anytime, without needing to ask for permission again and again.
This is different from HTTP, where the client must always request first, and the server just
responds.
● At the beginning, the client sends a handshake request to the server (using HTTP).
● If the server accepts, a WebSocket connection is established.
● After that, both client and server can freely send messages to each other whenever
needed.
● The connection stays open until either side decides to close it.
Similarly, WebSocket is also used in chat apps, online gaming, stock market apps, and live
sports scores.
Conclusion
📚 Summary Table
Topic Key Idea
1. Request-Response Model
● In this model, one device (client) sends a request, and another device (server) sends
back a response.
● It is like asking a question and getting an answer.
● Mostly used where instant data is needed, but only on demand.
● It follows the client-server communication style.
🔹 Example:
● A mobile app requests the temperature from a sensor.
● The sensor receives the request and sends back the current temperature reading.
🔹 Features:
● Simple to understand.
● Good for occasional data access.
● Not efficient for real-time continuous data.
🔹 Example:
● A temperature sensor publishes readings to a server (Broker).
● A mobile app subscribes to the Broker and automatically receives live temperature
updates without asking each time.
🔹 Features:
● Good for real-time continuous data sharing.
● Efficient when multiple devices need the same data.
● Reduces the load on devices because the Broker handles the delivery.
● Devices send their data (like temperature, humidity, etc.) to the broker.
● The broker stores the data and sends it to all devices or apps that have asked for it
(subscribers).
● Devices don't talk directly to each other — they only talk to the broker.
Example:
In short:
●
✅ Summary:
Request-Response Publish-Subscribe
Simple but not good for real-time updates. Best for real-time and multiple receivers.
CHapter 3
Definition:
A sensor is a device that detects changes in the environment (like temperature, light, motion,
etc.) and sends that information to other devices.
Characteristics of Sensors:
Types of Actuators:
1. Relays
○ Function: Acts like a switch that turns devices ON or OFF.
○ Used in: Home automation (e.g., turning on fans, lights).
○ How it works: When electricity flows through it, it creates a magnetic field to
open/close a circuit.
2. Motors
○ Function: Converts electrical energy into motion.
○ Types:
■ DC Motor: Spins when power is given; used in robots, toys.
■ Servo Motor: Rotates to a specific angle; used in robotic arms.
■ Stepper Motor: Moves in steps; used in 3D printers, CNC machines.
○ Used in: Fans, robotic systems, conveyor belts.
Definition:
An embedded system is a computer system designed to do a specific task. A microcontroller
is the brain of this system – it controls sensors and actuators.
1. Arduino
Definition:
Arduino is an open-source electronics platform based on easy-to-use hardware and
software. It is used to build digital devices and interactive objects that can sense and control
things in the real world.
3.3V: This pin of the board is used to provide a supply of 3.3V which is generated from a voltage
regulator on the board
GND: This pin of the board is used to ground the Arduino board.
Reset: This pin of the board is used to reset the microcontroller. It is used to Resets the
microcontroller.
Analog Pins: The pins A0 to A5 are used as an analog input and it is in the range of 0-5V.
Digital Pins: The pins 0 to 13 are used as a digital input or output for the Arduino board.
Serial Pins: These pins are also known as a UART pin. It is used for communication between the
Arduino board and a computer or other devices. The transmitter pin number 1 and receiver pin
number 0 is used to transmit and receive the data resp.
External Interrupt Pins: This pin of the Arduino board is used to produce the External interrupt and
it is done by pin numbers 2 and 3.
PWM Pins: This pins of the board is used to convert the digital signal into an analog by varying the
width of the Pulse. The pin numbers 3,5,6,9,10 and 11 are used as a PWM pin.
SPI Pins: This is the Serial Peripheral Interface pin, it is used to maintain SPI communication with
the help of the SPI library. SPI pins include:
LED Pin: The board has an inbuilt LED using digital pin-13. The LED glows only when the digital
pin becomes high.
AREF Pin: This is an analog reference pin of the Arduino board. It is used to provide a reference
voltage from an external power supply.
1. Microcontroller Board – The main part of Arduino is a microcontroller that acts like the
brain of the system.
2. Easy Programming – It is programmed using the Arduino IDE (Integrated
Development Environment), which uses a simple version of C/C++.
3. Open Source – Both hardware and software are open source, meaning anyone can use
and modify them.
4. Plug and Play – Arduino boards have USB ports for easy connection and power
supply.
5. Multiple Pins – It has digital and analog input/output pins to connect sensors, LEDs,
motors, etc.
Advantages of Arduino:
Definition:
The Raspberry Pi is a small and affordable single-board computer developed in the UK. It is
used for learning programming, building electronics projects, and developing IoT applications.
Main Features of Raspberry Pi:
1. Full Computer – It works like a normal computer with a processor, RAM, USB ports,
HDMI, and more.
2. Operating System – It runs on Raspberry Pi OS (Linux-based) and supports other
systems like Ubuntu.
3. GPIO Pins – It has 40 General Purpose Input/Output (GPIO) pins to connect sensors
and devices.
4. Internet Support – Has Wi-Fi, Bluetooth, and Ethernet for internet and network
connections.
5. Storage – Uses a microSD card for storing the operating system and files.
Model Features
Raspb Fast processor, up to 8GB RAM, 2
err micro-HDMI ports.
y
Pi
4
Comparison:
Feature Arduino Raspberry Pi
OS No OS Linux-based OS