Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use ESP32 LOLIN S2 Mini: Examples, Pinouts, and Specs

Image of ESP32 LOLIN S2 Mini
Cirkit Designer LogoDesign with ESP32 LOLIN S2 Mini in Cirkit Designer

Introduction

The ESP32 LOLIN S2 Mini is a compact microcontroller board based on the ESP32-S2 chip. It is designed for Internet of Things (IoT) applications, offering built-in Wi-Fi and Bluetooth capabilities. With its small form factor, multiple GPIO pins, and support for various sensors and peripherals, the ESP32 LOLIN S2 Mini is ideal for projects requiring wireless connectivity and efficient processing power.

Explore Projects Built with ESP32 LOLIN S2 Mini

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based LoRa Communication Device with OLED Display
Image of LoRa_Satellite_GS: A project utilizing ESP32 LOLIN S2 Mini in a practical application
This circuit features an ESP32 microcontroller connected to a 0.96" OLED display and a LoRa Ra-02 SX1278 module for wireless communication. The ESP32 facilitates communication with the OLED display via I2C (SDA and SCK lines) and with the LoRa module via SPI (MISO, MOSI, SCK, NSS lines) and GPIO for control signals (DI00, DI01, RST). The circuit is designed for applications requiring wireless data transmission and visual data display.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Powered OLED Display with 18650 Battery
Image of oled: A project utilizing ESP32 LOLIN S2 Mini in a practical application
This circuit features an ESP32 microcontroller powered by a single 18650 battery, which drives a 0.96" OLED display. The ESP32 communicates with the OLED via I2C protocol, using GPIO21 and GPIO22 as SDA and SCL lines, respectively. The purpose of the circuit is to display the message 'Hello, World!' on the OLED screen.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32C3 Supermini-Based Smart Environment Monitor and Lighting Control System
Image of Bedside RGB and Lamp: A project utilizing ESP32 LOLIN S2 Mini in a practical application
This is a smart control system featuring an ESP32C3 Supermini microcontroller for interfacing with various sensors and actuators. It includes temperature and humidity sensing, RGB LED strip control, user input via a pushbutton and rotary encoder, and AC power control through a two-channel relay. The system is powered by an AC source converted to DC by the HLK-PM12 module.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 Mini-Based Smart Timekeeper with OLED Display and Battery Charging
Image of RM Gloves: A project utilizing ESP32 LOLIN S2 Mini in a practical application
This circuit features an ESP32 Mini microcontroller as its core, interfaced with a 0.96" OLED display and a DS3231 Real-Time Clock (RTC) for timekeeping and display purposes. A TP4056 module is used for charging a LiPoly battery, which powers the system through an LM2596 voltage regulator and an AMS1117-3.3 voltage regulator to step down and stabilize the voltage for the ESP32 and peripherals. User inputs are captured through a rotary potentiometer and a red pushbutton, which are connected to the ESP32's GPIOs for control and reset functionality.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with ESP32 LOLIN S2 Mini

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of LoRa_Satellite_GS: A project utilizing ESP32 LOLIN S2 Mini in a practical application
ESP32-Based LoRa Communication Device with OLED Display
This circuit features an ESP32 microcontroller connected to a 0.96" OLED display and a LoRa Ra-02 SX1278 module for wireless communication. The ESP32 facilitates communication with the OLED display via I2C (SDA and SCK lines) and with the LoRa module via SPI (MISO, MOSI, SCK, NSS lines) and GPIO for control signals (DI00, DI01, RST). The circuit is designed for applications requiring wireless data transmission and visual data display.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of oled: A project utilizing ESP32 LOLIN S2 Mini in a practical application
ESP32-Powered OLED Display with 18650 Battery
This circuit features an ESP32 microcontroller powered by a single 18650 battery, which drives a 0.96" OLED display. The ESP32 communicates with the OLED via I2C protocol, using GPIO21 and GPIO22 as SDA and SCL lines, respectively. The purpose of the circuit is to display the message 'Hello, World!' on the OLED screen.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Bedside RGB and Lamp: A project utilizing ESP32 LOLIN S2 Mini in a practical application
ESP32C3 Supermini-Based Smart Environment Monitor and Lighting Control System
This is a smart control system featuring an ESP32C3 Supermini microcontroller for interfacing with various sensors and actuators. It includes temperature and humidity sensing, RGB LED strip control, user input via a pushbutton and rotary encoder, and AC power control through a two-channel relay. The system is powered by an AC source converted to DC by the HLK-PM12 module.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of RM Gloves: A project utilizing ESP32 LOLIN S2 Mini in a practical application
ESP32 Mini-Based Smart Timekeeper with OLED Display and Battery Charging
This circuit features an ESP32 Mini microcontroller as its core, interfaced with a 0.96" OLED display and a DS3231 Real-Time Clock (RTC) for timekeeping and display purposes. A TP4056 module is used for charging a LiPoly battery, which powers the system through an LM2596 voltage regulator and an AMS1117-3.3 voltage regulator to step down and stabilize the voltage for the ESP32 and peripherals. User inputs are captured through a rotary potentiometer and a red pushbutton, which are connected to the ESP32's GPIOs for control and reset functionality.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • IoT devices and smart home automation
  • Wireless sensor networks
  • Wearable devices
  • Data logging and remote monitoring
  • Prototyping and educational projects

Technical Specifications

Key Technical Details

  • Microcontroller: ESP32-S2 (Xtensa® 32-bit LX7 single-core processor)
  • Clock Speed: Up to 240 MHz
  • Flash Memory: 4 MB
  • SRAM: 320 KB
  • Wi-Fi: IEEE 802.11 b/g/n (2.4 GHz)
  • Bluetooth: Not supported (ESP32-S2 does not include Bluetooth)
  • Operating Voltage: 3.3V
  • Input Voltage: 5V (via USB-C)
  • GPIO Pins: 27 (including ADC, DAC, I2C, SPI, UART, PWM)
  • USB Interface: USB-C
  • Dimensions: 44.5 mm x 25.5 mm

Pin Configuration and Descriptions

The ESP32 LOLIN S2 Mini features a total of 27 GPIO pins, which can be configured for various functions. Below is the pinout description:

Pin Name Function
1 3V3 3.3V power output
2 GND Ground
3 GPIO0 General-purpose I/O, boot mode selection
4 GPIO1 General-purpose I/O, UART TX
5 GPIO2 General-purpose I/O, ADC, PWM
6 GPIO3 General-purpose I/O, UART RX
7 GPIO4 General-purpose I/O, ADC, PWM
8 GPIO5 General-purpose I/O, ADC, PWM
9 GPIO6 General-purpose I/O, SPI CLK
10 GPIO7 General-purpose I/O, SPI MISO
11 GPIO8 General-purpose I/O, SPI MOSI
12 GPIO9 General-purpose I/O, SPI CS
13 GPIO10 General-purpose I/O, ADC, PWM
14 GPIO11 General-purpose I/O, ADC, PWM
15 GPIO12 General-purpose I/O, ADC, PWM
16 GPIO13 General-purpose I/O, ADC, PWM
17 GPIO14 General-purpose I/O, ADC, PWM
18 GPIO15 General-purpose I/O, ADC, PWM
19 GPIO16 General-purpose I/O, ADC, PWM
20 GPIO17 General-purpose I/O, ADC, PWM
21 GPIO18 General-purpose I/O, ADC, PWM
22 GPIO19 General-purpose I/O, ADC, PWM
23 GPIO20 General-purpose I/O, ADC, PWM
24 GPIO21 General-purpose I/O, ADC, PWM
25 GPIO22 General-purpose I/O, ADC, PWM
26 GPIO23 General-purpose I/O, ADC, PWM
27 GPIO24 General-purpose I/O, ADC, PWM

Usage Instructions

How to Use the ESP32 LOLIN S2 Mini in a Circuit

  1. Powering the Board:

    • Use a USB-C cable to connect the board to a computer or a 5V power source.
    • Ensure the power source provides sufficient current (at least 500 mA).
  2. Programming the Board:

    • Install the Arduino IDE or ESP-IDF (Espressif IoT Development Framework).
    • Add the ESP32 board manager URL to the Arduino IDE:
      https://dl.espressif.com/dl/package_esp32_index.json.
    • Select "LOLIN S2 Mini" from the board options and upload your code.
  3. Connecting Peripherals:

    • Use the GPIO pins to connect sensors, actuators, or other peripherals.
    • Ensure the voltage levels of connected devices are compatible with the 3.3V logic of the ESP32.
  4. Wi-Fi Configuration:

    • Use the built-in Wi-Fi module to connect to a network.
    • Example code for connecting to Wi-Fi is provided below.

Important Considerations and Best Practices

  • Avoid supplying voltages higher than 3.3V to the GPIO pins to prevent damage.
  • Use level shifters if interfacing with 5V devices.
  • Ensure proper grounding when connecting external components.
  • Use decoupling capacitors for stable operation in noisy environments.

Example Code: Connecting to Wi-Fi

#include <WiFi.h>

// Replace with your network credentials
const char* ssid = "Your_SSID";
const char* password = "Your_PASSWORD";

void setup() {
  Serial.begin(115200); // Initialize serial communication at 115200 baud
  WiFi.begin(ssid, password); // Start Wi-Fi connection

  Serial.print("Connecting to Wi-Fi");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500); // Wait for connection
    Serial.print(".");
  }
  Serial.println("\nConnected to Wi-Fi!");
  Serial.print("IP Address: ");
  Serial.println(WiFi.localIP()); // Print the assigned IP address
}

void loop() {
  // Add your main code here
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. The board is not detected by the computer:

    • Ensure the USB-C cable supports data transfer (not just charging).
    • Install the necessary USB drivers for the ESP32-S2.
  2. Wi-Fi connection fails:

    • Double-check the SSID and password in your code.
    • Ensure the Wi-Fi network is within range and not using unsupported security protocols.
  3. GPIO pins not working as expected:

    • Verify the pin configuration in your code.
    • Check for short circuits or incorrect wiring.
  4. Code upload fails:

    • Ensure the correct board and port are selected in the Arduino IDE.
    • Press and hold the BOOT button while uploading the code.

FAQs

  • Can I use the ESP32 LOLIN S2 Mini with 5V sensors?
    No, the GPIO pins operate at 3.3V logic. Use a level shifter for 5V sensors.

  • Does the ESP32 LOLIN S2 Mini support Bluetooth?
    No, the ESP32-S2 chip does not include Bluetooth functionality.

  • What is the maximum current output of the 3V3 pin?
    The 3V3 pin can supply up to 500 mA, depending on the power source.

  • Can I use the ESP32 LOLIN S2 Mini for battery-powered projects?
    Yes, but you will need an external battery management circuit as the board does not include one.