LOLIN S2 Mini: Your Pocket-Sized ESP32 Powerhouse
A compact and versatile development board featuring the ESP32-S2, perfect for Wi-Fi enabled IoT projects.
The LOLIN S2 Mini is a compact development board designed around the Espressif ESP32-S2 Xtensa LX7 microcontroller. This chip is a single-core variant of the popular ESP32, focusing on Wi-Fi connectivity and a more robust security feature set, while omitting Bluetooth. The S2 Mini is an evolution in the ESP32 family, offering a streamlined yet powerful platform for makers and developers who need reliable Wi-Fi communication without the complexity of Bluetooth.
At its heart, the ESP32-S2 features a single Xtensa LX7 core running at up to 240 MHz, providing ample processing power for a wide range of applications. It boasts integrated Wi-Fi 802.11 b/g/n connectivity, enabling easy connection to local networks and the internet. Unlike its ESP32 predecessors, the ESP32-S2 does not include a Bluetooth radio, which simplifies its design and potentially reduces power consumption for Wi-Fi-only applications. It also incorporates several security enhancements, including a secure boot and flash encryption.
The LOLIN S2 Mini distinguishes itself with its small form factor, making it ideal for projects where space is a constraint, such as wearables, portable sensors, or embedded controllers. It typically includes a USB-C connector for power and programming, an onboard LED, and a reset button, simplifying the development process. The board is well-suited for hobbyists and students exploring IoT, embedded systems, and wireless communication, as well as engineers prototyping Wi-Fi-centric devices.
Released around 2021, the LOLIN S2 Mini arrived as Espressif expanded its ESP32 offerings to cater to specific use cases. The ESP32-S2 was designed to provide a cost-effective and secure Wi-Fi solution, and boards like the S2 Mini make this chip accessible to the maker community. Its straightforward pinout and compatibility with popular development environments make it a compelling choice for projects ranging from simple sensor nodes to more complex control systems.
Watch
Related video, embedded from YouTube.
Specifications
| Microcontroller / SoC | Espressif ESP32-S2FN4R2 |
| Architecture | Xtensa LX7 Single-Core |
| Clock speed | Up to 240 MHz |
| Flash / Storage | 4 MB |
| RAM / SRAM | 512 KB SRAM |
| Operating voltage | 3.3V |
| Digital I/O pins | 14 (configurable) |
| Analog / ADC | 20 (12-bit) |
| PWM | Yes (configurable on most GPIOs) |
| Connectivity | Wi-Fi 802.11 b/g/n |
| USB | USB-C (for power and programming) |
| Power input | 5V via USB-C or 3.3V pin |
| Dimensions | Approx. 34.2mm x 25.6mm |
Pinout & pin functions
| Pin | Function |
|---|---|
| 3V3 | 3.3V Power Output |
| GND | Ground |
| EN | Enable/Reset Pin |
| IO0 | Boot Mode Selection (Low on boot to enter download mode) |
| IO1 | UART TX (Default) |
| IO2 | UART RX (Default) |
| IO3 | ADC1_CH0 |
| IO4 | ADC1_CH1 |
| IO5 | SPI MOSI (Default) |
| IO6 | SPI SCK (Default) |
| IO7 | SPI MISO (Default) |
| IO8 | SPI CS (Default) |
| IO9 | ADC1_CH2 |
| IO10 | ADC1_CH3 |
| IO11 | ADC1_CH4 |
| IO12 | ADC1_CH5 |
| IO13 | ADC1_CH6 |
| IO14 | ADC1_CH7 |
| IO15 | ADC1_CH8 |
| IO16 | ADC1_CH9 |
| IO17 | ADC1_CH10 |
| IO18 | ADC1_CH11 |
| IO19 | I2C SDA (Default) |
| IO20 | I2C SCL (Default) |
| IO21 | GPIO |
| IO26 | GPIO |
| IO33 | GPIO |
| IO34 | GPIO |
| IO35 | GPIO |
| IO36 | GPIO |
| IO37 | GPIO |
| IO38 | GPIO |
| IO39 | GPIO |
Wiring & circuit basics
Powering the LOLIN S2 Mini is straightforward, primarily done via its USB-C port, which supplies 5V. The board has an onboard voltage regulator to step this down to the 3.3V required by the ESP32-S2 chip and its peripherals. You can also power the board by supplying 3.3V directly to the 3V3 pin, but ensure it is a stable 3.3V source. Avoid applying more than 3.3V to the 3V3 pin or more than 5V to the USB-C port, as this can damage the board.
All GPIO pins on the LOLIN S2 Mini operate at 3.3V logic levels. This is crucial when interfacing with external components. Connecting a 5V device directly to a GPIO pin can cause damage. If you need to interface with 5V components, use a logic level shifter. For example, when connecting an LED, always use a current-limiting resistor (typically 220-330 ohms) in series with the LED to protect both the LED and the GPIO pin. Connect the anode of the LED to a GPIO pin and the cathode to the resistor, then to GND.
For a typical I2C sensor, you would connect its VCC to the 3V3 pin on the S2 Mini, its GND to a GND pin, its SDA line to IO19, and its SCL line to IO20. These are the default I2C pins for the ESP32-S2. Ensure your sensor is also a 3.3V device or use a level shifter if it's a 5V sensor. The ESP32-S2's internal pull-up resistors can often be enabled in software for I2C communication, but some sensors may require external pull-up resistors (e.g., 4.7k Ohm) to 3.3V.
Programming & getting started
The LOLIN S2 Mini is highly compatible with the Arduino IDE, making it accessible for beginners. After installing the ESP32 board support package in the Arduino IDE, you can select the 'LOLIN S2 Mini' board and upload code directly via the USB-C connection. MicroPython and CircuitPython are also excellent choices, offering a Python-based programming environment that is great for rapid prototyping and learning. For more advanced users, the Espressif IoT Development Framework (ESP-IDF) provides a comprehensive C/C++ SDK for maximum control and performance.
To get started with the Arduino IDE, first ensure you have the ESP32 board support installed. Go to File > Preferences, add `https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json` to the Additional Boards Manager URLs. Then, go to Tools > Board > Boards Manager, search for 'esp32', and install it. Connect your LOLIN S2 Mini via USB-C. Select the correct board ('LOLIN S2 Mini') and COM port from the Tools menu. Write a simple sketch, like the 'Blink' example, and click the Upload button.