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.
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 / SoC | ESP32-D0WDQ6 |
| Architecture | Dual-core Tensilica LX6 |
| Clock speed | Up to 240 MHz |
| Flash / Storage | 16 MB |
| RAM / SRAM | 8 MB PSRAM + 520 KB SRAM |
| Operating voltage | 3.3V |
| Digital I/O pins | 26 (exposed via Pogo Pins and internal headers) |
| Analog / ADC | 12-bit ADC (multiple channels available via GPIO) |
| PWM | Supported on most GPIO pins |
| Connectivity | Wi-Fi 802.11 b/g/n, Bluetooth v4.2 BR/EDR and BLE |
| USB | USB Type-C (for power and programming) |
| Power input | 5V via USB Type-C, 3.7V Lithium Polymer Battery (integrated) |
| Dimensions | 54 x 54 x 14 mm |
Pinout & pin functions
| Pin | Function |
|---|---|
| 3V3 | Power output (3.3V) |
| GND | Ground |
| IO0 | General Purpose Input/Output, Boot button |
| IO2 | General Purpose Input/Output, ADC1_CH3 |
| IO4 | General Purpose Input/Output |
| IO5 | General Purpose Input/Output, SPI2_CS |
| IO12 | General Purpose Input/Output, SPI2_MISO, ADC1_CH5 |
| IO13 | General Purpose Input/Output, SPI2_MOSI, ADC1_CH4 |
| IO14 | General Purpose Input/Output, SPI2_SCK |
| IO15 | General Purpose Input/Output, ADC1_CH6 |
| IO16 | General Purpose Input/Output, UART2_RX |
| IO17 | General Purpose Input/Output, UART2_TX |
| IO18 | General Purpose Input/Output, SPI3_CS |
| IO19 | General Purpose Input/Output, SPI3_MISO, ADC1_CH8 |
| IO21 | General Purpose Input/Output, I2C SDA |
| IO22 | General Purpose Input/Output, I2C SCL |
| IO23 | General Purpose Input/Output, SPI3_MOSI, ADC1_CH9 |
| IO25 | General Purpose Input/Output, DAC_1, ADC1_CH10 |
| IO26 | General Purpose Input/Output, DAC_2, ADC1_CH11 |
| IO27 | General Purpose Input/Output, ADC1_CH7 |
| IO32 | General Purpose Input/Output, ADC1_CH4 |
| IO33 | General Purpose Input/Output, ADC1_CH2 |
| POGO A | Pogo Pin Interface (GPIO accessible) |
| POGO B | Pogo Pin Interface (GPIO accessible) |
| POGO C | Pogo Pin Interface (GPIO accessible) |
| POGO D | Pogo 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.