The Arduino MKR Zero is a compact 32-bit board based on the SAMD21 Cortex-M0+ processor.
Its defining feature is the onboard:
|
1 2 3 4 |
microSD card socket |
connected to a dedicated SPI interface, making the board particularly useful for:
- audio playback;
- data logging;
- portable instruments;
- offline storage;
- media projects;
- battery-powered applications.
The core architecture is:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
SAMD21 32-bit Arm Cortex-M0+ 48 MHz 3.3 V logic 256 KB Flash 32 KB SRAM native USB microSD Li-Po battery support |
Quick MKR Zero Specifications
| Feature | MKR Zero |
|---|---|
| Main MCU | SAMD21 Cortex-M0+ |
| Clock | 48 MHz |
| RTC clock | 32.768 kHz |
| Logic voltage | 3.3 V |
| Flash | 256 KB |
| Bootloader | 8 KB |
| SRAM | 32 KB |
| EEPROM | No dedicated EEPROM |
| Digital I/O | 22 usable digital-numbered pins including analogue aliases |
| PWM | 12 documented PWM-capable pins |
| Analog inputs | 7 |
| ADC resolution | 8/10/12-bit selectable |
| True DAC | 1 × 10-bit on A0 |
| UART | 1 external hardware UART |
| SPI | 1 external SPI bus |
| I2C | 1 external I2C bus |
| I2S | Available |
| microSD | Onboard, dedicated SPI1 |
| Native USB | Full-Speed USB device / embedded host capable |
| Li-Po battery | Single-cell 3.7 V, 700 mAh minimum recommended |
| GPIO current | 7 mA maximum per pin |
3.3 V Logic: Do Not Feed 5 V into GPIO
The most important electrical rule is:
|
1 2 3 4 |
MKR Zero GPIO = 3.3 V logic |
Arduino explicitly warns that applying more than:
|
1 2 3 4 |
3.3 V |
to an I/O pin can damage the board.
This is different from classic 5 V boards such as:
- UNO R3;
- Mega 2560;
- Leonardo;
- Micro;
- UNO R4.
GPIO Current Limit
The official MKR Zero pinout specifies:
|
1 2 3 4 5 |
7 mA maximum per I/O pin |
with additional group-level source/sink current limits.
Use GPIO for logic signals, not power loads.
For:
- relays;
- motors;
- solenoids;
- high-current LEDs;
use a transistor, MOSFET or dedicated driver.
Digital Pin Mapping
The main board edge exposes:
|
1 2 3 4 |
D0-D14 |
with these primary SAMD21 mappings:
| Arduino pin | SAMD21 pin | Main functions |
|---|---|---|
| D0 | PA22 | PWM |
| D1 | PA23 | PWM |
| D2 | PA10 | PWM / I2S SCK |
| D3 | PA11 | PWM / I2S frame sync |
| D4 | PB10 | PWM |
| D5 | PB11 | PWM |
| D6 | PA20 | PWM |
| D7 | PA21 | PWM |
| D8 | PA16 | PWM / SPI COPI |
| D9 | PA17 | SPI SCK |
| D10 | PA19 | PWM / SPI CIPO |
| D11 | PA08 | I2C SDA / I2S data |
| D12 | PA09 | PWM / I2C SCL / I2S MCK |
| D13 | PB23 | UART RX |
| D14 | PB22 | UART TX |
Analog Pins A0-A6
The MKR Zero exposes seven analogue inputs:
|
1 2 3 4 5 6 7 8 9 10 |
A0 A1 A2 A3 A4 A5 A6 |
| Analog pin | Digital alias | SAMD21 pin | Main function |
|---|---|---|---|
| A0 | D15 | PA02 | AIN0 / DAC0 |
| A1 | D16 | PB02 | AIN10 |
| A2 | D17 | PB03 | AIN11 |
| A3 | D18 | PA04 | AIN4 / PWM |
| A4 | D19 | PA05 | AIN5 / PWM |
| A5 | D20 | PA06 | AIN6 |
| A6 | D21 | PA07 | AIN7 / I2S data |
Analog Pins Can Also Be Digital Pins
The Arduino core gives the analogue pins digital aliases:
|
1 2 3 4 5 6 7 8 9 10 |
A0 = D15 A1 = D16 A2 = D17 A3 = D18 A4 = D19 A5 = D20 A6 = D21 |
That is why Arduino’s store specification can correctly list:
|
1 2 3 4 |
22 digital I/O pins |
even though only D0-D14 are printed as the main digital row.
ADC Resolution
The SAMD21 ADC supports selectable:
|
1 2 3 4 5 6 |
8-bit 10-bit 12-bit |
resolution.
For maximum Arduino-level resolution:
|
1 2 3 4 |
analogReadResolution(12); |
Then:
|
1 2 3 4 |
analogRead(A1) |
returns values approximately from:
|
1 2 3 4 |
0 to 4095 |
A0 Is a True DAC Output
A0 is not only an ADC input.
It is also connected to:
|
1 2 3 4 |
DAC0 |
and provides a true:
|
1 2 3 4 |
10-bit analogue output |
according to Arduino’s board specification.
DAC Example
|
1 2 3 4 5 6 7 8 9 10 |
void setup() { analogWriteResolution(10); } void loop() { analogWrite(A0, 512); } |
This is fundamentally different from ordinary PWM output.
PWM Pins
Arduino currently lists 12 PWM-capable pins:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
D0 D1 D2 D3 D4 D5 D6 D7 D8 D10 A3 / D18 A4 / D19 |
The remaining header pins are not marked as default PWM outputs in the official board specification.
Hardware UART
The external hardware UART is:
|
1 2 3 4 5 6 7 8 9 10 |
D13 → RX → PB23 D14 → TX → PB22 |
Use:
|
1 2 3 4 |
Serial1 |
for these pins.
USB Serial vs Serial1
Because the SAMD21 has native USB:
|
1 2 3 4 5 6 7 8 |
Serial → USB CDC Serial1 → D13/D14 UART |
This lets a project communicate with a PC and an external serial device at the same time.
I2C Pins
The main I2C bus is:
|
1 2 3 4 5 6 7 8 9 10 |
D11 → SDA → PA08 D12 → SCL → PA09 |
Use:
|
1 2 3 4 |
#include <Wire.h> |
I2C Example
|
1 2 3 4 5 6 7 8 9 10 11 |
#include <Wire.h> void setup() { Wire.begin(); } void loop() { } |
External SPI Pins
The user-accessible SPI bus is:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
D8 → COPI / MOSI → PA16 D9 → SCK → PA17 D10 → CIPO / MISO → PA19 |
Use:
|
1 2 3 4 |
#include <SPI.h> |
The microSD Card Uses a Separate SPI Interface
This is one of the MKR Zero’s best design features.
The onboard microSD slot uses:
|
1 2 3 4 |
SPI1 |
rather than the main user-facing SPI pins.
That means using the SD card does not normally consume:
|
1 2 3 4 5 6 |
D8 D9 D10 |
from your external SPI bus.
Internal microSD Pin Mapping
The dedicated SD interface is wired internally as:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
PA12 → SD COPI PA13 → SD SCK PA14 → SD SS PA15 → SD CIPO PA27 → SD card detect |
These are internal board signals rather than normal header pins.
Why Dedicated SPI1 Is Useful
A typical project can therefore use:
|
1 2 3 4 5 6 7 8 9 |
microSD → internal SPI1 external display or ADC → main SPI → D8/D9/D10 |
without sharing the same SPI wires.
This is especially useful for:
- audio players;
- data loggers;
- display projects;
- portable instruments.
SD Library
Arduino’s official MKR Zero documentation states that the SD library recognises the board’s dedicated SD interface automatically.
The important chip-select constant is:
|
1 2 3 4 |
SDCARD_SS_PIN |
rather than hard-coding an UNO-style SD chip-select number.
Basic microSD Example
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#include <SD.h> void setup() { Serial.begin(115200); if (!SD.begin(SDCARD_SS_PIN)) { Serial.println("SD failed"); while (1) { } } Serial.println("SD ready"); } void loop() { } |
Writing a File
|
1 2 3 4 5 6 7 8 9 10 |
File file = SD.open("data.txt", FILE_WRITE); if (file) { file.println("MKR Zero"); file.close(); } |
microSD Card Uses 3.3 V Signalling
The onboard SD interface is already designed for the board’s 3.3 V domain.
No external SD level-shifter board is required when using the integrated socket.
I2S Makes MKR Zero Useful for Audio
The SAMD21 also exposes an:
|
1 2 3 4 |
I2S |
digital-audio interface.
The official pinout identifies signals including:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
D2 → I2S SCK D3 → I2S frame sync D12 → I2S MCK D11 / A6 → I2S data functions |
This is one reason Arduino positions MKR Zero strongly for sound and music projects.
microSD + I2S Audio Architecture
A typical digital audio project can use:
|
1 2 3 4 5 6 7 8 9 |
microSD → audio file → SAMD21 → I2S → external DAC / codec → amplifier / headphones |
The SD card handles storage while I2S moves digital audio data to an external audio device.
Native USB
The SAMD21 includes native:
|
1 2 3 4 |
Full-Speed USB |
with USB device and embedded-host capability.
The normal board connector is:
|
1 2 3 4 |
Micro-USB |
for:
- programming;
- power;
- USB serial;
- USB HID applications.
USB HID
Because the SAMD21 provides native USB, MKR Zero can be used for:
- keyboard HID;
- mouse HID;
- custom USB interfaces.
This makes it more flexible than classic ATmega328P boards for USB-device projects.
Li-Po Battery Connector
The board includes support for a:
|
1 2 3 4 |
3.7 V single-cell Li-Po battery |
with onboard charging.
Arduino currently recommends at least:
|
1 2 3 4 |
700 mAh |
capacity.
Battery Voltage Monitoring
MKR Zero includes an internal battery-voltage measurement path.
The Arduino SAMD core defines:
|
1 2 3 4 |
ADC_BATTERY |
for reading that internal battery monitor.
This can be useful for:
- battery gauges;
- low-voltage warnings;
- portable loggers;
- sleep/wake applications.
VIN Is Not a Classic UNO VIN
The board is designed around a:
|
1 2 3 4 |
5 V board supply |
from USB/VIN.
Do not assume you can feed:
|
1 2 3 4 5 |
9 V 12 V |
into VIN simply because classic UNO boards accept those ranges.
MKR boards use a different power architecture.
3.3 V and 5 V Rails
Arduino currently specifies:
|
1 2 3 4 5 6 7 8 |
3.3 V pin → up to 600 mA 5 V pin → up to 600 mA |
subject to the power source and board operating conditions.
Remember:
|
1 2 3 4 5 6 |
5 V power rail ≠ 5 V GPIO |
Built-In LED
The SAMD core defines:
|
1 2 3 4 5 6 |
LED_BUILTIN → internal pin 32 → PB08 |
This is not one of the normal D0-D14 board-edge numbers.
ATECC508 Secure Element
The official MKR Zero pinout also shows an:
|
1 2 3 4 |
ATECC508 |
secure element connected internally.
This can be used for secure key storage and cryptographic identity functions through appropriate libraries.
External Interrupts
Arduino’s current store specification lists interrupt-capable pins including:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
D0 D1 D4 D5 D6 D7 D8 A1 / D16 A2 / D17 |
The SAMD21 event/interrupt system is more flexible than classic AVR boards, but using:
|
1 2 3 4 |
digitalPinToInterrupt() |
remains the safest Arduino-level approach.
SWD Debugging
The bottom-side debug pads expose:
|
1 2 3 4 5 6 7 |
SWDIO SWCLK 3.3 V GND |
for advanced debugging and programming with a suitable SWD probe.
Common Mistake 1: Applying 5 V to GPIO
The SAMD21 I/O is:
|
1 2 3 4 |
3.3 V only |
Do not apply 5 V to digital or analogue inputs.
Common Mistake 2: Using UNO SD Wiring
The onboard microSD does not use the main:
|
1 2 3 4 |
D8/D9/D10 |
SPI connection.
It uses its own internal:
|
1 2 3 4 |
SPI1 |
bus.
Common Mistake 3: Hard-Coding the SD Chip Select
Use:
|
1 2 3 4 |
SDCARD_SS_PIN |
rather than assuming an UNO-style SS pin.
Common Mistake 4: Assuming D9 Is PWM
Arduino’s current MKR Zero specification does not list:
|
1 2 3 4 |
D9 |
among its 12 default PWM pins.
D9 is the main SPI:
|
1 2 3 4 |
SCK |
pin.
Common Mistake 5: Confusing Serial with the UART
On MKR Zero:
|
1 2 3 4 5 6 7 8 |
Serial → USB Serial1 → D13/D14 |
Common Mistake 6: Driving Too Much Current
The official pinout states:
|
1 2 3 4 |
7 mA maximum per GPIO |
so use drivers for larger loads.
Quick Digital Reference
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
D0 PA22 PWM D1 PA23 PWM D2 PA10 PWM / I2S SCK D3 PA11 PWM / I2S FS D4 PB10 PWM D5 PB11 PWM D6 PA20 PWM D7 PA21 PWM D8 PA16 PWM / COPI D9 PA17 SCK D10 PA19 PWM / CIPO D11 PA08 SDA / I2S data D12 PA09 PWM / SCL / I2S MCK D13 PB23 RX D14 PB22 TX |
Quick Analog Reference
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
A0 / D15 PA02 AIN0 DAC0 A1 / D16 PB02 AIN10 A2 / D17 PB03 AIN11 A3 / D18 PA04 AIN4 PWM A4 / D19 PA05 AIN5 PWM A5 / D20 PA06 AIN6 A6 / D21 PA07 AIN7 I2S data |
Quick Communications Reference
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
USB serial: Serial Hardware UART: D13 RX D14 TX Serial1 I2C: D11 SDA D12 SCL Main SPI: D8 COPI D9 SCK D10 CIPO microSD SPI1: PA12 COPI PA13 SCK PA14 SS PA15 CIPO PA27 card detect I2S: D2 / D3 / D11 / D12 / A6 depending signal |
Final Thoughts
The Arduino MKR Zero is essentially a compact SAMD21 board optimised for storage and audio-oriented projects.
Its strongest combination is:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
48 MHz Cortex-M0+ 256 KB Flash 32 KB SRAM native USB 7 ADC inputs true DAC I2S dedicated microSD SPI1 Li-Po battery support |
The dedicated microSD bus is particularly useful because it leaves the normal external SPI pins free for another peripheral.
The most important pinout rules are:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
logic → 3.3 V only UART → D13/D14 I2C → D11/D12 main SPI → D8/D9/D10 microSD → separate internal SPI1 DAC → A0 PWM → 12 documented pins GPIO current → 7 mA maximum |
For a wireless version of the same general MKR/SAMD21 concept, see our Arduino MKR WiFi 1010 pinout guide. For other native-USB choices, see our Arduino USB HID boards comparison.