📌 26 de Março, 2024

ESP32-S2 Mini: Review and ESPHome Notes

ARM / Single Board Computer · Informática · Programação

📌 26 de Março, 2024

ESP32-S2 Mini: Review and ESPHome Notes

ARM / Single Board Computer · Informática · Programação

During my search for a small and cheap ESP32 board to use with ESPHome IoT projects, I stumbled upon the amazing ESP32-S2 Mini. This board is the compact and low budget option I was looking for, and while it is available on AliExpress from various sellers, there are a few details to consider.

Hardware Features

The ESP32-S2 Mini boards (aka WEMOS LOLIN S2 Mini) are based on the ESP32-S2FN4R2 that runs at 240Mhz and come with an impressive 27 IO pins and 4MB of flash on a 34.3 x 25.4mm purple PCB. The full details, including schematics, can be found here and here.

A full resolution poster with the detailed board pinout is also available here.

Flashing with ESPHome

Unlike most ESP32 boards this one doesn’t usually come with a bootloader pre-flashed so you’ll have to do it yourself. The first flash is the trickiest and it must be done using a USB cable. Later on you may upgrade the firmware over Wi-Fi.

ESP32 boards can usually be flashed with ESPHome at web.esphome.io, however, in this case it fails due to a bug in esptool-js described here. Fortunately we can get around this with the official ESP32 flashing tool and the generic firmware image:

To start the process place the board in “download mode”:

  1. Connect the board to your computer;
  2. Hold the button labeled as 0 (don’t release it);
  3. Press the RST button for about a second and release it;
  4. Now release the 0 button.

After the last sequence a new serial port will appear in your computer. Now launch the tool and flash the board with esphome-web-esp32s2.bin at the address 0x0 and with DoNotChgBin checked:

After the flashing is complete power cycle the board and you’ll find the usual ESPHome Wi-Fi hotspot.

ESPHome Configuration

Your ESPHome yaml file for this board should look like this:

  board: lolin_s2_mini
  variant: ESP32S2
    type: arduino

This board usually run hot and disabling logging, web server etc. will help but won’t fix the issue completely. You may also lower the CPU clock and disable USB CDC:

  # ...
    board_build.f_cpu = 160000000L # 160 Mhz instead of the default 240 Mhz.

Here’s an example of this board running the Bosch BME680 sensor and publishing environmental information to Home Assistant:

Board Revisions

Be aware that there are different versions of the board on AliExpress and some have a design issue that causes random reboots when the Wi-Fi is in use. Here is an analysis by vettel:

I bought dozens of those boards and the only reliable store seems to be this one as most sellers seem to ship mixed batches boards and you never know what you’ll get.

Closing Remarks

I consider this to be a good ESP32 board when a lot of I/O and a fast chip is required. It may be a very good modern replacement for Arduino Mega boards as well.

However, if you’re looking for a small board to run a single sensor or a relay with ESPHome then the ESP32-C3 Super Mini (seller here) is most likely a better option as it can be flashed much faster with web.esphome.io from any browser.

All files linked in this article are mirrored here for future reference and preservation.