Arduino Micro

A Leonardo shrunk to fit a breadboard. The Arduino Micro uses the ATmega32U4 with native USB, so it can pretend to be a USB keyboard or mouse — all on a board barely bigger than a stick of gum. This guide covers the full board anatomy, a complete pinout with every pin explained, its native-USB HID trick, power & programming, a Micro vs Leonardo vs Nano comparison, and code and mini-projects.

Complete Learning Path — Arduino Micro

From board anatomy and the ATmega32U4, to a full pinout with every pin detailed, native USB (HID), power, digital & analog I/O, the buses, Micro vs Leonardo vs Nano, code and mini-projects

What is the Arduino Micro?

The Arduino Micro is a tiny, breadboard-friendly board built around the ATmega32U4 — the same native-USB chip as the Leonardo. That means it can appear to a PC as a real USB keyboard or mouse, with no separate USB chip.

Think of it as the Leonardo's brain in the Nano's body: all the 32U4's abilities, in a package that drops straight into a breadboard.

Labelled Arduino Micro board anatomy: native-USB ATmega32U4, micro-USB port, reset, LEDs, two pin rows and the ICSP header
A map of the Micro: the native-USB ATmega32U4 does both the computing and the USB — on a board barely bigger than a stick of gum.
ATmega32U4
8-bit AVR + USB
Native USB
Keyboard / mouse
20 + 12
Digital + analog pins
Breadboard
Tiny form factor

The Brain: ATmega32U4

Like the Leonardo, the Micro runs the ATmega32U4 — an 8-bit AVR at 16 MHz with a built-in USB controller, so the chip is its own USB device.

Block diagram of the ATmega32U4: AVR CPU, 32 KB flash, 2.5 KB SRAM, 1 KB EEPROM, 20 I/O lines, 12-channel ADC, timers and native USB
Inside the ATmega32U4: CPU + 32 KB flash / 2.5 KB SRAM / 1 KB EEPROM + GPIO, 12-channel ADC, timers, and a native USB controller.
  • Flash (32 KB) — stores your program; ~4 KB is the (USB) bootloader.
  • SRAM (2.5 KB) — working memory for variables.
  • EEPROM (1 KB) — non-volatile store that survives power-off.
  • Native USB — the stand-out feature: the chip is its own USB device (keyboard, mouse, or serial).

Full Arduino Micro Pinout

Here is the complete pinout. The pin functions match the Leonardo exactly: I2C on D2/D3, SPI on the ICSP header, and six analog inputs (A6–A11) on digital pins.

Detailed Arduino Micro pinout: every pin with its Arduino number, port register and alternate functions (ADC, PWM, I2C, UART), with SPI on ICSP
The full Micro pinout — digital on the right, power & analog on the left. SCL = D3, SDA = D2; A6–A11 share digital pins.

Prefer a simpler view? This colour-coded map groups the pins by function:

Simplified Arduino Micro pinout showing digital, PWM, analog and power pins colour-coded, with I2C on D2/D3
Quick overview — note D2 = SDA, D3 = SCL and the extra analog pins on the digital header.

Every Pin Explained

Let's go through each group of pins. The Micro shares the Leonardo's assignments, so the same gotchas apply.

Digital pins (0–13)

14 header pins that read or write HIGH (5 V) or LOW (0 V) with pinMode(), digitalWrite() and digitalRead(). Each handles ~20 mA (40 mA max). With A0–A5 usable as digital, that's 20 in total.

D2 (SDA) & D3 (SCL)

The I2C bus — on the Micro it's here, not on A4/A5.

D0 (RX) & D1 (TX)

Serial1 hardware UART — separate from the USB Serial.

PWM (~) — 7 pins

Pins 3, 5, 6, 9, 10, 11, 13 — analogWrite(0–255).

Interrupts

Pins 0, 1, 2, 3, 7 support attachInterrupt().

Pin 13

Wired to the on-board “L” LED.

Analog input pins (12 total)

The Micro has 12 analog inputs, each a 10-bit ADC reading 0–5 V as 0–1023:

  • A0–A5 on the header.
  • A6–A11 share digital pins 4, 6, 8, 9, 10, 12 — read them with analogRead(A6) … analogRead(A11).

The buses (and where they live)

BusMicro pinsOn the Uno…
Serial (USB)Serial — virtual USB portsame object as pins 0/1
UARTSerial1 on D0 (RX) / D1 (TX)this is Serial
I2CD2 (SDA) / D3 (SCL)A4 / A5
SPIICSP header only11–13 + ICSP

Power pins

VIN (7–12 V in), 5V (regulated out), 3.3V (~50 mA), GND, IOREF and RESET. There is no DC barrel jack — power comes from micro-USB or VIN.

The 32U4 gotchas

If a library says “I2C on A4/A5” or “SPI on 11–13”, that's Uno wiring. On the Micro, wire I2C to 2/3 and take SPI from the ICSP header. And use Serial1 (not Serial) for a module on pins 0/1.

Native USB — Keyboard & Mouse (HID)

This is the Micro's headline trick. Because the 32U4 speaks USB itself, the board can present to a PC as a real USB keyboard or mouse — something the Uno and Nano can't do.

Arduino Micro native USB HID: the board connects over USB and the PC sees a real keyboard or mouse, with Keyboard.print and Mouse.move
The PC sees a genuine HID device. Type with Keyboard.print(), move the cursor with Mouse.move().
// type a line when a button on pin 2 is pressed
#include <Keyboard.h>
void setup() {
  pinMode(2, INPUT_PULLUP);
  Keyboard.begin();
}
void loop() {
  if (digitalRead(2) == LOW) {      // pressed
    Keyboard.println("Hello from Micro!");
    delay(1000);                    // avoid repeats
  }
}
Gate your HID code

A sketch that types or moves the mouse non-stop makes the PC very hard to use. Always trigger HID actions from a button or condition (as above), never on every loop(). If you get stuck, double-tap RESET to re-flash.

Powering the Micro

Power it from micro-USB (5 V), or feed 7–12 V into the VIN pin through the on-board regulator. There is no barrel jack.

Arduino Micro power paths: micro-USB 5 V or 7-12 V on VIN through the regulator to the 5 V and 3.3 V rails
Micro-USB or VIN → regulator → clean 5 V (and 3.3 V from a second regulator).

Digital I/O

Output a HIGH/LOW to drive an LED or relay, or read a HIGH/LOW input from a button or sensor.

Arduino digital I/O: an output pin driving an LED through a resistor, and an input pin reading a button with a pull-down resistor
Output drives an LED (via a 220 Ω resistor); input reads a button with a 10k pull-down so the pin never floats.
// digital output + input
void setup() {
  pinMode(13, OUTPUT);      // LED pin
  pinMode(7, INPUT);        // button pin
}
void loop() {
  digitalWrite(13, digitalRead(7));   // LED follows the button
}

PWM Output (~)

PWM fakes an analog voltage by switching a pin on and off fast. The Micro has 7 PWM pins: 3, 5, 6, 9, 10, 11, 13.

Arduino PWM: three duty cycles (25%, 50%, 75%) and their average voltages, set with analogWrite
Higher duty → higher average voltage. Use analogWrite(pin, 0–255) on any of the 7 ~ pins.
// fade an LED on a PWM pin (~9)
void setup() { pinMode(9, OUTPUT); }
void loop() {
  for (int v = 0; v <= 255; v++) { analogWrite(9, v); delay(5); }
  for (int v = 255; v >= 0; v--) { analogWrite(9, v); delay(5); }
}

Analog Input (ADC)

The Micro has 12 analog inputs. Each 10-bit reading turns 0–5 V into 0–1023.

Arduino analog input: a potentiometer feeding A0, and the 10-bit ADC mapping 0-5 V to 0-1023
A potentiometer on A0 → the ADC reads 0–1023. Convert to volts with v * 5.0 / 1023.0. A6–A11 live on digital pins.
// read an "extra" analog input (A6 is on digital pin 4)
void setup() { Serial.begin(9600); }
void loop() {
  int raw = analogRead(A6);          // 0..1023
  float volts = raw * 5.0 / 1023.0;
  Serial.println(volts);
  delay(200);
}

Serial, SPI & I2C

The Micro has the usual three buses — on the same pins as the Leonardo, which differ from the Uno.

Arduino Micro communication buses: Serial1 on D0/D1, SPI on the ICSP header, and I2C on D2/D3
Serial1 on D0/D1 (separate from USB Serial), SPI on the ICSP header, I2C on D2/D3.

How Code Gets onto the Micro

The 32U4 handles USB itself, so there's no separate USB chip. Write a sketch, connect micro-USB, pick Arduino Micro, and upload.

Arduino Micro upload flow: write in the IDE, compile, send over the 32U4's native USB, and the bootloader writes it to flash
Write → compile → native USB (32U4) → the bootloader writes it to flash → run.
If an upload fails: double-tap RESET

Because the sketch shares the USB port, a bad sketch can hide the board. Double-tap the RESET button to force the bootloader for a few seconds, then upload and pick the temporary bootloader port.

Micro vs Leonardo vs Nano

The Micro sits neatly between two boards: it has the Leonardo's native-USB chip and the Nano's tiny breadboard body.

Comparison table of the Arduino Micro, Leonardo and Nano: microcontroller, native USB, HID, form factor, pins and analog inputs
Same 32U4 abilities as the Leonardo (native USB, HID, 12 analog), in a Nano-sized breadboard form.

Choose the Micro for compact projects that need USB keyboard/mouse tricks; the Leonardo if you also want Uno shield headers; the Nano if you don't need native USB/HID.

Code Examples

The everyday building blocks — plus one only the 32U4 boards can run.

1. Blink the on-board LED

void setup() { pinMode(LED_BUILTIN, OUTPUT); }
void loop() {
  digitalWrite(LED_BUILTIN, HIGH); delay(1000);
  digitalWrite(LED_BUILTIN, LOW);  delay(1000);
}

2. Print to the Serial Monitor (wait for USB)

void setup() {
  Serial.begin(9600);
  while (!Serial) { ; }          // wait for the USB port (32U4)
  Serial.println("Ready!");
}
void loop() { Serial.println(millis()); delay(1000); }

3. Talk to a module on Serial1

void setup() {
  Serial.begin(9600);       // USB to PC
  Serial1.begin(9600);      // module on pins 0/1
}
void loop() {
  if (Serial1.available()) Serial.write(Serial1.read());
}

Beginner Mini-Projects

Small, breadboard-ready, and USB-native — here are four to start with.

Arduino Blink project: an LED and 220 ohm resistor on pin 13 with the blink sketch
Project 1 wiring — the classic Blink. Pin 13 already has an on-board LED, so this works even with no parts.

Project 1 — Blink an LED

Parts: 1 LED, 1 × 220 Ω resistor. LED anode → resistor → pin 13; cathode → GND.
void setup() { pinMode(13, OUTPUT); }
void loop() {
  digitalWrite(13, HIGH); delay(500);
  digitalWrite(13, LOW);  delay(500);
}

Project 2 — Button-triggered keyboard shortcut

Parts: 1 push-button between pin 2 and GND. Pressing it types text on your PC — the 32U4's HID trick.
#include <Keyboard.h>
void setup() { pinMode(2, INPUT_PULLUP); Keyboard.begin(); }
void loop() {
  if (digitalRead(2) == LOW) {
    Keyboard.print("power4all.in");
    delay(800);              // debounce / avoid repeats
  }
}

Project 3 — USB volume knob

Parts: a potentiometer on A0 — map it to mouse-wheel or media keys (uses the HID libraries). A neat compact desk gadget.
#include <Mouse.h>
int last = 0;
void setup() { Mouse.begin(); last = analogRead(A0); }
void loop() {
  int now = analogRead(A0);
  if (now - last > 8)  { Mouse.move(0, 0, 1);  last = now; }  // wheel up
  if (last - now > 8)  { Mouse.move(0, 0, -1); last = now; }  // wheel down
  delay(50);
}

Project 4 — I2C sensor on D2/D3

Parts: any I2C module. Wire SDA → D2, SCL → D3 (not A4/A5!), then use the Wire library.
#include <Wire.h>
void setup() {
  Serial.begin(9600);
  Wire.begin();                // SDA=2, SCL=3 on the Micro
}
void loop() {
  Wire.beginTransmission(0x3C);   // example device address
  Serial.println(Wire.endTransmission() == 0 ? "found" : "not found");
  delay(1000);
}

Specifications

The Arduino Micro at a glance.

Arduino Micro specifications table: ATmega32U4, 16 MHz, 5 V, 32 KB flash, 20 digital pins, 12 analog inputs, native micro-USB
Key numbers for the Micro — MCU, clock, memory, pins, native USB and size.

Key Terms — Glossary

TermMeaning
ATmega32U4The Micro's 8-bit AVR chip, with a built-in USB controller.
Native USBUSB handled by the MCU itself — no separate USB-serial chip.
HIDHuman Interface Device — a keyboard or mouse the PC recognises.
Serial vs Serial1Serial = USB to PC; Serial1 = hardware UART on 0/1.
PWM (~)Pulse-width modulation; 7 pins on the Micro (3,5,6,9,10,11,13).
ADCAnalog-to-digital converter; 12 inputs, 10-bit (0–1023).
I2C2-wire bus on D2 (SDA) / D3 (SCL) — not A4/A5.
SPIOn the ICSP header (MISO/MOSI/SCK) — not pins 11–13.
BootloaderUSB bootloader; double-tap RESET to force it if uploads fail.

Frequently Asked Questions

Quick answers to the questions people ask most about the Arduino Micro.

What is the Arduino Micro?

A tiny, breadboard-friendly board built around the native-USB ATmega32U4. It can act as a USB keyboard or mouse, and has 20 digital pins (7 PWM), 12 analog inputs, 32 KB flash and 5 V logic — essentially a Leonardo shrunk to a Nano-sized board.

Micro vs Leonardo — what's different?

Same ATmega32U4, native USB, HID, 20 digital + 12 analog pins, and the same pin assignments (I2C on 2/3, SPI on ICSP, Serial vs Serial1). The Micro is much smaller and breadboard-friendly; the Leonardo is Uno-shaped with shield headers and a DC jack.

Micro vs Nano — what's different?

Both are tiny breadboard boards, but the Micro's 32U4 has native USB (so it can be a keyboard/mouse) and 12 analog inputs, while the Nano's 328P uses a USB-serial chip and has 8 analog inputs. On the Micro, I2C is on 2/3 and SPI is on the ICSP header.

Can it be a keyboard or mouse?

Yes — use the built-in Keyboard and Mouse libraries (Keyboard.print(), Mouse.move()). Always trigger HID actions from a button, or the PC becomes hard to control.

Where are I2C and SPI?

I2C is on pins 2 (SDA) and 3 (SCL). SPI is only on the ICSP header (MISO, MOSI, SCK) — not pins 11–13. Serial1 (UART) is on pins 0/1.

How do I power it?

From micro-USB (5 V), or 7–12 V into the VIN pin through the regulator. There is no barrel jack. Each I/O pin handles ~20 mA.

How many analog inputs does it have?

12: A0–A5 on the header, plus A6–A11 on digital pins 4, 6, 8, 9, 10 and 12. Read them with analogRead(A6) and so on.

Why won't my Micro upload?

A misbehaving sketch can hide the USB port. Double-tap the RESET button to force the bootloader for a few seconds, then start the upload and select the temporary bootloader port. Confirm the board is set to Arduino Micro.

Conclusion & Key Takeaways

The Arduino Micro is the Leonardo's USB-native power in a breadboard-sized package — ideal for compact keyboard/mouse gadgets.

ATmega32U4

Native USB built in.

Keyboard / mouse

HID libraries.

20 + 12 pins

Digital + analog.

I2C on 2/3

SPI on ICSP.

Breadboard

Tiny form factor.

No barrel jack

USB or VIN.

Continue Learning