Skip to main content
Tutorials

Arduino Uno ATmega328P Schematic Tutorial

Overview

This tutorial guides you through designing a complete Arduino Uno compatible board using tscircuit. The Arduino Uno is one of the most popular microcontroller boards, and understanding its circuit design is foundational for electronics engineers.

System Architecture

The Arduino Uno consists of four main subsystems:

  1. MCU: ATmega328P — the heart of the board
  2. USB Interface: ATmega16U2 — USB-to-serial conversion
  3. Power: 5V regulator and auto-switching (USB/external)
  4. I/O: Digital/analog pin headers, ICSP connectors

Components

RefPartDescriptionFootprint
U1ATmega328P-PUMain MCU, 32KB Flash, 2KB SRAMdip-28
U2ATmega16U2USB-to-Serial interfacetqfp-32
U3NCP1117-5.05V LDO regulatorsot-223
J1USB-BUSB Type-B connectorusb-b
Y116 MHz CrystalMCU clock sourcehc49
R1Reset pull-up10kΩ resistor0805
C1-C3Decoupling caps100nF ceramic0805
C4Crystal load (×2)22pF ceramic0805
LED_PPower LEDGreen indicator0805
LED_LD13 LEDYellow activity LED0805
JP1-JP4Pin headersDigital/Analog I/Opin_header_1x15

Step 1: ATmega328P MCU

The ATmega328P is an 8-bit AVR microcontroller with 32KB of flash memory:

<chip
name="U1"
footprint="dip-28"
pcbX={0}
pcbY={0}
/>

Key Pin Assignments

PinFunctionDescription
1RESETActive-low reset, pulled up to 5V
2-4PD0-PD2Digital I/O 0-2 (RX, TX, INT0)
5-6PD3-PD4Digital I/O 3-4 (INT1, XCK)
7-8VCC/GNDPower supply
9-10PB6-PB7XTAL1/XTAL2 (crystal oscillator)
11-13PB0-PB2Digital I/O 8-10 (SPI)
14-17PB3-PB5Digital I/O 11-13 (SPI, PWM)
18-19XTAL2/GNDCrystal and ground
20AVCCADC power supply (connect to VCC)
21AREFADC reference voltage
22-27PC0-PC5Analog inputs A0-A5
28VCCPower supply

Step 2: 16 MHz Crystal Oscillator

The ATmega328P requires an external 16 MHz crystal for clock generation:

<crystal
name="Y1"
footprint="hc49"
frequency="16MHz"
pcbX={-5}
pcbY={-10}
/>

<capacitor name="C_Y1A" footprint="0805" capacitance="22pF" pcbX={-6} pcbY={-11} />
<capacitor name="C_Y1B" footprint="0805" capacitance="22pF" pcbX={-4} pcbY={-11} />

<trace from=".Y1 .1" to=".U1 > .XTAL1" />
<trace from=".Y1 .2" to=".U1 > .XTAL2" />
<trace from=".C_Y1A .pos" to=".Y1 .1" />
<trace from=".C_Y1B .pos" to=".Y1 .2" />
<trace from=".C_Y1A .neg" to="net.GND" />
<trace from=".C_Y1B .neg" to="net.GND" />

Step 3: Reset Circuit

The reset circuit ensures the MCU starts in a known state:

<resistor name="R1" footprint="0805" resistance="10k" pcbX={5} pcbY={-10} />
<capacitor name="C_RST" footprint="0805" capacitance="100nF" pcbX={7} pcbY={-10} />

<trace from="net.5V" to=".R1 .pos" />
<trace from=".R1 .neg" to=".U1 > .RESET" />
<trace from=".R1 .neg" to=".C_RST .pos" />
<trace from=".C_RST .neg" to="net.GND" />

The pull-up resistor keeps RESET high during normal operation. The capacitor provides noise filtering.

Step 4: Power Regulation

The Arduino can be powered via USB or an external barrel jack (7-12V):

<chip name="U3" footprint="sot-223" pcbX={-15} pcbY={-10} />

<trace from=".U3 .vin" to="net.VIN" />
<trace from=".U3 .gnd" to="net.GND" />
<trace from=".U3 .vout" to="net.5V" />

<capacitor name="C_IN" footprint="0805" capacitance="10uF" />
<capacitor name="C_OUT" footprint="0805" capacitance="10uF" />

<trace from="net.VIN" to=".C_IN .pos" />
<trace from="net.5V" to=".C_OUT .pos" />
<trace from=".C_IN .neg" to="net.GND" />
<trace from=".C_OUT .neg" to="net.GND" />

Step 5: LED Indicators

<led name="LED_P" color="green" footprint="0805" pcbX={-15} pcbY={10} />
<resistor name="R_LED_P" footprint="0805" resistance="330" pcbX={-17} pcbY={10} />

<trace from="net.5V" to=".R_LED_P .pos" />
<trace from=".R_LED_P .neg" to=".LED_P .pos" />
<trace from=".LED_P .neg" to="net.GND" />

<led name="LED_L" color="yellow" footprint="0805" pcbX={-10} pcbY={10} />
<resistor name="R_LED_L" footprint="0805" resistance="330" pcbX={-12} pcbY={10} />

<trace from=".U1 > .PB5" to=".R_LED_L .pos" />
<trace from=".R_LED_L .neg" to=".LED_L .pos" />
<trace from=".LED_L .neg" to="net.GND" />

Step 6: Pin Headers

<chip name="JP1" footprint="pin_header_1x15" pcbX={-25} pcbY={0} />
<chip name="JP2" footprint="pin_header_1x15" pcbX={25} pcbY={0} />
<chip name="JP3" footprint="pin_header_1x6" pcbX={-25} pcbY={-15} />
<chip name="JP4" footprint="pin_header_1x6" pcbX={25} pcbY={-15} />

Digital I/O Mapping

Header PinATmega328P PinArduino Pin
JP1:1PD0D0 (RX)
JP1:2PD1D1 (TX)
JP1:3PD2D2
JP1:4PD3D3 (PWM)
JP1:5PD4D4
JP1:6PD5D5 (PWM)
JP1:7PD6D6 (PWM)
JP1:8PD7D7

Complete Circuit

export default () => {
return (
<board width="70mm" height="55mm">
{/* ATmega328P MCU */}
<chip name="U1" footprint="dip-28" pcbX={0} pcbY={0} />

{/* 16 MHz Crystal */}
<crystal name="Y1" footprint="hc49" frequency="16MHz" pcbX={-5} pcbY={-10} />
<capacitor name="C_Y1A" footprint="0805" capacitance="22pF" pcbX={-6} pcbY={-11} />
<capacitor name="C_Y1B" footprint="0805" capacitance="22pF" pcbX={-4} pcbY={-11} />

{/* Reset Circuit */}
<resistor name="R1" footprint="0805" resistance="10k" pcbX={5} pcbY={-10} />
<capacitor name="C_RST" footprint="0805" capacitance="100nF" pcbX={7} pcbY={-10} />

{/* Power Regulator */}
<chip name="U3" footprint="sot-223" pcbX={-15} pcbY={-10} />
<capacitor name="C_IN" footprint="0805" capacitance="10uF" />
<capacitor name="C_OUT" footprint="0805" capacitance="10uF" />

{/* LEDs */}
<led name="LED_P" color="green" footprint="0805" pcbX={-15} pcbY={10} />
<resistor name="R_LED_P" footprint="0805" resistance="330" pcbX={-17} pcbY={10} />
<led name="LED_L" color="yellow" footprint="0805" pcbX={-10} pcbY={10} />
<resistor name="R_LED_L" footprint="0805" resistance="330" pcbX={-12} pcbY={10} />

{/* Pin Headers */}
<chip name="JP1" footprint="pin_header_1x15" pcbX={-25} pcbY={0} />
<chip name="JP2" footprint="pin_header_1x15" pcbX={25} pcbY={0} />
<chip name="JP3" footprint="pin_header_1x6" pcbX={-25} pcbY={-15} />
<chip name="JP4" footprint="pin_header_1x6" pcbX={25} pcbY={-15} />
</board>
)
}

PCB Layout Guidelines

Power Traces

  • 5V supply: Minimum 0.5mm width for 500mA current
  • 3.3V supply: Minimum 0.3mm width
  • GND plane: Solid ground plane on bottom layer

Crystal Routing

  • Keep traces short: Under 10mm from crystal to MCU pins
  • Guard ring: Route ground pour around crystal traces
  • No vias: Avoid vias in crystal signal paths

Decoupling Capacitors

  • Placement: Within 2mm of MCU power pins
  • Trace width: 0.3mm minimum
  • Via placement: Use multiple vias for ground connections

Manufacturing Files

# Generate Gerbers
tsci build --gerber

# Generate BOM
tsci build --bom

# Generate Assembly
tsci build --pick-and-place

Cost Estimate

ComponentUnit CostQtyTotal
ATmega328P-PU$1.801$1.80
ATmega16U2$1.201$1.20
NCP1117-5.0$0.201$0.20
USB-B Connector$0.151$0.15
16 MHz Crystal$0.151$0.15
Passives (×15)$0.0215$0.30
Pin Headers (×4)$0.104$0.40
PCB (2-layer)$1.001$1.00
Total$5.20

Summary

You've designed a complete Arduino Uno compatible board covering:

  • ATmega328P MCU configuration
  • 16 MHz crystal oscillator circuit
  • Reset circuit with noise filtering
  • Power regulation and filtering
  • LED indicators for status and activity
  • Pin header layout matching Arduino Uno form factor
  • Manufacturing file generation

This design is fully compatible with the Arduino IDE and bootloader.