When it comes to comparing the performance of Arduino and STM32, which one is superior? Many electronics enthusiasts face a dilemma when deciding between Arduino and STM32, unsure of how to choose. Arduino has always been popular, but does STM32, with its numerous interfaces, strong performance, and faster speed, hold the edge?
Features of Arduino and STM32
Arduino:
Arduino is more focused on creativity; it simplifies hardware operations, and its functions and syntax are very straightforward and user-friendly. Most Arduino controllers are based on AVR microcontrollers, and its advantages lie in high code encapsulation and fewer required statements, which reduces software development difficulty. Arduino is relatively easy to learn; anyone with a basic understanding of hardware and C++ can start developing. Most of Arduino’s functionalities come with well-prepared libraries, making it simple to use, but its controllability is relatively poor for slightly more complex functions. STM32:
For applications requiring computation or control, STM32 is the better choice. If you buy a development board for STM32, you need to start learning from the hardware level and master its various details. STM32 focuses more on practical engineering; in fact, many simple instruments in factories, such as temperature controllers, ordinary motor controllers, low-end PLCs, and some consumer toys, game controllers, wired keyboards and mice, and POS machines used in college canteens, are widely used. STM32 is primarily designed for professional developers, requiring a certain level of expertise, but coding for functionality is relatively complex. For example, outputting a simple string via serial communication might take around 10 lines of code in Arduino, but using STM32 development tools like Keil may require hundreds of lines of code or more, as seen in the serial communication example: sending data through serial after pressing a button.
Comparing Arduino and STM32
Arduino has many versions with inconsistent features. Taking the most common Arduino UNO R3 as an example, its controller is the AVR 138 microcontroller, which is not on the same performance level as STM32. This model is somewhat comparable to the STC12 series from Holtek (only in terms of computation). The Arduino MEGA 2560 is considered the leader among Arduino MCU versions, with rich interfaces, comparable to the STM32F1 series, but it has high power consumption, and the chip heats up noticeably, while the STM32F1ZET6 with the same package has only minimal heat, sometimes feeling cool in low-temperature environments. Based on the different characteristics of both, we can compare them according to various applications: in terms of ease of learning, Arduino is much easier than STM32; in terms of basic programming concepts, Arduino is primarily object-oriented, based on C++ and Java, while STM32 mainly uses standard C language for development; in terms of knowledge gained after learning, Arduino lags behind STM32 because Arduino encapsulates many low-level operations. Unless you attempt to write libraries for Arduino and its associated circuit modules, you will remain at a basic programming level.
In terms of openness, projects created with STM32 can be open-sourced if desired, or kept private without publication. In terms of ease of peripheral circuit construction, Arduino is significantly easier than STM32. In terms of expandability, Arduino and STM32 are comparable, as Arduino has most of the controller’s pins printed out.
In terms of cost, assuming similar functionality, Arduino is more expensive than STM32.
If you are still unsure how to choose, here are some recommendations:
-
If you are a regular student below university level with little knowledge of programming languages, it is recommended to start with Arduino.
-
If your C foundation is weak, diving into STM32 might lead to quick frustration.
-
If you are learning solely for employment, go for STM32 microcontrollers.
-
If you are learning just for fun, and you are not from an electronics background and lack confidence, Arduino is recommended.
-
If you have a good programming foundation, STM32 is advisable. Once you grasp it, you can easily accomplish tasks that Arduino open-source community has done using STM32.
-
Of course, if you have the capability, try both. Generally, within a week, you can master the basic features of Arduino, and later, if needed, you can easily port Arduino code to STM32 and other MCU platforms.
In fact, these two cater to slightly different directions: Arduino is generally the choice for electronics enthusiasts and DIY projects, while STM32 is often used for actual product development and manufacturing. However, the Arduino series now also supports STM32 chips; by first downloading the Arduino firmware, you can then use the Arduino development environment for programming. Choosing what suits your project type and needs is the most important.