What is an Embedded System?
An embedded system is a dedicated computer system designed to perform one or a few specific functions — often with real-time computing constraints. Unlike a general-purpose desktop computer, an embedded system is embedded as part of a complete device, frequently including hardware and mechanical components.
Embedded systems are ubiquitous: they power microwave ovens, anti-lock braking systems, medical pacemakers, industrial conveyor belts, and robotic arms. In robotics, virtually every subsystem — motor drivers, sensor interfaces, safety interlocks, communication stacks — relies on an embedded processor.
Key characteristics of embedded systems:
- Real-time operation: responses must occur within defined time bounds (soft or hard deadlines)
- Resource constraints: limited RAM, flash, CPU cycles, and power
- Reliability: often must run continuously for years without human intervention
- Low-level hardware access: direct manipulation of GPIO pins, timers, interrupts, and peripherals
Core Concepts in Embedded Control
- 01
Microcontroller Unit (MCU): integrates CPU, RAM, flash, and I/O peripherals on a single chip
- 02
Clock speed and instruction cycles determine how fast the CPU can execute code
- 03
Interrupts allow the CPU to respond immediately to hardware events without polling
- 04
Watchdog timers reset the system automatically if software hangs
- 05
Direct Memory Access (DMA) transfers data between peripherals and RAM without CPU involvement
- 06
Real-Time Operating Systems (RTOS) schedule tasks with deterministic timing guarantees
Microcontroller vs Microprocessor vs SBC
Microcontroller (MCU)
- CPU + RAM + Flash + peripherals on one chip (e.g., ATmega328, STM32)
- Low power, low cost — ideal for real-time I/O tasks
- Runs bare-metal firmware or lightweight RTOS
- No operating system overhead; deterministic timing
- Typical clock: 8–480 MHz, RAM: 2 KB – 1 MB
Single-Board Computer (SBC)
- Full Linux/Windows OS on a credit-card board (e.g., Raspberry Pi)
- High computational power — suitable for vision, ML, ROS
- Non-deterministic OS scheduler; hard real-time requires RT kernel patch
- Higher power consumption (2–10 W typical)
- GPIO available but with software overhead
Control Loops in Embedded Systems
A control loop is the fundamental pattern of embedded control software:
while (true) {
read_sensors(); // sample physical world
compute_control(); // run control algorithm (e.g., PID)
write_actuators(); // drive motors, valves, LEDs
wait_until_next_tick(); // maintain fixed sample rate
}
The sample rate (loop frequency) must be fast enough relative to the system dynamics. A rule of thumb is to sample at least 10× the bandwidth of the controlled process. Industrial servo drives typically run at 1–20 kHz; mobile robot base controllers at 100–500 Hz.
Hard real-time systems guarantee a worst-case response time — missing a deadline causes system failure (e.g., engine ignition timing, surgical robot). Soft real-time systems tolerate occasional deadline misses with degraded — but acceptable — performance (e.g., video streaming buffer).
Common Embedded Processor Families in Robotics
| Family | Examples | Architecture | Typical Use |
|---|---|---|---|
| AVR (Atmel/Microchip) | ATmega328, ATmega2560 | 8-bit RISC | Arduino Uno/Mega, hobby robotics |
| ARM Cortex-M | STM32, nRF52, SAMD21 | 32-bit RISC | Motor drivers, sensor nodes, ROS 2 micro |
| ARM Cortex-A | BCM2711 (Pi 4), i.MX8 | 64-bit ARMv8 | ROS 2 hosts, computer vision |
| RISC-V | ESP32-C3, GD32VF | 32-bit open ISA | IoT sensors, low-cost wireless nodes |
| Xtensa LX7 | ESP32-S3 | 32-bit + vector | Wi-Fi/BT edge AI, sensor hubs |
| x86-64 | Intel NUC, Jetson (ARM) | 64-bit CISC/ARM | High-performance compute, simulation |