MakerLab
ESP32LOLIN S2 Mini

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.

LOLIN S2 Mini

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 / SoCEspressif ESP32-S2FN4R2
ArchitectureXtensa LX7 Single-Core
Clock speedUp to 240 MHz
Flash / Storage4 MB
RAM / SRAM512 KB SRAM
Operating voltage3.3V
Digital I/O pins14 (configurable)
Analog / ADC20 (12-bit)
PWMYes (configurable on most GPIOs)
ConnectivityWi-Fi 802.11 b/g/n
USBUSB-C (for power and programming)
Power input5V via USB-C or 3.3V pin
DimensionsApprox. 34.2mm x 25.6mm

Pinout & pin functions

PinFunction
3V33.3V Power Output
GNDGround
ENEnable/Reset Pin
IO0Boot Mode Selection (Low on boot to enter download mode)
IO1UART TX (Default)
IO2UART RX (Default)
IO3ADC1_CH0
IO4ADC1_CH1
IO5SPI MOSI (Default)
IO6SPI SCK (Default)
IO7SPI MISO (Default)
IO8SPI CS (Default)
IO9ADC1_CH2
IO10ADC1_CH3
IO11ADC1_CH4
IO12ADC1_CH5
IO13ADC1_CH6
IO14ADC1_CH7
IO15ADC1_CH8
IO16ADC1_CH9
IO17ADC1_CH10
IO18ADC1_CH11
IO19I2C SDA (Default)
IO20I2C SCL (Default)
IO21GPIO
IO26GPIO
IO33GPIO
IO34GPIO
IO35GPIO
IO36GPIO
IO37GPIO
IO38GPIO
IO39GPIO

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.

Project ideas

Wi-Fi Connected Weather StationMonitor temperature, humidity, and pressure using sensors like the BME280, and send the data wirelessly to a web server or cloud service. This project utilizes I2C for sensor communication and Wi-Fi for data transmission, teaching about IoT data logging.
Smart Home LED ControllerControl an RGB LED strip or individual LEDs over Wi-Fi using a web interface or a mobile app. This project involves PWM for LED brightness control and Wi-Fi for remote access, demonstrating wireless control applications.
ESP32-S2 Based Web ServerHost a simple web server directly on the LOLIN S2 Mini to display sensor readings or control outputs. This project leverages the board's Wi-Fi capabilities and web server libraries, teaching fundamental web server concepts on microcontrollers.
Wireless Sensor Network NodeCreate a distributed network of S2 Mini boards to collect data from various locations and report back to a central hub. This project focuses on Wi-Fi networking and inter-device communication, suitable for environmental monitoring or asset tracking.
USB HID Keyboard/MouseUtilize the ESP32-S2's native USB capabilities to act as a Human Interface Device (HID). This allows the S2 Mini to send keyboard presses or mouse movements to a connected computer, opening up possibilities for custom input devices and automation.
MQTT Data LoggerCollect data from various sensors and publish it to an MQTT broker for centralized data management. This project involves sensor interfacing (ADC, I2C, SPI) and network communication protocols, ideal for building robust IoT data pipelines.

Buying tips & gotchas

When purchasing the LOLIN S2 Mini, be aware of potential clones or boards with slightly different pinouts or component versions; always refer to the specific product page for accurate pin descriptions. Ensure you have a reliable USB-C cable, as a poor connection can lead to upload failures. For debugging, consider using the onboard LED or adding a serial console output. Accessories like small breadboards, jumper wires, and basic sensors (DHT11/22, BME280, basic buttons, LEDs) are excellent companions for getting started. Remember that the S2 Mini is a 3.3V device, so always check the voltage requirements of any external components you connect.