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.
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.
- 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.
Prefer a simpler view? This colour-coded map groups the pins by function:
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)
| Bus | Micro pins | On the Uno… |
|---|---|---|
| Serial (USB) | Serial — virtual USB port | same object as pins 0/1 |
| UART | Serial1 on D0 (RX) / D1 (TX) | this is Serial |
| I2C | D2 (SDA) / D3 (SCL) | A4 / A5 |
| SPI | ICSP header only | 11–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.
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.
Digital I/O
Output a HIGH/LOW to drive an LED or relay, or read a HIGH/LOW input from a button or sensor.
// 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.
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.
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.
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.
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.
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.
Project 1 — Blink an LED
void setup() { pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); delay(500); digitalWrite(13, LOW); delay(500); }
Project 2 — Button-triggered keyboard shortcut
#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
#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
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.
Key Terms — Glossary
| Term | Meaning |
|---|---|
| ATmega32U4 | The Micro's 8-bit AVR chip, with a built-in USB controller. |
| Native USB | USB handled by the MCU itself — no separate USB-serial chip. |
| HID | Human Interface Device — a keyboard or mouse the PC recognises. |
| Serial vs Serial1 | Serial = 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). |
| ADC | Analog-to-digital converter; 12 inputs, 10-bit (0–1023). |
| I2C | 2-wire bus on D2 (SDA) / D3 (SCL) — not A4/A5. |
| SPI | On the ICSP header (MISO/MOSI/SCK) — not pins 11–13. |
| Bootloader | USB 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.