MakerLab
ESP32M5Stack Core2

M5Stack Core2: Your All-in-One ESP32 Development Powerhouse

The M5Stack Core2 is a compact, feature-rich development board built around the ESP32, offering a touchscreen, built-in battery, and extensive I/O for rapid prototyping.

M5Stack Core2

The M5Stack Core2 is a highly integrated development board designed for rapid prototyping and embedded projects. It's part of the M5Stack ecosystem, which focuses on modularity and ease of use. This board distinguishes itself with a vibrant capacitive touchscreen display and a robust set of built-in peripherals, making it a powerful platform for interactive applications without requiring extensive external components.

At its heart, the M5Stack Core2 features the Espressif ESP32-D0WDQ6 microcontroller. This dual-core Tensilica LX6 processor running at up to 240 MHz provides ample processing power for complex tasks, including Wi-Fi and Bluetooth connectivity, which are integral to the ESP32's design. The ESP32 is known for its low power consumption and integrated RF capabilities, making it ideal for IoT and connected projects.

Compared to its predecessor, the original M5Stack (which used an ESP32-WROVER module), the Core2 offers significant upgrades. It boasts a higher-resolution capacitive touchscreen (compared to the resistive screen on some earlier M5Stack models), a more powerful onboard power management IC, and improved audio capabilities with a built-in speaker and vibration motor. This makes it particularly well-suited for makers who need a self-contained, interactive device for user interfaces, data logging, or portable gadget development.

The M5Stack Core2 is an excellent choice for hobbyists, students, and professional engineers looking for a fast development cycle. Its integrated display, battery, and sensors, combined with the ESP32's Wi-Fi and Bluetooth, allow for quick iteration on projects ranging from smart home devices and wearable tech to educational tools and interactive art installations. The M5Stack ecosystem also provides a wide array of compatible add-on modules (Units) that can be easily connected via the Grove or Pogo Pin interfaces.

Watch

Related video, embedded from YouTube.

Specifications

Microcontroller / SoCESP32-D0WDQ6
ArchitectureDual-core Tensilica LX6
Clock speedUp to 240 MHz
Flash / Storage16 MB
RAM / SRAM8 MB PSRAM + 520 KB SRAM
Operating voltage3.3V
Digital I/O pins26 (exposed via Pogo Pins and internal headers)
Analog / ADC12-bit ADC (multiple channels available via GPIO)
PWMSupported on most GPIO pins
ConnectivityWi-Fi 802.11 b/g/n, Bluetooth v4.2 BR/EDR and BLE
USBUSB Type-C (for power and programming)
Power input5V via USB Type-C, 3.7V Lithium Polymer Battery (integrated)
Dimensions54 x 54 x 14 mm

Pinout & pin functions

PinFunction
3V3Power output (3.3V)
GNDGround
IO0General Purpose Input/Output, Boot button
IO2General Purpose Input/Output, ADC1_CH3
IO4General Purpose Input/Output
IO5General Purpose Input/Output, SPI2_CS
IO12General Purpose Input/Output, SPI2_MISO, ADC1_CH5
IO13General Purpose Input/Output, SPI2_MOSI, ADC1_CH4
IO14General Purpose Input/Output, SPI2_SCK
IO15General Purpose Input/Output, ADC1_CH6
IO16General Purpose Input/Output, UART2_RX
IO17General Purpose Input/Output, UART2_TX
IO18General Purpose Input/Output, SPI3_CS
IO19General Purpose Input/Output, SPI3_MISO, ADC1_CH8
IO21General Purpose Input/Output, I2C SDA
IO22General Purpose Input/Output, I2C SCL
IO23General Purpose Input/Output, SPI3_MOSI, ADC1_CH9
IO25General Purpose Input/Output, DAC_1, ADC1_CH10
IO26General Purpose Input/Output, DAC_2, ADC1_CH11
IO27General Purpose Input/Output, ADC1_CH7
IO32General Purpose Input/Output, ADC1_CH4
IO33General Purpose Input/Output, ADC1_CH2
POGO APogo Pin Interface (GPIO accessible)
POGO BPogo Pin Interface (GPIO accessible)
POGO CPogo Pin Interface (GPIO accessible)
POGO DPogo Pin Interface (GPIO accessible)

Wiring & circuit basics

The M5Stack Core2 operates at a 3.3V logic level. Connecting 5V devices directly to its GPIO pins can cause permanent damage. Always use a level shifter if you need to interface with 5V components. The board is powered via its USB Type-C port, which can supply 5V. It also has an integrated 3.7V Lithium Polymer battery for portable operation. The onboard power management IC handles charging and power distribution.

For basic output, you can connect an LED to a GPIO pin. For example, connect an LED's anode (longer leg) to GPIO26 and its cathode (shorter leg) through a current-limiting resistor (typically 220-330 ohms) to GND. This ensures the LED doesn't draw too much current from the GPIO pin. When the GPIO pin is set HIGH (3.3V), current flows through the resistor and LED, illuminating it.

For sensors, the I2C interface is commonly used. The M5Stack Core2 exposes I2C on GPIO21 (SDA) and GPIO22 (SCL). To connect an I2C sensor, connect its VCC pin to 3.3V, GND to GND, SDA to GPIO21, and SCL to GPIO22. Ensure the sensor also operates at 3.3V or has appropriate level shifting. Always check the sensor's datasheet for specific wiring and voltage requirements.

Programming & getting started

The M5Stack Core2 can be programmed using various popular environments. The Arduino IDE is a common choice, offering a vast library of examples and community support. You'll need to install the ESP32 board support package within the Arduino IDE. MicroPython and CircuitPython are also excellent options for rapid development, providing a Python-based programming experience. For more advanced control and bare-metal programming, Espressif's ESP-IDF framework or PlatformIO IDE can be used.

To upload your first program using the Arduino IDE: 1. Install the ESP32 board support package. 2. Select the correct board (M5Stack-Core2) and COM port. 3. Write your code (e.g., a simple sketch to blink the onboard LED or display text on the screen). 4. Connect the M5Stack Core2 via USB. 5. Click the 'Upload' button. The board will typically enter bootloader mode automatically, or you may need to press the 'BOOT' button while clicking upload.

Project ideas

Smart Weather StationDisplay real-time weather data fetched via Wi-Fi onto the touchscreen. Uses Wi-Fi, I2C for a sensor like the BME280, and the display. Learns about IoT data retrieval and display management.
Interactive Game ControllerUse the touchscreen and buttons to create a custom game controller for a PC or Raspberry Pi via Bluetooth. Uses Bluetooth, GPIO for buttons, and touchscreen input. Teaches wireless communication and user input handling.
Portable Data LoggerLog sensor readings (e.g., temperature, humidity, light) to an SD card or cloud service. Uses Wi-Fi, an SD card module (via SPI), and GPIO for sensors. Explores data storage and cloud integration.
Voice Assistant InterfaceDevelop a simple interface for a voice assistant service, displaying status and commands on the screen. Uses Wi-Fi and the touchscreen. Introduces working with web APIs and asynchronous operations.
Customizable Alarm ClockCreate a smart alarm clock with multiple alarms, weather display, and snooze functionality. Uses Wi-Fi, the RTC (Real-Time Clock) if available or NTP, and the display. Covers timekeeping, user interface design, and network synchronization.
Gesture-Controlled RobotControl a robot (e.g., a simple line-following robot with M5GO Bottom) using gestures detected on the touchscreen. Uses the touchscreen for gesture recognition and communicates via Bluetooth or UART to the robot. Teaches sensor fusion and wireless control.

Buying tips & gotchas

When purchasing, ensure you are buying the M5Stack Core2 (model number C001-2). Be wary of older M5Stack models or clones that may lack the capacitive touchscreen or have different specifications. For power, use a reliable USB power supply capable of at least 1A, especially when using Wi-Fi. The M5Stack ecosystem offers many compatible 'Units' (add-on modules) and 'Bases' (expansion boards) that can be easily connected via the Pogo Pin interface or Grove connectors, significantly expanding the board's capabilities. Always refer to the official M5Stack documentation for the most accurate pin mappings and library usage.