Skip to content

KiCad Symbol Pin Placement Guidelines

Core Principles for Perfect Pin Alignment

1. Pin-to-Rectangle Connection Rule

  • Pin connection points (red circles) should be positioned OUTSIDE the symbol rectangle
  • Pin lines (uncircled/bubbled side) should TOUCH the rectangle edges exactly
  • Standard offset: 2.54mm from rectangle edge to pin connection point

2. Rectangle Dimensions Calculation

Rectangle Width = (Number of pins per side × 2.54mm) + 5.08mm padding
Rectangle Height = (Pin span in Y-direction) + 5.08mm padding

3. Pin Positioning Formulas

For Left-Side Pins:

X = Rectangle_Left_Edge - 2.54mm
Y = Start_Y + (Pin_Number - 1) × 2.54mm

For Right-Side Pins:

X = Rectangle_Right_Edge + 2.54mm
Y = Start_Y + (Pin_Number - 1) × 2.54mm

For Top/Bottom Pins:

X = Start_X + (Pin_Number - 1) × 2.54mm
Y = Rectangle_Top/Bottom_Edge ± 2.54mm

Step-by-Step Symbol Creation Process

Step 1: Calculate Pin Requirements

  1. Count total pins needed
  2. Determine pin arrangement (sides)
  3. Calculate pin spacing (typically 2.54mm)

Step 2: Design Rectangle

  1. Width: (Max_Pins_Per_Side × 2.54mm) + 5.08mm
  2. Height: (Pin_Y_Span) + 5.08mm
  3. Center: Rectangle should be centered at origin (0,0)

Step 3: Position Pins

  1. Left pins: X = Rectangle_Left - 2.54mm
  2. Right pins: X = Rectangle_Right + 2.54mm
  3. Pin length: Always 2.54mm
  4. Pin orientation:
  5. Left pins: (pointing right)
  6. Right pins: 180° (pointing left)

Step 4: Verify Alignment

  • Pin connection points should be outside rectangle
  • Pin lines should touch rectangle edges exactly
  • No gaps between pins and symbol body

Example Calculations

32-Pin IC (16 pins per side)

Rectangle Width = (16 × 2.54mm) + 5.08mm = 45.72mm
Rectangle: (-22.86, Y_top) to (22.86, Y_bottom)

Left Pins: X = -22.86 - 2.54 = -25.4mm
Right Pins: X = 22.86 + 2.54 = 25.4mm

20-Pin IC (10 pins per side)

Rectangle Width = (10 × 2.54mm) + 5.08mm = 30.48mm
Rectangle: (-15.24, Y_top) to (15.24, Y_bottom)

Left Pins: X = -15.24 - 2.54 = -17.78mm
Right Pins: X = 15.24 + 2.54 = 17.78mm

Automated Symbol Generator Template

def create_symbol_template(component_name, pin_config):
    """
    Generate KiCad symbol with proper pin alignment

    Args:
        component_name: Name of the component
        pin_config: Dictionary with pin layout information
    """

    # Calculate rectangle dimensions
    max_pins_per_side = max(pin_config['left_pins'], pin_config['right_pins'])
    rect_width = (max_pins_per_side * 2.54) + 5.08
    rect_height = pin_config['y_span'] + 5.08

    # Rectangle coordinates
    rect_left = -rect_width / 2
    rect_right = rect_width / 2
    rect_top = rect_height / 2
    rect_bottom = -rect_height / 2

    # Pin positioning
    left_pin_x = rect_left - 2.54
    right_pin_x = rect_right + 2.54

    return {
        'rectangle': {
            'start': (rect_left, rect_top),
            'end': (rect_right, rect_bottom)
        },
        'left_pins': {
            'x': left_pin_x,
            'orientation': 0
        },
        'right_pins': {
            'x': right_pin_x,
            'orientation': 180
        }
    }

Quality Checklist

Before Finalizing Symbol:

  • All pin connection points are outside rectangle
  • All pin lines touch rectangle edges exactly
  • No visual gaps between pins and symbol body
  • Pin spacing is consistent (2.54mm)
  • Pin lengths are consistent (2.54mm)
  • Rectangle provides adequate space for all pins
  • Symbol is properly centered

Visual Verification:

  • Load symbol in KiCad
  • Check that pins connect cleanly to rectangle
  • Verify no floating or disconnected appearance
  • Ensure professional schematic appearance

Common Mistakes to Avoid

  1. Pins inside rectangle: Connection points should never be inside
  2. Gaps at edges: Pin lines must touch rectangle exactly
  3. Inconsistent spacing: All pins should have same spacing
  4. Oversized rectangles: Don't add excessive padding
  5. Misaligned centers: Rectangle should be centered at origin

Tools and Automation

Symbol Generator Script

Create a Python script that: - Takes pin configuration as input - Calculates proper rectangle dimensions - Generates pin positions automatically - Outputs KiCad symbol format

Validation Script

Create a script that: - Checks pin positions relative to rectangle - Verifies proper alignment - Reports any misalignments - Suggests corrections

Integration with Existing Workflow

  1. Add to symbol creation process: Always use these guidelines
  2. Create templates: Pre-made templates for common pin counts
  3. Automated validation: Check symbols before committing
  4. Documentation: Include pin placement notes in symbol files

This ensures all future symbols will have perfect pin alignment and professional appearance.