M5Stack-Station
by M5 Stack
ESP32 board in a dock-style enclosure - built for desktop-style IoT dashboards and HMI stations.

On this page
Pinout
21 pins| Pin | GPIO | Labels | Status | Capabilities | Notes |
|---|---|---|---|---|---|
| 1 | 1 | TXG1 | uart | uart | |
| 2 | 3 | RXG3 | uart | uart | |
| 3 | 4 | G4 | strapping | - | |
| 4 | 5 | SSG5 | strapping | spi | |
| 5 | 13 | RXD1G13 | strapping | - | |
| 6 | 14 | TXD1G14 | strapping | - | |
| 7 | 16 | RXD2G16 | strapping | - | |
| 8 | 17 | TXD2G17 | strapping | - | |
| 9 | 18 | SCKG18 | safe | spi | |
| 10 | 19 | G19 | safe | - | |
| 11 | 23 | MOSIG23 | safe | spi | |
| 12 | 25 | G25DAC1 | safe | dac | |
| 13 | 26 | G26DAC2 | safe | dac | |
| 14 | 32 | SDAG32 | safe | i2c | |
| 15 | 33 | SCLG33 | safe | i2c | |
| 16 | 35 | G35ADC1 | strapping | - | |
| 17 | 36 | G36ADC2 | strapping | - | |
| 18 | 37 | G37 | strapping | - | |
| 19 | 38 | G38 | strapping | - | |
| 20 | 39 | G39 | strapping | - | |
| 21 | - | MISO | safe | spi |
Start with these
7 pins with no boot or system involvementFreely assignable - no strapping, flash, USB or JTAG duties. Ideal first picks for buttons, sensors and LEDs.
Fine - with a little care
sampled at boot or shared with debug/serial| Pin | Label | What to know | Role |
|---|---|---|---|
| G4 | GPIO4 | Sampled at reset for boot config; should not be driven at boot (affects boot mode timing). | Strapping |
| SS | GPIO5 | Must be HIGH during boot; if pulled LOW at reset, alters SDIO slave timing and may prevent normal boot. | Strapping |
| RXD1 | MTCK (GPIO13) | Used for JTAG debugging (TCK); avoid using as GPIO if JTAG is needed. | Other |
| TXD1 | MTMS (GPIO14) | Used for JTAG debugging (TMS); driving it as GPIO may interfere with JTAG or produce spurious signals at boot. | Other |
| G35 | GPIO35 | Cannot be used as output; only suitable for input. | Other |
| G36 | GPIO36 (SENSOR_VP) | Cannot be used as output; only suitable for input (e.g., analog read). | Other |
| G37 | GPIO37 (SENSOR_CAPP) | Cannot be used as output; only suitable for input. | Other |
| G38 | GPIO38 (SENSOR_CAPN) | Cannot be used as output; only suitable for input. | Other |
| G39 | GPIO39 (SENSOR_VN) | Cannot be used as output; only suitable for input. | Other |
Only if you know the tricks
wired to flash or USB - expect a fight| Pin | Label | What to know | Role |
|---|---|---|---|
| TX | U0TXD (GPIO1) | Connected to on-board USB-UART for uploading and logs; drives serial output at boot, so using as GPIO can disrupt programming or console. | USB |
| RX | U0RXD (GPIO3) | Used for receiving data from USB-UART (programming); also pulled HIGH at boot for console communication, so using as GPIO can disrupt uploads. | USB |
| RXD2 | GPIO16 | Connected to internal PSRAM on PSRAM-enabled modules; not usable as GPIO on those modules. | Flash |
| TXD2 | GPIO17 | Connected to internal PSRAM on PSRAM-enabled modules; not usable as GPIO on those modules. | Flash |
Pinout notes The M5Stack-Station pinout brings out 21 pins - 20 usable GPIO. Peripheral wiring is straightforward: I²C is mapped to SDA on GPIO32 and SCL on GPIO33; the SPI…
The M5Stack-Station pinout brings out 21 pins - 20 usable GPIO.
Peripheral wiring is straightforward: I²C is mapped to SDA on GPIO32 and SCL on GPIO33; the SPI bus (MOSI, MISO, SCK, SS) is broken out in full; TX/RX on GPIO1 and GPIO3 cover serial logging and flashing.
Beyond plain digital I/O you get 2 true DAC outputs.
9 of the exposed pins carry boot-time or system duties on the ESP32 (G4, SS, RXD1 and 6 more) - check the guidance above before wiring anything to them. SCK, G19, MOSI, G25 and 3 more are free of any such role - the safest first picks.
Getting started
flash your first firmware in ~2 minutesBoard: ESP32 Dev Module Flash Size: 16MB (128Mb) Flash Mode: DIO Partition Scheme: 16M Flash (3MB APP / 9.9MB FATFS) Upload Speed: 921600
// blink the onboard LED
void setup() {
pinMode(18, OUTPUT);
}
void loop() {
digitalWrite(18, HIGH); delay(500);
digitalWrite(18, LOW); delay(500);
}[env:m5stack-station]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_speed = 921600esp32dev — or type it after board =.esp32:
board: esp32dev
variant: m5stack_station
framework:
type: esp-idf
# blink - GPIO18
output:
- platform: gpio
pin: 18
id: led_out
light:
- platform: binary
name: "LED"
output: led_outesp32dev (same ids as PlatformIO).esptool.py --chip esp32 --port /dev/ttyACM0 \
--baud 921600 write_flash 0x0 firmware.bin--port = your /dev/tty* (macOS/Linux) or COMx (Windows).Specifications
ESP32 · 88 × 65 mmAbout this board
Inside sits the ESP32 - a dual-core Xtensa with both Bluetooth Classic and BLE.
At $48.50 it's on the expensive side for an ESP32 board - most land around $20.
Around the module: an IPS LCD 1.14" 240x135 display, a BM8563 RTC, an addressable RGB LED, an RS485 interface (SP3485), battery charging (AXP192) and 3 programmable/Power buttons.
- 7x SK6812 addressable RGB LEDs
- USB-A 5V power output port
- Reserved LiPo battery socket (battery not included)
Where to buy
prices are typical street prices
Resources
Similar boards




