Which Microcontroller Is Right for You?

A microcontroller is an integrated circuit that can be programmed to perform tasks independently of other devices. The Raspberry Pi Pico and the ESP32 are two of the most popular microcontrollers on the market. They are two small, low-power microcontrollers built on 32-bit dual-core CPUs that can be used to control electronics projects.

There are quite a few differences between these two devices that may interest you if you are in the market for a new microcontroller board. Among other things, let’s compare the cost, processing power, hardware, and connectivity features of each board.

Raspberry Pi Pico Overview

The Raspberry Pi Pico is the first microcontroller board from the Raspberry Pi Foundation and is based on the RP2040 chip. It is not a full-fledged computer like the company’s previous offerings but a tiny microcontroller board similar to the Arduino.

It comes with a dual-core ARM cortex M0+ processor, 264 on-chip static random-access memory, 26 multifunction GPIO pins, a temperature sensor and an on-chip clock.

ESP32 Overview

Designed by Espressif Systems, the ESP32 is the successor to the ESP8266 microcontroller and offers a number of improvements over it. These include a faster processor, faster Wi-Fi, Bluetooth connectivity, more GPIO pins, and several other features.

The ESP32 has quickly emerged as a community favorite due to its low cost, low energy consumption, and wireless connectivity features, making it suitable for Internet of Things (IoT) projects.

Price: Which Board Offers the Most Value?

Generally, the Raspberry Pi Pico is not subject to the same supply constraints as the other Raspberry Pis, and you’re likely to find it in stock from approved resellers at official prices. So, the recent Raspberry Pi shortage isn’t really a factor here.

Depending on where you’re buying from, you can generally find both boards for sale at more or less the same price. However, the connectivity features included in the ESP32 make it a better bargain for the same price. You can opt for the Pico W, but that’s at least two dollars more expensive than the normal version.

Processing Power

The ESP32 has a slightly more powerful processor, with a clock speed of up to 240 MHz, compared to the Raspberry Pi Pico’s maximum clock speed of 133 MHz. The ESP32 has a faster instruction rate than the RP2040 chip in the Pico.

Both microcontroller boards have dual-core CPUs and are capable of running more than one process at a time. However, tasks run on the ESP32 should be completed faster than the Raspberry Pi Pico, all other things being equal.

Networking and Connectivity

The ESP32 includes both Bluetooth and Wi-Fi connectivity which the Raspberry Pi Pico lacks.

If you want to connect your device to other devices wirelessly, then the ESP32 is a better choice because it lets you connect with other wireless devices.

Another option is the Raspberry Pi Pico W which was launched in June 2022. It comes with onboard Wi-Fi and a $2 extra price tag, but it does not include Bluetooth functionality.

Hardware Features Compared

Raspberry Pi PicoESP32
ProcessorArm Cortex-M0+ dual-coreTensilica Xtensa LX6 32 bit dual-core
Clock Speed133MHz80/160/240MHz
Operating Voltage1.8-5.5V DC2.2-3.6V
Operating Temperature-20 °C to +85 °C–40 °C to +125 °C
External Flash Support16MB16MB
RTC MemoryNot specified16KB
BluetoothNoBluetooth 4.2, BLE
EthernetNo10/100 Mbps
Other Interfaces2 × UART, 2 × I2C, 2 × SPI, 16 × PWM channels2 × I2S, 2 × I2C, 3 × UART, 4 × SPI, 16 × PWM channels
SensorsTemperatureTouch, Temperature, Hall Effect
GPIO26, plus 3 analogue pins34 programmable pins
Native USB SupportUSB 1.1 (Device or Host)No
Dimensions21 mm × 51 mm

Power Consumption

Both boards have advanced power-saving technologies that allow them to minimize power consumption. The ESP32 however has a faster processor and more flash memory which results in more power draw.

According to the datasheet, the Raspberry Pi Pico consumes about 91mA during the popcorn test (VGA video, SD card and I2S audio) with power-saving disabled. The Raspberry Pi Pico also allows you a bit more flexibility in choosing your power supply. It provides two low-power modes, dormant mode and sleep mode. The dormant mode uses even less power but requires an external trigger to wake.

The ESP32 has six power modes: active, modem-sleep, light-sleep, deep-sleep, hibernation and power-off. The active mode has all features running concurrently and can consume as much as 240mA of current at a time. The hibernation mode however has been found to consume as little as 5 µA. The ESP32 board can be woken up from any state with the onboard RTC timer.

Due to its lower power consumption in active modes, the Raspberry Pi Pico is therefore more suitable for simple, low-power projects that will be powered from a battery pack.

Supported Programming Languages

There are several development environments available for both microcontroller boards, including MicroPython, C, and C++. Regardless of your language of choice, there’s likely to be an interpreter for Pico or ESP32 that supports it. There is even a JavaScript interpreter for the ESP32.

You can use either MicroPython or C++ for creating small projects on the ESP32. For large, complex projects, it is recommended that you use the ESP-IDF (Espressif IoT Development Framework) through the Visual Code extension or the Eclipse plugin. Programming on the Raspberry Pi Pico is as easy as drag-and-drop since the device shows up as mass storage when connected to a PC through USB.

There’s no competition here as both boards have a wide range of supported languages, and you can get pretty much anything done as long as you are not afraid to dig around a bit.

Programmable I/O

Programmable I/O or PIO, for short, allows you to add extra communication interfaces and even create new interfaces. This feature is completely absent in the ESP32 and can be a sticking point especially if you are an advanced hardware hacker who needs to connect to legacy hardware. Programmable I/O is an incredibly powerful feature, and you should consider opting for the Raspberry Pi Pico if you need it in your projects.

Which One Should You Buy?

The Raspberry Pi Pico is a great board for those who have never used one before and are looking to get started with microcontrollers. Also, if you’re already in the Raspberry Pi ecosystem, then the Raspberry Pi Pico might be a better option just to fit the motif.

The ESP32 is a powerful device in its own right and may better suit users who need connectivity but do not want to spend the extra cash on a Pico W. There can be a bit of a steep learning curve to the ESP32 but nothing too overwhelming for savvy users.

[quads id=2]
Read the full article here

Leave a Reply

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

Back to top button