Free tech learning for everyone, from basics to pro

IoT FundamentalsIoT SecurityBeginner

Microcontrollers vs single-board computers: Arduino, ESP32 and Raspberry Pi

In short: A microcontroller runs one small program directly on the hardware, uses very little power and reacts in real time. A single-board computer runs a full operating system such as Linux and can do far more, but needs more power and more maintenance. Many real systems use both.

Two kinds of brain

Every IoT device needs something to run its logic. There are two broad choices. A microcontroller unit (MCU) is a single chip with a processor, a little memory and input/output pins. It runs one firmware program with no operating system, or with a tiny real-time operating system (RTOS). A single-board computer (SBC) is a complete computer on one circuit board, with a more powerful processor, much more memory and a full operating system, usually Linux.

MCU vs SBCMicrocontroller (MCU)Runs one firmware programKB to a few MB of RAMMilliwatts, deep sleepStarts instantlyReal-time controlSingle-board computer (SBC)Runs a full OS (Linux)Hundreds of MB to GB RAMWatts, needs steady powerBoots in secondsNetworking, cameras, AI
Figure 1. Microcontrollers are small, frugal and predictable; single-board computers are full computers on one board.

The boards you will meet

Popular boardsPrototype boardsArduino Unosimple 8-bitMCUESP32MCU with Wi-Fi,BLERaspberry PiPicolow-cost MCURaspberry PiLinux SBCOther SBCssimilar Linuxboards
Figure 2. Common boards used in learning and prototyping, from simple microcontrollers to Linux computers.
  • Arduino Uno: a classic 8-bit board, ideal for learning to read sensors and drive LEDs or motors. No built-in networking.
  • ESP32: a low-cost 32-bit MCU family from Espressif with built-in Wi-Fi and Bluetooth Low Energy (BLE). Very popular for connected sensors. Some variants add hardware features for secure boot and flash encryption.
  • Raspberry Pi Pico: an inexpensive microcontroller board; the Pico W adds Wi-Fi.
  • Raspberry Pi (for example models 4 and 5): a Linux SBC that can run web servers, databases, cameras and machine learning, often used as a gateway or local hub.

How to choose

NeedBetter fitWhy
Years on a batteryMCUDeep sleep draws microamps
Precise timing (motor control)MCUNo OS scheduler getting in the way
Camera, video or local AISBCNeeds memory and processing power
Gateway for many sensorsSBCRuns a broker, database and VPN
Simple Wi-Fi sensorMCU (ESP32)Cheap, small, low power

A common pattern combines both: battery-powered ESP32 sensors report to a Raspberry Pi gateway that stores data and forwards it to the cloud.

Security differences

An SBC is a full computer, so treat it like one. Change the default user, use SSH keys, apply updates with the package manager, turn off unused services and run a host firewall. On a Raspberry Pi running Raspberry Pi OS you might start with:

sudo apt update && sudo apt full-upgrade -y
sudo apt install ufw
sudo ufw allow from 192.168.10.0/24 to any port 22 proto tcp
sudo ufw enable

An MCU has a much smaller attack surface, but different weaknesses. Firmware may be readable over a debug port, Wi-Fi passwords are often hard-coded, and updates require reflashing. Use features such as secure boot and flash encryption where the chip supports them, keep secrets out of source code, and disable debug interfaces in production.

Tip: a Raspberry Pi is not a microcontroller. If an exam question mentions running Linux, multiple processes or a desktop, the answer is SBC.

Practice

You need a soil sensor to run for two years on AA batteries. MCU or SBC?
An MCU, because it can deep sleep at very low current and wake only to take readings.
Why is a Raspberry Pi often used as an IoT gateway?
It runs Linux, so it can host a message broker, store data, run a VPN and translate between local devices and the cloud.
Name two security steps specific to MCUs.
Enable secure boot and flash encryption where supported, disable debug ports such as JTAG in production, and avoid hard-coding secrets in firmware.

Key takeaways

  • MCUs run one firmware program, use little power and react in real time.
  • SBCs run a full OS such as Linux and suit gateways, cameras and AI.
  • ESP32 adds Wi-Fi and BLE to a low-cost MCU; Raspberry Pi is a Linux SBC.
  • Harden an SBC like any Linux server.
  • Protect MCU firmware with secure boot, flash encryption and locked debug ports.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.