MakerLab
ESP32M5Stack Core (Basic)

M5Stack Core (Basic): The All-in-One ESP32 Development Board

A compact, stackable development kit built around the ESP32 microcontroller, ideal for rapid prototyping and IoT projects.

M5Stack Core (Basic)

The M5Stack Core (Basic) is a highly integrated development board designed for ease of use and rapid prototyping. It consolidates a powerful ESP32 microcontroller, a display, buttons, and various sensors into a small, self-contained unit. This makes it an excellent choice for makers, students, and engineers who want to quickly build and test embedded systems without extensive external circuitry.

At the heart of the M5Stack Core (Basic) is the Espressif ESP32-D0WDQ6 chip, a versatile System-on-Chip (SoC) that features a dual-core Tensilica LX6 microprocessor. This powerful chip offers Wi-Fi and Bluetooth connectivity, ample processing power, and a rich set of peripherals, making it suitable for a wide range of applications from simple sensor nodes to more complex IoT devices and even basic graphical interfaces.

Released around 2017, the M5Stack Core (Basic) was one of the early iterations in the M5Stack family, which emphasizes a modular, stackable design. This allows users to easily expand the functionality of the core unit by attaching different "stackable" modules (e.g., GPS, RFID, environmental sensors) via its expansion bus. This modularity, combined with the ESP32's capabilities, positions the M5Stack Core as a flexible platform for both learning and professional development.

The M5Stack Core (Basic) is particularly well-suited for makers who appreciate an all-in-one solution that minimizes wiring and setup time. Its built-in display and buttons provide immediate interaction capabilities, while the ESP32's connectivity features open doors to IoT projects. It's a great starting point for anyone interested in Wi-Fi-enabled microcontrollers, graphical interfaces on embedded devices, or the M5Stack ecosystem.

Watch

Related video, embedded from YouTube.

Specifications

Microcontroller / SoCESP32-D0WDQ6
ArchitectureDual-core Tensilica LX6 microprocessor
Clock speedUp to 240 MHz
Flash / Storage4 MB (external SPI flash)
RAM / SRAM520 KB SRAM
Operating voltage3.3V
Digital I/O pinsApproximately 34 (exposed via headers and internal use)
Analog / ADC12-bit, up to 18 channels (exposed on some pins)
PWMUp to 16 channels
ConnectivityWi-Fi 802.11 b/g/n, Bluetooth v4.2 BR/EDR and BLE
USBMicro-USB interface (for power and programming)
Power input5V via Micro-USB, or 3.7V LiPo battery
Dimensions54 x 54 x 14 mm

Pinout & pin functions

PinFunction
G0General Purpose Input/Output (GPIO)
G2GPIO, Touch Sensor 2
G4GPIO
G5GPIO, SPI CS1
G12GPIO, SPI MISO, ADC2_CH5
G13GPIO, SPI MOSI, ADC2_CH4
G14GPIO, SPI SCK, ADC2_CH6
G15GPIO, ADC2_CH3, DAC2
G16GPIO, UART2 RX, I2S RX
G17GPIO, UART2 TX, I2S TX
G18GPIO, PWM0, I2S MCK
G19GPIO, PWM1, I2S BCK
G21GPIO, I2C SDA
G22GPIO, I2C SCL
G23GPIO, PWM6, ADC1_CH12
G25GPIO, ADC1_CH13, DAC1
G26GPIO, ADC1_CH14
G27GPIO, ADC1_CH15, Touch Sensor 0
G32GPIO, ADC1_CH4, Touch Sensor 9
G33GPIO, ADC1_CH0, Touch Sensor 8
G34GPIO, ADC1_CH6 (Input only)
G35GPIO, ADC1_CH7 (Input only)
G36GPIO, ADC1_CH0 (Input only)
G39GPIO, ADC1_CH3 (Input only)
5VPower Output
3V3Power Output (Regulated)
GNDGround
BATBattery Input (3.7V LiPo)
ENEnable Pin (Active High)

Wiring & circuit basics

The M5Stack Core (Basic) operates at a logic level of 3.3V. Connecting 5V devices directly to its GPIO pins can cause permanent damage. When interfacing with 5V components, a level shifter is necessary. Powering the board is typically done via the Micro-USB port, which supplies 5V. The board has an onboard 3.3V regulator to provide stable power to the ESP32 and other components. A LiPo battery can also be connected to the BAT terminal for portable operation; the charging circuit is integrated.

When connecting external components, always ensure you connect them to the correct pins and respect the operating voltage. For example, to light up an LED, connect the longer leg (anode) to a GPIO pin (like G21) through a current-limiting resistor (typically 220-330 ohms), and connect the shorter leg (cathode) to a GND pin. This limits the current flowing through the LED and prevents damage to the GPIO pin.

For I2C communication, the M5Stack Core (Basic) uses GPIO 21 for SDA and GPIO 22 for SCL. When connecting an I2C sensor, ensure its VCC pin is connected to the 3.3V pin on the M5Stack, its GND pin to a GND pin, and its SDA/SCL pins to the corresponding GPIO 21/22 pins. Remember that I2C devices often require pull-up resistors on the SDA and SCL lines; check the sensor's datasheet. The M5Stack Core (Basic) typically has onboard pull-ups, but external ones might be needed depending on the bus capacitance and device count.

Programming & getting started

The M5Stack Core (Basic) can be programmed using several popular development environments. The Arduino IDE is a common choice, offering a vast library ecosystem and familiar programming structure. You'll need to install the ESP32 board support package for the Arduino IDE. Alternatively, MicroPython and CircuitPython provide a Pythonic approach to embedded development, often preferred for rapid prototyping and ease of learning. For more advanced users, Espressif's official ESP-IDF (Espressif IoT Development Framework) offers the most control and access to the ESP32's full capabilities, while PlatformIO provides an integrated development environment that supports multiple frameworks including Arduino and ESP-IDF.

To upload your first program using the Arduino IDE: 1. Install the ESP32 board support package via the Arduino IDE's Board Manager. 2. Select the correct ESP32 board (e.g., 'M5Stack-Core-ESP32' if available, or a generic ESP32 Dev Module). 3. Connect the M5Stack Core (Basic) to your computer via Micro-USB. 4. Select the correct COM port. 5. Write your sketch (e.g., a simple 'Blink' example or reading sensor data). 6. Click the 'Upload' button. The board will typically enter bootloader mode automatically, or you may need to press the 'Reset' and 'Boot' buttons in sequence.

Project ideas

Wi-Fi Connected Weather StationRead temperature and humidity from an external sensor (e.g., DHT22 connected to GPIO) and display the data on the M5Stack's screen. Use the ESP32's Wi-Fi to fetch current weather data from an online API and compare it. This project teaches sensor interfacing, display output, and network communication.
Bluetooth Low Energy (BLE) BeaconConfigure the ESP32 as a BLE beacon to broadcast custom data. This project is excellent for learning about BLE advertising and can be used for proximity detection or simple asset tracking.
Interactive Game with ButtonsDevelop a simple game (e.g., a reaction timer or a basic platformer) using the M5Stack's built-in buttons and display. This project focuses on user input handling, game logic, and graphical rendering on the small screen.
I2C Sensor HubConnect multiple I2C sensors (e.g., an accelerometer, a light sensor, and a gas sensor) to the M5Stack's I2C bus (G21/G22). Display readings from all sensors simultaneously on the screen. This project reinforces I2C communication and multi-sensor data management.
Remote Controlled LED StripUse the M5Stack's Wi-Fi to connect to a network and receive commands (e.g., via a web server or MQTT). Control an external addressable LED strip (like WS2812B) connected to a suitable GPIO pin. This project combines networking, control logic, and external hardware control.
LoRaWAN NodeIntegrate a LoRaWAN module (via SPI or UART) and connect it to the M5Stack. Develop firmware to send sensor data over a LoRaWAN network to a gateway. This project introduces long-range, low-power communication protocols.

Buying tips & gotchas

When purchasing an M5Stack Core (Basic), be aware that newer versions and variants exist (e.g., Core2, CoreInk). Ensure you are buying the original 'Core (Basic)' if that's your intention, as pinouts and features can differ. Clones might exist, so buying from reputable distributors is advised. The M5Stack ecosystem is rich; consider accessories like the Grove base for easier sensor connection, external battery packs for extended use, or specific function modules that stack onto the Core unit. Always ensure your power supply can provide sufficient current, especially when using Wi-Fi or Bluetooth, as the ESP32 can have significant current spikes.