IBM3118 - Embedded Systems and IoT


Gitbook designed to serve as an additional source of information to students of the discipline IBM3118 Embedded Systems and IoT at Ibmec.

1. Introduction


This Chapter presents definitions, applications, challenges, and common characteristics of Embedded Systems and Internet of Things. In addition, educational aspects of this discipline and the structure of this book are introduced.

1.1 Definitions

This section provides key definitions for foundational concepts in embedded systems and the Internet of Things (IoT). These topics form the basis for understanding cyber-physical systems and their real-world applications.

1.1.1 Embedded systems

An embedded systemis a specialized computing system designed to perform dedicated functions within a larger system. Unlike general-purpose computers, embedded systems are optimized for specific tasks and often operate with limited hardware resources.

Embedded systems are found in a wide range of applications, including:
Consumer electronics(e.g., smartphones, smart TVs, digital cameras)
Automotive systems(e.g., engine control units, infotainment systems)
Medical devices(e.g., pacemakers, MRI scanners)
Industrial automation(e.g., robotic controllers, programmable logic controllers)

Characteristics

Embedded systems typically have the following characteristics:
Real-time operation: They must process tasks within strict timing constraints.
Reliability: Many applications require continuous, fault-free operation.
Resource constraints: Limited memory, processing power, and power consumption.
Application-specific: Designed to perform a dedicated function rather than general computing tasks.

Architecture

An embedded system consists of both hardwareand softwarecomponents:

Hardware Components Microcontroller (MCU) or Microprocessor (MPU)– The processing unit that executes program instructions.
Memory (RAM, ROM, Flash)– Stores program code and runtime data.
Sensors & Actuators– Interfaces for data acquisition and control.
Communication Interfaces– Serial (UART, SPI, I2C), wireless (Wi-Fi, Bluetooth), etc.

Software Components Firmware– Low-level software running on the device.
Operating System (if applicable)– Real-Time Operating System (RTOS) or bare-metal programming.
Drivers & Middleware– Handle hardware abstraction and communication.

Applications

Embedded systems play a crucial role in modern technology. Some emerging trends include:
Edge computingfor AI processing in IoT devices.
Autonomous vehicleswith embedded AI controllers.
Wearable health devicesfor continuous monitoring.

1.1.2 Internet of things

Introduction

The Internet of Things (IoT)refers to a vast network of interconnected devices that communicate and share data over the internet. IoT systems integrate sensors, embedded controllers, and cloud-based services to enable automation and smart decision-making.

Key Components

IoT systems consist of several layers:

1. Perception Layer (Devices & Sensors)

  • Sensors collect real-world data (e.g., temperature, motion, pressure).
  • Actuators trigger actions based on received commands.

2. Network Layer (Communication & Connectivity)

  • Wireless communication: Wi-Fi, Bluetooth, Zigbee, LoRa, 5G.
  • Wired communication: Ethernet, CAN bus, Modbus.

Edge & Cloud Computing Layer

  • Edge computing: Processes data locally for faster response times.
  • Cloud computing: Stores and analyzes large amounts of IoT data.

Application Layer (User Interaction & Services)

  • Smart home applications, industrial automation, healthcare monitoring, etc.

Challenges in IoT

Despite its benefits, IoT faces several challenges:

  • Security vulnerabilities: IoT devices are targets for cyberattacks.
  • Scalability: Managing billions of connected devices requires robust infrastructure.
  • Interoperability: Standardizing communication protocols across diverse devices.

Future Trends

The IoT landscape is evolving with emerging technologies:

  • AI-powered IoTfor intelligent automation and analytics.
  • 5G networksenabling ultra-fast, low-latency communication.
  • Blockchain for IoT securityin decentralized networks.

History

The term Internet of Things (IoT) was coined in 1999 by Kevin Ashton, a British technology pioneer working on supply chain optimization at Procter & Gamble. He proposed using RFID (Radio Frequency Identification) to track products more effectively and proposed the concept of a world where computers could collect data without human input. Kevin Ashton introduced the term during a presentation at the MIT Auto-ID Center, highlighting the potential of linking the physical world to the Internet through automatic identification and data capture. Although originally focused on retail and logistics, the IoT concept has since expanded to cover a wide range of domains such as healthcare, smart homes, industrial automation, and environmental monitoring. Despite the evolving scope, the core vision of connecting “things” to the Internet to enable real-time data exchange and automation remains central to IoT.

Gubbi, J., Buyya, R., Marusic, S., & Palaniswami, M. (2013). Internet of Things (IoT): A vision, architectural elements, and future directions. Future Generation Computer Systems, 29(7), 1645–1660. https://doi.org/10.1016/j.future.2013.01.010

1.2 Applications

1.3 Challenges

1.4 Common Characteristics

1.5 Conclusion

1.6 Problems

2. Hardware


Cyber-Physical Systems (CPS) rely on several key hardware components that work together to process, communicate, and act on data collected from the physical world. These components include actuators, embedded computing units, communication interfaces, and power management systems, all of which ensure the seamless integration of cyber and physical domains.

2.1 Models of sensors and actuators

2.1.1 Common sensors

Sensors are fundamental components in Cyber-Physical Systems (CPS) as they provide real-world data that enables decision-making, automation, and control. Depending on the application, different types of sensors are used to measure physical phenomena such as temperature, motion, pressure, or chemical composition. Below is a detailed explanation of common sensor types, including their working principles and applications.

Potentiometer: a sensor to measure rotation

// Potentiometer - code to manipulate potentiometer

#define sensorPin A0 // define entrada analógica A0

int sensorValue = 0; // variável inteiro igual a zero
float voltage; // variável número fracionário

void setup(){
Serial.begin(9600); // monitor serial - velocidade 9600 Bps
delay(100); // atraso de 100 milissegundos
}

void loop(){
sensorValue = analogRead(sensorPin); // leitura da entrada analógica A0
voltage = sensorValue * (5.0 / 1024); // cálculo da tensão
}
Serial.print("Tensão do potenciômetro: "); // imprime no monitor serial
Serial.print(voltage); // imprime a tensão
Serial.print("Valor: "); // imprime no monitor serial
Serial.println(sensorValue); // imprime o valor
delay(500); // delay of 500 ms

Temperature Sensors

Function: Measure the temperature of an environment, object, or fluid. Types:

Thermocouples: Generate a voltage proportional to temperature differences between two junctions. Used in industrial applications, kilns, and HVAC systems. Resistance Temperature Detectors (RTDs): Change resistance with temperature; offer high precision in laboratory and industrial settings. Thermistors: Semiconductor devices with resistance that varies significantly with temperature. Found in household appliances, medical thermometers, and battery management systems.

**Applications: Smart home climate control

Industrial process monitoring

Medical temperature sensing

Pressure Sensors

Function: Measure pressure in gases or liquids, often used in industrial and automotive systems. Types:

Piezoelectric Sensors: Convert mechanical pressure into an electrical charge; used in fuel injection systems and vibration analysis. Strain Gauge Sensors: Detect deformation in materials due to applied pressure; commonly used in load cells. Capacitive Pressure Sensors: Measure pressure changes by detecting variations in capacitance; used in barometric pressure monitoring and touch-sensitive devices.

**Applications:

Automotive (tire pressure monitoring, engine diagnostics)

Industrial process control

Weather monitoring

Optical Sensors

Function: Detect light intensity, wavelength, or changes in illumination. Types:

Photodiodes: Convert light into electrical current; used in fiber optic communication and ambient light sensing. Infrared (IR) Sensors: Detect heat radiation; commonly used in motion detection and remote controls. LiDAR (Light Detection and Ranging): Uses laser pulses to measure distance and create 3D maps; widely used in autonomous vehicles.

**Applications: Gesture and motion recognition

Industrial automation

Autonomous vehicle navigation

Inertial Sensors

Function: Measure acceleration, orientation, and angular velocity. Types:

Accelerometers: Measure acceleration forces (e.g., gravity or movement); used in smartphones for screen orientation and in drones for stabilization. Gyroscopes: Measure rotational motion; used in navigation systems, VR headsets, and aircraft control systems. Magnetometers: Detect magnetic fields and are used in compasses and metal detection.

**Applications:

Vehicle stability control

Virtual reality motion tracking Robotics and drone navigation

Gas Sensors

Function: Detect the presence of gases and measure air quality. Types:

Electrochemical Sensors: React with gases to produce an electrical signal; used for detecting toxic gases like CO and O₂. NDIR (Non-Dispersive Infrared) Sensors: Measure gas concentrations by detecting infrared absorption; commonly used for CO₂ monitoring. Semiconductor Sensors: Detect changes in resistance when exposed to gases like methane or alcohol.

**Applications:

Indoor air quality monitoring

Industrial safety and leak detection

Breath alcohol analyzers

Proximity Sensors

Function: Detect the presence of objects without physical contact. Types:

Capacitive Sensors: Detect changes in capacitance; used in touchscreens and fluid level monitoring. Inductive Sensors: Detect metallic objects using electromagnetic fields; used in industrial automation. Ultrasonic Sensors: Use sound waves to measure distance; commonly found in automotive parking assistance systems.

**Applications:

Automated manufacturing

Smartphones and touch interfaces

Robotics and automation

Conclusion

Sensors are crucial in CPS, enabling data collection for real-time decision-making. The choice of sensor depends on the specific application, required accuracy, and environmental conditions. By integrating multiple sensors, cyber-physical systems can improve automation, safety, and efficiency in industries like healthcare, automotive, and industrial control.

Would you like me to expand on specific types of sensors, such as biometric or environmental sensors?

2.1.2 Actuators

While sensors collect data, actuators perform actions based on that data. Actuators convert electrical signals into mechanical, thermal, or other physical actions, making them essential for automation and control in CPS.

LED (Light-Emitting Diode) can be considered an actuator in Cyber-Physical Systems (CPS). Why is a LED an Actuator?

An actuator is any device that takes an electrical signal and converts it into a physical action. In the case of an LED:

It receives an electrical signal (voltage/current). It converts electrical energy into light (a physical output).

Examples of LED as an Actuator in CPS:

Visual Indicators → Status indicators in IoT devices (e.g., Wi-Fi routers, industrial machines).

Automotive Systems → Brake lights and smart LED headlights in cars. Smart Home Applications → LED lighting controlled via mobile apps or voice assistants. Optical Communication → Infrared LEDs used in remote controls and Li-Fi technology. Medical Applications → LEDs in pulse oximeters to measure blood oxygen levels.

Although LEDs don’t produce mechanical movement, they physically change their light output in response to an electrical signal, which qualifies them as light actuators.

2.2 A/D converter

2.2.1 Flash ADC

2.2.2 Successive-approximation ADC

2.3 D/A Converter

2.3.1 DAC

2.3.2 PWM

2.4 Communication components

In IoT, communication components are essential for enabling devices to exchange data locally or with the cloud. These components can be categorized based on their communication range, protocol, and modulation techniques (baseband characteristics).

2.4.1 Very Short Range Components

RFID (Radio-Frequency Identification)

  • Enables wireless identification using electromagnetic fields.
  • Comes in passive (no battery) and active (battery-powered) forms.
  • Common in asset tracking and authentication systems.

NFC (Near Field Communication)

  • Subset of RFID operating at 13.56 MHz.
  • Communication range: ~4 cm.
  • Widely used in contactless payments and digital IDs.

2.4.2 Short Range Components

Bluetooth / BLE (Bluetooth Low Energy)

  • Operates in the 2.4 GHz ISM band.
  • BLE 5.0 supports up to 100 meters range.
  • Used in fitness trackers, audio devices, mobile accessories.
  • Baseband: GFSK modulation with adaptive frequency hopping.

Zigbee

  • Mesh network protocol designed for low-power devices.
  • Frequency: 2.4 GHz globally; 868/915 MHz in some regions.
  • Ideal for smart homes and industrial sensors.
  • Baseband: DSSS (Direct Sequence Spread Spectrum).

Wi-Fi

  • High-bandwidth communication protocol.
  • Frequencies: 2.4 GHz, 5 GHz, and 6 GHz (Wi-Fi 6E).
  • Ideal for internet access and local network communication.
  • Baseband: OFDM (Orthogonal Frequency Division Multiplexing).

2.4.3 Long Range Components

LoRa (Long Range)

  • Utilizes Chirp Spread Spectrum (CSS) for long-range communication.
  • Operates in ISM bands (e.g., 433 MHz, 868 MHz, 915 MHz).
  • Ultra-low power and supports distances up to 15 km.
  • Applications: remote sensors, smart agriculture, smart cities.

Example: E32 LoRa Module

  • Based on the SX1278 LoRa chip.
  • Uses UART for microcontroller communication.
  • Configurable parameters: power, spreading factor, bandwidth.
  • Includes built-in AES encryption and error correction.

E32 - LoRa

NB-IoT (Narrowband IoT)

  • Cellular-based LPWAN standard using LTE bands.
  • Provides robust, secure, and long-distance communication.
  • Extremely low power consumption; battery life up to 10 years.
  • Ideal for smart metering and infrastructure monitoring.

Wi-SUN

  • IPv6-based wireless mesh networking protocol.
  • Designed for utilities (e.g., smart grids, gas meters).
  • Uses sub-GHz frequencies for extended range via mesh hopping.

2.4.4 Summary of Baseband Characteristics

Protocol Frequency Modulation Type
Bluetooth 2.4 GHz GFSK
Zigbee 2.4 GHz DSSS
Wi-Fi 2.4/5/6 GHz OFDM
LoRa 433/868/915 MHz Chirp Spread Spectrum
NB-IoT LTE Bands QPSK
NFC/RFID 13.56 MHz ASK

2.4 Platforms

2.4.1 Arduino

2.4.2 Raspberry

2.4.3 ESP-32

2.4.4 Smartphone as an IoT platform

2.5 Conclusion

3. Software


4. Data communication protocols for IoT


4.1 MQTT

MQTT sequence diagram:

sequenceDiagram
    participant Alice
    participant Bob
    Alice->>John: Hello John, how are you?
    loop Healthcheck
        John->>John: Fight against hypochondria
    end
    Note right of John: Rational thoughts <br/>prevail!
    John-->>Alice: Great!
    John->>Bob: How about you?
    Bob-->>John: Jolly good!

4.2 CoAP

4.3 AMQP

4.4 Comparative analysis of IoT protocols

4.5 Conclusion

5. Digital signal processing


6. Embedded machine learning


results matching ""

    No results matching ""