What do you want? A microcontrollers performance comparison

Spread the love

Guest post created with ♥ by Josses 🙂|

A micro controller performance comparison
A micro controller performance comparison

Whoever has started to peek into the wonderful world of small electronics will undoubtedly have read about Raspberry Pi or Arduino boards. This is where I personally started to ask myself, what is the right board for which project? 

Introduction

I only started collecting my first experiences with this hobby in 2018. I decided to enter my retirement and suddenly had a wealth of time. My first action was a 400 pages book on the Raspberry Pi 2. I remembered the equation V= i*R from school; in Germany, this is known as U = R * I, strangely enough.

Led strip digital clock
Led strip digital clock

In order to understand this formula, you will need to step into the matter and do it. But, my personal goal is the KISS principle, Keep It Simple (and) Stupid. In the meantime, I have finished more complicated projects, such as a digital clock similar to the Düsseldorf Rheinturm (https://de.wikipedia.org/wiki/Lichtzeitpegel), the largest decimal clock in the world (according to the Düsseldorf city guide. I learned a lot reading the documentation from HJBerndt (Homepage von H.-J. Berndt (hjberndt.de) in german language). My final version is a desktop unit, which switches automatically between summer and winter time. 

Based on an ESP8266, which does not have a reliable RTC, I pick up the actual time from the NTP time signal via WiFi. This webpage also was a great help in defining summer and winter time:

In the meantime, I have built several units for friends and family, and they can select how often the WiFi budget is charged. Typically every 5 or 10 minutes. The update is indicated by walking red lights followed by decent blue lights. And every full hour, there is a colorful waterfall of all colors, indicating one hour has passed. The base is printed with my Ender 3D pro printer, which has added perfectly to my new office environment.

How to select a board

Well, let’s go back to the start: which board is the right board? There is no simple answer to this question. Too many options will influence your decision:

  • Budget, what is the price for a board?
  • Connections, how many I/O ports are needed or available?
  • Supported by the Arduino IDE or PlatformIO?
  • Does the board have a dedicated function, such as the ESP32-CAM?
  • Does the project need internet access and Wifi functionality?
  • and many more …

Even within the range of products, you will find variants that will answer some or all of your requirements. Surprisingly the ESP-01 can do a great job in supporting an old Raspberry Pi, which lacked the Wifi function.

WeMos D1 mini and esp01
WeMos D1 mini and esp01

Also, it is a great “gate-keeper” to forward messages via ESP-NOW. I once built a system reading temperature and light density in front of the garage. The distance did not allow me to receive the data directly at my desk, so I built a chain of boards to solve this problem:

  • One ESP8266 is built with a solar-powered light above the garage door. It picks up the light and temperature information and sends an ESP-NOW message to the ESP-01 in my bedroom. 
  • The ESP-01 then sent the information, again ESP-NOW,  to a combined ESP32/ePaper board
  • then my solar lamp broke, so I have no pictures. But I picked up the satisfaction that I can do even less common things by combining what I have found in many hours of reading.
  • Knowledge is what remains after you have forgotten what you have learned.

Yes, I have ordered quite a number of different boards, both locally and from China. Sometimes you will need fast and reliable delivery (like for my 3D printer), but if time is not the problem, you can quite safely order from Banggood or the others. I have hardly ever lost a shipment, but I never lost my money. If you order rubbish, you will get rubbish. If you think you ordered 10 USB cables, but you received only one, you should blame yourself for not reading precisely what you ordered before you paid the price.

Back to the start of this article. The question is: what do you want to achieve if you start your project. Sometimes it is good to know that you can up or downgrade as well. 

Sometimes you can even reach remarkable results without ESPxxxx or Raspberry Pi power, as you can see from a nice little blinking gadget I have built based on a NE555. 

ne555 blink genius at work
ne555 blink genius at work
ne555 blink genius at work bottom battery
ne555 blink genius at work bottom battery

Start the performance comparison

For my own reference, I have started a comparison chart, which I will gladly share with you. Of course, it can be improved by adding more topics, such as price, Mhz numbers, etc. 

esp8266 boards WeMos D1 mini - NodeMCU V2 V2.1 V3 - esp01 - esp01 programmer

esp32 boards ESP32 Dev Kit v1 - TTGO T-Display 1.14 ESP32 - NodeMCU V3 V2 ESP8266 Lolin32 - NodeMCU ESP-32S - WeMos Lolin32 - WeMos Lolin32 mini - ESP32-CAM programmer - ESP32-CAM bundle - ESP32-WROOM-32 - ESP32-S

Arduino's boards AliExpress

Pico boards Official Pi Pico - Official Pi Pico W - Waveshare rp2040-zero - WeAct Studio rp2040

stm32 boards STM32F103C8T6 STM32F401 STM32F411 ST-Link v2 ST-Link v2 official

But, as I said earlier, KISS. This chart shows not only the difference between the various variants of ESP, Raspberry Pi Pico, or even my latest add-on, the STM34F401 Black Pill. Also, it indicates the reliability of the CPU and the surprising difference between the compiler driver settings. 

STM32 STM32F401 STM32F401CCU6 pinout low resolution
STM32 STM32F401 STM32F401CCU6 pinout low resolution

To reach comparable results, the test program needed to be short, with only one function: display the number of iterations after 10 seconds:

#include "Arduino.h"

unsigned long timeNow, it = 0;
unsigned long timeLast = 0;
boolean running = true;

void setup() {
	Serial.begin(115200);
	timeNow = millis() / 1000;
	timeLast = timeNow;
}

void loop() {
	if (!running)
		return;
// Time Range of exact 10 seconds
	if (timeLast + 10 > timeNow) {
		it = it + 1;
	} else {
		Serial.print("Duration: ");
		Serial.print(timeNow);
		Serial.print(" seconds, iterations: ");
		Serial.println(it);
		running = false;
	}
	timeNow = millis() / 1000;
}
Raspberry Pi Pico W pinout
Raspberry Pi Pico W pinout

Here is the comparison table

VariantDriver1st2nd3rd4th5th
ESP8266ESP-011 LED764.978778.337778.324778.335778.407
2 LED778.310778.321778.388778.320778.351
ESP-12EGeneric ESP8266 Module779.078779.067779.185778.984779.149
NodeMCU 1.0 (ESP-12E Module)778.877778.816778.687778.857778.835
ESP8266 D1 MiniLolin D1 Mini777.557777.515777.511777.594777.405
Generic ESP8266 Module778.226778.222778.208778.205778.215
D1 Minin (Clone)777.323777.450777.475777.461777.248
ESP32WROOM-32ESP32 Dev Module7.253.3467.253.3087.253.3677.253.3677.253.372
DOIT ESP32 DEVKIT V17.252.2167.252.2187.252.2157.252.2147.252.220
D1 R32 BoardWEMOS D1 Mini ESP7.252.3257.252.3227.252.3237.252.3247.252.325
ESP32 Dev Module7.253.4167.253.4177.253.4167.253.4167.253.416
ESP32-SESP-CAMAI Thinker ESP32 CAM6.401.0796.401.0836.401.0836.401.0836.401.083
ESP32 Dev Module7.253.6127.253.6127.253.6147.253.6397.253.609
Arduino NanoArduino Nanoold Bootloader243.392243.392243.392243.392243.392
Arduino UnoGEEKCREIT cloneArduino Uno243.392243.392243.392243.392243.392
Arduino Mega 2560no-name cloneArduino Mega 2560233.021233.021233.021233.021233.021
Raspberry Pi RP2040originalRaspberry Pi Pico6.484.7636.484.7706.484.7736.484.7656.484.779
STM32Black Pill STM32F4BlackPill F401CC10.468.84710.468.84710.468.84310.468.81910.468.842

As you can see from the chart, the original Arduino products (Nano, Uno, and Mega2560) all presented identical results after 5 test runs, be it at the slowest rate of all tested boards. 

Comparison microcontroller performance: esp32, esp8266, stm32, Raspberry Pi Pico and Arduino
Comparison microcontroller performance: esp32, esp8266, stm32, Raspberry Pi Pico and Arduino

esp8266 troubleshooting

Ah yes, indeed, you should also consider reliability as well. Sometimes the ESP8266 board refuses to do its job. During my excursions to the world wide web, I found somewhere this message:

Finally, If I replace:

while(!displayAnimate());

with

while(!displayAnimate()) yield();

it works, and it looks better now.

Yielding

This is one of the most critical differences between the ESP8266 and a more classical Arduino microcontroller. The ESP8266 runs a lot of utility functions in the background – keeping WiFi connected, managing the TCP/IP stack, and performing other duties. Blocking these functions from running can cause the ESP8266 to crash and reset itself. To avoid these mysterious resets, avoid long, blocking loops in your sketch.

The amazing creators of the ESP8266 Arduino libraries also implemented a yield() function, which calls on the background functions to allow them to do their things.

Finally

Now it is up to the reader to decide which board will do the planned job. Success! 


Spread the love

Josses

Hi, I'm Jos Wich from Germany. I am very careful when talking about electricity, resistors, capacitors, etc.

4 Responses

  1. Baciu Aurel Florin says:

    Hello. I think that I have a problem with my ESP32’s.

    This is my tests helped by your schetch.

    ESP32
    Duration: 10 seconds, iterations: 1217435
    Duration: 10 seconds, iterations: 1217440
    Duration: 10 seconds, iterations: 1217438

    ESP32 U
    Duration: 10 seconds, iterations: 1213727
    Duration: 10 seconds, iterations: 1213462

    RP2040
    Duration: 10 seconds, iterations: 6484855

    ESP8266MOD
    Duration: 10 seconds, iterations: 1720587
    Duration: 10 seconds, iterations: 1720565

    I had made many tests. The ESP32 score is to small. I dont know why.

  2. JB says:

    Boards are not microcontrollers. Microcontrolles are single chips that contain all the important parts, including CPU, I/O, Flash and RAM. This disqualifies most of the Pi stuff and also anything that includes a PCB. Atmel AT Mega is a Microcontroller, Arduino is a PCB with an AT Mega and some development stuff, Rasperry Pi is a computer with a SoC chip, some DRAM chips and some I/O chips, Flash not included. The Raspberry Pi Rp2040 chip has no built in flash, requiring everyone to buy an extra chip and protect the connection between the chips from noise, accidents and sabotage.
    To me Microcontrollers include products like the 8051 and its clones, the ATR and PIC chips, Padauk PSM, GigaDevice GD32 series, certain NXP chips, the STM and ESP chips etc.

  3. Jos Wich says:

    Hi JB,

    thank you for jumping into this post. I hope you have enjoyed the comparison, still. Any additional comments will help our readers to make the correct decision for themselves, which was my initial intent.

Leave a Reply

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