Microcontroller vs. Microprocessor for Remote Sensors

2022-11-11 09:07:18
关注

Microcontroller vs. Microprocessor for Remote Sensors
Illustration: © IoT For All

It is easy to feel overwhelmed when you’re building low-power electronics. There are so many different components and technologies that it can be hard to know where to begin. Recently, a MistyWest client wanted to redesign their field-deployed IoT environmental monitor to a smaller, lighter, and more power-efficient package with a longer battery life that could be placed more easily in remote locations. In order to achieve this, they faced a choice of going with a Linux-based single-board-computer with a microprocessor or a microcontroller-based compute platform. Let’s take a look at the differences between a microcontroller and a microprocessor when it comes to designing a successful remote sensor so that you have the information you need to choose the right solution for future applications.

'When it comes to microcontroller vs. microprocessor, you must consider computing power, how resource-intensive your problem is, and several other variables.' -MistyWestClick To Tweet

Microcontroller Kits vs. SBCs

A microcontroller is a small, all-in-one computing platform with features like onboard memory, built-in timers, IO handling, and others for interacting with electrical hardware. Microcontrollers’ common uses are devices like remote controls, toys, industrial equipment, cars, and implantable medical devices. You can find them in microcontroller kits like Arduino.

A microprocessor is similar to a conventional computer CPU, which is only the processor, and needs to be connected to external memory, timers, storage, and IO peripherals in order to function. Microprocessors are generally more powerful and allow for a more granular hardware design by selecting the exact memory, timers, and other features that one needs. You’ll find microprocessors in consumer computing equipment, and the increase of small and cheap single-board computers (SBCs) like Raspberry Pi has enabled them to be used in new applications like smart devices.

Strengths & Weaknesses: Microcontroller vs. Microprocessor

When it comes to microcontroller vs. microprocessor, you must consider computing power, how resource-intensive your problem is, and several other variables. Will your sensor require simple sensor reading (low intensity), image processing (high intensity), or machine vision/AI (very intense)? For development, can you use an off-the-shelf operating system or reuse other people’s code? And how much power consumption or battery life will you require?

Here is a detailed breakdown of each feature:

Strengths and weaknesses between the computing devices

#1: Computing Power

Some microcontrollers are designed with low power consumption in mind and are specified to be run at reduced clock frequencies, meaning the chip computes more slowly but with less power consumption. This makes microcontrollers good for less compute-intensive applications like sensor reading, serial communication, or mechanical control systems, but they don’t tend to have the processing power for computationally intensive tasks, like image processing.

In comparison, there is often much more computing power available on commercial microprocessor boards like Raspberry Pi, which can support more complicated tasks like streaming video or running a local website. There are also microprocessors with additional modules, such as the Nvidia Jetson Nano, which has a graphics processing unit for tasks like machine vision and AI.

#2: Packages, Development Resources, and Support

If you pick an established platform like Arduino or Raspberry Pi, there are many existing open-source libraries and a community that can help debug issues. However, If you pick a more specialized and less common platform, you may be on your own when sorting through documentation and trying to fix the issue. You need to decide if you need the specialized features of a particular platform and trade that against the support.

With embedded Linux solutions, most of the basic drivers for common connections like ethernet, audio, and video are already available, tested, and stable. In contrast, you may need to write the drivers for your particular microcontroller to connect with peripherals, which can be time-consuming and challenging.

Battery Charging

#3: Power Consumption

Microcontroller-based boards usually use less energy than microprocessor-based SBCs. One of the reasons is that microcontrollers generally run at lower clock frequencies than microprocessors, which in turn also means reduced computing power.

#4: Coding Language Support

If you’re running your code on a microcontroller, you’re likely going to need to build your software with a lower-level language like C or C++. On a microprocessor with a Linux distribution, you will have the choice between many more languages. This can help to create POCs (Proof Of Concepts) at a much faster pace. There are many libraries for peripherals like cameras, sensors, etc. written in higher-level languages like Python, for instance. By picking a platform that can run those languages you will be able to leverage those open-source libraries. However, If your solution requires a lot of low-level hardware manipulation, this may not be helpful.

#5: Code Portability

How tightly integrated is the code with the hardware? If you write a bare-metal application for a microcontroller, it will be challenging to switch over to another platform – but projects that are running FreeRTOS, for example, make switching easier. If you’re using a Linux-based SBC and peripherals over a protocol like USB, it will be even easier to change the compute platform because there are often libraries and drivers available. Depending on the tools you are planning to use some platforms might be more flexible to be interchangeable than others.

Boot Time

#6: Boot time

The boot time of an SBC with embedded Linux on it is significantly greater than that of a microcontroller, be it bare-metal or running an RTOS. When utilizing an SBC, an application must not depend on fixed time slots during start-up, and a few seconds for it to come up must be acceptable.

#7: Cost

In general, microcontrollers cost less than microprocessors. As an example, top-of-the-line Teensy costs $26 and the flagship Arduino board (Uno) costs $25, whereas the flagship Raspberry Pi board (Pi 4) starts at $35, and more expensive boards like the Jetson Nano may range up to $130. There is a wide range of costs in both domains and plenty of choices available on the market.

Making the Best Choice

Ultimately, SBCs and microcontroller kits are both solutions for embedded applications that require computing. It is the use case that will inform which selection is the right one to make. SBCs with an embedded Linux OS, even though more costly, offer greater computing power, and allow a quick start to your project, with a wide range of options for your application’s programming language, very active online communities, and advantageous portability. Microcontrollers, on the other hand, are much more energy efficient and allow full control and fine-tuning of their internal configuration – but additional time for the development of features might need to be considered.

When it comes to making the right selection between a microcontroller vs. microprocessor, if a quick prototype for a proof of concept is needed or if the device is going to be used for inference, object localization, or other demanding computing tasks, an SBC is likely the better solution. The portability of the code and the flexibility of the system will simplify development and maintenance significantly.

Tweet

Share

Share

Email

  • Artificial Intelligence
  • Connectivity
  • Data Analytics
  • Edge Computing
  • Hardware Components

  • Artificial Intelligence
  • Connectivity
  • Data Analytics
  • Edge Computing
  • Hardware Components

参考译文
远程传感器微控制器vs.微处理器
图示:© IoT For All —— 当你构建低功耗电子产品时,很容易感到不知所措。有太多不同的组件和技术,让人难以知道从哪里开始。最近,一家 MistyWest 的客户想要重新设计他们部署在野外的物联网环境监测设备,使其更小、更轻、更节能,电池续航时间更长,并且更容易部署在偏远地区。为了实现这一目标,他们面临着一个选择,是采用基于 Linux 的单板计算机(SBC)加微处理器,还是采用基于微控制器的计算平台。让我们来看看在设计成功的远程传感器时,微控制器和微处理器之间的区别,以便你在未来应用中能够做出正确的选择。 “在微控制器和微处理器之间,你必须考虑计算能力、问题的资源密集程度,以及其他几个变量。” —— MistyWest 点击推特 ### 微控制器套件 vs. 单板计算机 微控制器是一种小型、一体化的计算平台,通常具备诸如片上存储器、内置定时器、I/O 处理等功能,可以与电气硬件进行交互。微控制器常见的应用包括遥控器、玩具、工业设备、汽车和可植入式医疗设备。你可以在 Arduino 等微控制器套件中找到它们。 微处理器则类似于传统计算机的 CPU,它只是处理器本身,需要连接外部存储器、定时器、存储和 I/O 外设才能运行。微处理器通常更强,允许通过选择所需的精确内存、定时器和其他功能,进行更精细的硬件设计。你会发现微处理器出现在消费类计算设备中,而小型且价格低廉的单板计算机(SBC)如 Raspberry Pi 的增多,也使它们能够用于智能设备等新应用中。 ---### 微控制器 vs. 微处理器:优势与劣势 在选择微控制器和微处理器时,你必须考虑计算能力、问题的资源需求程度,以及一些其他变量。你的传感器需要简单的传感器读取(低需求)、图像处理(高需求)还是机器视觉/AI(极高需求)?在开发方面,你是否可以使用现成的操作系统或复用他人的代码?你又需要多少的功耗或电池续航时间?以下是对每个功能的详细分析。 #### #1:计算能力 一些微控制器设计时考虑了低功耗,其工作频率较低,意味着芯片计算速度较慢但功耗更低。这使得微控制器适合处理计算需求较低的应用,如传感器读取、串行通信或机械控制系统,但它们通常没有足够的处理能力来执行计算密集型任务,如图像处理。 相比之下,商业微处理器板(如 Raspberry Pi)通常具备更强的计算能力,可以支持更复杂任务,如视频流或运行本地网站。还有些微处理器带有额外模块,如 Nvidia Jetson Nano,其图形处理单元(GPU)可用于机器视觉和人工智能任务。 #### #2:封装、开发资源与支持 如果你选择了一个成熟平台,如 Arduino 或 Raspberry Pi,你会发现有许多现成的开源库以及活跃社区可以协助你解决问题。但如果选择一个较为专业且不常见的平台,你可能在阅读文档和解决问题时需要独自面对。你需要决定是否需要某个平台的特殊功能,并权衡这一功能与支持的强弱之间的关系。 在嵌入式 Linux 解决方案中,大多数常见连接(如以太网、音频和视频)的基本驱动程序已经存在、测试并稳定。相比之下,你可能需要为特定微控制器编写驱动程序以连接外围设备,这可能会耗费大量时间和精力。 #### #3:电池充电 基于微控制器的开发板通常比基于微处理器的 SBC 消耗更少的能源。其中一个原因是微控制器通常以比微处理器更低的时钟频率运行,这意味着它们的计算能力也较低。 #### #4:编程语言支持 如果你的代码运行在微控制器上,你很可能需要使用如 C 或 C++ 这类底层语言编写软件。而在使用 Linux 系统的微处理器上,你可以有更多的语言选择。这可以加快原型设计(POC)的开发速度。例如,许多用于相机、传感器等外设的库是用 Python 等高级语言编写的。选择一个可以运行这些语言的平台,你就能利用这些开源库。但如果解决方案需要大量底层硬件操作,这种方式可能并不适用。 #### #5:代码可移植性 代码与硬件的集成程度有多紧密?如果你为微控制器编写的是裸机程序,那么将其切换到另一个平台可能会很困难。但像 FreeRTOS 之类的项目,会使得平台的切换变得更容易。 如果你使用的是基于 Linux 的 SBC,并通过 USB 等协议连接外围设备,那么更改计算平台会更加容易,因为通常已经有现成的库和驱动程序可用。 #### #6:启动时间 带有嵌入式 Linux 的 SBC 启动时间明显长于微控制器,无论是裸机系统还是运行 RTOS 的系统。在使用 SBC 时,应用程序不能依赖固定的启动时间,必须接受几秒的启动时间。 #### #7:成本 总体来说,微控制器的成本通常低于微处理器。例如,顶级 Teensy 的价格为 26 美元,旗舰 Arduino 板(Uno)为 25 美元,而 Raspberry Pi 的旗舰板(Pi 4)起价为 35 美元,更昂贵的板,如 Jetson Nano,价格可能高达 130 美元。两个领域的价格范围都很宽,市场上有丰富的选择。 ---### 做出最佳选择 总而言之,单板计算机(SBC)和微控制器套件都是嵌入式应用中需要计算的解决方案。选择哪一种取决于具体应用场景。尽管价格更高,但带有嵌入式 Linux 的 SBC 可提供更强的计算能力,并能快速启动你的项目。它在编程语言选择上更加多样,拥有活跃的在线社区,并具有良好的代码可移植性。 另一方面,微控制器则更加节能,并允许对内部配置进行完全控制和精细调整,但可能需要额外的时间来开发功能。 在选择微控制器和微处理器时,如果你需要快速构建一个概念验证原型,或者设备将用于推理、目标定位或其他高要求计算任务,SBC 通常是更好的选择。代码的可移植性和系统的灵活性将显著简化开发和维护过程。 TweetShareShareEmail 人工智能连接数据分析边缘计算硬件组件 --> 人工智能连接数据分析边缘计算硬件组件
您觉得本篇内容如何
评分

相关产品

ROHM Semiconductor 罗姆 KX23H-1035 加速度传感器

KX23H是一个集成的传感器集线器设备,将高性能、低功耗的3轴加速度计与32位ARM cortex微控制器结合在一个3毫米x 3毫米x 0.9毫米的封装中。此外,KX23H还包括用于点击/双击的嵌入式算法,屏幕旋转、倾斜和其他常见应用程序。KX23H’s微控制器是一款功能齐全的低功耗ARM cortex M-0,运行频率32MHz。KX23H能够接受陀螺仪、磁强计和压力传感器等附加输入,并能够运行传感器融合软件,因此可以减少对系统CPU或应用处理器的需求,降低功耗并简化系统架构。该加速度计基于Kionix最高性能设计,16位分辨率,256字节FIFO/FILO缓冲区,功耗低至1 u00b5A。KX23H传感器集线器面向广泛的应用,包括可穿戴设备、移动电话和便携式设备以及物联网应用程序。

评论

您需要登录才可以回复|注册

提交评论

广告

iotforall

这家伙很懒,什么描述也没留下

关注

点击进入下一篇

SK海力士引领High-k/Metal Gate工艺变革

提取码
复制提取码
点击跳转至百度网盘