IoT and Its Applications - Course Material
IoT and Its Applications - Course Material
Training Objectives:
● Introduce the foundational concepts of the Internet of Things (IoT) and its
application in smart systems.
● Enable students to interface and integrate various digital and analog sensors with
IoT platforms.
● Train students in real-time data acquisition, processing, and wireless transmission
using microcontrollers.
● Provide exposure to AI/ML techniques for sensor data analysis and smart
decision-making at the edge.
● Build practical, scalable IoT-AI applications in sectors such as agriculture,
healthcare, and automation.
Confidential: The content of this document is confidential and intellectual property of InGage Technologies. It is strictly forbidden to share any part of
this document with any third party without a written consent of the owner
Course Syllabus:
UNIT I – Fundamentals of IoT and Sensor Systems
IoT architecture and ecosystem, Types of sensors (analog/digital), Microcontrollers for IoT
(Arduino, ESP32), Power sources and safety
UNIT V - IoT System Development & Capstone Project and Case Studies
Design and implementation of an IoT + AI solution. Use case exploration in agriculture, smart
home, and health monitoring
Table of Content
Chapter Section Title Page No.
— 📚 References 58
List of Figures
Figure No. Title Page No.
List of Tables
Table No. Title Page No.
The Internet of Things (IoT) represents a transformative shift in how physical devices connect to
each other and to digital systems. At its core, IoT refers to a network of interconnected devices
embedded with sensors, software, and communication capabilities that enable them to collect,
transmit, and act upon data without direct human intervention. From smart homes that automate
lighting and climate control, to industrial systems that monitor equipment performance, IoT is
rapidly reshaping the landscape of technology and human interaction.
The evolution of IoT can be traced back to the emergence of wireless networks and low-power
embedded systems, allowing everyday objects to become part of the digital fabric. Today, IoT
solutions span multiple domains—healthcare, agriculture, manufacturing, urban infrastructure,
transportation, and beyond—each with its own ecosystem of devices, protocols, and platforms.
The underlying goal of IoT is not merely data collection, but intelligent decision-making that
enhances efficiency, safety, and user experience.
Understanding IoT begins with a deep appreciation of its architecture, which defines how its
components interact. A typical IoT system can be broken down into four essential layers: the
perception layer, the network layer, the processing layer, and the application layer.
The Perception Layer is the most foundational. It includes all sensors and actuators that interact
with the physical environment. These components are responsible for sensing parameters such as
temperature, humidity, motion, gas levels, or even biometrics like pulse rate. The data collected by
these sensors represents the raw input of the IoT system.
The final component is the Application Layer, where the user interacts with the IoT system. It
includes mobile apps, dashboards, and web interfaces that visualize data or allow the user to
configure system settings. This layer brings context and utility to the otherwise abstract data,
turning it into something meaningful for the end-user.
The IoT ecosystem is a complex but coordinated assembly of hardware, software, protocols, and
platforms that allow intelligent systems to operate efficiently. At the heart of this ecosystem lies
the seamless integration between sensor technology, embedded computing, communication
protocols, and data processing platforms.
Various platforms play a critical role in simplifying the development and deployment of IoT
applications. Platforms such as Blynk and ThingSpeak provide user-friendly dashboards for
real-time data visualization, while Firebase and Azure offer robust backend support for data
storage, cloud functions, and security.
Security, too, is a fundamental part of this ecosystem. Because IoT systems often operate in open,
wireless environments and interact with sensitive data, measures such as encryption,
authentication, and secure firmware updates are crucial for ensuring the integrity and safety of the
system.
Moreover, an effective IoT ecosystem requires efficient data management strategies. The flow
typically begins with data collection from sensors, followed by transmission via wireless modules.
This data is then processed, either locally (edge computing) or in the cloud, before triggering a
decision or action. This cycle—collect, communicate, compute, and control—is central to every IoT
application.
1.4 Types of Sensors in IoT
Sensors are the sensory organs of any IoT system. They capture real-world parameters and convert
them into signals understandable by electronic systems. Broadly, sensors are categorized as analog
or digital, based on the nature of their output.
Analog Sensors
Analog sensors produce a continuous signal that varies over time and is proportional to the
physical quantity being measured. For instance, a temperature sensor might produce a voltage
that varies linearly with ambient temperature. Examples of analog sensors include thermistors,
light-dependent resistors (LDR), potentiometers, and gas sensors.
Fig 1.3. Analog Sensor Workflow
The main characteristic of analog sensors is their ability to provide detailed data over a continuous
range. However, this also makes them susceptible to noise, and therefore they often require signal
conditioning—filtering, amplification, and calibration—before being processed by
microcontrollers.
In practical applications, analog sensors are commonly used in environments where precise,
gradual measurement is required. For example, in smart agriculture, analog soil moisture sensors
help farmers monitor and maintain optimal watering conditions based on continuous readings.
Digital Sensors
In contrast, digital sensors produce discrete signals, typically in the form of binary values—either
HIGH (1) or LOW (0). These sensors often include internal analog-to-digital converters (ADC),
enabling them to provide more straightforward integration with digital systems like Arduino or
ESP32.
Fig 1.4. Digital Sensor Workflow
Common digital sensors include Passive Infrared (PIR) motion sensors, ultrasonic distance sensors,
and digital temperature sensors like the DHT11 or DS18B20. These sensors are typically more
immune to noise and are easier to work with, especially for beginners or for applications that
require threshold-based decision-making.
Digital sensors shine in scenarios like security systems, where a PIR sensor detects motion and
triggers an alarm, or in automatic lighting where an ultrasonic sensor activates lights upon
detecting presence.
Microcontrollers form the computing backbone of IoT devices. Among the most widely used in
educational and hobbyist environments are Arduino and ESP32.
ESP32, on the other hand, is a more powerful alternative with built-in Wi-Fi and Bluetooth
capabilities. It supports dual-core processors, a larger memory, and more GPIOs than Arduino.
ESP32 is perfect for wireless applications and can run machine learning models on-device, making
it ideal for edge AI applications.
Both platforms are programmable using the Arduino IDE, and numerous open-source libraries are
available for quick integration of sensors and communication modules.
Fig.1.6.Esp32 Microcontroller
Whether you're building a remote weather station or a smart irrigation system, these boards are
versatile, cost-effective, and well-supported.
Powering IoT devices efficiently is critical, especially in remote or inaccessible locations. Depending
on the application, IoT devices may be powered through USB, batteries, solar panels, or
energy-harvesting techniques.
Battery-powered IoT devices are common in wearable technologies or wildlife monitoring, where
portability is essential. Low-power microcontrollers and sleep modes are essential here to extend
battery life. Solar-powered IoT devices are ideal for outdoor applications like smart agriculture or
weather stations, providing sustainable and renewable energy options.
More advanced systems may utilize energy harvesting techniques, capturing ambient energy from
motion, light, or temperature differences to generate small amounts of electricity. Such methods
are valuable in sensor networks deployed in hard-to-reach areas.
Power management is not just about choosing a source; it also includes regulating voltage,
protecting against overcurrent, and ensuring safe operation in varying environmental conditions.
While IoT opens a world of possibilities, it also introduces potential risks—electrical, operational,
and even environmental. Ensuring safety in IoT systems involves both hardware and software
considerations.
On the hardware side, short circuits, overvoltage, or component overheating can damage devices
or even cause fire hazards. Using appropriate resistors, fuses, voltage regulators, and enclosures
helps mitigate these risks. Additionally, isolating high-voltage and low-voltage sections is crucial,
especially in industrial applications.
Fig 1.7. Safety Systems in IoT
From a software perspective, preventing unauthorized access, ensuring firmware integrity, and
validating sensor input are vital to system reliability. For instance, an IoT-based gas leak detector
must not only function correctly but also avoid false positives or delayed responses, which could
lead to dangerous outcomes.
Proper grounding, insulation, and thermal management are necessary for safe long-term
operation. Additionally, adherence to local and international standards (such as ISO/IEC for IoT
devices) further ensures compliance and reliability in professional settings.
The concept of connecting physical devices to a network is not new. In fact, early automation
systems in the 1980s already featured embedded controllers communicating through wired
protocols. However, the convergence of several technological trends in the early 2000s—including
the proliferation of wireless communication, the miniaturization of electronics, and the rise of
cloud computing—enabled the large-scale realization of what we now call the Internet of Things.
Fig 1.8. Evolution of IoT
The term "IoT" was popularized by Kevin Ashton in 1999, who envisioned a world where everyday
objects could collect data and transmit it via the internet. Early IoT implementations were often
proprietary and closed. But as open-source hardware platforms like Arduino and Raspberry Pi
emerged, IoT development became accessible to hobbyists, educators, and startups.
In modern contexts, IoT has evolved beyond mere connectivity. The rise of artificial intelligence
and edge computing has transformed IoT systems into intelligent, self-adapting ecosystems
capable of learning from patterns and automating decisions. Today, smart cities use IoT for traffic
monitoring and energy management, while in agriculture, IoT enables precision farming with data
from soil sensors, weather stations, and drone imaging.
IoT systems are defined by a set of characteristics that distinguish them from traditional computing
systems:
● Connectivity: Every device in an IoT system must be connected to a network, either directly
to the internet or via a local gateway. Connectivity ensures seamless data flow between the
physical world and digital applications.
● Scalability: As applications grow, IoT systems should support the addition of new sensors
and devices without compromising performance.
● Autonomy: Advanced IoT systems can perform actions or make decisions without human
intervention. This is enabled through rule-based programming or machine learning
algorithms.
● Context Awareness: IoT devices often operate based on environmental context. For
instance, a smart AC might adjust cooling based on room occupancy and temperature.
● Real-Time Operation: Many IoT applications require immediate response—e.g., fire
detection, gas leak alerts, or automated braking in vehicles.
● Energy Efficiency: Since many IoT devices operate on batteries, they must consume
minimal power, especially during idle or sleep states.
● Security and Privacy: Given that many IoT systems handle sensitive data (like health
metrics or location), ensuring encryption, authentication, and data privacy is critical.
Choosing the right sensor for an IoT project involves evaluating several key parameters:
● Accuracy: The degree to which the sensor value matches the true value of the measured
quantity.
● Sensitivity: The minimum change in input that the sensor can detect.
● Range: The limits within which the sensor can operate effectively.
● Response Time: How quickly the sensor reacts to a change in input.
● Stability and Durability: The sensor’s ability to function reliably over time and in various
environmental conditions.
● Interfacing Compatibility: Whether the sensor works with your chosen microcontroller
(e.g., analog vs. digital output, voltage levels, communication protocols).
● Cost and Availability: For large-scale deployment, cost-effective sensors are preferred,
without sacrificing critical performance.
For example, if you're building an indoor air quality monitor, you might need gas sensors (MQ
series), temperature/humidity sensors (DHT22), and possibly a dust particle sensor. Choosing
sensors that are reliable and accurate over time is crucial in applications like healthcare or
environmental monitoring.
Widely used in greenhouses, industrial drying processes, and climate control systems. DHT11 and
DHT22 combine temperature and humidity sensing.
Important in safety systems, e.g., detecting LPG leaks in kitchens, or CO2 levels in indoor
environments. The MQ series (MQ2, MQ135, etc.) offers detection of various gases.
Fig 1.11. Gas Sensor
PIR (Passive Infrared) sensors detect motion and are used in security systems and automatic
lighting. Accelerometers (e.g., MPU6050) are used in wearable fitness devices and vehicle crash
detection.
Used to measure distance or detect presence, useful in parking sensors, object avoidance robots,
and water level monitoring (e.g., HC-SR04 sensor).
FIg 1.13. Ultrasonic Sensors
LDRs (Light Dependent Resistors) and photodiodes help detect ambient light and are commonly
used in smart street lights or display dimming.
Microcontrollers act as the brain of an IoT system, interpreting sensor data and making decisions
based on programmed logic. To interface a sensor with a microcontroller like Arduino or ESP32,
one must consider:
● Pin configuration: Knowing which pins are digital, analog, PWM, I2C, or SPI is essential.
● Voltage levels: Most sensors work at 3.3V or 5V. Supplying incorrect voltage can damage
the sensor.
● Signal Conditioning: Some analog signals are weak and require amplification or filtering
before use.
● ADC (Analog-to-Digital Conversion): Since microcontrollers can only read digital data,
analog signals must be converted using built-in or external ADCs.
Example: Interfacing an LM35 with Arduino involves connecting the VCC to 5V, GND to GND, and
output to an analog input pin (like A0). The Arduino code reads the analog voltage and converts it
to Celsius using a formula based on sensor calibration.
Many sensors are available as breakout boards or integrated in shields, which simplify wiring and
protect against reverse polarity. These modules often include pull-up resistors, capacitors, and
even LEDs for status indication.
For example, an ultrasonic sensor like HC-SR04 on a breakout board includes trigger and echo pins,
and is easily mountable. Similarly, shields like the Arduino Sensor Shield or NodeMCU Base Shield
provide ready-to-use pin headers for multiple sensors.
These modular approaches are especially useful in rapid prototyping and educational
environments, where reducing setup complexity speeds up experimentation.
To extract meaningful data from sensors, one must write programs (also called sketches) that run
on microcontrollers. The Arduino IDE is a popular tool for writing, compiling, and uploading such
code.
Interfacing refers to the process of connecting sensors to a microcontroller or IoT board so that data can
be accurately read, processed, and used in applications. The goal is to ensure that the physical quantity
measured by a sensor (like temperature, distance, or humidity) is properly converted into an electrical
signal that can be interpreted by a computing device.
Successful sensor interfacing depends not only on the physical connection (wiring, voltage compatibility,
etc.) but also on understanding the signal type, appropriate software drivers, calibration, and signal
conditioning. Whether the sensor is analog or digital, how it communicates (via I2C, SPI, UART, or GPIO),
and what data format it outputs are all crucial considerations.
Data acquisition (DAQ) is the process of collecting signals from sensors and converting them into digital
data that can be processed by a microcontroller or computer. A complete data acquisition system
consists of:
In IoT, real-time and accurate data acquisition is vital for making automated decisions, triggering alerts,
or feeding AI algorithms. Inaccurate data acquisition can lead to incorrect predictions or system failures.
The LM35 sensor outputs an analog voltage linearly proportional to temperature. It provides 10 mV per
°C rise in temperature. Interfacing it with Arduino involves reading the analog pin using
analogRead() and converting it to Celsius.
Wiring:
● VCC to 5V
● GND to GND
● OUT to A0 (Analog Input)
Code Snippet:
void setup() {
Serial.begin(9600);
void loop() {
Serial.println(temperature);
delay(1000);
These are digital sensors that output temperature and humidity data using a single digital pin. Libraries
like DHT.h make reading data easy.
Wiring:
● VCC to 3.3V/5V
● GND to GND
● DATA to Digital Pin (e.g., D2
DHT11/DHT22 also serve as humidity sensors. They operate based on capacitive humidity sensing and
offer reliable results for indoor applications. DHT22 has higher accuracy and range than DHT11.
● Temperature in °C
● Relative Humidity in %
Applications include smart agriculture, indoor weather stations, and HVAC control.
Wiring:
● VCC to 5V
● GND to GND
● AOUT to Analog Pin (e.g., A0)
● DOUT to Digital Pin (optional)
Use-case examples:
Important Note: Gas sensors often require a "burn-in time" of 24–48 hours for calibration before they
give stable readings.
PIR (Passive Infrared) sensors detect motion based on the infrared radiation emitted by warm objects
(like humans).
Wiring:
● VCC to 5V
● GND to GND
● OUT to Digital Pin (e.g., D2)
When motion is detected, the output pin goes HIGH for a few seconds. You can adjust sensitivity and
delay using onboard potentiometers.
Use-cases:
● Intruder detection
● Energy-saving automatic lights
● Smart security systems
Ultrasonic sensors measure distance by sending a sound pulse and calculating the time it takes to return
after bouncing off an object.
Wiring:
● VCC to 5V
● GND to GND
● TRIG to Digital Pin
● ECHO to Digital Pin
Code :
#define trigPin 9
#define echoPin 10
void setup() {
Serial.begin(9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
Serial.print("Distance: ");
Serial.println(distance);
delay(500);
Applications:
Microcontrollers like Arduino Uno have built-in ADCs to convert analog voltages (0–5V) into digital values
(typically 10-bit, i.e., 0 to 1023).
For ESP32, ADC resolution can be configured (up to 12-bit). ESP32 also supports multiple analog input
channels, making it ideal for advanced DAQ systems.
Importance of ADC:
Before data is sent to ADCs, signals often need to be conditioned to improve accuracy and reliability.
Common signal conditioning techniques include:
● Linearization: Non-linear sensor responses are mapped to a linear scale using algorithms or
circuitry.
● Clipping and Clamping: Protects ADC inputs from voltage spikes.
Signal conditioning ensures the sensor data is clean, accurate, and suitable for decision-making in the
IoT system.
Once data is acquired, it must be logged and visualized for analysis. Basic methods include:
● Serial Monitor: Used in Arduino IDE for debugging and live monitoring.
● Local Storage: Using SD card modules for offline logging.
● Cloud Platforms: ThingSpeak, Firebase, Blynk for real-time online dashboards.
Visual representation of data helps in identifying trends, setting alerts, or integrating with AI for automation. For
example, a temperature graph over 24 hours can help predict HVAC usage patterns.
These challenges can be managed using techniques like adaptive sampling, sensor fusion, and edge
computing.
Communication is the lifeline of the Internet of Things (IoT). It enables sensors, microcontrollers,
gateways, and cloud services to exchange data in real-time. The true power of IoT lies in connecting
devices—not only to each other but also to humans and data processing systems. For this, choosing the
right communication protocol is essential, as it impacts power consumption, data speed, range, and
complexity.
IoT communication is generally categorized into two layers: device-to-device (D2D) and device-to-cloud.
Devices communicate using a wide variety of wired and wireless protocols. Each has trade-offs and is
suitable for specific use cases. For example, Wi-Fi provides high speed but consumes more power, while
Zigbee consumes very little power and is ideal for mesh networks.
This chapter explores the communication methods that allow IoT systems to transmit sensor data,
receive commands, and function as intelligent, interconnected systems.
Serial communication is the most fundamental type of communication used in embedded systems. It
transmits data one bit at a time over a single wire (or a few wires). There are two major types:
UART is a common protocol for device-to-device communication. It uses two wires: TX (transmit) and RX
(receive). UART is asynchronous, meaning both devices must agree on a baud rate (bits per second).
Key features:
● Point-to-point communication
● Baud rates commonly used: 9600, 115200 bps
● No shared clock; timing is based on start/stop bits
Use cases:
SPI is a synchronous protocol and much faster than UART. It uses four wires:
Advantages:
Limitations:
I2C is another synchronous protocol, but with only two wires: SDA (Serial Data) and SCL (Serial Clock).
Devices are assigned unique addresses, and a master device controls the bus.
Advantages:
Limitations:
● Slower than SPI
● Only half-duplex
● Pull-up resistors required
I2C is ideal for applications like environmental sensor clusters (e.g., BMP180, BH1750), real-time clocks,
or EEPROM chips.
Wireless connectivity is a hallmark of modern IoT. Choosing the correct wireless protocol is critical to
system design. The most common wireless standards in IoT are:
● Wi-Fi
● Bluetooth (Classic and BLE)
● Zigbee
● LoRa (Long Range)
● Cellular (2G/3G/4G/NB-IoT)
● RFID/NFC (for short-range identification)
Wi-Fi is a high-speed wireless technology based on IEEE 802.11 standards. It supports high data rates
and is ideal for applications where power is not a major concern.
Pros:
Cons:
Use cases:
Bluetooth is widely used in short-range communication, especially in wearables, health monitors, and
portable electronics.
Classic Bluetooth:
BLE is ideal for battery-operated sensors, smartwatches, and fitness trackers. Modules like HC-05
(classic) and HM-10 (BLE) are common in Arduino projects.
3.3.3 Zigbee
Zigbee is a mesh network protocol designed for low-power, low-data-rate applications. It is based on
IEEE 802.15.4 standard.
Pros:
Cons:
Use cases:
Zigbee modules like XBee are widely used in professional IoT networks.
Key Concepts:
● Broker: A server that receives all messages, filters them, and distributes them to subscribers.
● Publisher: Device that sends data (e.g., sensor).
● Subscriber: Device or application that receives data.
● Topic: A string identifier for filtering messages.
Example:
● Topic: /home/livingroom/temperature
● Publisher: ESP32 sends temp data
● Subscriber: Mobile app or dashboard displays it
Advantages:
● Lightweight
● Works on unstable networks
● Easy to implement on microcontrollers
MQTT is ideal for low-bandwidth, low-power applications. Popular brokers include Mosquitto, HiveMQ,
and Adafruit IO.
3.5 HTTP Protocol in IoT
HTTP (Hypertext Transfer Protocol) is the backbone of the web and is used for transmitting data over the
internet. In IoT, HTTP is used to send or retrieve sensor data using RESTful APIs.
Pros:
Cons:
Use cases:
Example:
POST https://api.example.com/sensor-data
"temperature": 27.5,
"humidity": 60
While HTTP is more resource-intensive than MQTT, it’s suitable for infrequent data transmission and
cloud dashboard integration.
IoT systems often need to send structured data to cloud platforms or between devices. JSON (JavaScript
Object Notation) is the most commonly used format for this purpose.
Features:
Example JSON:
"device": "ESP32",
"temperature": 26.7,
"humidity": 58,
"timestamp": "2025-06-20T14:00:00Z"
When using MQTT or HTTP, JSON is the preferred format for payloads due to its simplicity and
compatibility with databases, web APIs, and mobile apps.
Multiple
I2C Wired Short Low Medium peripherals
Security is essential when data is transmitted wirelessly or over the internet. The following measures
should be considered:
● Data Encryption: Use TLS/SSL for MQTT and HTTPS for HTTP.
● Authentication: Ensure only verified devices can publish or subscribe.
● Firewall and Port Management: Protect against unauthorized access.
● Secure Tokens or API Keys: Prevent misuse of cloud APIs.
● OTA (Over-the-Air) Updates: Patch security flaws remotely.
In secure systems, even communication protocols should support encryption and device verification.
● Smart Homes: Wi-Fi-connected bulbs and switches controlled via smartphone apps.
● Agriculture: Zigbee-based soil sensors relaying data to a central gateway.
● Health Monitoring: BLE-enabled wearables sending pulse and temperature data to a phone app.
● Smart Cities: MQTT-based traffic sensors communicating with a cloud server.
Artificial Intelligence (AI) in the context of IoT represents a powerful synergy between sensing and
thinking. While IoT devices can collect massive amounts of real-world data through sensors, AI allows
systems to learn from this data, recognize patterns, and make intelligent decisions without direct human
input.
In traditional systems, sensor data is analyzed based on predefined rules. However, such systems are
often rigid and cannot adapt to dynamic environments. AI-enhanced IoT systems, on the other hand, use
learning algorithms to detect trends, predict outcomes, and optimize decisions. For instance, a
temperature sensor in a smart thermostat may learn user preferences and adjust room temperature
proactively.
Fig 4.1 AI in IoT
AI transforms raw sensor data into actionable insights and forms the core of intelligent
automation—whether it’s predictive maintenance in factories, anomaly detection in healthcare, or yield
prediction in smart agriculture.
Artificial Intelligence refers to the ability of machines or computer programs to perform tasks that
typically require human intelligence. These include reasoning, problem-solving, pattern recognition, and
decision-making.
● Supervised Learning: Models are trained with labeled data (e.g., temperature = 30°C, label =
“hot”).
● Unsupervised Learning: Models find patterns in unlabeled data (e.g., clustering).
● Reinforcement Learning: Models learn by interacting with environments and receiving feedback.
In IoT, supervised learning is most commonly used to classify sensor readings or predict numerical
values.
The process of building and integrating an AI model into an IoT device follows a structured pipeline:
1. Data Collection: Gathering data from sensors (e.g., temperature, motion, gas).
2. Preprocessing: Cleaning and organizing data—normalizing values, removing noise, converting
units.
3. Feature Extraction: Identifying useful attributes from raw data (e.g., mean temperature over
time, movement frequency).
4. Model Training: Feeding the processed data into a machine learning algorithm to build a
predictive model.
5. Evaluation: Testing model performance using metrics like accuracy, precision, recall, and RMSE.
6. Deployment: Embedding the trained model into an edge device (e.g., ESP32) or cloud service.
7. Inference: Making real-time decisions based on new incoming sensor data.
These models assign input data to predefined categories. For example, a gas sensor's readings might be
classified as “safe” or “hazardous.”
Common algorithms:
● Decision Trees
● k-Nearest Neighbors (k-NN)
● Support Vector Machines (SVM)
● Neural Networks
Used for predicting continuous values based on input features. A regression model might estimate
temperature 1 hour from now based on current sensor trends.
Common algorithms:
● Linear Regression
● Random Forest Regression
● Polynomial Regression
4.4.3 Time-Series Analysis
Used to model temporal patterns in data collected over time, such as humidity variation across the day
or vibration patterns of a motor.
4.5 Tools for Edge AI: Edge Impulse and TensorFlow Lite Micro
Edge Impulse is a powerful online platform for developing machine learning models specifically
optimized for embedded and edge devices like Arduino and ESP32.
Features:
Edge Impulse supports sensor data like audio, motion, environmental inputs, and image classification
using simple visual workflows.
TensorFlow Lite Micro is a lightweight version of TensorFlow designed to run on microcontrollers with
limited memory (as low as 16 KB RAM). It supports inference for small neural networks directly on
embedded boards without requiring a cloud connection.
Advantages:
TFLite Micro is ideal for deploying gesture recognition, keyword spotting, or condition monitoring
models in IoT systems.
Let’s take a simple example: classifying the room environment as "Comfortable" or "Uncomfortable"
using temperature and humidity sensors.
Using a DHT11 sensor, collect readings over several days. Each data point includes:
● Temperature (°C)
● Humidity (%)
● Label: “Comfortable” or “Uncomfortable”
Clean noisy readings, convert strings to numbers, normalize ranges, and remove outliers.
Step 4: Training
Use tools like Edge Impulse or Google Colab to train the model on your dataset. The model
learns patterns such as:
Step 5: Evaluation
Check model accuracy using a test dataset. Evaluate confusion matrix, precision, recall, etc.
Step 6: Deployment
Export the trained model in .tflite or C++ code and upload it to an ESP32 or Arduino board using the
Arduino IDE or PlatformIO.
Steps to Deploy:
1. Export the model from Edge Impulse or convert it to .tflite format.
2. Install the required libraries (TFLite_ESP32, EdgeImpulseInference).
3. Integrate the model with sensor code.
4. Use live sensor readings as model input and perform inference.
5. Take actions based on model output (e.g., send alert, activate actuator).
A vibration sensor (accelerometer) reads real-time machine movement data. A trained AI model
classifies it as “Normal” or “Faulty.” If the status is “Faulty,” the system sends an alert or shuts down the
machine.
Edge AI allows decisions to be made directly on the device—without needing internet access. This
reduces latency and increases reliability. Use-cases include:
● Model Quantization: Reduce model size by converting 32-bit floats to 8-bit integers.
● Pruning: Remove unnecessary model nodes to reduce complexity.
● Knowledge Distillation: Train smaller models to mimic larger ones.
Process:
Developing an IoT system is not just about connecting sensors and writing code. It involves a structured
approach that encompasses hardware integration, software development, data management,
communication setup, and often the application of AI for decision-making. A well-designed IoT system
should not only sense and transmit data but also be secure, scalable, efficient, and adaptable to
real-world conditions.
The process begins with identifying a problem or opportunity that can be solved using IoT, followed by
system design, hardware selection, software integration, cloud or edge deployment, testing, and
validation. Whether the application is in agriculture, healthcare, smart homes, or urban infrastructure,
the development methodology remains largely consistent, though technologies and priorities may vary.
1. Problem Identification
Understand the domain-specific challenge—e.g., monitoring soil moisture in agriculture, tracking heart
rate in health tech, or automating home lighting.
2. Requirements Gathering
List out the hardware components, communication protocols, power needs, data storage, UI needs, and
intelligence level (rules vs. AI) of the system.
3. Hardware Design
Select appropriate sensors, microcontrollers (Arduino, ESP32), power sources, actuators, and support
circuitry.
4. Sensor Integration
Physically connect sensors to microcontrollers, ensuring compatibility in terms of voltage, interface type
(analog/digital/I2C/SPI), and calibration.
5. Software Development
Write firmware to read sensor values, process data, trigger actions, and transmit data using
communication protocols like MQTT or HTTP.
Send data to cloud platforms like Blynk, Firebase, or Thingspeak for visualization, or process it locally
using AI models (e.g., TFLite Micro on ESP32).
Perform real-world testing to fine-tune sensor accuracy, optimize energy consumption, and debug
communication or logic issues.
8. Deployment
Deploy the IoT system in the intended environment. Ensure it's durable, waterproof (if needed), and
capable of autonomous operation.
Example: In a smart irrigation system, the sensor measures soil moisture, sends data to ESP32, which
checks the threshold and either activates a pump or sends data to the cloud dashboard.
Problem: Unmonitored soil conditions lead to inefficient watering and reduced crop yield.
Solution: Deploy soil moisture sensors in fields, connect them to ESP32, and automate water
pumps based on data.
System Design:
Benefits:
Problem: Manual control of home lights and appliances wastes energy and lacks convenience.
Solution: Automate lighting based on occupancy and ambient light using PIR and LDR sensors.
System Design:
Solution: Use wearable devices to track vital parameters and transmit alerts when abnormalities
are detected.
System Design:
Outcomes:
Solution: Detect slot occupancy using ultrasonic sensors and display status on a web app.
System Design:
Enhancement: Add number plate recognition using a camera and OpenCV for security and
automation.
Problem: Urban air pollution is a growing health threat, but real-time monitoring is limited.
Solution: Deploy a network of low-cost gas sensors in public places to measure pollution levels.
System Design:
● Sensor: MQ135 for CO2, MQ7 for CO, DHT22 for humidity
● Controller: ESP32
● Power: Solar + battery
● Cloud: Blynk for live visualization
● Alerts: SMS when pollution exceeds thresholds
Background: Logistics firms transporting perishable goods need to maintain strict temperature
and humidity levels.
IoT Solution:
● Use temperature and humidity sensors (e.g., DHT22) inside containers
● ESP32 reads data and sends it via Wi-Fi to Firebase
● A threshold-based rule triggers an alert if values exceed limits
● Historical data is logged to assess compliance
Benefits:
1. Problem Relevance:
2. System Integration:
3. Data Processing:
4. Communication Efficiency:
5. Innovation:
● Enclosure and Weatherproofing: Outdoor systems must be protected from dust and rain.
● Power Management: Use deep-sleep modes, solar charging, and power budgeting.
● Security: Use encrypted communication and authenticated access.
● Scalability: Ensure system can support more sensors or users.
● Maintenance and Updates: Provide OTA (Over-the-Air) firmware update capabilities.
5.13 Conclusion
IoT system development culminates in building real-world, working solutions that improve efficiency,
safety, or quality of life. The blend of hardware, software, communication, and AI unlocks new
possibilities across industries. By following structured development methods and incorporating design
thinking, students and engineers can create impactful, scalable IoT-AI applications.
Capstone projects offer the opportunity to apply everything learned—from sensors and microcontrollers
to machine learning and dashboards—into a cohesive system. With IoT evolving rapidly, the next
generation of innovation will be led by those who can not only collect data but also understand and act
on it intelligently.
● Problem: Street and indoor lighting waste energy during low occupancy.
● Solution: Use light, PIR, and AI to adaptively control lighting based on occupancy and daylight.
● Technologies: LDR, PIR, ESP32, ML model to predict usage trends
This project/course integrates various modern development and simulation platforms to implement,
simulate, visualize, and deploy IoT and AI-based systems effectively.
4. ThingSpeak
5. Arduino IDE
● Purpose: Professional Python IDE for AI model development and backend scripting.
● Key Features:
○ Code intelligence and debugging tools.
○ Git integration.
○ Virtual environment and package management.
● Usage: Used to build machine learning models, preprocess sensor data, and create Python
scripts for backend logic.
7. Streamlit
● Purpose: Open-source Python library to build interactive data science dashboards and web apps.
● Key Features:
○ Simple Python scripting for UI.
○ Real-time graphs and sliders.
○ Supports model inference and data visualization.
● Usage: Used to create web-based dashboards to display sensor data, AI predictions, and allow
user control from a browser.
📚 References
1. Bahga, Arshdeep, and Vijay Madisetti. Internet of Things: A Hands-On Approach. Universities
Press, 2015.
2. Margolis, Michael. Arduino Cookbook. 2nd ed., O'Reilly Media, 2020.
3. Sharma, Suresh, et al. "Recent Advances in Embedded Systems and IoT Design Techniques."
Journal of Embedded Systems Engineering, vol. 11, no. 2, 2021, pp. 85–98.
4. Desai, Alok, et al. "Optimizing Sensor-Based IoT Architectures Using ESP32 and MQTT Protocols."
Proceedings of the IEEE IoT Congress, 2020, pp. 130–137.
5. Smith, Laura. "Security and Communication Protocols in the IoT Era." International Journal of
Computer Networks and Applications, vol. 9, no. 4, 2021, pp. 289–296.
6. TensorFlow. TensorFlow Lite for Microcontrollers Documentation. 2023.
https://www.tensorflow.org/lite/microcontrollers
7. Edge Impulse. TinyML on Embedded Systems Documentation. 2024.
https://docs.edgeimpulse.com
8. Wokwi Ltd. Wokwi ESP32/Arduino Simulator Documentation. 2024. https://docs.wokwi.com
9. Autodesk. Tinkercad Circuits: Design and Simulation Platform. 2024. https://www.tinkercad.com
10.MQTT.org. MQTT Version 5.0 Specification. OASIS Standard, 2019.
https://mqtt.org/mqtt-specification
11.MathWorks. ThingSpeak IoT Platform Documentation. 2024.
https://www.mathworks.com/help/thingspeak
12.Arduino. Arduino IDE and Documentation. 2024. https://www.arduino.cc
13.JetBrains. PyCharm Python IDE Documentation. 2024. https://www.jetbrains.com/pycharm/
14.Streamlit Inc. Streamlit Documentation. 2024. https://docs.streamlit.io
15.Adafruit Industries. Sensor Library Collection (MQ, DHT, etc.). GitHub Repository, 2024.
https://github.com/adafruit