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 specifically designed for IoT (Internet of Things) applications, offering built-in Wi-Fi and Bluetooth capabilities. This board is ideal for projects requiring wireless connectivity, low power consumption, and support for multiple sensors and peripherals. Its small form factor makes it suitable for space-constrained applications.

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

  • Smart home devices (e.g., smart lights, thermostats)
  • IoT sensor nodes
  • Wearable devices
  • Wireless data logging
  • Prototyping and development of Wi-Fi-enabled projects
  • Automation and robotics

Technical Specifications

The ESP32 LOLIN S2 Mini is packed with features that make it versatile and powerful for a wide range of applications. Below are its key technical specifications:

Specification Details
Microcontroller ESP32-S2 (Xtensa® 32-bit LX7 single-core processor)
Clock Speed Up to 240 MHz
Flash Memory 4 MB SPI Flash
RAM 320 KB SRAM + 128 KB ROM
Wi-Fi IEEE 802.11 b/g/n (2.4 GHz)
Bluetooth Not supported (ESP32-S2 does not include Bluetooth functionality)
GPIO Pins 27 GPIO pins (multiplexed with other functions)
USB Interface USB Type-C (native USB support for programming and communication)
Operating Voltage 3.3V
Input Voltage Range 5V (via USB)
Power Consumption Ultra-low power consumption in deep sleep mode
Dimensions 44.5 mm x 25.5 mm

Pin Configuration and Descriptions

The ESP32 LOLIN S2 Mini features a variety of pins for different functionalities. Below is the pinout description:

Pin Function Description
3V3 Power 3.3V output for powering external components
GND Ground Ground connection
GPIO0 Boot Mode / General Purpose I/O Used for entering bootloader mode during programming
GPIO1 UART TX Transmit pin for UART communication
GPIO2 UART RX Receive pin for UART communication
GPIO12 ADC / General Purpose I/O Analog-to-Digital Converter or digital I/O
GPIO13 PWM / General Purpose I/O Pulse Width Modulation or digital I/O
GPIO21 I2C SDA Data line for I2C communication
GPIO22 I2C SCL Clock line for I2C communication
GPIO23 SPI MOSI Master Out Slave In for SPI communication
GPIO19 SPI MISO Master In Slave Out for SPI communication
GPIO18 SPI SCK Clock line for SPI communication
EN Enable Resets the microcontroller when pulled low

Usage Instructions

How to Use the ESP32 LOLIN S2 Mini in a Circuit

  1. Powering the Board:

    • Connect the board to a USB power source using a USB Type-C cable.
    • Alternatively, supply 3.3V to the 3V3 pin and connect GND to ground.
  2. Programming the Board:

    • Install the ESP32 board package in the Arduino IDE or use the ESP-IDF (Espressif IoT Development Framework).
    • Connect the board to your computer via USB.
    • Select the correct board (e.g., "ESP32-S2 Dev Module") and port in the Arduino IDE.
    • Write your code and upload it to the board.
  3. Connecting Peripherals:

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

    • The ESP32 LOLIN S2 Mini supports Wi-Fi for wireless communication.
    • Use the WiFi library in the Arduino IDE to connect to a network and send/receive data.

Example Code: Blinking an LED

The following example demonstrates how to blink an LED connected to GPIO13:

// Define the GPIO pin for the LED
const int ledPin = 13;

void setup() {
  // Initialize the LED pin as an output
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // Turn the LED on
  digitalWrite(ledPin, HIGH);
  delay(1000); // Wait for 1 second

  // Turn the LED off
  digitalWrite(ledPin, LOW);
  delay(1000); // Wait for 1 second
}

Important Considerations and Best Practices

  • Voltage Levels: Ensure that all connected peripherals operate at 3.3V logic levels to avoid damaging the board.
  • Boot Mode: To enter bootloader mode, hold down the BOOT button while pressing the RESET button.
  • Deep Sleep Mode: Use deep sleep mode to minimize power consumption in battery-powered applications.
  • USB Cable Quality: Use a high-quality USB Type-C cable for reliable programming and data transfer.

Troubleshooting and FAQs

Common Issues and Solutions

  1. The board is not detected by the computer:

    • Ensure that the USB cable supports data transfer (not just charging).
    • Check if the correct drivers for the ESP32-S2 are installed on your computer.
  2. Upload fails with a timeout error:

    • Ensure the board is in bootloader mode by holding the BOOT button during upload.
    • Verify that the correct board and port are selected in the Arduino IDE.
  3. Wi-Fi connection issues:

    • Double-check the SSID and password in your code.
    • Ensure the Wi-Fi network operates on the 2.4 GHz band (the ESP32-S2 does not support 5 GHz).
  4. Peripherals not working as expected:

    • Verify the wiring and connections.
    • Check that the GPIO pins used in your code match the physical connections.

FAQs

Q: Can I use the ESP32 LOLIN S2 Mini with a 5V sensor?
A: No, the ESP32-S2 operates at 3.3V logic levels. Use a level shifter to interface with 5V sensors.

Q: Does the ESP32 LOLIN S2 Mini support Bluetooth?
A: No, the ESP32-S2 chip does not include Bluetooth functionality. For Bluetooth, consider using an ESP32 board with dual-core support.

Q: How do I reset the board?
A: Press the RESET button on the board to perform a soft reset.

Q: Can I power the board with a battery?
A: Yes, you can use a 3.7V LiPo battery with a suitable voltage regulator to supply 3.3V to the board.