Loading the figure…
The board most people learn on: a socketed ATmega328P, 5 V pins you can't easily hurt, and a USB cable that does everything.
Each lesson runs your own code on the board. Finish its checks to tick it off.
Build the board in the right order, then power it up and check it, as on the bench.
0 of 26 stepsPull the USB cable and the adapter. Never build or repair a live board.
Each fault really happens in the simulation. Trigger one, watch the figure, then read why.
The Uno R3 (A000066) runs an ATmega328P at 16 MHz with 5 V logic. It sits in a DIP-28 socket, so a chip you cook can be swapped in a minute. A second chip, the ATmega16U2, is the USB-to-serial bridge: it shows up as a serial port on your computer and resets the 328P when an upload starts. You get 14 digital pins (6 with PWM, marked ~), 6 analog inputs, 32 KB of flash (32 256 bytes free for your sketch after the Optiboot bootloader), 2 KB of RAM and 1 KB of EEPROM. Power it from USB, from 7-12 V on the barrel jack, or from VIN; the board switches to the jack by itself when VIN is above about 6.6 V.
| Header | Pin | Name | Functions | Level | Max current | Notes |
|---|---|---|---|---|---|---|
| IOL | 1 | D0 | RX, PCINT16 | 5 V5 V tolerant | 40 mA | RX. Also wired to the 16U2 through a 1 kΩ resistor: anything on D0 can block uploads. |
| IOL | 2 | D1 | TX, PCINT17 | 5 V5 V tolerant | 40 mA | TX. Serial.print() sends its bytes out here, and the 16U2 passes them to USB. |
| IOL | 3 | D2 | INT0, PCINT18 | 5 V5 V tolerant | 40 mA | External interrupt 0: attachInterrupt() works on D2 and D3 only. |
| IOL | 4 | ~D3 | PWM 490 Hz (OC2B), INT1, PCINT19 | 5 V5 V tolerant | 40 mA | PWM at 490 Hz and external interrupt 1. tone() borrows the same timer, so PWM here stops while a tone plays. |
| IOL | 5 | D4 | T0, XCK, PCINT20 | 5 V5 V tolerant | 40 mA | |
| IOL | 6 | ~D5 | PWM 977 Hz (OC0B), T1, PCINT21 | 5 V5 V tolerant | 40 mA | |
| IOL | 7 | ~D6 | PWM 977 Hz (OC0A), AIN0, PCINT22 | 5 V5 V tolerant | 40 mA | |
| IOL | 8 | D7 | AIN1, PCINT23 | 5 V5 V tolerant | 40 mA | The last pin of the left header; then the gap that makes Uno shields fit only one way. |
| IOH | 1 | D8 | ICP1, CLKO, PCINT0 | 5 V5 V tolerant | 40 mA | |
| IOH | 2 | ~D9 | PWM 490 Hz (OC1A), PCINT1 | 5 V5 V tolerant | 40 mA | PWM at 490 Hz. The Servo library takes over this timer, so analogWrite() on D9 and D10 stops working once a servo is attached. |
| IOH | 3 | ~D10 | PWM 490 Hz (OC1B), SPI SS, PCINT2 | 5 V5 V tolerant | 40 mA | PWM, and SPI SS. It must stay an output while the Uno is the SPI master. |
| IOH | 4 | ~D11 | PWM 490 Hz (OC2A), SPI MOSI, PCINT3 | 5 V5 V tolerant | 40 mA | |
| IOH | 5 | D12 | SPI MISO, PCINT4 | 5 V5 V tolerant | 40 mA | |
| IOH | 6 | D13 | SPI SCK, LED_BUILTIN, PCINT5 | 5 V5 V tolerant | 40 mA | Built-in LED pin (LED_BUILTIN). The L LED hangs off it through a buffer, so it does not load the pin. |
| IOH | 7 | GND | – | – | – | |
| IOH | 8 | AREF | ADC reference | 5 V | – | Reference for analogRead(). Leave it alone unless you call analogReference(EXTERNAL) first. |
| IOH | 9 | SDA | I2C SDA, A4 | 5 V5 V tolerant | 40 mA | I²C data. The same wire as A4: use one or the other. |
| IOH | 10 | SCL | I2C SCL, A5 | 5 V5 V tolerant | 40 mA | I²C clock. The same wire as A5. |
| POWER | 1 | NC | – | – | – | Not connected: kept free for future shields. |
| POWER | 2 | IOREF | I/O voltage for shields | 5 V | – | Tells a shield the board's I/O voltage: 5 V on the Uno. |
| POWER | 3 | RESET | Active-low reset | 5 V | – | Pull it to GND to reset the 328P, the same as the RESET button. |
| POWER | 4 | 3V3 | 3.3 V out | 3.3 V | 150 mA | 3.3 V out, 150 mA at most. |
| POWER | 5 | 5V | 5 V out | 5 V | – | 5 V out from the board. You can also feed a clean 5 V in here, but nothing protects the board if you get it wrong. |
| POWER | 6 | GND | – | – | – | |
| POWER | 7 | GND | – | – | – | |
| POWER | 8 | VIN | Supply in (after the jack diode) | 8.3 V | – | The jack's voltage after D1, or a 7-12 V input that skips D1's protection. |
| AD | 1 | A0 | ADC0, D14, PCINT8 | 5 V5 V tolerant | 40 mA | Analog input 0. Like A1-A5 it also works as a digital pin (D14). |
| AD | 2 | A1 | ADC1, D15, PCINT9 | 5 V5 V tolerant | 40 mA | |
| AD | 3 | A2 | ADC2, D16, PCINT10 | 5 V5 V tolerant | 40 mA | |
| AD | 4 | A3 | ADC3, D17, PCINT11 | 5 V5 V tolerant | 40 mA | |
| AD | 5 | A4 | ADC4, D18, I2C SDA, PCINT12 | 5 V5 V tolerant | 40 mA | Analog input 4 and I²C SDA: the same pin as SDA on the top header. |
| AD | 6 | A5 | ADC5, D19, I2C SCL, PCINT13 | 5 V5 V tolerant | 40 mA | Analog input 5 and I²C SCL: the same pin as SCL on the top header. |
| ICSP | 1 | MISO | SPI MISO = D12 | 5 V | – | |
| ICSP | 2 | 5V | – | 5 V | – | |
| ICSP | 3 | SCK | SPI SCK = D13 | 5 V | – | |
| ICSP | 4 | MOSI | SPI MOSI = D11 | 5 V | – | |
| ICSP | 5 | RESET | – | 5 V | – | The 328P's reset line, for an in-circuit programmer. |
| ICSP | 6 | GND | – | – | – | |
| ICSP1 | 1 | MISO2 | 16U2 PB3 | 5 V | – | |
| ICSP1 | 2 | 5V | – | 5 V | – | |
| ICSP1 | 3 | SCK2 | 16U2 PB1 | 5 V | – | |
| ICSP1 | 4 | MOSI2 | 16U2 PB2 | 5 V | – | |
| ICSP1 | 5 | RESET2 | 16U2 reset | 5 V | – | The 16U2's reset. Briefly joining it to GND (pin 6) puts the 16U2 in its DFU bootloader. |
| ICSP1 | 6 | GND | – | – | – |
Sensors and actuators this board drives, with the real connections.
Anode (long leg) toward the pin, cathode to GND, with a 220 Ω to 1 kΩ resistor in series.
| Part pin | Board pin |
|---|---|
| A | D13Wire colour orange |
| K | GNDWire colour black |
Never without the resistor: the pin would try to push over 100 mA through the LED.
Between D2 and GND with pinMode(2, INPUT_PULLUP): reads LOW while pressed. With an external pull-down to GND and the button to 5 V it reads HIGH while pressed instead.
| Part pin | Board pin |
|---|---|
| 1 | D2Wire colour blue |
| 3 | GNDWire colour black |
Ends to GND and 5V, the middle leg (wiper) to A0. analogRead(A0) then goes from 0 to 1023 as you turn it.
| Part pin | Board pin |
|---|---|
| 1 | GNDWire colour black |
| 2 | A0Wire colour green |
| 3 | 5VWire colour red |
From 5V to A0, with a 10 kΩ resistor from A0 to GND. More light, lower resistance, higher reading.
| Part pin | Board pin |
|---|---|
| 1 | 5VWire colour red |
| 2 | A0Wire colour green |
+ to a pin, − to GND. tone(pin, frequency) plays a note; a piezo draws only a few mA, so no resistor is needed.
| Part pin | Board pin |
|---|---|
| POS | D8Wire colour orange |
| NEG | GNDWire colour black |
Flat face toward you: left leg 5V, middle leg to A0, right leg GND. Degrees C = (volts − 0.5) × 100.
| Part pin | Board pin |
|---|---|
| VS | 5VWire colour red |
| VOUT | A0Wire colour green |
| GND | GNDWire colour black |
Brown to GND, red to 5V, orange to a pin (D9). Servo.attach(9) then write(0..180).
| Part pin | Board pin |
|---|---|
| GND | GNDWire colour brown |
| VCC | 5VWire colour red |
| SIG | D9Wire colour orange |
A moving servo can draw 250 mA and a stalled one 700 mA. More than one servo needs its own 5 V supply, with the grounds joined.
Base through a 1 kΩ resistor to a PWM pin, emitter to GND, the load from 5 V (or its own supply) to the collector.
| Part pin | Board pin |
|---|---|
| B | D6Wire colour orange |
| E | GNDWire colour black |
A motor or fan needs a 1N4007 diode across it, band toward the + supply, or switching it off sends a voltage spike into the transistor.
VCC to 5V, GND to GND, TRIG to D9, ECHO to D10. A 10 µs pulse on TRIG starts a ping; ECHO's pulse length is the round trip.
| Part pin | Board pin |
|---|---|
| VCC | 5VWire colour red |
| TRIG | D9Wire colour yellow |
| ECHO | D10Wire colour green |
| GND | GNDWire colour black |
GND, VCC to 3V3, SCL to SCL, SDA to SDA. The display answers at I²C address 0x3C.
| Part pin | Board pin |
|---|---|
| GND | GNDWire colour black |
| VCC | 3V3Wire colour orange |
| SCL | SCLWire colour blue |
| SDA | SDAWire colour purple |
Check your module: many SSD1306 boards are 3.3 V only. Ones with an on-board regulator also take 5 V.
IN1-IN4 to D8-D11, − to GND, + to 5V; the stepper's 5-wire plug goes into the white socket.
| Part pin | Board pin |
|---|---|
| IN1 | D8Wire colour orange |
| IN2 | D9Wire colour yellow |
| IN3 | D10Wire colour green |
| IN4 | D11Wire colour purple |
| GND | GNDWire colour black |
| VCC | 5VWire colour red |
The stepper takes up to 160 mA with two coils on. Fine from USB for one small stepper; give anything bigger its own supply.
AOUT to A0, VCC to 5V, GND to GND. The reading falls as the soil gets wetter.
| Part pin | Board pin |
|---|---|
| AOUT | A0Wire colour yellow |
| VCC | 5VWire colour red |
| GND | GNDWire colour black |
GND to GND, R to D4, Y to D3, G to D2. The module has its own resistors, so the pins drive it directly.
| Part pin | Board pin |
|---|---|
| GND | GNDWire colour black |
| R | D4Wire colour orange |
| Y | D3Wire colour yellow |
| G | D2Wire colour green |
One leg to 5V, the other to A0, with a 10 kΩ pull-down from A0 to GND. Press harder, read higher.
| Part pin | Board pin |
|---|---|
| 1 | 5VWire colour red |
| 2 | A0Wire colour green |
VCC, GND, SCL to SCL, SDA to SDA. It answers at address 0x68 (0x69 with AD0 high).
| Part pin | Board pin |
|---|---|
| VCC | 5VWire colour red |
| GND | GNDWire colour black |
| SCL | SCLWire colour blue |
| SDA | SDAWire colour purple |
Use a breakout with a regulator on it (the common GY-521 has one); the bare chip is 3.3 V only.
VCC to 5V for its logic, GND, SCL and SDA. It drives up to 16 servos at address 0x40.
| Part pin | Board pin |
|---|---|
| VCC | 5VWire colour red |
| GND | GNDWire colour black |
| SCL | SCLWire colour blue |
| SDA | SDAWire colour purple |
Feed the servos through the board's V+ terminal from their own 5-6 V supply, never from the Uno's 5V pin.