ESP32 vs RP2040 vs STM32: Which is Best for Your Project?

31 October 2023


Ⅰ. What is a microcontroller?

Ⅱ. ESP32 vs RP2040 vs STM32: Overview

Ⅲ. ESP32 vs RP2040 vs STM32: Manufacturers

Ⅳ. ESP32 vs RP2040 vs STM32: Pin configuration

Ⅴ. ESP32 vs RP2040 vs STM32: Features

Ⅵ. ESP32 vs RP2040 vs STM32: Specifications

Ⅶ. ESP32 vs RP2040 vs STM32: Applications

Ⅷ. Conclusion



Microcontrollers are widely used in various control electronic equipment, automation systems, military equipment, medical equipment, home appliances and other fields. It can not only handle various abnormal situations that occur during the data sampling process and ensure the accuracy and reliability of the collected data, but also implement an energy-efficient low-power consumption mode and improve work efficiency. Today, let’s explore the differences between ESP32, RP2040 and STM32 microcontrollers in order to choose the most suitable chip for your project.


01bafe36c8b7b1e964aaa4c2526d72b7.png



Ⅰ. What is a microcontroller?


A microcontroller is a single-chip microcomputer that integrates the main parts of a microcomputer on a single chip. It is commonly used to control and monitor various electronic devices and systems such as automotive electronic systems, home appliances, and medical equipment. It is an integrated circuit chip composed of memory, microprocessor, system control logic circuit and input and output interface. It can implement various control tasks through programming and communicate with external devices through input and output interfaces.



Ⅱ. ESP32 vs RP2040 vs STM32: Overview


1. Introduction to ESP32


12eef228f6078f64b7ef09a43e26a126.png


ESP32 is a highly integrated low-power system-on-chip (SoC) microcontroller launched by Espressif Systems. It combines wireless communications, dual-core processors, low-power features and rich peripherals. It is suitable for various Internet of Things applications. It's powered by a 32-bit dual-core processor, one for Wi-Fi connectivity and the other for running code. ESP32 supports Wi-Fi and Bluetooth connectivity, has 512 KB RAM, 448 KB ROM, and 34 GPIO pins.


2. Introduction to RP2040


b6e66297389d7b677b17a2015b2aa8fe.png


The RP204 is the Raspberry Pi's first microcontroller. It has 264KB of internal SRAM and supports up to 16MB of off-chip flash memory. Manufactured through a 40nm process node, it blends high-performance capabilities with minimal dynamic power usage, and employs several low-power modes to ensure extended battery-powered operation. The RP2040's compact size, energy efficiency, and impressive performance render it a fitting choice for a wide range of IoT and embedded system applications.


3. Introduction to STM32


8764bbd7ffc3a83b536b826a2010f67f.png


The STM32 microcontroller is a 32-bit microcontroller manufactured by ST Microelectronics based on the ARM Cortex-M core and is used in embedded fields such as the Internet of Things, wireless communications and industrial control. According to different application scenarios and characteristics, it can be divided into different series and models. Among them, the common ones include STM32F0, STM32F1, STM32F4, STM32F7 and other series.



Ⅲ. ESP32 vs RP2040 vs STM32: Manufacturers


1. Manufacturer of ESP32


The ESP32 is manufactured by Espressif Systems, a global semiconductor company. Founded in 2008, it focuses on the development and design of software and hardware products in the AIoT field, including wireless communication MCU chips that are safe and stable, have excellent performance, and are cost-effective. Its main products include ESP8089 series chips, ESP8266 series chips, ESP32 series chips, ESP8266 series modules, and ESP32 series modules.


2. Manufacturer of RP2040


The RP2040 is manufactured by the Raspberry Pi Foundation, a charitable foundation in the UK. The Raspberry Pi is a card-sized development board that can run a Linux system and provides many programmable GPIOs for hardware expansion.


3. Manufacturer of STM32


The STM32 is manufactured by ST Microelectronics, which resulted from the merger of Italy's SGS Microelectronics and France's Thomson Semiconductor. It has a wide range of product layouts in smart travel, power energy, Internet of Things and other fields. Its product range ranges from discrete diodes and transistors, to complex system-on-chip devices, to complete platform solutions, including reference designs, application software, manufacturing tools and specifications. STMicroelectronics is a major supplier to various industrial sectors, providing a wide range of services and products to a wide range of customers.



Ⅳ. ESP32 vs RP2040 vs STM32: Pin configuration


Their pinout is as follows.


23ff408890dfaa8bfb2b9b4f737316c3.png



Ⅴ. ESP32 vs RP2040 vs STM32: Features


1. Features of ESP32


(1) GPIO: It has 34 GPIO ports, which can connect and control various peripherals.


(2) WiFi and Bluetooth module: Built-in WiFi and Bluetooth 4.2 module, capable of wireless communication


(3) Dual-core: Most ESP32s are dual-core, they come with two Xtensa 32-bit LX6 microprocessors.


(4) Security: Supports security features such as encryption and digital signatures


(5) Low power consumption: It has multiple power-saving modes, and the lowest power consumption is only 5μA.


(6) High performance: It has a 240MHz dual-core processor, 520KB RAM and 4MB flash memory.


2. Features of RP2040


(1) MicroPython is natively supported, making it convenient for users who are not very good at software to obtain open source programs from the Internet and use them flexibly according to their needs without affecting each other.


(2) Each pin can be programmed independently and can be used to generate various commonly used and customized protocols.


(3) The pins of RP2040 can be flexibly configured into groups to support the most commonly used serial buses.


(4) It has two Arm Cortex M0+ cores inside.


(5) It is manufactured by the Raspberry Pi Foundation on a 40nm TSMC silicon wafer and uses a 7×7 mm QFN-56SMD package design.


3. Features of STM32


(1) There are many types of chip models and wide coverage.


(2) It has built-in stack protection, memory protection, debugging and tracing protection and other security protection functions.


(3) The STM32 series of microcontrollers has a wealth of peripherals, including multiple timers, ADC, DAC, counters, PWM output, communication interfaces, etc.


(4) It has built-in flash memory of different capacities for storing program code and data.


(5) It uses ARM Cortex-M core, which has excellent processing performance and running speed.


(6) It provides a variety of low-power modes, which can put the processor and peripherals into a low-power state to extend battery life or reduce power consumption.



Ⅵ. ESP32 vs RP2040 vs STM32: Specifications


1. Specification of ESP32 


• Its power supply voltage range is 2.2V-3.6V, with built-in switching power management unit (SMU) and low-voltage regulator (LDO).


• It supports Bluetooth audio transmission (A2DP/AVRCP/SPP).


• Dual-core 32-bit LX6 microprocessor running at 160 or 240 MHz


• It supports STA/AP/STA+AP working mode, with a maximum transmission rate of 150Mbps.


• Up to 34 programmable GPIO pins for connecting sensors, actuators and other peripherals


2. Specification of RP2040


• Its dimensions are 23.5 x 17.5 mm.


• USB Type-C interface for connecting power supply, data cable, and programming


• It has 30 GPlO pins, 4 of which can be used as analog inputs.


• 264kB on-chip SRAM in six independent banks


• Dual Cortex M0+ cores, up to 133 MHz (default 48MHz)


3. Specification of STM32 


• It supports multiple communication protocols such as I2C, CAN, SPI, USART, etc.


• It usually has multiple timers and counters and can be used in various timing and control applications.


• It provides different packages such as BGA, LQFP, TSSOP etc.


• It has a variety of pins including digital GPIO pins, ADC input pins, etc.


• Its supply voltage range is 3.3V or 5V.



Ⅶ. ESP32 vs RP2040 vs STM32: Applications


1. Applications of ESP32


• Smart home system


• Drone and robot control


• Sensor data collection and monitoring


• Health tracking and medical devices


• loT devices and applications


• Industrial automation and embedded control


2. Applications of RP2040


• Smart home


• Medical equipment


• IoT devices


• Embedded audio and video


3. Applications of STM32


• Communication


• Aerospace


• Medical equipment


• Vehicle electronics


• Automated industry



Ⅷ. Conclusion


In addition to the above, we can learn that there are some differences between ESP32, RP2040 and STM32 in terms of I/O, price and clock frequency.


Initially, with regard to I/O, RP2040 boasts a relatively modest number of ports, while both ESP32 and STM32 provide support for a greater array of ports and peripherals. Secondly, concerning pricing, RP2040 offers a more budget-friendly option compared to ESP32 and STM32. Lastly, in terms of clock frequencies, ESP32 utilizes a 32-bit processor with a clock speed of up to 240MHz, while STM32 typically operates within the range of 72MHz to 180MHz. RP2040, on the other hand, utilizes a 16-bit processor with a clock speed that can reach up to 133MHz.


Therefore, we need to comprehensively consider factors such as performance, price, application scenarios, etc., and choose the appropriate microprocessor according to our own needs.




Frequently Asked Questions


1. What is the application of RP2040?


Four RP2040 IO are used for internal functions - driving an LED, on-board Switched Mode Power Supply (SMPS) power control and sensing the system voltages.


2. Does RP2040 have ADC?


The RP2040 has an internal SAR (Successive Approximation Register) ADC. The ADC uses an independent 48MHz clock, and a sample takes 96 cycles of this clock to complete (2us). A pacing timer can be used to reduce the speed with which samples are gathered (but any individual conversion always takes 96 cycles).


3. What is STM32 used for?


STM32 microcontrollers play a vital role in various industries. In the automotive industry, they are used for engine control, safety systems, infotainment systems, and more. In consumer electronics, STM32 microcontrollers power devices such as smartphones, tablets, smartwatches, and home automation systems.


4. Is ESP32 better than STM32?


Both are good for there features. ESP32 gives you Wifi feature where STM32 Nucleo you doesnt have inbuilt. and Nucleo STM32 is an ARM CORTEX -Mx based have good market. 


5. What does an ESP32 do?


ESP32 can perform as a complete standalone system or as a slave device to a host MCU, reducing communication stack overhead on the main application processor. ESP32 can interface with other systems to provide Wi-Fi and Bluetooth functionality through its SPI / SDIO or I2C / UART interfaces.