A Complete Guide To Microcontrollers For IoT
A Complete Guide To Microcontrollers For IoT
A Complete Guide To Microcontrollers For IoT
A Complete Guide to
Microcontrollers for IoT
In this article, we’re going into detail on the essentials of microcontrollers for
IoT.
Such IoT devices need something less heavy duty than the type of processor found
in a typical personal computer. For this, they use microcontrollers.
https://www.nabto.com/iot-microcontroller-guide/ 1/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
When trying to understand the place microcontrollers occupy in IoT, we’re going to
look at an IoT technology stack for an embedded device and how the MCU
interacts within it.
For example, a simplified IoT stack for a smart camera device might look
something like this:
The MCU operates at the hardware abstraction layer, acting as a bridge to allow
the other two layers to interact, and runs the chosen RTOS/OS that operates the
device.
https://www.nabto.com/iot-microcontroller-guide/ 2/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
GET APP DEMO
On the other hand, a microcontroller has the CPU, RAM and ROM, as well as
peripherals all embedded onto a single chip, effectively making it a computer itself.
Now, this heavily embedded chip, of course, has lower performance capabilities
than a microprocessor-powered computer, but when it comes to typical IoT
devices, such as smart industrial machines, microcontrollers are a much better
choice. They can provide sufficient computing power while keeping costs,
complexity, and energy usage low.
Microcontroller features
With hundreds of MCUs on the market, it’s important to understand their common
features before deciding on the best MCU for an IoT project.
Bits
https://www.nabto.com/iot-microcontroller-guide/ 3/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
For this primary distinction between MCUs, there are 5 different options currently
available:
4-8 bit
These are used in remote controls, and other constrained and inexpensive
applications. Generally, they are not fit for use in IoT applications, since they lack
the computing and memory needed for handling internet.
8 bit
Mostly used in cost-constrained but more elaborate applications than the 4-8 bit.
With the correct setup, these can be used in IoT applications, sometimes running
an RTOS, but mostly with a simple control loop. The well-known Arduino project is
an example of an 8-bit design. Even though 8-bit systems can handle Internet, they
normally lack the compute power and memory requirements to do it properly with
encryption and strong authentication protocols.
16 bit
While these are of course an option, the 16-bit architecture is not incredibly
common in IoT. Implementations will typically switch between an 8-bit or 32-bit
MCU.
32 bit*
This is the normal entry point for IoT applications, unless the application can fit 8-
bit architecture and has cost constraints. The price difference between 8 and 32-bit
architectures is small enough, however, that developers should think twice before
choosing 8 bit.
Whether the MCUs run an RTOS or OS mostly depends on the compute power of
the MCU, and/or the presence of a memory management unit (MMU).
https://www.nabto.com/iot-microcontroller-guide/ 4/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
64 bit
These are reserved for high-end systems, usually Linux or another OS. You
typically need a specific (compute intensity) reason to jump from a 32-bit to a 64-bit
system.
Architecture
The majority of MCUs use one of the following architectures: ARM, MIPS, or X86,
though now there’s the new RISC-V architecture we’ll also consider.
We’re going to take a look at these different specifications and their primary
features. As will be seen, ARM, MIPS, and RISC-V are similar in many ways, while
X86 possesses significant differences from the others.
https://www.nabto.com/iot-microcontroller-guide/ 5/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
Different processors in each of these categories will also have different RAM,
number of GPIO pins, and connectivity options.
RAM
This varies greatly, from around 16B at the lowest end on the 8-bit MCUs, to about
4.5MB on 32 and 64-bit MCUs. To many, the more RAM the better, but this will
increase costs substantially.
GPIO
General-purpose input/output are the pins that allow connectivity of various
hardware, such as sensors to the CPU. Like RAM, the number of GPIOs range
substantially to accommodate all types of device stacks.
Connectivity
Different CPUs come with different connectivity options, including Wi-Fi protocols,
Bluetooth, and wired ethernet ports.
https://www.nabto.com/iot-microcontroller-guide/ 6/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
There are a few operating system options for MCUs. Here’s what you’ll find on the
market:
RTOS
Short for “real-time operating system,” this software component can execute only
one program at a time, but rapidly switches between programming tasks in order to
accomplish multiple tasks simultaneously.
You can read more here on how to choose the best RTOS for IoT.
OS
This is a “traditional” operating system, such as Linux. Unlike its “real time”
counterpart, an OS provides non-deterministic, soft, real-time responses, meaning
it’s more effective at processing large quantities of different tasks than an RTOS,
but requires a lot more processing power.
Because of this, OS software is usually only found on 32 and 64-bit MCUs that
have MMU units. You can read more on the advantages and disadvantages of OS
versus RTOS here.
Bare metal
Some CPUs have no operating system software at all. Instead, the firmware is
written directly onto the hardware—the result is bare metal programming. This is
very common with older generation embedded devices and MCUs for IoT.
https://www.nabto.com/iot-microcontroller-guide/ 7/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
However, as MCU processing power has advanced, and come down in cost, fewer
devices are operated bare metal. Having said that, it is still used when an MCU has
low memory, or when direct control over every piece of hardware is needed to meet
very strict timing requirements.
Memory
The amount of memory will, of course, have a fundamental impact on the overall
performance of the device. Therefore, memory requirements for a device’s
programming tasks must be carefully calculated—both RAM and ROM.
Also, ensure the decision is future-proofed by arranging for enough spare capacity
to handle the demands placed on it by future updates.
Power
Power requirements is another major consideration when it comes to choosing the
best MCU.
For instance, an IoT smart medical device, like a hearing aid, can run on a low-
power battery. On the other hand, heavy smart industrial equipment will consume
lots of electricity, but you’ll want the device to be as energy efficient as possible.
https://www.nabto.com/iot-microcontroller-guide/ 8/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
How will your IoT device connect to the application? What type of data will the
device be pushing, and where? Does it need to interact with other devices locally?
For example, a residential smart alarm system may need Wi-Fi protocols, while an
office IoT HVAC system may require wired ethernet. For local device
communication, Bluetooth or Thread network could be needed, and remote devices
outside Wi-Fi range require 4G data connectivity.
Connection ports
To work out how many GPIOs are needed on a microcontroller, first define the data
inputs the device requires. Also, bear in mind, there are both digital ports and
analog ports on a CPU, which process different types of data inputs and outputs.
Architecture
Remember, most applications run off ARM, MIPS, or X86 architecture. Therefore,
make sure your choice can support the complexity of your device and system,
including the I/Os and data processing and how much power that requires.
If your team or organization has no prior experience working with MCUs, dev
support offered by the manufacturer and the developer community is crucial.
Check for comprehensive documentation from the manufacturer, and sites like
StackOverflow or Reddit for community support. You can also find plenty of useful
tutorials on our blog.
Cost
https://www.nabto.com/iot-microcontroller-guide/ 9/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
Always keep one eye on the future when considering microcontroller costs. There
is no point building a prototype with a board that can become prohibitively
expensive to scale and take to market. Also, be aware, some MCUs come with
licensing fees for individual device drivers.
Security
Security is a significant consideration for all IoT projects and needs to be
engineered across the stack. Standard security features on commercial boards
include cryptographic bootloaders and hardware accelerators, shield layers, and
memory protection units.
We’re going to follow this up with a supplemental post, examining the top
microcontroller options as well as their specifications, so then, you’ll have
everything you need to get started.
https://www.nabto.com/iot-microcontroller-guide/ 10/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
https://www.nabto.com/iot-microcontroller-guide/ 11/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
https://www.nabto.com/iot-microcontroller-guide/ 12/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
###
11
Jul
https://www.nabto.com/iot-microcontroller-guide/ 13/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
03
Jul
When it comes to connecting devices within the Internet of Things (IoT), it’s easy to [...]
22
May
Video surveillance is one of the fastest-growing markets within the Internet of Things (IoT), i.e., [...]
https://www.nabto.com/iot-microcontroller-guide/ 14/15
10/5/24, 1:59 PM A Complete Guide to Microcontrollers for IoT
Aabogade 15, 8200 Aarhus N, Denmark. Phone: +45 70218040 All rights reserved © Nabto 2009 - 2024
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Read the Privacy Policy for this website here.
https://www.nabto.com/iot-microcontroller-guide/ 15/15