fbpx

The choice of microcontroller is a crucial step in the design of an IoT device. In this article we will see what we must take into account to choose the right one for our IoT project.

But first let's see what is the difference between a microprocessor and a microcontroller.

In principle we can say that both devices are very similar in terms of technology, beyond the multiple architectures that exist in each of these families. However, to understand what differentiates them from each other, it is necessary to start with their purpose.

microprocessors

Microprocessors are designed to perform calculations and process information. Examples of them are the chips we use in laptops, smartphones, TVs, etc. Microprocessors access data in memory by reading or writing and send data to other peripherals through hardware interface devices. In this way, the microprocessor does not have a direct link with the peripherals or with the environment. This is a substantial difference from the microcontroller.

Photo by Slejven Djurakovic on Unsplash

On the other hand, microprocessors generally have a much higher computing capacity than microcontrollers, so they can perform many more operations per unit of time. Since they process much more data per second, also memory and data storage units (for example: disks), are much larger in capacity and speed, compared to those used in conjunction with microcontrollers.

Finally, since these devices are designed to process the largest amount of information in the shortest possible time, that is, to be very efficient in processing, the energy consumption is much higher than in the case of microcontrollers. In fact, over time, one of the biggest challenges for microprocessor manufacturers has been to lower power consumption while maintaining processing capacity.

microcontrollers

On the other hand, microcontrollers are intended to interact with the environment through sensors and actuators and perform control tasks. Their processing capacity is less than that of microprocessors, as are the memory and storage resources they access.

Microcontrollers directly access peripherals through interfaces such as analog/digital or digital/analog converters, serial bus interfaces, or general purpose pins. In this way they have a direct connection with the environment and the peripherals. This means that much less hardware and software is needed to read the status of a sensor, activate an output, or send a message over the WiFi network, to give a few examples.

Photo by Frank Wang on Unsplash

Since memory and storage resources are limited, they must be used as efficiently as possible, so that the code fits in flash memory and can run smoothly with the available RAM.

Finally, power consumption is a critical factor in microcontroller-based devices, especially those that will run on battery power. This is why power management is a built-in function, allowing the microcontroller to enter various states, ranging from full utilization of the microcontroller and peripherals, through disconnection of peripherals and memory, to sleep states. (deep sleep) from which the microcontroller can only recover by a specific interrupt.

Characteristics of a microcontroller

Microcontrollers have a series of characteristics, which we will see summarized below.

bits: this is the first characteristic that appears when we see the data sheet of a microcontroller. Indicates the size of the instructions or data (in bits) that it can process. The bits can be 8, 16 or 32.

RAM: it is the memory that the microcontroller will use to store and access data that is generated during the execution of the program. They are small in size and if the program handles a lot of data, some care may need to be taken when selecting the chip. It has a significant impact on its cost.

Flash memory: Unlike RAM memory, it is a non-volatile memory, so it is used to store data that must remain saved if the power supply is interrupted. 

GPIOs: the acronym is General Porpouse Input Output, which in Spanish means that they are general purpose pins. They can include digital inputs or outputs, A/D or D/A converters.

Communication interfaces: They range from serial interfaces like I2C, 1-Wire, SPI, to Ethernet, WiFi, Bluetooth, etc. These interfaces are highly dependent on the type of microcontroller selected.

Energy consumption: As already said, energy consumption and management is crucial in the use of microcontrollers and this must be analyzed in depth for each device or project.

How to choose the microcontroller

As we have seen, there are many variables to consider based on the characteristics of each chip and the specific use.

One of these aspects is compatibility with hardware and systems already installed. From the type of sensors, to the communication interfaces. The choice of the microcontroller must allow a smooth integration, which does not require important modifications of the environment where it is going to be installed.

Regarding the chip itself, it is important to anticipate the most suitable architecture, processing capacity and sizes of flash and RAM. Also the interfaces available in digital inputs/outputs, ADCs, DACs, communication interfaces (I2C, Bluetooth, WiFi, etc.).

Another important aspect is the supply voltage and energy consumption. This can be strongly conditioned by the installation conditions and the type of power supply available at the site. Variants can range from 220 V alternating voltage, 12 V direct voltage, 3.7 batteries, etc. In each case, different power conversion and management circuits will be needed to adapt the power supply to the requirements of the microcontroller and associated peripherals.

Cost is obviously also an important factor, along with the availability of the microcontroller in your market. The cost must be in accordance with the function that the IoT device will perform, the scale of the project and the possibilities of expanding it. Also the microcontroller must be available in the necessary quantities not only at the initial moment, but over time.

In the development stage it is important to have development environments, such as boards, programming environments, etc. Each microcontroller has its own tools, some are free and some are not. Prototypes will typically be built using these development or evaluation boards and proper selection can save a lot of time.

Finally, documentation, technical support, and the online community are important to learning how to use the microcontroller and saving time on development. You can, for example, see if there are specific libraries for part of the software that will be running on the microcontroller. This will save a lot of development time, although it will be necessary to evaluate each case, for example examining if these libraries are updated frequently and are used by many developers.

In short, these are some considerations to take into account when selecting a microcontroller for our IoT device. I hope they have served you and I invite you to comment below.


1 Comment

IoT and its relationship with software and hardware development - Bambú Mobile · 24 December, 2020 at 12:04 PM

[…] hardware development behind the Internet of Things lies in a microcontroller or an integrated circuit that must be small and have very low consumption. This element is called SoC (system on chip, for its acronym in English), and it is essential that […]

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

en_USEnglish
%d bloggers like this: