0% found this document useful (0 votes)
60 views

iot 2,3,4

dtoihjiodjth

Uploaded by

codercool23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

iot 2,3,4

dtoihjiodjth

Uploaded by

codercool23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

UNIT 2

Hardware for IoT Systems

IoT systems rely on various hardware components to collect, process, transmit, and act on data.
These components include sensors, microcontrollers, communication modules, actuators, and
gateways.

1. Key Hardware Components in IoT

A. Sensors

Sensors are crucial in IoT for gathering data from the physical environment. They detect changes
and convert them into electrical signals.

Types of Sensors:

1. Environmental Sensors:
o Temperature Sensors: Measure ambient temperature (e.g., DHT11, DS18B20).
o Humidity Sensors: Measure moisture levels (e.g., DHT22).
o Light Sensors: Detect light intensity (e.g., LDR, BH1750).
2. Motion and Proximity Sensors:
o Infrared (IR) Sensors: Detect motion and proximity (e.g., PIR sensors).
o Ultrasonic Sensors: Measure distance using sound waves (e.g., HC-SR04).
3. Pressure and Force Sensors:
o Measure atmospheric pressure or applied force (e.g., BMP180, FSR).
4. Chemical and Gas Sensors:
o Detect gases like CO2, methane, or smoke (e.g., MQ series sensors).
5. Position and Location Sensors:
o GPS Modules: Provide location data (e.g., NEO-6M).

B. Microcontrollers and Microprocessors

Microcontrollers and microprocessors serve as the brain of IoT devices, processing data and
controlling connected components.

1. Microcontrollers (MCUs):
o Lightweight, power-efficient processors designed for simple IoT tasks.
o Examples:
 Arduino Uno: Popular for beginners, easy prototyping.
 ESP32/ESP8266: Built-in Wi-Fi and Bluetooth, cost-effective.
2. Microprocessors (MPUs):
o More powerful, suitable for complex IoT applications requiring intensive
processing.
o Examples:
 Raspberry Pi: A single-board computer for advanced IoT projects.
 BeagleBone Black: Open-source hardware for industrial applications.

C. Communication Modules

Communication modules enable IoT devices to transmit data over different networks.

Common Types:

1. Wi-Fi Modules:
o Enable wireless connectivity over local networks.
o Example: ESP8266, ESP32.
2. Bluetooth and BLE Modules:
o For short-range, low-power communication.
o Example: HC-05 (Bluetooth), nRF52840 (BLE).
3. Cellular Modules:
o Use 3G, 4G, LTE, and 5G for wide-area network connectivity.
o Example: SIM900, Quectel EC25.
4. LPWAN Modules (Low Power Wide Area Network):
o Optimized for long-range, low-power communication.
o Example: LoRa (SX1276), Sigfox Modules.
5. RFID/NFC Modules:
o Used for short-range identification and data exchange.
o Example: RC522 (RFID), PN532 (NFC).

D. Actuators

Actuators receive signals from controllers and perform physical actions (e.g., movement,
switching).
Types of Actuators:

1. Motors:
o Servo Motors: Precise control of position (e.g., SG90).
o DC Motors: General-purpose motors for movement.
2. Relays:
o Switch high-power devices using low-power signals.
3. LEDs:
o Used for signaling and lighting in IoT applications.
4. Solenoids:
o Convert electrical signals into mechanical action (e.g., locking mechanisms).

E. IoT Gateways

Gateways act as intermediaries, aggregating data from devices and transmitting it to cloud
services.

Features of IoT Gateways:

 Protocol translation (e.g., MQTT to HTTP).


 Local data processing and storage.
 Examples:
o Raspberry Pi: Often used as a DIY gateway.
o Intel IoT Gateway: Industrial-grade solutions.

2. Power Management Hardware

Efficient power management is crucial for IoT devices, especially in remote or battery-powered
applications.

1. Battery Solutions:
o Rechargeable batteries (Li-ion, Li-Po) for long-term use.
o Coin cell batteries for ultra-low-power applications.
2. Energy Harvesting Modules:
o Solar panels, piezoelectric generators, or thermoelectric generators.
3. Power Management ICs (PMICs):
o Regulate power supply to IoT devices, ensuring efficiency.

3. Storage and Memory Hardware

IoT devices need memory for data storage, configuration, and processing.

1. Onboard Flash Memory:


o Used in microcontrollers to store firmware and small datasets.
2. SD Cards and External Storage:
o Used in microprocessors like Raspberry Pi for large datasets.
3. EEPROM (Electrically Erasable Programmable Read-Only Memory):
o Non-volatile memory for storing configuration data.
4. Security Hardware

IoT security is critical to ensure data integrity and device authentication.

1. Cryptographic Chips:
o Perform encryption and authentication (e.g., TPM (Trusted Platform Module)).
2. Secure Boot Modules:
o Ensure that only trusted firmware can run on the device.
3. Hardware Security Modules (HSMs):
o Used in industrial IoT for secure key storage and management.

5. Examples of Complete IoT Hardware Solutions

1. Smart Home Devices:


o Amazon Echo, Google Nest: Integrate sensors, actuators, and microcontrollers.
2. Wearable IoT Devices:
o Fitbit, Apple Watch: Incorporate sensors (heart rate, accelerometer),
microcontrollers, and BLE modules.
3. Industrial IoT (IIoT) Devices:
o Siemens MindSphere IoT hardware: Used for predictive maintenance and factory
automation.

IoT Hardware Concepts: Digital Sensors, RFID Technology, Wireless Sensor


Networks, and Participatory Sensing Technology

1. Digital Sensors in IoT

Digital sensors are critical components in IoT systems that detect physical or environmental
changes and output data in digital format. Unlike analog sensors that produce continuous signals,
digital sensors provide discrete digital values, often simplifying data processing.

Characteristics of Digital Sensors:

 Produce binary or discrete outputs (e.g., 0s and 1s).


 Interface directly with microcontrollers via protocols like I2C, SPI, or UART.
 Require less signal processing compared to analog sensors.

Types of Digital Sensors:

1. Temperature Sensors:
o Example: DS18B20 (communicates via 1-Wire protocol).
o Measures temperature in Celsius or Fahrenheit and outputs a digital signal.
2. Humidity Sensors:
o Example: DHT11/DHT22.
o Provides digital data on humidity and temperature.
3. Light Sensors:
o Example: BH1750.
o Measures light intensity and outputs data in digital format via I2C.
4. Motion Sensors:
o Example: PIR Sensors.
o Detects motion and provides a digital HIGH/LOW output.
5. Proximity Sensors:
o Example: HC-SR04 (Ultrasonic Sensor).
o Measures distance by sending digital pulses based on echo timing.

Advantages of Digital Sensors:

 Higher accuracy and noise resistance compared to analog sensors.


 Easier integration with digital systems (e.g., microcontrollers).
 Reduced need for additional signal processing circuitry.

2. Radio Frequency Identification (RFID) Technology

RFID is a wireless communication technology used to identify and track objects using
electromagnetic fields. It consists of RFID tags (transponders) and readers (interrogators).

Components of an RFID System:

1. RFID Tags:
o Store data that can be transmitted wirelessly.
o Types:
 Passive Tags: No internal power source; rely on reader’s energy.
 Active Tags: Have their own power source for extended range.
2. RFID Readers:
o Emit radio waves to power passive tags and receive data from tags.
3. Antenna:
o Transmits and receives radio signals between tag and reader.

Types of RFID Systems:

1. Low-Frequency (LF) RFID: (125-134 kHz)


o Short-range (up to 10 cm).
o Example Use: Animal tracking.
2. High-Frequency (HF) RFID: (13.56 MHz)
o Medium-range (up to 1 meter).
o Example Use: Contactless payment (NFC is a subset of HF RFID).
3. Ultra-High-Frequency (UHF) RFID: (860-960 MHz)
o Long-range (up to 10 meters).
o Example Use: Supply chain management, asset tracking.

Applications of RFID:

 Inventory Management: Real-time tracking of goods in warehouses.


 Access Control: Secure entry systems using RFID badges.
 Logistics: Automated tracking of shipments and containers.

Advantages of RFID:

 No line-of-sight required (unlike barcodes).


 Can read multiple tags simultaneously.
 Durable and reusable in harsh environments.

3. Wireless Sensor Network (WSN)

A Wireless Sensor Network (WSN) consists of spatially distributed sensors that communicate
wirelessly to collect and transmit data to a central system.

Key Components of WSN:

1. Sensor Nodes:
o Composed of sensors, microcontrollers, and communication modules.
o Example: Temperature, humidity, or vibration sensors.
2. Communication Nodes:
o Relay data between sensor nodes and the central base station.
3. Base Station/Gateway:
o Aggregates data from sensor nodes and transmits it to cloud or local servers.

Communication Protocols for WSN:

1. Zigbee:
o Low power, mesh networking capability.
o Example: Smart home devices.
2. LoRaWAN:
o Long-range, low-power protocol suitable for IoT.
o Example: Smart agriculture applications.
3. Bluetooth Low Energy (BLE):
o Short-range, low-power protocol for wearable devices.
Applications of WSN:

 Environmental Monitoring: Collect data on weather, soil moisture, and pollution levels.
 Smart Agriculture: Monitor soil conditions, crop health, and irrigation systems.
 Industrial IoT (IIoT): Monitor equipment conditions and predictive maintenance.

Advantages of WSN:

 Flexible deployment without the need for wired infrastructure.


 Scalable to large numbers of sensor nodes.
 Low power consumption for battery-operated devices.

4. Participatory Sensing Technology

Participatory sensing involves the collection of data through the active participation of
individuals using mobile devices, such as smartphones, wearables, or personal IoT devices.

Characteristics of Participatory Sensing:

 User-Centric: Data is gathered by individuals contributing voluntarily.


 Mobile Devices as Sensors: Smartphones or wearable devices act as data collectors.
 Distributed Data Collection: Large-scale data collection by many participants across
diverse locations.

Key Technologies Involved:

1. Smartphones:
o Equipped with sensors (GPS, accelerometer, gyroscope, camera) for data
collection.
2. Wearable Devices:
o Health monitors (e.g., heart rate, step counters) contribute data to health studies.
3. Cloud Platforms:
o Aggregate data from participants for processing and analysis.

Applications of Participatory Sensing:

1. Environmental Monitoring:
o Users collect data on air quality, noise pollution, or water quality using
smartphones.
2. Urban Planning:
o Citizens report infrastructure issues like potholes or traffic conditions.
3. Health Monitoring:
o Individuals contribute data on health metrics for public health research.
4. Disaster Management:
o Crowd-sourced information on natural disasters, such as flood mapping.

Advantages of Participatory Sensing:

 Cost-Effective: Utilizes existing personal devices for data collection.


 Wide Coverage: Can collect data over large geographic areas.
 Real-Time Data: Provides up-to-date information from multiple sources.

Summary of Key Technologies:

Technology Function Example Applications


Capture and transmit data in digital
Digital Sensors Smart homes, wearables
format
Inventory management,
RFID Technology Wireless identification and tracking
contactless payments
Wireless Sensor Environmental monitoring,
Distributed wireless data collection
Network (WSN) smart agriculture
Crowd-sourced data collection using Environmental monitoring,
Participatory Sensing
personal devices health data sharing

Embedded Platforms for IoT: Definitions and Overview

Embedded platforms are essential in IoT systems, acting as the computing core that enables data
collection, processing, and communication. These platforms typically include microcontrollers,
microprocessors, and peripheral interfaces to connect sensors, actuators, and communication
modules. Below are detailed definitions and explanations of widely used embedded platforms in
IoT.

1. Arduino: An Open-Source Microcontroller Platform

Definition:

Arduino is an open-source electronics platform based on easy-to-use hardware and software. It is


designed for beginners and professionals to create interactive projects and IoT applications.

Key Features:

 Microcontroller-based: Uses AVR or ARM Cortex-M microcontrollers.


 Programming Language: Simplified version of C/C++.
 I/O Interfaces: Digital/analog pins, I2C, SPI, and UART.
 Power Supply: USB or external (typically 5V).
Examples of Arduino Boards:

1. Arduino Uno: Based on the ATmega328P microcontroller, suitable for simple projects.
2. Arduino Mega: Features more I/O pins and memory, ideal for complex projects.

Applications:

 Home automation, robotics, wearables, and environmental monitoring.

2. Netduino: IoT Platform Based on .NET Framework

Definition:

Netduino is an open-source microcontroller platform that integrates with Microsoft’s .NET


Micro Framework, enabling developers to write applications in C# using the Visual Studio IDE.

Key Features:

 Microcontroller: ARM Cortex-M processors.


 Programming Language: C# and .NET framework.
 I/O Interfaces: GPIO, PWM, I2C, SPI.
 Connectivity: Ethernet and Wi-Fi models available.

Advantages:

 Supports multitasking and advanced features like threading.


 Ideal for developers familiar with the .NET ecosystem.

Applications:

 Industrial automation, IoT prototyping, networked devices.

3. Raspberry Pi: A Single-Board Computer

Definition:

Raspberry Pi is a series of small, affordable, single-board computers designed for education,


prototyping, and IoT development. Unlike microcontroller-based platforms, it functions as a full-
fledged computer capable of running an operating system.

Key Features:
 Processor: ARM Cortex-A series.
 Operating System: Runs Linux-based OS (e.g., Raspbian).
 Connectivity: Built-in Wi-Fi, Bluetooth, Ethernet.
 I/O Interfaces: GPIO, USB, HDMI, I2C, SPI, UART.

Popular Models:

1. Raspberry Pi 4: Quad-core ARM Cortex-A72, supports up to 8 GB RAM.


2. Raspberry Pi Zero: Compact version, low power, suitable for minimal projects.

Applications:

 IoT gateways, AI/ML applications, media centers, smart home hubs.

4. BeagleBone: Open-Source Single-Board Computer

Definition:

BeagleBone is an open-source single-board computer designed for industrial and IoT


applications, offering extensive I/O capabilities and real-time control.

Key Features:

 Processor: ARM Cortex-A8 or Cortex-A15.


 Operating System: Linux or real-time OS support.
 Connectivity: Ethernet, USB, and optional Wi-Fi modules.
 I/O Interfaces: Extensive GPIO, ADC, PWM, I2C, SPI.

Popular Models:

1. BeagleBone Black: Affordable and widely used in industrial settings.


2. BeagleBone AI: Designed for AI and machine learning applications.

Applications:

 Robotics, industrial automation, AI-driven applications, IoT edge computing.

5. Intel Galileo: Intel-Based IoT Board

Definition:
Intel Galileo is a microcontroller development board designed by Intel, compatible with the
Arduino ecosystem but powered by an Intel Quark processor.

Key Features:

 Processor: Intel Quark x1000 (32-bit, 400 MHz).


 Programming Compatibility: Arduino IDE and Linux-based software.
 Connectivity: Ethernet, USB, and expansion via shields.
 I/O Interfaces: Digital and analog I/O compatible with Arduino shields.

Advantages:

 Combines the simplicity of Arduino with the power of Intel processors.


 Supports Linux-based development, offering flexibility in IoT applications.

Applications:

 Industrial IoT, education, smart city projects, and prototyping.

6. ARM Cortex: Versatile Microcontroller and Microprocessor Platform

Definition:

ARM Cortex refers to a family of microcontroller and microprocessor cores designed by ARM
Holdings. They are widely used in embedded systems due to their power efficiency,
performance, and scalability.

Key Features:

 Cortex-M Series: Designed for low-power embedded applications (e.g., STM32 series).
 Cortex-A Series: Used in high-performance applications, such as Raspberry Pi.
 Cortex-R Series: Real-time applications requiring deterministic performance.

Applications:

 Cortex-M: Used in microcontroller platforms like STM32 for IoT devices and wearables.
 Cortex-A: Used in single-board computers like Raspberry Pi for complex IoT systems.
 Cortex-R: Used in automotive and industrial control systems requiring real-time
performance.

Summary of Key Embedded Platforms


Programming
Platform Processor Type OS Support Applications
Language
AVR, ARM None (bare- Prototyping, home
Arduino C/C++
Cortex-M metal) automation
Industrial IoT, networked
Netduino ARM Cortex-M C#/.NET None (real-time)
devices
Raspberry
ARM Cortex-A Python, C/C++ Linux IoT gateways, AI, robotics
Pi
ARM Cortex- Industrial automation,
BeagleBone Python, C/C++ Linux, RTOS
A8/A15 robotics
Intel Quark
Intel Galileo C/C++, Linux APIs Linux Industrial IoT, education
x1000
ARM Cortex-M, A, R Varies (C/C++, Varies (bare- Wearables, smart devices,
Cortex series Python) metal/OS) real-time apps
UNIT 3
Networking and Communication Aspects in IoT

The Internet of Things (IoT) relies on efficient networking and communication technologies to
enable seamless data exchange between devices, sensors, actuators, and cloud platforms. IoT
communication involves various protocols, network architectures, and technologies tailored to
different application requirements such as low power, long range, high data rate, and security.

1. Key Components of IoT Networking and Communication

A. IoT Device Types in Networks:

1. Sensors and Actuators:


o Sensors collect data (e.g., temperature, humidity).
o Actuators perform actions based on received commands (e.g., opening valves).
2. Edge Devices/Gateways:
o Aggregate data from sensors and connect to the internet.
o Perform pre-processing and protocol translation.
3. Cloud Platforms/Servers:
o Store, analyze, and manage large-scale IoT data.
o Provide remote control and monitoring capabilities.

B. IoT Communication Models:

1. Device-to-Device (D2D):
o Direct communication between IoT devices without intermediary.
o Example: Bluetooth-connected smartwatches and smartphones.
2. Device-to-Gateway (D2G):
o IoT devices communicate with gateways, which relay data to the cloud.
o Example: Smart home hubs like Amazon Echo.
3. Device-to-Cloud (D2C):
o Devices send data directly to cloud platforms for storage and processing.
o Example: Wi-Fi-enabled security cameras.
4. Gateway-to-Cloud (G2C):
o Gateways aggregate data from multiple devices and send it to the cloud.
o Example: Industrial IoT gateways in manufacturing plants.

2. IoT Network Architectures

A. Edge and Fog Computing Architecture:


1. Edge Computing:
o Data processing occurs at or near the data source (IoT devices).
o Reduces latency by minimizing data transfer to the cloud.
o Example: Smart surveillance cameras with local AI processing.
2. Fog Computing:
o Extends cloud capabilities closer to the data source by using local nodes (fog
nodes).
o Balances processing between edge devices and cloud servers.
o Example: Smart traffic management systems.

B. Cloud-Centric Architecture:

 All data is transmitted to centralized cloud servers for processing and storage.
 Suitable for applications that require large-scale analytics.
 Example: Smart thermostats sending data to cloud services.

3. IoT Communication Protocols

IoT communication protocols can be divided into two main categories: Network/Transport
Layer Protocols and Application Layer Protocols.

A. Network/Transport Layer Protocols:

1. IPv6 over Low-power Wireless Personal Area Networks (6LoWPAN):


o Enables IPv6 communication over low-power, low-data-rate wireless networks.
o Common in applications like smart homes and healthcare monitoring.
2. IEEE 802.15.4:
o Standard for low-power wireless networks used by Zigbee and Thread.
o Provides reliable communication with low power consumption.
3. Transmission Control Protocol (TCP) and User Datagram Protocol (UDP):
o TCP: Reliable, connection-oriented protocol suitable for critical data.
o UDP: Lightweight, connectionless protocol ideal for real-time data.

B. Application Layer Protocols:

1. MQTT (Message Queuing Telemetry Transport):


o Lightweight publish/subscribe protocol for low-bandwidth, high-latency
networks.
o Example: Used in smart home automation systems.
2. CoAP (Constrained Application Protocol):
o Designed for constrained devices; similar to HTTP but optimized for IoT.
o Example: Used in smart lighting systems.
3. HTTP/HTTPS:
o Standard web protocol for communication over the internet.
oExample: IoT devices that send data to web-based dashboards.
4. DDS (Data Distribution Service):
o Real-time data distribution protocol for time-sensitive applications.
o Example: Industrial control systems.

4. Communication Technologies in IoT

A. Short-Range Communication Technologies:

1. Bluetooth and Bluetooth Low Energy (BLE):


o Short-range, low-power wireless communication.
o BLE is widely used in wearable devices and smart home devices.
2. Zigbee:
o Low-power, low-data-rate mesh networking protocol.
o Ideal for smart home and industrial automation applications.
3. Wi-Fi:
o High data rate and widespread availability.
o Used in home automation and video streaming IoT devices.
4. Near Field Communication (NFC):
o Very short-range communication for contactless transactions.
o Example: Mobile payment systems.

B. Long-Range Communication Technologies:

1. LoRaWAN (Long Range Wide Area Network):


o Long-range, low-power communication protocol for LPWAN.
o Example: Smart agriculture and environmental monitoring.
2. Sigfox:
o Ultra-narrowband technology for low-data-rate IoT applications.
o Example: Asset tracking and utility metering.
3. Cellular (4G, 5G, NB-IoT, LTE-M):
o 4G/5G: High data rates for video streaming and critical applications.
o NB-IoT/LTE-M: Low power, wide-area technologies for IoT applications like
smart metering.

5. IoT Data Communication Challenges

A. Scalability:

 IoT networks must handle large numbers of devices, requiring scalable protocols and
architectures.
B. Power Efficiency:

 Many IoT devices are battery-operated, necessitating the use of low-power


communication technologies like BLE and LoRaWAN.

C. Latency and Real-Time Requirements:

 Some IoT applications (e.g., industrial automation) require real-time communication with
minimal latency.

D. Security and Privacy:

 Ensuring secure communication in IoT is critical, especially for sensitive data.


 Protocols like HTTPS, TLS, and data encryption are essential for secure IoT
communication.

6. Summary of IoT Networking and Communication Technologies

Power
Technology Range Data Rate Applications
Consumption
Short (10- Moderate (1-2 Wearables, smart home
Bluetooth/BLE Low
100m) Mbps) devices
Short (10- Smart lighting, industrial
Zigbee Very low Low (250 Kbps)
100m) automation
Medium High (100+ Home automation, video
Wi-Fi High
(100m) Mbps) streaming
Long (10-20 Low (0.3-50 Smart agriculture,
LoRaWAN Very low
km) Kbps) environmental monitoring
Long (1-20 High (Mbps for Smart cities, autonomous
5G/NB-IoT Moderate
km) 5G) vehicles
Lightweight Remote monitoring, home
MQTT N/A N/A
protocol automation
Lightweight Constrained devices,
CoAP N/A N/A
protocol industrial IoT

Wireless Medium Access Issues and MAC Protocols in IoT

In IoT systems, communication between wireless devices is a key challenge due to the shared
nature of the wireless medium. Efficient use of the available bandwidth, minimizing delays, and
managing interference are critical factors to ensure smooth and reliable communication. The
solution to these challenges often lies in the design of effective Medium Access Control (MAC)
protocols.
1. Wireless Medium Access Issues

A. Contention and Interference:

 Contention: Multiple devices trying to access the shared communication channel at the
same time, leading to collisions.
 Interference: Devices operating on overlapping frequencies or in close proximity may
interfere with each other, degrading the quality of communication.

B. Energy Efficiency:

 IoT devices are often battery-powered, making energy-efficient communication essential


to extend device lifetime. Protocols need to minimize power consumption by reducing
idle listening and transmission times.

C. Latency and Bandwidth Allocation:

 IoT applications, such as industrial automation and health monitoring, often require low
latency. Ensuring bandwidth availability for time-sensitive applications while
maintaining fairness is crucial.

D. Scalability:

 IoT networks often involve a large number of devices. The medium access control
protocol must scale effectively as the number of devices increases, without introducing
significant overhead or delays.

2. MAC Protocol Survey

MAC protocols determine how devices in a network coordinate their transmission over the
shared wireless medium. Below is an overview of common MAC protocols used in IoT
applications:

A. Synchronous vs Asynchronous MAC Protocols:

1. Synchronous MAC Protocols:


o Devices synchronize their transmission times to reduce collisions and improve
efficiency.
o Example: TDMA (Time Division Multiple Access) assigns fixed time slots for
each device to transmit data, preventing collisions and minimizing idle times.
2. Asynchronous MAC Protocols:
o Devices transmit data at any time without synchronization, relying on contention
mechanisms like random backoff.
o Example: CSMA/CA (Carrier Sense Multiple Access with Collision
Avoidance), used in IEEE 802.11 (Wi-Fi), where devices listen for activity before
sending data, backing off when the channel is busy.

B. Common MAC Protocols for IoT:

1. IEEE 802.15.4:
o Low-power wireless standard used for low-rate personal area networks (LR-
WPANs), and the foundation for protocols like Zigbee, Thread, and 6LoWPAN.
o Supports both TDMA and CSMA/CA access mechanisms for different needs
(e.g., fixed time slots or contention-based access).
2. Zigbee:
o An extension of IEEE 802.15.4, designed for low-power, low-data-rate, and short-
range communication. It uses a tree or mesh network topology.
o MAC Protocol: Uses slotted CSMA/CA, with support for low-power listening
(LPL) to save energy.
3. LoRaWAN (Long Range Wide Area Network):
o A Low Power Wide Area Network (LPWAN) protocol based on Aloha-based
MAC, which reduces overhead and allows for long-range communication in IoT
applications.
o Efficient for sparse, intermittent traffic with low data rates.
4. Bluetooth Low Energy (BLE):
o A power-efficient protocol used for short-range communication in IoT devices,
with a time-division multiplexing scheme that ensures multiple devices can
transmit without interfering.

3. Survey of Routing Protocols in IoT

Routing protocols are responsible for determining the optimal path for data transmission across
networks of IoT devices. These protocols need to handle dynamic topologies, low power
consumption, and large numbers of devices.

A. Flat Routing Protocols:

 All devices are treated equally, and the same protocol is used to route data from any node
to the destination.
 Example: Flooding (used in simple networks like small sensor networks), where every
node forwards the data to its neighbors.

B. Hierarchical Routing Protocols:


 Devices are divided into clusters, with cluster heads responsible for collecting data from
member nodes and forwarding it to higher-level nodes (e.g., base stations or cloud).
 Example: LEACH (Low Energy Adaptive Clustering Hierarchy), where nodes form
clusters, and the cluster heads aggregate data from sensors to reduce communication
overhead.

C. Geographic Routing Protocols:

 Routing decisions are made based on the geographic location of devices, which reduces
the need for complex routing tables.
 Example: Geographic Routing Protocol (GRP), where nodes use GPS to determine
routing based on proximity to the destination.

D. Multipath Routing Protocols:

 These protocols use multiple paths to transmit data, improving fault tolerance and load
balancing.
 Example: MECN (Multipath Energy-Conserving Routing) protocol, which ensures
energy efficiency while considering multiple routing paths.

E. Low Power and Lossy Networks (RPL):

 RPL (IPv6 Routing Protocol for Low-Power and Lossy Networks) is an IPv6-based
routing protocol designed specifically for IoT devices in resource-constrained
environments.
 Features: Supports low-power communication, hierarchical routing, and IPv6
addressing.

4. Sensor Deployment and Node Discovery in IoT

A. Sensor Deployment:

 Deployment Strategies:
o Random Deployment: Nodes are deployed randomly, suitable for large-scale,
difficult-to-reach areas (e.g., environmental monitoring).
o Deterministic Deployment: Nodes are deployed in a predefined pattern to ensure
coverage and efficient communication (e.g., smart agriculture).
o Hybrid Deployment: Combines random and deterministic deployment to balance
efficiency and flexibility.
 Challenges in Deployment:
o Coverage optimization (ensuring all areas are monitored).
o Connectivity (ensuring devices can communicate with each other and the
gateway).
o Energy efficiency (minimizing power consumption during both deployment and
operation).

B. Node Discovery:

 The process where new nodes identify and register with a network to begin
communication.
 Challenges:
o Ensuring reliable communication during the discovery phase.
o Minimizing energy consumption during discovery.
 Approaches:
o Proactive Discovery: Nodes actively search for other nodes.
o Reactive Discovery: Nodes search for neighbors only when required.
o Neighbor Discovery Protocols: Nodes exchange information about their
neighbors to build a routing table (e.g., AODV or DSDV).

5. Data Aggregation and Dissemination in IoT

A. Data Aggregation:

 Definition: The process of collecting data from multiple nodes and combining it into a
single summary or representative value before transmission, reducing the volume of data
sent over the network.
 Importance: Reduces communication overhead, saves energy, and prevents data
redundancy.
 Techniques:
o In-Network Aggregation: Data is aggregated by intermediate nodes, such as
cluster heads, before being sent to the base station.
o Centralized Aggregation: A central node (e.g., a gateway) collects all the data
and performs aggregation.
o Distributed Aggregation: Data is aggregated across various nodes before
sending it to a central point.
 Examples: Data compression, data fusion, average-based aggregation.

B. Data Dissemination:

 Definition: The process of distributing data from a central source (e.g., a cloud platform
or gateway) to all the IoT devices or nodes.
 Importance: Ensures that all relevant devices receive the necessary data for action.
 Techniques:
o Multicast: Sending data from a single source to multiple devices simultaneously.
o Broadcast: Sending data to all devices within range.
o Unicast: Sending data from one device to another specific device.
 Challenges:
o Ensuring data consistency across devices.
o Minimizing delay and energy consumption during dissemination.

Summary of Key Concepts

Concept Description Example Protocols/Technologies


Manage access to the shared wireless IEEE 802.15.4, Zigbee, LoRaWAN,
MAC Protocols
medium. Bluetooth
Routing
Manage data paths in IoT networks. RPL, LEACH, GRP, AODV, MECN
Protocols
Sensor Random, Deterministic, Hybrid
Strategies to deploy IoT devices.
Deployment Deployment
Process of finding and connecting
Node Discovery AODV, DSDV
nodes in the network.
Data Combining data from multiple nodes Data fusion, average-based
Aggregation to save energy. aggregation
Data
Distributing data to IoT devices. Multicast, Broadcast, Unicast
Dissemination
UNIT 4
Arduino Platform: Boards Anatomy Arduino is an open-source electronics platform that
consists of hardware (boards) and software (IDE) to create interactive projects. Arduino boards
are widely used for prototyping and development of embedded systems due to their simplicity,
versatility, and large community support. The core of the platform is the Arduino board, which is
made up of various components that allow it to interface with sensors, actuators, and other
devices.

1. Key Components of an Arduino Board

A. Microcontroller:

 Definition: The microcontroller is the brain of the Arduino board. It is responsible for
executing instructions from the program (sketch) loaded onto the board.
 Common Microcontrollers:
o ATmega328P: Found in Arduino Uno, one of the most popular models.
o ATmega2560: Found in Arduino Mega, with more I/O pins and memory.
o ARM Cortex: Found in boards like Arduino Due (more powerful, 32-bit
architecture).

B. Digital Input/Output Pins:

 Definition: These pins allow the board to interface with external devices (e.g., sensors,
LEDs, motors).
 Functionality:
o Digital pins: Can be set to HIGH (5V or 3.3V, depending on the board) or LOW
(0V).
o PWM pins: Some digital pins (e.g., on Arduino Uno) can output a Pulse Width
Modulated (PWM) signal for dimming LEDs or controlling motor speeds.
 Example: Arduino Uno has 14 digital I/O pins (D0 to D13).

C. Analog Input Pins:

 Definition: These pins receive analog signals (e.g., from sensors) and convert them into
digital values.
 Functionality:
o The Arduino board typically has 6 analog input pins (A0 to A5 on Arduino Uno).
o Each pin can read values in the range of 0 to 1023, representing 0 to 5V (on a 10-
bit scale).

D. Power Pins:

 Definition: These pins provide power to external components connected to the Arduino.
 Pins Include:
o 5V: Supplies a regulated 5V power source for external devices.
o 3.3V: Provides a 3.3V regulated power source for low-voltage components.
o GND (Ground): The ground pin, used to complete the electrical circuit.
o Vin: This pin can be used to provide an external voltage to the board (typically
between 6-12V) when the board is powered through an external power supply.

E. Serial Communication Pins (TX/RX):

 Definition: These pins are used for serial communication between the Arduino and other
devices (e.g., computers or peripherals).
 Pins Include:
o TX (Transmit): Sends data to another device.
o RX (Receive): Receives data from another device.
 Common Use: Used for uploading code to the Arduino from the computer and for
communication with serial peripherals (e.g., Bluetooth modules).

F. Reset Button:

 Definition: The reset button allows you to restart the Arduino board, causing it to begin
running the loaded program from the start.
 Usage: Pressing this button reboots the microcontroller, which is helpful for debugging
or restarting the program after making changes.

G. Voltage Regulator:

 Definition: The voltage regulator ensures the board gets the correct voltage supply,
converting the input voltage (e.g., from an external power supply or USB) to a stable
voltage required by the microcontroller and other components.
 Types: Typically provides 5V or 3.3V.

2. Types of Arduino Boards

A. Arduino Uno:

 Microcontroller: ATmega328P
 Digital I/O Pins: 14 (6 with PWM)
 Analog Input Pins: 6
 Operating Voltage: 5V
 Flash Memory: 32 KB (with 0.5 KB used by bootloader)
 RAM: 2 KB
 EEPROM: 1 KB
 Purpose: Ideal for beginners and simple projects.
B. Arduino Mega 2560:

 Microcontroller: ATmega2560
 Digital I/O Pins: 54 (15 with PWM)
 Analog Input Pins: 16
 Operating Voltage: 5V
 Flash Memory: 256 KB (with 8 KB used by bootloader)
 RAM: 8 KB
 EEPROM: 4 KB
 Purpose: Suitable for larger projects requiring many I/O pins, like robotic control
systems.

C. Arduino Nano:

 Microcontroller: ATmega328P
 Digital I/O Pins: 14 (6 with PWM)
 Analog Input Pins: 8
 Operating Voltage: 5V
 Flash Memory: 32 KB
 RAM: 2 KB
 EEPROM: 1 KB
 Purpose: Compact version of the Uno, ideal for smaller projects with limited space.

D. Arduino Due:

 Microcontroller: ARM Cortex-M3 (Atmel SAM3X8E)


 Digital I/O Pins: 54 (12 with PWM)
 Analog Input Pins: 12
 Operating Voltage: 3.3V
 Flash Memory: 512 KB
 RAM: 96 KB
 Purpose: More powerful board for advanced projects, especially those requiring higher
processing power or more complex calculations.

E. Arduino Leonardo:

 Microcontroller: ATmega32U4
 Digital I/O Pins: 20 (7 with PWM)
 Analog Input Pins: 12
 Operating Voltage: 5V
 Flash Memory: 32 KB
 RAM: 2.5 KB
 EEPROM: 1 KB
 Purpose: Used for projects that need USB functionality, such as creating custom
keyboards or mice.
F. Arduino MKR1000:

 Microcontroller: SAMD21 Cortex-M0+


 Digital I/O Pins: 8
 Analog Input Pins: 7
 Operating Voltage: 3.3V
 Flash Memory: 32 MB
 RAM: 2 KB
 Purpose: Ideal for Internet of Things (IoT) projects with integrated Wi-Fi.

3. Other Important Features on Arduino Boards

A. USB Port:

 Definition: Used to connect the Arduino board to a computer for programming and
communication.
 Purpose: Enables the board to be powered via USB and to communicate with the
Arduino IDE for code uploading.

B. External Power Jack:

 Definition: This is an alternative power input (typically 7-12V), used when the board is
not connected to a computer via USB.
 Purpose: Provides an external power source to the Arduino board when deployed in
standalone projects.

C. Built-in LED (Pin 13):

 Definition: Most Arduino boards have a built-in LED connected to digital pin 13.
 Purpose: Used for basic troubleshooting, to indicate the program is running, or for
simple projects like blink programs.

D. Crystal Oscillator:

 Definition: This component provides the clock signal for the microcontroller, helping it
keep time and synchronize operations.
 Purpose: Typically a 16 MHz crystal is used in most Arduino boards to ensure reliable
timing and execution of the code.

4. Summary of Key Components

Component Purpose Example Board


Component Purpose Example Board
Executes the program, controls ATmega328P (Uno), SAMD21
Microcontroller
inputs/outputs. (MKR1000)
Interact with external devices,
Digital I/O Pins 14 on Uno, 54 on Mega 2560
input/output.
Read analog signals (e.g., from
Analog Input Pins 6 on Uno, 12 on Due
sensors).
Provide power to external devices or
Power Pins 5V, 3.3V, GND, Vin
the board.
Serial Enables communication with other
TX/RX pins (Used in all boards)
Communication devices.
Restarts the board and reboots the
Reset Button Found on all boards
program.
Ensures stable power supply to
Voltage Regulator Found on all boards
components.
For programming and power supply
USB Port Found on all boards
via computer.
Provides timing for the
Crystal Oscillator Found on all boards
microcontroller.

Conclusion

The anatomy of an Arduino board includes key components that allow it to function as an
interface between hardware (sensors, motors) and software (programs). These components
include the microcontroller, I/O pins, power pins, communication interfaces, and voltage
regulators. Different Arduino boards come with different features and capabilities, but all share
the same core functionality of making electronics projects more accessible.

Arduino IDE Overview and Programming for IoT

The Arduino Integrated Development Environment (IDE) is the software used to write,
compile, and upload code (called sketches) to Arduino boards. The IDE supports a variety of
boards and provides access to a rich ecosystem of libraries and tools, which makes it popular for
both beginners and advanced users working on a wide range of projects, including Internet of
Things (IoT) applications.

1. Arduino IDE: Key Features

A. Arduino IDE Interface:


 Text Editor: This is where you write the code for your Arduino projects. It uses a
simplified version of C/C++.
 Verify/Compile Button: Compiles the code to check for errors before uploading it to the
board.
 Upload Button: Uploads the compiled code to the connected Arduino board.
 Serial Monitor: Allows you to view serial output from your board (e.g., sensor data or
debugging messages).
 Boards and Port Selection: Lets you select the appropriate Arduino board and the
communication port for uploading the code.

B. Code Structure in Arduino IDE:

Arduino sketches follow a specific structure:

 setup(): A function that runs once when the Arduino starts or is reset. It is used to
initialize variables, pin modes, and start communication.
 loop(): The function that continuously runs after setup() is executed. It contains the
main program logic that repeats indefinitely.

Example:

cpp
Copy code
void setup() {
// Initialize pin modes and serial communication
pinMode(13, OUTPUT); // Set pin 13 as an output (usually connected to an
onboard LED)
Serial.begin(9600); // Start serial communication at 9600 baud
}

void loop() {
digitalWrite(13, HIGH); // Turn on the LED
delay(1000); // Wait for 1 second
digitalWrite(13, LOW); // Turn off the LED
delay(1000); // Wait for 1 second
Serial.println("LED toggled"); // Send a message to the serial monitor
}

2. Coding Using Emulators:

Emulators are virtual environments that allow you to simulate the behavior of an Arduino board
without needing the physical hardware. This can be particularly useful for testing and debugging
the code before deployment. However, while emulators are great for learning and simulating,
they do not perfectly replicate all hardware features.

A. Popular Arduino Emulators:


 Proteus: A powerful simulation software that supports Arduino programming and allows
you to simulate circuits and code. It supports a variety of sensors, actuators, and other
components.
 Tinkercad: An online tool by Autodesk that lets you design and simulate Arduino
circuits in a virtual environment. It is especially good for beginners and allows for basic
sensor simulation and programming.
 Fritzing: Primarily a circuit design tool, Fritzing also supports Arduino-based projects
but has limited simulation capabilities compared to Proteus or Tinkercad.

B. Using Emulators for IoT Projects:

 Simulating IoT Sensors: Emulators allow you to simulate various IoT sensors
(temperature, humidity, motion, etc.) and use virtual components like Wi-Fi and
Bluetooth modules for network communication.
 Code Testing: You can write and test code for IoT applications (e.g., controlling LEDs,
sending data to a cloud service) without needing to set up physical hardware
immediately.
 Limitations: Emulators may not support all sensors or advanced communication
protocols (like real-time communication or long-range wireless transmission). Actual
hardware testing is often necessary for real-world IoT deployment.

3. Using Libraries in Arduino IDE:

Arduino libraries are pre-written code that makes it easier to interface with sensors, motors,
displays, communication modules, and other hardware without having to write the low-level
code from scratch. Libraries can simplify the development of IoT projects.

A. Adding Libraries:

 To add libraries, go to Sketch > Include Library > Manage Libraries... in the Arduino
IDE. Here you can search and install libraries for different components.
 Libraries can be specific to certain hardware (e.g., a sensor library for DHT11 or a motor
driver library) or more general-purpose (e.g., for Wi-Fi communication).
 After installation, you can include a library in your sketch by using the #include
directive.

Example:

cpp
Copy code
#include <WiFi.h> // Include the Wi-Fi library

const char* ssid = "your_network";


const char* password = "your_password";

void setup() {
Serial.begin(9600); // Start serial communication
WiFi.begin(ssid, password); // Connect to Wi-Fi

while (WiFi.status() != WL_CONNECTED) {


delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
}

void loop() {
// Your code here
}

B. Popular Libraries for IoT:

 WiFi.h / ESP8266WiFi.h: For connecting the Arduino to Wi-Fi networks.


 DHT.h: For reading data from temperature and humidity sensors like DHT11 or DHT22.
 PubSubClient: For MQTT-based communication, commonly used for sending data to
cloud services.
 Adafruit_Sensor: A library that works with various sensors (e.g., temperature, motion).
 SPI.h, Wire.h: For communication with SPI (Serial Peripheral Interface) and I2C (Inter-
Integrated Circuit) devices.

4. Addition in Arduino:

The addition of components to an Arduino-based IoT project involves connecting sensors,


actuators, communication modules, and other devices to the board. Here's how you can integrate
common components in your IoT projects:

A. Adding Sensors:

 Temperature and Humidity Sensors (e.g., DHT11, DHT22): These sensors provide
data that can be sent to a cloud service or displayed on an LCD screen.
 Motion Sensors (e.g., PIR sensor): Can be used to detect motion and trigger actions such
as sending alerts.
 Gas Sensors (e.g., MQ series): Can detect gases like CO2 or methane and can be useful
for smart home or industrial applications.

Example of integrating a DHT11 temperature sensor:

cpp
Copy code
#include <DHT.h>

#define DHTPIN 2 // Pin connected to DHT11 sensor


#define DHTTYPE DHT11 // Define sensor type
DHT dht(DHTPIN, DHTTYPE); // Initialize DHT sensor

void setup() {
Serial.begin(9600);
dht.begin(); // Initialize sensor
}

void loop() {
float humidity = dht.readHumidity(); // Read humidity
float temperature = dht.readTemperature(); // Read temperature

if (isnan(humidity) || isnan(temperature)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

Serial.print("Humidity: ");
Serial.print(humidity);
Serial.print("% Temperature: ");
Serial.print(temperature);
Serial.println("°C");
delay(2000); // Wait for 2 seconds
}

B. Adding Communication Modules:

 Wi-Fi (e.g., ESP8266, ESP32): For internet connectivity, allowing the Arduino to send
and receive data over the internet.
 Bluetooth (e.g., HC-05, HC-06): For short-range communication, useful in home
automation or device-to-device communication.
 LoRa: For long-range, low-power communication over large distances.
 GSM (e.g., SIM800L): For mobile network communication, allowing Arduino boards to
send SMS or connect to the internet.

Example of using an ESP8266 Wi-Fi module:

cpp
Copy code
#include <ESP8266WiFi.h>

const char* ssid = "your_network";


const char* password = "your_password";

void setup() {
Serial.begin(9600);
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {


delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
}
void loop() {
// Your code here
}

5. Programming the Arduino for IoT

Programming an Arduino for IoT involves combining sensor readings, communication protocols,
and often cloud services to create useful applications. The process typically involves the
following steps:

A. Gathering Data from Sensors:

 Use sensors to collect environmental data (e.g., temperature, humidity, light) and process
it.

B. Sending Data Over the Network:

 Use communication modules like Wi-Fi, Bluetooth, or LoRa to send sensor data to the
cloud or another device.

C. Cloud Integration:

 Integrate the Arduino with cloud platforms (e.g., ThingSpeak, Blynk, Google Cloud
IoT, AWS IoT), where the data can be visualized and analyzed.

D. Taking Action Based on Data:

 Based on the data received from sensors, your Arduino can trigger actions like turning on
an LED, sending alerts via SMS, or adjusting connected devices.

Summary of Steps to Program Arduino for IoT:

1. Write the Code: Use the Arduino IDE to write code that reads sensor data.
2. Add Libraries: Include necessary libraries to interface with sensors and communication
modules.
3. Upload the Code: Upload the code to the Arduino using the IDE.
4. Test and Debug: Use the serial monitor to test sensor readings and communication.
5. Cloud Integration: Send data to cloud services or display it on a web interface.
6. Automation: Program actions based on sensor data (e.g., turn on a fan when temperature
exceeds a certain threshold).

By combining sensors, communication modules, and the Arduino IDE, you can create fully
functional IoT systems for home automation, environmental monitoring, industrial automation,
and more.

You might also like