Unit - 2 Iot
Unit - 2 Iot
(DIRUSUMARRU ROAD)
DEPARTMENT OF COMPUTER SCIENCE
INTERNET OF THINGS ( B. Sc Ds )
UNIT II
V SEMESTER
Presented By
G. TRINADHA RAO ( M.Sc cs )
Lecturer in computer science
G. TRINADHA RAO
ADC-BVRM
UNIT -2
SENSOR NETWORKS & IOT DEVELOPMENT BOARDS
WHAT IS A SENSOR NETWORK?
WHAT IS A SENSOR?
A Sensor is a device that detects and measures physical properties from the environment
and converts them into a digital or electrical signal for processing.
Working of a Sensor:
1. Sensing Element detects physical input (like heat, light, or pressure).
2. Transducer converts it into an electrical signal.
3. Signal Conditioning modifies and prepares the signal for output.
WHAT IS AN ACTUATOR?
An Actuator is a device that receives control signals (usually electrical) and performs a
physical action like movement, rotation, or controlling fluid flow. It is the "action" part of an
IoT or automated system.
Working of an Actuator:
1. Receives a command (signal) from a controller.
2. Converts electrical signal into physical movement or output.
3. Executes a task (e.g., turning on a motor or opening a valve).
G. TRINADHA RAO
ADC-BVRM
Types of Actuators (with Examples):
Actuator Type Output Action Example Device Application Example
Light switch, door lock
Electrical Actuator Electrical operation Relay, Solenoid
control
Hydraulic Excavators, aircraft landing
Hydraulic Actuator Fluid pressure
cylinders gear
Pneumatic Packaging systems, robotic
Compressed air Air pistons
Actuator arms
Thermal Actuator Heat-based motion Bimetallic strips Fire alarms, HVAC systems
Mechanical
Physical motion Gears, cams Clocks, engines
Actuator
Rotational Conveyor belts, CNC
Rotary Actuator Stepper motor
movement machines
Linear Actuator Straight-line motion Linear motor Adjustable beds, elevators
Sensor vs Actuator:
Feature Sensor Actuator
Function Detects environment changes Acts upon environment
Signal Flow Input to the system Output from the system
Example Temperature sensor Heating element
Role Data collection Response/action
Working:
1. Room temperature is sensed using a temperature sensor.
2. If temperature > 30°C, a fan or AC is turned on via a relay (actuator).
3. If temperature < 20°C, a heater is turned on.
4. System continuously monitors and adjusts based on sensor input.
G. TRINADHA RAO
ADC-BVRM
Role Description
4. Input for Sensor data acts as a trigger for automation systems (e.g., turning on
Automation lights when motion is detected).
Allow sensing in remote, hazardous, or inaccessible areas (e.g.,
5. Remote Sensing
volcanoes, mines, oceans).
Enables smart decisions based on sensor input (e.g., smart irrigation
6. Decision Support
if soil is dry).
7. Resource Helps in efficient use of resources like water, electricity, etc., using
Optimization sensor feedback.
8. Scalability and Easy to add or remove nodes in wireless sensor networks without
Flexibility major infrastructure changes.
WHAT IS A SENSOR?
A sensor is a device that detects physical or environmental changes (like temperature,
pressure, motion, etc.) and converts them into electrical signals that can be read and
processed by a computer or microcontroller.
1. Temperature Sensor
Working Principle: Uses thermocouples or thermistors that change resistance with
temperature.
Example: LM35, DHT11
Used in: Air conditioners, refrigerators, weather stations, greenhouses.
2. Motion Sensor (PIR Sensor)
Working Principle: Detects infrared radiation (heat) emitted by moving objects.
Example: HC-SR501 PIR Sensor
Used in: Security systems, smart lighting, automatic doors.
3. Proximity Sensor
Working Principle: Emits electromagnetic fields or infrared waves to detect nearby
objects.
Types: IR sensor, Ultrasonic sensor
Example: HC-SR04 (Ultrasonic), IR Proximity Sensor
Used in: Smartphones (screen off during call), robotics, parking assistance.
4. Light Sensor (LDR - Light Dependent Resistor)
Working Principle: Changes resistance based on light intensity.
Example: LDR module
Used in: Street lights (auto ON/OFF), camera exposure, solar trackers.
5. Gas Sensor
Working Principle: Measures concentration of gases via change in conductivity.
Example: MQ-2 (Smoke), MQ-135 (Air quality)
Used in: Smoke detectors, industrial safety, air purifiers.
G. TRINADHA RAO
ADC-BVRM
1. DC Motor
Working Principle: Converts electrical energy into rotational mechanical energy using
magnetic fields.
Example: Small motors in fans, toys, conveyor belts.
Used in: Robotics, automation systems.
2. Servo Motor
Working Principle: Uses feedback mechanism to precisely control angular position.
Example: SG90, MG996R
Used in: Robotic arms, camera gimbals, drones.
3. Stepper Motor
Working Principle: Rotates in fixed steps using electromagnets, allowing precise
control.
Example: NEMA 17
Used in: 3D printers, CNC machines.
4 Relay
Working Principle: Electrically operated switch that opens/closes circuits using
electromagnetic induction.
Used in: Home automation (to control AC devices using low-voltage signals), alarms.
5. Solenoid Valve
Working Principle: Uses electromagnetic field to control flow of liquid or gas.
Used in: Washing machines, irrigation systems, medical devices.
ARDUINO
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 the
physical world.
Key Point
- Microcontroller-based boar
- Programmable via USB
- Used in automation, IoT, robotics, etc.
- Affordable and beginner-friendly
Arduino IDE
Features:
• - Simple code editor (C/C++ based)
• - Upload code to Arduino via USB
• - Serial monitor for debugging
• - Includes built-in examples and libraries
• Available for Windows, Mac, and Linux
How Arduino IDE Works
• Steps to use Arduino IDE:
• 1. Connect Arduino board to PC via USB.
• 2. Select the correct board and port in IDE.
• 3. Write or load a sketch (program).
G. TRINADHA RAO
ADC-BVRM
• 4. Verify the code.
• 5. Upload the sketch to the board.
• 6. Observe output using Serial Monitor (if needed).
Arduino Uno
• - Most popular board for beginners
• - Microcontroller: ATmega328P
• - Digital I/O: 14, Analog In: 6
• - USB powered and programmable
• - Ideal for basic electronics and automation projects
Arduino Nano
• - Compact and breadboard-friendly
• - Microcontroller: ATmega328P
• - Digital I/O: 22, Analog In: 8
• - Mini USB connection
• - Ideal for portable or embedded systems
Arduino Leonardo
• - Unique ability to emulate keyboard/mouse
• - Microcontroller: ATmega32u4
• - USB can act as an input device
• - Good for HID (Human Interface Device) projects
Arduino Due
• - First Arduino board with 32-bit ARM core
• - Microcontroller: ATSAM3X8E
• - High performance and speed
• - Ideal for advanced robotics and processing-heavy tasks
G. TRINADHA RAO
ADC-BVRM
Arduino MKR1000
• - Designed for IoT applications
• - Microcontroller: SAMD21 Cortex-M0+
• - Built-in Wi-Fi support
• - Secure and energy-efficient
• - Best for cloud-connected projects
Arduino Pro Mini
• - Small, low-power, and inexpensive
• - Microcontroller: ATmega328P
• - No USB port (needs external programmer)
• - Suitable for wearable or battery-powered devices
•
How Arduino Fits into IoT Architecture
IoT Layer Arduino’s Role
Perception
Connects to sensors to collect real-world data
Layer
Network Layer Uses modules like ESP8266, GSM, Zigbee to send/receive data wirelessly
Application Works with cloud platforms (like Blynk, ThingSpeak, Adafruit IO) for
Layer user interaction and automation
RASPBERRY PI
G. TRINADHA RAO
ADC-BVRM
Components of Raspberry Pi
• - CPU (Broadcom ARM processor)
• - RAM (varies by model: 512MB to 8GB)
• - HDMI ports (for video output)
• - USB ports (for keyboard, mouse, devices)
• - Ethernet/Wi-Fi/Bluetooth (networking)
• - GPIO pins (connect sensors and actuators)
• - microSD card slot (storage and OS)
• - Audio jack and camera/display interfaces
Features of Raspberry Pi
• - Low cost, credit-card-sized computer
• - Can run a full Linux operating system
• - Connects to monitor, keyboard, and mouse
• - Supports internet and wireless connectivity
• - Programmable via multiple languages
• - Used as media center, server, desktop, or IoT hub
• - GPIO pins allow physical computing
2. Programming:
- Pi: Multiple languages & multitasking
- Arduino: C/C++ with single-task loop
3. Operating System:
- Pi: Runs Linux (Raspberry Pi OS)
- Arduino: No OS, runs firmware
4. Use Case:
- Pi: High-level projects, edge computing
- Arduino: Real-time hardware control
5. Connectivity:
- Pi: Wi-Fi, Ethernet, USB, HDMI
- Arduino: USB and GPIO (add Wi-Fi via module)
G. TRINADHA RAO
ADC-BVRM
Advantages of Raspberry Pi
• - Affordable and compact
• - Runs full Linux OS (multitasking)
• - Supports many programming languages
• - Ideal for media, IoT, and learning
• - GPIO for hardware projects
• - Community support and open-source
• - Can be used as desktop PC or web server
Types of Tags:
A. Based on Power Source
Type Description Range Use Case
Short (~10 cm
Passive No battery. Gets power from reader's signal. ID cards, retail
to 5 m)
Active Has its own battery to send signals. Long (~100 m) Vehicle tracking
Semi- Battery powers internal chip, but Temperature
Medium
Passive communication is reader-powered. tracking
B. Based on Application
Read-Only – Data written once, only read later.
Read/Write – Data can be updated multiple times.
G. TRINADHA RAO
ADC-BVRM
2. ANTENNA
The antenna is responsible for transmitting and receiving RF signals between the reader
and the tag.
Antenna Types in RFID:
Antenna Type Description Used In
Linear Polarized Sends waves in one direction. Needs tag alignment. Conveyor belts
Circular Polarized Rotates signal direction to catch misaligned tags. Warehouses
Patch Antenna Flat, mounted antennas for fixed installations. Doorways, shelves
Dipole Antenna Common for tags. Balanced design. General RFID tags
Key Role:
Helps focus signal energy.
Influences the read range and accuracy of the RFID system.
G. TRINADHA RAO
ADC-BVRM
Type Description
Has its own battery to transmit signals. Greater range and speed. Used
Active RFID
in vehicles, containers, etc.
Semi-Active (Semi- Has battery for internal use (e.g., sensors) but uses reader signal to
Passive) communicate.
Applications of RFID
Inventory Management
Access Control (ID badges, doors)
Hospital Patient Tracking
Supply Chain & Logistics
Animal Tracking
Vehicle Toll Collection
Library Book Tracking
Advantages of RFID
No line-of-sight needed (unlike barcodes)
Accurate, automatic identification
Fast scanning of multiple tags at once
Improves inventory and asset management
Disadvantages of RFID
Higher cost than barcodes
Active tags need battery maintenance
Signal interference from metal or liquids
Privacy/security concerns
G. TRINADHA RAO
ADC-BVRM
History and Context of Wireless Sensor Networks (WSN)
What is a Wireless Sensor Network (WSN)?
A Wireless Sensor Network (WSN) is a system of spatially distributed autonomous sensors
that monitor physical or environmental conditions (like temperature, sound, pressure, etc.) and
communicate wirelessly to transmit data to a central system for processing and analysis.
G. TRINADHA RAO
ADC-BVRM
Key Contextual Features of WSN
Feature Description
Miniaturization Sensor nodes are small and embedded in the environment.
Wireless
No wiring needed; nodes use radio signals to communicate.
Communication
Energy Constraints Operate on batteries or energy-harvesting (solar).
Nodes autonomously form networks without manual
Self-Organizing
configuration.
THE NODE
In WSN or IoT, a node refers to any device or unit that can sense, process, and communicate
data in a network.
A node can be a sensor, actuator, gateway, or controller.
It plays a critical role in collecting environmental data and communicating it to other
nodes or a central system.
Working of a Node
1. Sensing: The sensor detects physical/environmental conditions.
2. Conversion: The ADC converts the analog data to digital form.
3. Processing: The microcontroller processes and formats the data.
4. Transmission: The data is sent to other nodes or a base station via the transceiver.
5. Sleep/Idle Mode: To save energy, the node enters low-power states when not active.
Types of Nodes
Nodes can vary based on their function within the network:
Type of Node Description
Captures and transmits physical data to other nodes. Example:
1. Sensor Node
Temperature sensor.
G. TRINADHA RAO
ADC-BVRM
Type of Node Description
2. Actuator Node Performs actions based on commands (e.g., switch ON fan).
Forwards data between nodes; helps in multihop
3. Router Node
communication.
4. Coordinator/Gateway
Connects sensor network to external networks (e.g., Cloud).
Node
Gathers and stores data from all sensor nodes; central
5. Sink/Base Station Node
processing unit.
What Does “Connecting Nodes” Mean
Connecting nodes refers to the communication link between different
sensor/actuator/gateway nodes in a WSN or IoT network to enable data exchange.
G. TRINADHA RAO
ADC-BVRM
Node Type Function Example
Receives control signals and performs
Actuator Node Motors, alarms, pumps
actions
G. TRINADHA RAO
ADC-BVRM
DEFINITION: WSN AND IOT
WSN (Wireless Sensor Network)
The Internet of Things (IoT) is a global network of interconnected devices that can collect,
exchange, and act on data using embedded technologies like sensors, actuators, software, and
network connectivity — without human intervention.
IoT connects the physical world (devices, sensors) to the digital world (cloud, applications).
Key Point:
WSN provides the "sense" in the sense-think-act cycle of IoT.
It acts as the first step in the IoT data pipeline.
G. TRINADHA RAO
ADC-BVRM
Applications of WSN in IoT
G. TRINADHA RAO
ADC-BVRM