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:¶
For Right-Side Pins:¶
For Top/Bottom Pins:¶
Step-by-Step Symbol Creation Process¶
Step 1: Calculate Pin Requirements¶
- Count total pins needed
- Determine pin arrangement (sides)
- Calculate pin spacing (typically 2.54mm)
Step 2: Design Rectangle¶
- Width:
(Max_Pins_Per_Side × 2.54mm) + 5.08mm - Height:
(Pin_Y_Span) + 5.08mm - Center: Rectangle should be centered at origin (0,0)
Step 3: Position Pins¶
- Left pins: X =
Rectangle_Left - 2.54mm - Right pins: X =
Rectangle_Right + 2.54mm - Pin length: Always 2.54mm
- Pin orientation:
- Left pins:
0°(pointing right) - 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¶
- Pins inside rectangle: Connection points should never be inside
- Gaps at edges: Pin lines must touch rectangle exactly
- Inconsistent spacing: All pins should have same spacing
- Oversized rectangles: Don't add excessive padding
- 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¶
- Add to symbol creation process: Always use these guidelines
- Create templates: Pre-made templates for common pin counts
- Automated validation: Check symbols before committing
- Documentation: Include pin placement notes in symbol files
This ensures all future symbols will have perfect pin alignment and professional appearance.