KiCad Tutorial

From Bespoke Robot Society
Jump to navigation Jump to search
KiCad Tutorial
Competency PCB Design
Difficulty Beginner
Time Required 3-6 hours (spread across multiple sessions)
Prerequisites Electronics Fundamentals - Understanding of circuits, components, schematics
Materials Needed KiCad (free download), computer, practice project (LED breakout board)
Next Steps Design custom board for your robot, study SimpleBot PCB design, order boards from JLCPCB

KiCad Tutorial is your complete guide to designing your first printed circuit board (PCB) from start to finish. This tutorial walks you through KiCad, a free and powerful PCB design tool, using a simple LED breakout board project.

By the end of this tutorial, you'll:

  • Install and configure KiCad
  • Create a schematic with components and connections
  • Assign footprints to components
  • Layout a PCB with proper trace routing
  • Generate Gerber files for manufacturing
  • Order your PCB from an online manufacturer

This tutorial is hands-on. You'll design a complete, manufacturable PCB that you can order and assemble.

Part 1: Installing KiCad

Download and Install

  1. Visit KiCad Downloads
  2. Download the latest stable version for your operating system
  3. Run the installer (accept defaults)
  4. Launch KiCad

Note: This tutorial uses KiCad 7.x or 8.x. Interface may differ slightly in older versions.

First Launch Setup

When you first launch KiCad:

  1. Select default library paths (click OK/Next)
  2. KiCad will download symbol and footprint libraries (this may take a few minutes)
  3. You'll see the KiCad project manager window

Understanding KiCad's Interface

KiCad has several tools (all launched from the project manager):

  • Schematic Editor - Draw circuit diagrams
  • Symbol Editor - Create/edit component symbols
  • PCB Editor - Layout physical board
  • Footprint Editor - Create/edit component footprints
  • Gerber Viewer - Preview manufacturing files

Workflow: Schematic → Footprint Assignment → PCB Layout → Gerber Export

Part 2: Creating a New Project

Project: LED Breakout Board

We'll design a simple LED breakout board:

  • Input: 5V and GND via screw terminal
  • Components: Current-limiting resistor, LED, header pins for output
  • Output: LED indicator, 5V/GND headers for connecting to other boards

This teaches fundamental PCB design skills without overwhelming complexity.

Create the Project

  1. Click File → New Project
  2. Name it: led_breakout
  3. Choose a location to save it
  4. Click Create

You'll see two files created:

  • led_breakout.kicad_sch - Schematic file
  • led_breakout.kicad_pcb - PCB layout file

Part 3: Schematic Design

Launch the Schematic Editor

  1. Double-click led_breakout.kicad_sch in the project manager
  2. You'll see a blank grid with a title block in the corner

Adding Components (Symbols)

We need these components:

  • 1× LED
  • 1× Resistor (220Ω)
  • 1× Screw terminal (2-position)
  • 1× Pin header (1×3, for 5V/LED/GND output)
  • Power symbols (VCC, GND)

Adding the LED:

  1. Press A (Add symbol shortcut) or click the "Place Symbol" icon
  2. Type "LED" in the search box
  3. Select Device:LED from the list
  4. Click to place it on the schematic (middle of the grid)
  5. Press ESC to exit placement mode

Adding the resistor:

  1. Press A again
  2. Type "R" in the search box
  3. Select Device:R (resistor)
  4. Place it to the left of the LED
  5. Press ESC

Adding the screw terminal:

  1. Press A
  2. Type "screw terminal" or "conn_01x02"
  3. Select Connector:Screw_Terminal_01x02 (2-position terminal)
  4. Place it on the far left
  5. Press ESC

Adding the output header:

  1. Press A
  2. Type "conn_01x03"
  3. Select Connector_Generic:Conn_01x03 (3-pin header)
  4. Place it on the far right
  5. Press ESC

Adding power symbols:

  1. Press P (Power symbol shortcut)
  2. Type "VCC"
  3. Select power:VCC
  4. Place above the screw terminal
  5. Press P again
  6. Type "GND"
  7. Select power:GND
  8. Place below the screw terminal and near the LED

Your schematic should have: screw terminal (left) → resistor → LED → header (right), with VCC/GND symbols.

Connecting Components (Wiring)

Now connect the components with wires (nets):

  1. Press W (Wire tool) or click "Place Wire" icon
  2. Click on the screw terminal pin 1 (top pin)
  3. Click on the VCC symbol (creates a connection)
  4. Press ESC to exit wire mode

Repeat for all connections:

  • Screw terminal pin 1 → VCC symbol
  • Screw terminal pin 2 → GND symbol (bottom)
  • VCC → Resistor pin 1 (left side)
  • Resistor pin 2 (right side) → LED anode (top pin, triangle side)
  • LED cathode (bottom pin, bar side) → GND
  • VCC → Header pin 1
  • LED anode → Header pin 2 (LED output)
  • GND → Header pin 3

Tips:

  • Wires connect when you click directly on a pin (pink circle appears)
  • Press ESC to cancel wire placement
  • Move components with M (grab and move)

Annotating Components

Components need unique reference designators (R1, D1, J1):

  1. Click Tools → Annotate Schematic
  2. Click Annotate button (uses defaults)
  3. Click Close

Your components now have designators:

  • J1 (screw terminal)
  • R1 (resistor)
  • D1 (LED)
  • J2 (header)

Setting Component Values

Assign values to resistor and LED:

  1. Hover over R1 and press V (Value shortcut)
  2. Type "220" (220 ohms)
  3. Press Enter
  4. Hover over D1 and press V
  5. Type "Red LED" or just "LED"
  6. Press Enter

Adding Title Block Information

  1. Click File → Page Settings
  2. Fill in:
    • Title: "LED Breakout Board"
    • Date: (auto-filled)
    • Revision: "1.0"
    • Company: (your name or "BRS")
  1. Click OK

Electrical Rules Check (ERC)

Check for errors before moving to PCB layout:

  1. Click Inspect → Electrical Rules Checker
  2. Click Run ERC
  3. Review any errors or warnings
  4. Fix errors (warnings about unused pins are usually OK)
  5. Click Close

Common errors:

  • Unconnected pins - Make sure all wires connect to pins (pink circle at connection)
  • Missing power flags - Can ignore for this simple circuit

Save Your Schematic

  1. Press Ctrl+S or click File → Save

Your schematic is complete! Next: assign footprints.

Part 4: Footprint Assignment

Understanding Footprints

Schematic symbols show logical connections (how components connect). Footprints show physical layout (where pads/holes are on the PCB).

Each component needs a footprint:

  • LED → 5mm through-hole LED footprint
  • Resistor → Axial resistor footprint
  • Screw terminal → 5mm pitch screw terminal
  • Header → 2.54mm pin header

Open Footprint Assignment Tool

  1. In schematic editor, click Tools → Assign Footprints
  2. You'll see a list of components on the left, libraries in the middle, footprints on the right

Assigning Footprints

For each component, select it (left column), then double-click the footprint (right column):

J1 (Screw Terminal):

  1. Select J1 in left column
  2. Middle column: scroll to TerminalBlock_Phoenix
  3. Right column: double-click TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_Horizontal
  4. This is a 2-position, 5mm pitch screw terminal

R1 (Resistor):

  1. Select R1
  2. Middle column: scroll to Resistor_THT
  3. Right column: double-click R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal
  4. This is a standard through-hole resistor footprint

D1 (LED):

  1. Select D1
  2. Middle column: scroll to LED_THT
  3. Right column: double-click LED_D5.0mm
  4. This is a standard 5mm LED footprint

J2 (Header):

  1. Select J2
  2. Middle column: scroll to Connector_PinHeader_2.54mm
  3. Right column: double-click PinHeader_1x03_P2.54mm_Vertical
  4. This is a 3-pin, 2.54mm pitch (0.1") header

Verify Assignments

All components should now have footprints listed in the left column. If any show "No Footprint", assign one.

  1. Click OK to save footprint assignments
  2. Close the footprint assignment window

Save and Update PCB

  1. In schematic editor, press Ctrl+S to save
  2. Click Tools → Update PCB from Schematic (or press F8)
  3. Click Update PCB
  4. Click Close

This generates a netlist and sends it to the PCB editor.

Part 5: PCB Layout

Open PCB Editor

  1. In project manager, double-click led_breakout.kicad_pcb
  2. You'll see a blank workspace

Import Components from Schematic

If you followed the "Update PCB from Schematic" step, components should already be imported. If not:

  1. In PCB editor, click Tools → Update PCB from Schematic
  2. Click Update PCB
  3. All components appear in a cluster near the origin

Setting Up the Board

Before placing components, set up the PCB:

Set design rules:

  1. Click File → Board Setup
  2. Left panel: click Constraints
  3. Set minimum values (for JLCPCB/PCBWay standard):
    • Minimum Clearance: 0.2mm
    • Minimum Track Width: 0.2mm
    • Minimum Via Diameter: 0.8mm
    • Minimum Via Drill: 0.4mm
  1. Click OK

Select layers: For this beginner project, use 2 layers (F.Cu = top, B.Cu = bottom).

Drawing the Board Outline

Define the physical board shape:

  1. Select Edge.Cuts layer (dropdown in top toolbar)
  2. Click Draw a Rectangle tool (right toolbar)
  3. Click to start at (0, 0)
  4. Click to end at (40mm, 25mm) - creates a 40mm × 25mm rectangle
  5. This is your board outline

Tips:

  • Grid helps with alignment (default 1mm is fine)
  • Switch to mm units if needed (bottom status bar)

Placing Components

Arrange components logically on the board:

  1. Switch to F.Cu layer (top copper)
  2. Press M (move) and click a component to move it
  3. Press R while moving to rotate component

Suggested layout:

  • J1 (screw terminal) - Left edge, centered vertically
  • R1 (resistor) - Middle, horizontal orientation
  • D1 (LED) - Right of resistor, vertical orientation
  • J2 (header) - Right edge, vertical

Layout strategy:

  • Inputs (screw terminal) on one side
  • Outputs (header) on opposite side
  • Flow left-to-right matches schematic

Routing Traces (Connecting Components)

Ratsnest lines (thin white lines) show which pads need to be connected.

  1. Select F.Cu layer
  2. Press X (Route tracks tool)
  3. Click on a pad to start a trace
  4. Follow the ratsnest line to the destination pad
  5. Click on destination pad to complete connection
  6. Press ESC to finish

Route all connections:

  • J1 pin 1 → R1 left pad (this is the VCC net)
  • R1 right pad → D1 anode (top pad)
  • D1 cathode → J1 pin 2 (GND net)
  • Branch VCC to J2 pin 1
  • Branch LED anode to J2 pin 2
  • Branch GND to J2 pin 3

Trace width:

  • For this low-current circuit, default 0.25mm traces are fine
  • To change: Press W while routing to cycle through widths

Tips:

  • Route on F.Cu (top) layer when possible
  • Use vias to switch layers if traces cross (press V while routing)
  • Press / while routing to switch between 45° and free-angle modes

Adding a Ground Plane (Copper Pour)

A ground plane improves power distribution and reduces noise:

  1. Select F.Cu layer
  2. Press Ctrl+Shift+Z (Add filled zone tool) or click "Add Filled Zone" icon
  3. Click to start zone around the board edge
  4. Follow the board outline (click each corner)
  5. Double-click to close the zone
  6. In the dialog:
    • Net: select GND
    • Clearance: 0.3mm
    • Minimum width: 0.2mm
  1. Click OK

The ground plane fills all unused copper with GND connection.

  1. Press B to rebuild all copper zones

Repeat for bottom layer (B.Cu) if desired (also connect to GND).

Adding Mounting Holes

Mounting holes let you attach the PCB to a chassis:

  1. Press Ctrl+Shift+A (Add footprint) or click "Add Footprint" icon
  2. Type "MountingHole"
  3. Select MountingHole:MountingHole_3.2mm_M3
  4. Place in four corners (inside the board outline)

Press ESC when done.

Adding Text (Silkscreen)

Add labels to identify the board:

  1. Select F.Silkscreen layer (front silkscreen)
  2. Press Ctrl+Shift+T (Add text) or click "Add Text" icon
  3. Type "LED Breakout v1.0"
  4. Click to place near top edge
  5. Press ESC

Add polarity labels:

  • "+" near VCC connections
  • "-" near GND connections
  • "LED OUT" near J2 pin 2

Tips:

  • Keep silkscreen text away from pads (0.5mm clearance)
  • Use F.Silkscreen for top, B.Silkscreen for bottom

Design Rule Check (DRC)

Check for errors before manufacturing:

  1. Click Inspect → Design Rules Checker
  2. Click Run DRC
  3. Review errors and warnings:
    • Errors (red) - Must fix
    • Warnings (yellow) - Review, may be OK
  1. Fix any errors:
    • Traces too close? Reroute with more spacing
    • Unconnected nets? Route missing traces
  1. Re-run DRC until no errors
  2. Click Close

3D Preview

View your board in 3D:

  1. Click View → 3D Viewer (or press Alt+3)
  2. Rotate view with mouse (left-click drag)
  3. Inspect component placement and board appearance
  4. Close 3D viewer when satisfied

Part 6: Generating Gerber Files

Understanding Gerber Files

Gerber files are the industry-standard format for PCB manufacturing. They describe:

  • Copper layers (traces and pads)
  • Soldermask (green coating)
  • Silkscreen (white text)
  • Board outline (cut shape)
  • Drill holes

Exporting Gerbers

  1. In PCB editor, click File → Fabrication Outputs → Gerbers (.gbr)
  2. In the dialog:
    • Output directory: gerbers/
    • Layers to export: Check these:
      • F.Cu (front copper)
      • B.Cu (back copper)
      • F.Paste (front solder paste - optional)
      • B.Paste (back solder paste - optional)
      • F.Silkscreen (front silkscreen)
      • B.Silkscreen (back silkscreen)
      • F.Mask (front soldermask)
      • B.Mask (back soldermask)
      • Edge.Cuts (board outline)
    • Format: 4.6, unit mm (defaults are fine)
    • Check "Use Protel filename extensions" (JLCPCB/PCBWay prefer this)
  1. Click Plot
  2. Click Generate Drill Files
    • Format: Excellon (default)
    • Units: Millimeters
    • Zeros: Decimal format
  1. Click Generate Drill File
  2. Click Close

You now have Gerber files in the gerbers/ folder.

Zipping Gerber Files

Manufacturers need all Gerbers in a single ZIP file:

  1. Navigate to your project folder → gerbers/ subfolder
  2. Select all .gbr and .drl files
  3. Right-click → Send to → Compressed (zipped) folder
  4. Name it: led_breakout_gerbers.zip

This ZIP file is ready to upload to a manufacturer.

Part 7: Ordering Your PCB

Choosing a Manufacturer

Recommended beginner-friendly manufacturers:

  • JLCPCB - $2 for 5 boards, fast shipping (1-2 weeks)
  • PCBWay - Similar pricing, good quality
  • OSH Park - USA-based, $5 per sq inch, purple boards

This tutorial uses JLCPCB (most popular for hobbyists).

Ordering from JLCPCB

  1. Visit JLCPCB.com
  2. Click Instant Quote
  3. Click Add Gerber File and upload led_breakout_gerbers.zip
  4. JLCPCB auto-detects settings:
    • Size: 40mm × 25mm (from your board outline)
    • Layers: 2
    • Quantity: 5 boards (default minimum)
  1. Select options:
    • PCB Color: Green (cheapest), or choose Blue/Red/Black (+$2)
    • Surface Finish: HASL (default, fine for through-hole)
    • PCB Thickness: 1.6mm (default)
  1. Review price (typically $2-5 for 5 boards)
  2. Add shipping (varies by location, $5-20)
  3. Click Save to Cart
  4. Checkout and pay

Waiting for Delivery

  • Production: 1-3 days
  • Shipping: 1-2 weeks (standard), 3-7 days (expedited)
  • Tracking: Emailed when shipped

Part 8: Assembling Your PCB

When your boards arrive:

Gather Components

Order components to match your design:

  • 1× 220Ω resistor (1/4W through-hole)
  • 1× 5mm red LED
  • 1× 2-position 5mm screw terminal
  • 1× 1×3 pin header (2.54mm pitch)

Where to buy:

  • Mouser, Digikey (exact parts, fast shipping, minimum order fees)
  • Amazon, eBay (component kits, slower shipping, no fees)

Soldering Components

Follow Soldering tutorial for technique. Assembly order:

  1. Resistor - Bend leads, insert, solder, trim
  2. LED - Mind polarity! Long leg = anode (+), short leg = cathode (-)
  3. Screw terminal - Insert, solder (requires more heat)
  4. Pin header - Insert, solder

Testing

  1. Connect 5V power supply to screw terminal (+ to top, - to bottom)
  2. LED should light up
  3. Measure voltage at header pins with multimeter:
    • Pin 1: ~5V (VCC)
    • Pin 2: ~2V (LED forward voltage)
    • Pin 3: 0V (GND)

Troubleshooting:

  • LED not lighting? Check polarity, test LED separately
  • No voltage? Check solder joints for cold joints (dull, not shiny)
  • Short circuit? Check for solder bridges between pads

Part 9: Next Steps

Congratulations! You've designed, ordered, and assembled your first PCB. Next:

Design a Custom Board for Your Robot

Apply your skills to a real project:

  • Design a sensor breakout board for SimpleBot
  • Create a motor driver board
  • Design a main board integrating MCU, sensors, and power

Study Existing Designs

Learn from production-quality PCBs:

  • SimpleBot PCB design (files in ./simplebot/kicad/)
    • Study component placement strategy
    • Observe trace routing and ground plane usage
    • Note silkscreen labeling

Learn Advanced Techniques

Expand your PCB design skills:

  • SMD components - Surface-mount devices for compact boards
  • 4-layer boards - Internal power and ground planes
  • High-current traces - Calculate trace width for motor drivers
  • Impedance control - High-speed signal integrity
  • PCBA services - Let manufacturers assemble SMD boards

Share Your Design

Contribute to the BRS community:

  • Document your PCB on the wiki
  • Share KiCad files on GitHub
  • Write an Implementation page
  • Help others learn PCB design

Common Beginner Mistakes

  • Wrong footprint dimensions - Always verify footprints with calipers or datasheets before ordering
  • Forgetting board outline - No Edge.Cuts layer = manufacturer can't cut your board
  • Missing connections - Run DRC to find unrouted nets
  • Traces too narrow - Use at least 0.2mm (wider for high current)
  • No ground plane - Increases noise, makes routing harder
  • Overlapping silkscreen - Text on pads won't print correctly
  • Reversed component polarity - Double-check LED, capacitor, IC orientation
  • Forgetting mounting holes - Can't attach board to chassis

Troubleshooting Tips

  • Ratsnest lines everywhere? Press N to show/hide ratsnest (airwires)
  • Can't route a trace? Switch layers with V (via) or rearrange components
  • DRC errors won't clear? Zoom in closely - errors are marked with small icons
  • Gerber upload fails? Ensure Edge.Cuts layer is included (board outline)
  • Board too expensive? Reduce size to <100mm × 100mm for cheapest pricing
  • Components don't fit? Verify footprints - measure physical parts with calipers

KiCad Keyboard Shortcuts Reference

Schematic Editor

  • A - Add symbol (component)
  • P - Add power symbol
  • W - Wire (connect components)
  • L - Label net (name wires)
  • M - Move component
  • R - Rotate component
  • V - Edit value (resistor value, etc.)
  • Ctrl+S - Save
  • F8 - Update PCB from schematic

PCB Editor

  • M - Move component
  • R - Rotate component
  • X - Route track (trace)
  • V - Add via (while routing)
  • W - Change track width (while routing)
  • / - Change routing mode (45° / free angle)
  • Ctrl+Shift+Z - Add filled zone (copper pour)
  • B - Rebuild all copper zones
  • N - Toggle ratsnest display
  • Alt+3 - 3D viewer

Tools and Resources

Essential Software

  • KiCad (Free) - Download
  • PDF reader - View component datasheets

Component Suppliers

PCB Manufacturers

Learning Resources

Design Files for This Tutorial

If you want to compare your work or download a complete reference design:

  • LED Breakout KiCad project (schematic, PCB, Gerbers)
  • Available in BRS repository: ./pcb_examples/led_breakout/ (if created)

Expanding Your Skills

After mastering this tutorial, try these progressively challenging projects:

Beginner+

  • Power indicator board - Add multiple LEDs, different colors
  • Sensor breakout - IR sensor + headers
  • Button array - 4 buttons + pull-up resistors + header

Intermediate

  • Motor driver board - TB6612FNG IC + terminal blocks + logic inputs
  • Voltage regulator board - LM7805 IC + capacitors + heatsink
  • Sensor array - 4× IR sensors + multiplexer IC

Advanced

  • Robot main board - MCU + sensors + motor driver + power (like SimpleBot)
  • SMD practice board - Recreate LED breakout with 0805 resistor, SMD LED
  • Programmable board - ESP32 module + USB-to-serial + sensors

See Also