Friday, May 2, 2014

Via sizes and soldermask

Vias.  The plated holes that go from from one side of a PCB to the other to make a circuit between them.  They're very useful when there are too many traces to keep on just one side of the PCB.  In this picture, there are 8 vias in the area under the small CPU.  (This board has had solder paste applied to it)

Except for the pad areas (covered here by solder paste), this board is covered by green solder mask.  It's the solder mask that gives a PCB its colour.  The solder mask is a little see-through, so the lighter areas are the copper tracks.

Solder mask can be applied as a dry film, or as a liquid.  The fabs I use all use the liquid process. 

It's standard design practice to cover vias with solder mask, because they look better that way.  The problem with covered vias though, is that it's hard to use a test probe on the via to take measurements of the circuit.

If you're developing a circuit, most PCB design programs have a setting that lets you "open the vias".  If you turn this on, the file that describes the solder mask will specify solder mask holes where the vias are.  Each via will then have a small plated ring of solder.  That way, you can easily measure signals at a via.  If your design program doesn't have this setting, or you don't want to change your files between prototype and production, you can also ask me in your order email to "open the vias" of your design and I'll arrange to have it done at no cost.

All holes have a diameter, and vias, being plated holes, are no exception.  Holes on my standard boards can be as fine as 0.3mm (0.012"=12mil) across.  You can use 0.3mm holes with confidence.  (If you have a fine pitch design, I can arrange 0.25mm or 0.2mm holes at extra cost)

Because the fabs apply the solder mask as a liquid, and because vias are usually covered, the liquid has to span the barrel of the via.  For small via diameters (0.3mm) that's ok - surface tension is enough to keep the soldermask as a continuous film over the barrel.  But if the barrel is wider - say 0.5mm and above - surface tension isn't enough to stop the film from popping.  What happens then is one of two things.  If you're lucky, surface tension turns against you and causes the liquid to pull back from the via.  In this case, you'll get a via with a coppery look:

Picture supplied by M. Lövqvist, used with permission.

Picture by Sync, used with permission.

Picture by M. Rogger, used with permission.

If you're unlucky though, something else happens: The barrel of the via acts as a reservoir for the solder mask liquid.  This then bleeds out of the barrel and pools around the hole.  This shows up as a dark blotch near the via:

Picture by Sync, used with permission.

It's not a good look.

So, if you want to avoid problems with solder mask over vias, you can either open your vias, or choose via diameters of 0.5mm and smaller.  0.3mm is perfectly safe.

Friday, February 21, 2014

Registration numbers, tracking numbers, and statistics.

I offer two kinds of shipping: DHL and registered Hong Kong Post.  Both of them have proven to be very reliable.

Hackvana PCBs are produced in and around the city of Shenzhen China, which is right on the border with Hong Kong. 

When boards are shipped by DHL, they're picked up from the dispatch office by a DHL staffer who takes them and punts them into DHL's system.  No surprises there.  The next step for anything sent by DHL in Shenzhen that's bound for outside of China is that the packages make their way to Hong Kong.  This involves clearing customs in China and Hong Kong.  From when the package leaves the office to when they're safely tucked away on a plane out of Hong Kong takes about a day.

When boards are shipped by HK Post, they are collected from the dispatch office by a private contractor.  This contractor takes the sacks of packages from the office in Shenzhen across the border into Hong Kong.  Once they're in Hong Kong, the packages are handed over to Hong Kong Post for the rest of their journey.

Side note: Last year (2013) there was a time where I was forced to use China Post.  Packages sent by China Post get bagged and sent to the city of Xiamen a few hours up the Chinese coast.  Delivery took four weeks in many cases, and many packages got lost.  I'll never use China Post again.  If your supplier in China suggests China Post, run away.

When your boards ship, I'll send you a tracking number (for DHL) or a registration number (for HK Post).  What's the difference between these two kinds of number?

DHL's tracking number lets you see what's happening with your package in real time.  You can visit DHL, enter the number, and find out where it is.  You can even ring DHL and give them alternative delivery instructions.
The status of packages sent by HK Post is not live, and the information is not updated in real time.  In fact, there's no guarantee you'll be able to find out anything about your package.  However information about where your package has been does come through and you can visit and get some information.  The first scan can take several days to turn up.

My experience with Hong Kong Post is that it is super-reliable.  There have been a small number of problems, but these have been either a problem at the customer's end (twice, a customer's partner has received the package and then stashed it somewhere the customer didn't know), or a problem with the local mail delivery service in the customer's country.  There was also a time last year when all HK Post packages were suspended because of an issue with Lithium ion batteries.  That's what forced me to go to China Post).

You might ask "so if Hong Kong Post is so reliable, why pay the extra USD3 to send it registered?"

There are three reasons.  The first is to confirm that I sent your package to you.  HK Post has been so reliable that I'm certain your package will get there.  However if it hasn't turned up, you might be concerned that it was never sent in the first place.  Registration lets you and me verify that it was sent.

Second, registration lets me confirm that delivery was attempted.  if your package didn't turn up, you're going to be writing me an angry letter asking me to remake your boards.  And being able to see that delivery was attempted steers us clear of it being my word against yours that it was sent.  If you want me to consider replacing your boards, better send it registered.  I certainly won't replace them if it wasn't sent registered.

The third (and most important) reason is that when a postal worker sees the registration sticker, well, they won't throw your package into the bin, or over a hedge, because they know that if they do, I'll be able to track them down.  So sending it registered is a bit like a magic spell which keeps your package safe from postal workers!

So, what are some other good things to know?

Well, with DHL I have to declare the true value of the package, so if the customs service in your country charges steep duty on everything (for example, Britain charges 20%), then paying this on entry is going to be a bit annoying.  Packages sent through HK Post by our shipping partner ( are declared to have a value of USD10, and usually no duty is paid on them (Germany is an exception).

HK Post is generally faster than people think.  The average delivery times to England, France and Germany is about 7-8 days.  The average time to Australia and the USA is about two weeks.  Some European countries can be 3 weeks or longer.  It really depends on the efficiency of the postal service in the country the package is going to.

HK Post has a weight limit per-package of about 2-3kg.  If your PCBs weigh more than this, your PCBs may be split up into separate packages.  With DHL there's effectively no weight limit and your items can be sent in one package.  I have sent packages of boards and parts weighing nearly 40kg, and I know DHL are happy to move objects weighing more than a tonne.  You'll pay for it though.

HK Post can deliver to a PO Box, whereas DHL won't.  With DHL you have to give the address of somewhere that can accept a package for you during business hours.

DHL costs more than HK Post, but if you want to get your boards quicker, it's the way to go.  I offer "combo shipping" to help with the shipping price.  If you and your friends want to order at the same them, then I'm happy to ship them together.  Each person gets their own Hackvana paperwork and organises their own payment with me.  At delivery time, all the boards are put into the same bag.  This means that shipping for each person will be lower.  This is a good way to go if you're part of a club and can organise to get boards made at the same time.

Sunday, February 2, 2014

Slots in KiCad

This post shows you how to create PCB slots using KiCad.  It's a follow-on from my general Slots article.

Slots in the drill file.

First, place a hole module on your board.  In my KiCad, it's called "douille_4mm".  You can then load the hole into the module editor, and edit the pad.

In the pad properties, set the "Pad type" to "NPTH, Mechanical", set the Pad shape to "Oval", and set the Drill shape to "Oval".  Then edit the pad X and Y to be the dimensions of the slot, and set the drill X and Y to be the same size:

I think you don't need to set the layer.

Slots in the outline file.

First set the current layer to "Eco2.User", and use the line drawing tool to draw a fat line of the size of the slot you'd like:

Next we're going to trace around the outline of the slot with thinner lines, in the "Edge Cuts" layer.  Select "Edge Cuts", then the line tool, and do the two parallel horizontal lines:

 Now draw the ends of the slot using the arc tool:

Pro tip: Rather than using four 90° degree arcs, you can use 2  180° arcs by drawing one arc then setting the arc angle to 1800, which is 180°'s worth of 1/10° increments:

Now that we've traced all around the outline of the slot, erase the inner stroke from the Eco2.User layer:

And finally reduce the line width of the outline strokes in Edge Cuts:

Here's the finished outline done with 0.001mm lines:

This outline will then be present in your outline layer after gerber generation.
Thanks to Honeyclaw for the pictures. Used with permission.


Sometimes a design needs some non-round cut-outs in the board. These are often in the form of slots. If you need slots, here are some things to keep in mind.

During manufacture, slots are created using CNC routing.  The milling bit used to create them is 0.8mm in diameter, so this sets the minimum width of the slot.

These slots are minimum width
(Image:RikusW, used with permission)
The files you send need to show where you'd like the slots.  There are two ways to do it.

The first way is by putting them into the Excellon drill format.  This format can do simple slots as well as holes.  A simple slot is basically a line that goes from one point to another.  Because it's an extension of a hole, the ends of the slot will be rounded.  It's possible to overlap these slots to make more complex shapes, but it's a bit limited by the format supporting only fixed-width slots, rather than arbitrary polygons.

If your design requires plated slots, then make sure the slot definitions go into your plated drill hole file (generally with a .txt ending). If you need unplated slots, put the slot definitions in your unplated drill hole file (generally with a -NPTH.txt ending).

If you'd like to see how to do this with KiCad, see my Slots in KiCad article.

The second way is to put the slot information into your outline file, just as for your board outline.

Consider for a moment how strokes in your outline layer define the size of your board.  The outline of your board isn't affected by the stroke width (it's ignored), but by the centreline of the stroke.  And the same is true of any slots in the outline file: It's the centreline of the strokes that sets the boundaries of the slot.  So apart from keeping in mind that the the minimum slot width is 0.8mm, you don't need to do anything that takes into consideration how the factory will make the boards.  I.e., you don't need to allow for the tool size when defining the slot.

Let's say you want a slot that's 3mm across.  There are two ways to do this.  The first is to have a stroke in your outline layer with a width of 3mm.  The second way is to have two very thin parallel strokes, plus corresponding arcs at the end, that form a polygon enclosing a space of width 3mm.

The fabs I use accept both, although my preference is for the latter, for three reasons:
  • The thick stroke method relies on not ignoring the width of the defining stroke.  So it puts the factory in a situation where they have to assess every stroke in your outline layer and work out whether thickness is significant.
  • The thick strokes look terrible when viewed with tools such as gerbv and gerblook.
  • My panelisation tools have trouble panelising designs that use thick strokes. 
If your design uses fat strokes, you can convert them to thin strokes by drawing around the perimeter of the fat stroke with thin strokes, then deleting the fat stroke.  See here for an example of doing this with KiCad.

So, both the drill file method and the outline layer method are valid and common.  When to use one over the other?

If you need plated slots, you have to use the drill file method.
If you want to see the slots using gerbv or gerbview, choose the outline layer method, as these programs don't display drill file slots.

Finally, here's a lovely example of a board that was done using the outline layer method:

Lots of exciting slot action here, using the outline file method.
Design by mog, shared with permission
You can see conventional slots (between the top, middle and bottom board), rectangular slots on the bottom board, and non-rectangular cutouts in the right-hand board.