Two kinds of small computer
Almost every connected device has some sort of processor inside, but the processors fall into two broad groups. A microcontroller is a single chip that combines a modest processor, a little memory and input and output pins, designed to do one job reliably. A single-board computer (SBC) is a complete small computer on one circuit board, with a more powerful processor, much more memory, storage and ports, and it usually runs a general-purpose operating system.
Both can read a sensor and send data over a network. The difference is in everything around that task: how much power it takes, how hard it is to build and maintain, and how much the device can do by itself.
What a microcontroller is good at
Microcontrollers tend to have memory measured in kilobytes up to perhaps a few megabytes, with processors running at anything from a few megahertz to a couple of hundred megahertz. Exact figures vary widely between families. They typically run either a single program loop or a small real-time operating system.
Their strengths follow from their simplicity.
- Low power. They can sleep at very low current and wake in moments. This makes them the usual choice for battery-powered sensors, together with techniques such as duty cycling.
- Instant start. They boot in a fraction of a second, so a device can wake, measure, transmit and sleep again.
- Predictable timing. With no complex operating system in the way, they respond to events within known time limits, which suits motor control and fast sensor sampling.
- Low cost. Chips are cheap, which matters when thousands of units are involved.
- Robustness. Fewer layers means fewer things to fail, and no file system to corrupt when power is cut.
Their weaknesses are limited memory, harder debugging, and fewer ready-made software libraries for heavy tasks such as running a database or processing video.
What a single-board computer is good at
An SBC generally has a multi-core processor, memory measured in hundreds of megabytes to several gigabytes, and storage on a memory card or flash chip. It runs a full operating system such as a Linux distribution, which brings a huge range of existing software, programming languages and network tools.
Typical strengths include:
- Flexibility. You can install software, run a web server, connect a screen, use a camera or attach many different peripherals.
- Easier development. Familiar languages and tools shorten the path from idea to working prototype, which is why SBCs are popular on development boards for experimenting.
- Heavier processing. Local analysis, image handling or running a small machine learning model becomes feasible.
- Gateway roles. An SBC can collect data from many small devices and forward it, working as one of the IoT gateways that bridge local devices and the wider internet.
Their weaknesses are higher power draw, which is often in the range of watts rather than milliwatts, slower start-up, more complexity, and the need to maintain an operating system with security patches. Memory cards can wear out or become corrupted if power is cut abruptly, and a full operating system presents a bigger surface for attackers.
A rough comparison
| Aspect | Microcontroller | Single-board computer |
|---|---|---|
| Typical memory | Kilobytes to a few megabytes | Hundreds of megabytes to gigabytes |
| Software | Firmware, sometimes a small real-time OS | Full operating system |
| Power use | Very low, long sleep | Higher, usually always on |
| Start-up | Almost instant | Seconds to tens of seconds |
| Timing | Predictable | Less predictable |
| Upkeep | Occasional firmware updates | Regular OS and package updates |
These are generalizations, and the line is blurring as some microcontrollers become much more capable and some small computers sip very little power.
Typical roles
A sensor node that reports temperature every few minutes from a battery-powered enclosure is a textbook microcontroller job. So is a motor driver, a light switch, a door contact or a simple actuator controller. The device does one thing, and the less it does, the longer it tends to run.
A hub that collects readings, stores a few days of history locally, hosts a dashboard and handles several network protocols is more natural on an SBC. So is a camera node that analyzes video on site, or a kiosk with a display.
Many real systems use both: several microcontroller-based nodes feeding one SBC that acts as a local brain. That arrangement keeps the numerous edge devices cheap and low-maintenance while concentrating complexity in a single place.
Questions to ask when choosing
- How is it powered? Battery operation points strongly toward a microcontroller.
- What must it process? Simple readings and thresholds need little. Video, audio or complex logic may need more.
- Does it need a rich interface? Screens, local web pages and multiple connections favor an SBC.
- How many units? Large numbers amplify cost and maintenance differences.
- Who will maintain it? A system running a full operating system needs patching, and a fleet of them increases the work of device management.
- What happens when something fails? A controller that restarts in a blink may be more forgiving than a computer that takes a minute to boot.
Starting small
For a first project, many people prototype on an SBC for convenience, then move the final design to a microcontroller once the requirements are clear. Others do the opposite, starting with a microcontroller to learn the basics of sensors and signals. Both paths are reasonable. The best choice is the simplest hardware that does the job within the power and maintenance budget available.