Creating SVG files for solder paste stencil stencils from KiCad


Eventually, hand soldering surface mount components becomes a pain, especially if you’re doing small manufacturing runs. It’s much easier to work with solder paste and a hotplate.  Joints are higher quality, and you can manufacture more boards at once.  If it was good enough to get Sparkfun started, it’s certainly good enough for us! Working with solder paste does require a stencil, though.  The stencil contains precisely sized holes which allow solder paste to be precision applied to the metal pads on your PCB.  There are many companies which will provide cheap and high quality stencils, but if you have access to a laser cutter, there’s no reason you can’t do this yourself.

There are a lot of guides out there for creating SVG stencils from Eagle, so I’ll be covering KiCad in this tutorial.  Additionally, the laser cutter I have access to at the LVL1 Hackerspace is a Full Spectrum laser which can cut directly from Inkscape, so I’ll be basing this tutorial on Inkscape.

Step 1

Generate gerbers from your completely routed KiCad PCB project.  There are a lot of good guides out there for getting to this point in KiCad.



and a collection of resources here: https://meatandnetworking.com/w/Kicad_Resources

Step 2

Open your PCB in a program like Gerbv.  Any gerber viewer capable of outputting to SVG is alright for this, but I like gerbv the best.  You’ll want to open the solder paste layer, which KiCad names by default to something like “pcbFileName-SoldP_Front.gtp”.

Export to SVG, put the file anywhere you like. In Linux, you have to manually add the SVG file extension.

Step 3

Open the file in Inkscape.

Ungroup the objects by right-clicking on a pad or line and selecting “Ungroup.”

Open the “Fill and Stroke” menu.

Clear the “Fill”.

Turn on “Stroke” and set it to a color that your laser cutter likes.

Our full spectrum laser will try to cut the inside and the outside of the stroke if it’s too thick.  .1mm is thin enough that our laser cutter software will only cut the outside of the stroke.

Step 4

Before proceeding, you can delete the board outline, since it’s unnecessary.

Select all the objects, and open the “Transform” menu under “Object.”  Under the “Scale” tab, MAKE SURE that “Apply to each object seperately” is CHECKED.  This maintains the centroids of all your pads.  You’ll have to play around a little bit to get this value just right. Decreasing the size of the features is necessary due to the thickness of the stencil material.  The thicker the material, the more you’ll need to reduce the size of each feature.  For overhead transparency plastic, 90% is just about right.

Now you’ve got a finished stencil SVG, suitable for lasering.  In a future post, I’ll show off how to soldering using paste and a hotplate.

A Cavalcade of KiCad Resources


This list will be kept up to date on the wiki: https://meatandnetworking.com/w/Kicad_Resources

KiCad is an Electronic Design tool, similar to EagleCAD. KiCad is free, open source software, and runs on OSX, Linux and Windows. KiCad is unrestricted. All features may be used for hobbyist or commercial works.

Here are some features of KiCad that might appeal to the hobbyist:

  • No restrictions on board size
  • No restrictions on number of layers
  • On-the-fly DRC test
  • Nested schematic sheets
  • No restrictions on commercial use
  • Completely open source
    (We should use open source software to build open source hardware!)

Getting Started

  • Kicad Project Homepage
    KiCad can be downloaded here. KiCad support on OSX is alright, but not as good as the other platforms.
  • kicad-testing-daily
    For Ubuntu users: Adam Wolf maintains a launchpad PPA for the KiCad daily build. This build is generally stable, and months ahead of the “official” release.

Basic Tutorials

  • Curious Inventor KiCad Guides
    These guides are very comprehensive, and will get you up and running in no time at all. Unfortunately, they’re a little out of date. For example, they still refer to KiCad as having no “undo” functionality, which it now does.
  • WikiBooks
    This isn’t the best tutorial in the world, but it’s got a great, thorough FAQ.
  • Dr. Johnathan Hill’s Kicad Tutorials
    Dr. Hill takes readers through an example project, which is a great way to get a good understanding of the workflow of KiCad.
  • KicadHowto.org
    This is the new tutorial on the block. It’s not very well organized, but the information contained therein is very good.
  • TransTronics Wiki
    Again, poorly organized, but there’s a lot of good info about general KiCad use here. Some parts are also a bit out of date.

KiCad Libraries

EagleCad users are familiar with having large parts libraries available instantly. With companies like Adafruit, Sparkfun and DangerousPrototypes publishing high-quality Eagle libraries, it can be tough to transition. These resources should help you overcome that hump.

  • KiCadLib.org
    A highly respectable collection of library components.
  • QuickLibGen
    When you have to make your own part, this can really speed up the process. Provide some basic info, and download your schematic symbol.
  • Footprint Builder
    A Java program for quickly creating certain types of land patterns for KiCad components.