Learning Goals 5 min
Cluster A's capstone: move your sketch off the £20 UNO board onto a £2 bare chip on a breadboard. The minimum-viable Arduino. By the end of this lesson you will:
- Wire a bare ATmega328P-PU chip on a breadboard with the "just enough" supporting components: 16 MHz crystal, 2 × 22 pF caps, reset pull-up, decoupling cap.
- Burn the bootloader onto it via Arduino-as-ISP, then upload a Blink sketch directly.
- Explain why this matters — a finished product based on Arduino code costs the price of one chip, not one whole development board.
Warm-Up 10 min
Take stock:
- ATmega328P-PU (DIP-28 package — the through-hole one). Bare chip, no PCB.
- 16 MHz crystal (HC-49 form factor, two leads).
- 2 × 22 pF ceramic capacitors (small disc / blob caps).
- 1 × 10 kΩ resistor (reset pull-up).
- 1 × 100 nF cap (decoupling).
- 1 × LED + 220 Ω resistor (Blink target).
- Breadboard.
- UNO loaded with ArduinoISP from L04-05.
- Jumper wires + 5 V supply (USB power bank, AA pack with regulator, or take 5 V from the UNO programmer).
The reveal
The UNO is essentially this chip + USB-serial + power LED + pin headers + a fancy PCB. Everything else is convenience. Bare chip on breadboard = same brain, ~£2 cost, no shield socket.
New Concept · Minimum Arduino circuit 20 min
ATmega328P pinout (DIP-28)
| Pin | Name | Arduino label |
|---|---|---|
| 1 | RESET | (reset) |
| 2 | PD0 / RXD | D0 |
| 3 | PD1 / TXD | D1 |
| 4 | PD2 / INT0 | D2 |
| 5 | PD3 / INT1 | D3 |
| 6 | PD4 | D4 |
| 7 | VCC | +5 V |
| 8 | GND | GND |
| 9 | PB6 / XTAL1 | (crystal) |
| 10 | PB7 / XTAL2 | (crystal) |
| 11 | PD5 | D5 |
| 12 | PD6 | D6 |
| 13 | PD7 | D7 |
| 14 | PB0 | D8 |
| 15 | PB1 | D9 |
| 16 | PB2 / SS | D10 |
| 17 | PB3 / MOSI | D11 |
| 18 | PB4 / MISO | D12 |
| 19 | PB5 / SCK | D13 (LED on UNO) |
| 20 | AVCC | +5 V (analog) |
| 21 | AREF | — |
| 22 | GND | GND |
| 23 | PC0 | A0 |
| 24 | PC1 | A1 |
| 25 | PC2 | A2 |
| 26 | PC3 | A3 |
| 27 | PC4 / SDA | A4 |
| 28 | PC5 / SCL | A5 |
The minimum supporting circuit
| Part | Connects between | Why |
|---|---|---|
| 16 MHz crystal | pin 9 (XTAL1) and pin 10 (XTAL2) | Clock source for the chip. The bootloader fuse settings expect this. |
| 22 pF cap A | pin 9 to GND | Load cap for the crystal. |
| 22 pF cap B | pin 10 to GND | Load cap for the crystal. |
| 10 kΩ resistor | pin 1 (RESET) to +5 V | Pull-up. Without this, the chip continuously resets. |
| 100 nF cap | pin 7 (VCC) to pin 8 (GND) | Decoupling. Smooths the supply. |
| +5 V | pin 7 (VCC) and pin 20 (AVCC) | Both power pins must be supplied. |
| GND | pin 8 and pin 22 | Both ground pins must be connected. |
That's it. 5 small components + the chip + power. Less than £3 in parts.
To upload to it
Wire the Arduino-as-ISP programmer from L04-05:
- Programmer D10 → chip pin 1 (RESET).
- Programmer D11 → chip pin 17 (MOSI).
- Programmer D12 → chip pin 18 (MISO).
- Programmer D13 → chip pin 19 (SCK).
- Programmer +5V → chip pins 7 + 20.
- Programmer GND → chip pins 8 + 22.
To run it standalone
Once uploaded, disconnect the programmer wires (keep power!). The chip runs its sketch from a 5 V supply (battery pack, USB power bank, etc.). No UNO board needed.
Worked Example · Standalone Blink 30 min
Step 1 — assemble the breadboard
Place the ATmega328P-PU across the central gap (chip straddles the middle, half on each side). Use the breadboard's rails for +5 V and GND. Add the crystal between pins 9 and 10, with one 22 pF cap from each crystal pin to GND. Add the 10 kΩ pull-up on pin 1. Add the 100 nF cap right next to pins 7/8.
Add the LED + 220 Ω resistor on pin 19 (PB5, which is "D13" in Arduino-speak — same pin as the UNO's on-board LED).
Step 2 — load the ArduinoISP sketch on the programmer UNO
From L04-05. Confirm the heartbeat LED on pin 9 of the programmer is blinking.
Step 3 — wire programmer to standalone chip
The 6 wires from §3.
Step 4 — burn the bootloader
- IDE → Tools → Board → Arduino UNO.
- Tools → Programmer → Arduino as ISP.
- Tools → Burn Bootloader.
- Wait ~10 s. Heartbeat keeps blinking; programming LED (pin 7) lights briefly. Error LED (pin 8) stays off. Done.
Step 5 — upload Blink directly
- Open File → Examples → Basics → Blink.
- Sketch → Upload Using Programmer (Ctrl+Shift+U).
- Wait. The LED on pin 19 should start blinking at 1 Hz.
Step 6 — cut the cord
Disconnect the programmer wires (RESET, MOSI, MISO, SCK). Keep +5 V and GND. The standalone chip continues to blink the LED. You've replaced a £20 board with a £2 chip + £1 of components.
Step 7 — measure power draw
Bare chip with a slow-blinking LED draws ~5 mA average. A UNO with the same sketch draws ~50 mA (USB-serial chip + LED indicators + voltage regulator overhead). 10× saving in power, perfect for battery deployment.
Try It Yourself 15 min
Goal: Modify the Blink sketch to flash a pattern: 3 short, 3 long, 3 short (SOS in Morse). Upload via programmer. Verify on the standalone chip.
Goal: Move one of your earlier L1 sketches (Reaction Timer, Mood Lamp, Traffic Light) to the standalone chip. Wire whatever sensors / LEDs / buttons you need to the appropriate ATmega pins.
Goal: Burn an 8 MHz internal-oscillator bootloader (no crystal needed). Save 2 components. Suitable for low-power battery devices where the speed difference doesn't matter.
Hint
In Tools → Board → install "MiniCore" or "ATmega328P (8 MHz internal)" via Boards Manager. Select that board, then Burn Bootloader. The chip now runs from its internal 8 MHz oscillator — no crystal or load caps needed.
Mini-Challenge · Build a finished standalone device 10 min
- Pick a project from L1–L3 (mood lamp, doorbell, blink patterns).
- Move it onto the standalone ATmega328 setup. Mount on a piece of perfboard or in a small enclosure.
- Power from a battery pack.
- Take a photo of the finished "product" — no USB cable, no UNO board, just the chip + supporting parts + the LEDs / sensors.
This is what shipping a product means: the brain is the chip; everything else is the brain's minimum needs. Adafruit/SparkFun's ATtiny / ATmega-based small products all do exactly this.
Recap 5 min
An Arduino UNO is an ATmega328P + USB-serial + voltage regulator + connectors. The chip itself runs Arduino sketches just fine on a breadboard with 5 small parts. Burning the bootloader requires an ISP (Arduino-as-ISP works); subsequent uploads either use the ISP or USB-serial via an FTDI adapter. The same approach scales to ATtiny chips (cheaper, smaller), bare AVR boards, and pro PCB designs. Cluster B starts tomorrow: Arduino IoT Cloud — the official cloud platform for "sketches in your browser, devices on your shelf".
- ATmega328P-PU
- The DIP-28 through-hole package of the chip used on UNO. -PU = pre-installed bootloader; -P = blank.
- DIP package
- Dual In-line Package — through-hole IC with two rows of legs, fits breadboards.
- Crystal oscillator
- Quartz resonator that gives the chip its clock. 16 MHz on UNO. Requires two load capacitors (typically 18–22 pF).
- Load capacitor
- Small cap between a crystal pin and ground that tunes the crystal to its specified frequency.
- Pull-up resistor (on RESET)
- 10 kΩ between RESET and VCC. Holds RESET HIGH (inactive) when no external reset is applied.
- Decoupling capacitor
- 100 nF directly between VCC and GND at the chip's power pins. Smooths supply noise.
- Internal oscillator
- The ATmega's built-in ~8 MHz RC clock. Less precise than a crystal but needs no external parts.
- Standalone device
- Microcontroller circuit with only the parts it actually needs — no USB chip, no extra LEDs, no shield headers.
Homework 5 min
- Build the standalone Blink. Photo of the finished breadboard.
- Save your "portable" sketch template (L04-03) — confirm it compiles for the bare ATmega328P-PU (it should, since it's an AVR target).
- Read ahead to ARD-L04-07 (What Is IoT Cloud?). Optional: create a free Arduino account at
create.arduino.ccand click around the IoT Cloud area to get the feel.