Building KiCad Footprints from Scans of Undocumented Connectors

A scan gives scale, not certainty

Connectors sold without a mechanical drawing still have to be mounted on a board, and a flatbed scanner is one of the few tools available for capturing their geometry. A 2016 jasiek.me article documents the approach for cheap SD card sockets that had no CAD data: scan the part, scale the bitmap, trace the pads in a CAD package, and import the result into KiCad’s footprint editor. The sequence produces a footprint candidate. It does not produce a validated footprint, and at connector pitch the difference matters.

What 300 dpi actually specifies

Scan resolution is a sampling rate, not an accuracy statement. At 300 dpi the nominal pitch is 25.4 / 300 = 0.0846667 mm per pixel, or 11.811 pixels per millimetre. The article’s author derives the same factor and reports the rounded value used for the drawing: “the width/height factor turned out to be 0.0847 (300 dpi is 11.811 dots/mm”. That number fixes the scale of the image. It does not describe how closely the scanner, its driver, or the operator’s judgement about where a pad edge begins will reproduce a real dimension: a one-pixel difference in edge placement is roughly 0.085 mm in the drawing.

The author’s statement that “At 300dpi, a scan will yield a sufficient measurement on most, if not all parts” is a report from that project’s parts, not a specification for fine-pitch connectors.

Calibrate against a known dimension

The nominal figure should be checked on the same scan that will be traced. Choose a feature with an independently known size – a pad width from a partial drawing, a body dimension, or a reference object placed beside the part – measure it in pixels, and divide to get millimetres per pixel. Repeat for X and Y separately, because the two axes need not scale identically. Arithmetic sanity checks help: at 300 dpi a 2.54 mm pitch should span 2.54 / 0.0846667 = 30 pixels, and a 10 mm feature about 118 pixels. Those counts are derivations from the nominal pitch, not tolerances, and a measured span that misses them points to a scale or alignment problem rather than an unusual part.

Alignment is the second capture-time error. The author placed each part against a straight rectangular card touching the scanner edge – “Simply place the card (or any other rectangular item) next to the edge” – because relying on “to use the edges of the scanner to align the parts” proved unreliable in that project. Rotation is worth preventing at capture: a tilted part inflates measured pitch along one axis and is awkward to correct after tracing.

From bitmap to footprint geometry

In the documented workflow the bitmap is imported into a CAD package – the author used QCAD: “Fire up your favorite CAD package ( QCAD is my choice), and import the bitmap.” Rectangles are drawn over the pads, with copy or array tools used to place them at equal spacing, and the connector body outline is traced as well for later silkscreen use. The drawing is exported as DXF and imported into KiCad’s footprint editor through “Select File | Import DXF File”, with “select a layer you wish to import your drawing into” – the author chose Dwgs.User.

The imported DXF is graphic geometry on a user layer, not a pad stack. Pads, numbering, courtyard and the reference and value fields still have to be built in the editor, and the KiCad 9 PCB Editor manual covers that work under “Creating and editing footprints” and “Managing footprint libraries”. Menu wording can move between releases, so the current manual is a better guide to editor behaviour than a 2016 article, which the documentation itself notes “is in the process of being revised”.

Checks that decide usability

Before the footprint reaches a board, the following should be checked against the physical part:

  • Pitch between adjacent pads, and the cumulative span across the whole row divided by the number of gaps. A local match with a drifting total points to scale error rather than part variation.
  • Pad length and width against the actual lead or solder tab, including the toe and heel fillets the assembly needs.
  • Courtyard and body clearance, including the space the mating plug or cable requires.
  • Pin 1 position and numbering read from the part, then re-read after flipping the footprint to the bottom side.
  • A mirrored view for parts mounted on the underside, where pad numbering and orientation are the usual errors.
  • A one-to-one paper print at the calibrated scale, with the connector placed on it and the pads checked by eye.

KiCad’s design rule checker is a separate control and answers a different question: it “is used to verify that the PCB meets all the requirements established in” the Board Setup dialog and that every pad is connected as the netlist requires. The documentation’s advice that “it is important to use the design rule checker” before generating manufacturing files therefore applies to the board as drawn. DRC cannot compare a footprint with the object on the desk, so a consistently mis-scaled footprint that violates no clearance rule will pass it.

What a scan cannot establish

Optical capture from above records a silhouette and the visible features of a connector. It does not reveal plated barrel diameter, plating thickness, contact position inside the housing, spring travel, or the coplanarity of solder tabs. Those details need a datasheet, calipers, or a cross-section, and where they are unknown the footprint should stay provisional until a physical fit check is done. Scanned edges are also an image feature, so a traced outline is an interpretation of the picture rather than a measurement of the part.

A workable order

Capture at the highest resolution the scanner supports – 600 dpi halves the nominal pitch to 0.0423 mm per pixel – include a known reference in the same image, calibrate both axes, then draw and import. Verify pitch, courtyard, orientation and the paper fit before any board is ordered. For readers moving existing library parts rather than scanning new ones, the notes on converting an Eagle library to KiCad cover the library side of the same workflow.


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top