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.

Monday, February 6, 2012

What's the Hackvana plan?

I recently re-read the notes I wrote back in June of last year about my Hackvana vision, and so far, that vision has survived intact.  The last six months have very much been investigation and set-up phases.  I now feel I am ready for the next step - handling orders and doing business. 

Ultimately I'd like to be a parts company.  Or rather, a bill-of-materials company where the bill-of-materials can contain any electronic part you can think of.  However people really want to be able to get all their parts in one place.  Someone who can't find a particular part their project needs will as likely as not go somewhere else for the whole bill-of-materials.  So my goal is to have 98% of parts for 98% of people.

I've heard it said that we only use about 25% of the functionality of the typical word processor or spreadsheet.  The problem is that your 25% is different to my 25%.  In order to be useful to you, to give you the functionality you need, the program needs to be huge.  I face the same problem with parts.  In order to have 98% of parts for 98% of people, I'm going to need a lot of parts.  How many parts?  I'm imagining it's a very large number, and my first guess is at least 100,000.  And 100,000 is a big number, far bigger than I can get going in a few weeks or so.  So I have to work out how I can get to that point, in several stages, while having something I can do for business.  I need to release something achievable today, so that I can get to parts tomorrow.  Here's my plan:
  1. PCBs
  2. Kits for projects we choose.
  3. Bills-of-materials for projects from customers.
PCBs is something I think I can get up and running fairly quickly: Collect the customer's gerber files, do some validation, provide a quote, and send the order for manufacture.  I don't have to have any products on the website, or do too much running around to fulfill orders.  I think it's a good starting point.  Later I'd like to add more comprehensive automated design checking, and automated quoting, but even something simple will be ok.  One of the core ideas here is that the designer can put a Hackvana link on their web page, then a visitor to the web page can get a PCB just by clicking on the link.

After that, I'd like to start on getting some kits together.  There are so many wonderful project ideas on the 'net.  I'd like to pick some and put together some kits for them.  Because I'm picking which kits to do, I can make sure that I can get all the parts (and if I can't get the parts, well I don't do that project).  That way there'll be no customer disappointment because of parts I don't have.  Having put together a kit, I can ask the kit designer to put the Hackvana link on their web page, so that others can order that kit.

Finally, I can start moving to my holy grail, which is to do bills-of-materials.  A designer comes to the Hackvana website, enters the bill of materials for their project, then puts the Hackvana link on their website.  Someone else who wants to build that project can click on the link and source the parts in just a few minutes.

Although I've talked about doing this online, in an automated way, there's no reason why I can't offer these services today, over email.  I have let my friends know this, and I'm now starting to handle some orders on the side.  To those who I've already done orders for, thanks for your early trust. 

So, that's my plan!

Tuesday, October 4, 2011

Hackers helping hackers

Here's an interesting article from Jameco.  This is more or less what I want to be doing.

We are not box shifters, we are hackers helping hackers.  If we're not having a dialog with our customers, I think we've failed.

I think it's that approachability that will make one hacker tell his friend about us, and will make a hacker buy from us a second time.  Repeat business is good business.

I have a friend who has an online store here in Australia (  He keeps it nice and quirky, a fun place to shop.  He says he often sends an order to place X, then next week, he'll get four new orders in a cluster within 10km of X.  That's because hackers are social creatures, inhabiting their own social networks, and if you give a hacker good service, he'll talk.  Far more potent advertising than we could ever do.

Tuesday, September 27, 2011

Suppliers: A look inside the component markets of Shenzhen

Welcome to my "office".
(A bird's eye view of where I spend my time, just one of many floors of many such buildings covering several city blocks)
The markets in Shenzhen, or at least the most visible part, consist of thousands upon thousands of individual stallholders.  The markets fill multiple floors, and take up several city blocks.  Each stall is only a couple of square metres, and may hold one or two people jammed in at impossible angles.  Stallholders are generally of two types:
  • Factory showroom.
    Those that represent a factory and the outputs of the factory.  The factory is usually within 50km.  A common example of this is companies that make switches and sockets.  Look under a glass-topped counter of a stall of a seller in this category,q and you'll see somewhere between 400-2000 different products, all made by the one factory, glued onto a display card using double sided tape.  You can point at an interesting switch, and they'll fish it out and you can inspect it.  In essence, the stall is acting as a showroom.  The idea is that if you're manufacturing  product, you pick a switch you like the look of, and order 10,000 of them.  These guys will happily gives you samples, but the expectation is that you're trying them out in your design with a view to buying, rather than freeloading for a 1-off project.
  • Good place to buy passives by the reel.
    Those that represent the end of a long supply "food chain" from the manufacturer to the market.  The manufacturers could be anywhere in the world, especially with ICs.  Typically, the manufacturers produce items in the 100,000-1,000,000s of items.  The items are fed into a tree-shaped distribution structure, with the distributors in each downstream level handling an order of magnitude's less parts than the level above.  Where you buy in the food chain depends on the quantity you're buying.  Typically, the sellers in the Shenzhen market like to handle sales in the 500-5000 range, and the items are often passive components and ICs.  (The office buildings around the markets contain the larger upstream distributors).  These sellers typically don't have sample tables because the parts are standard, and well, chips just look like chips.  But they do have reels and reels and bags and bags of stuff.  I've seen one stall that sells just one value of one kind of capacitor.  And the fact that the stallholder is still there shows that it's economically viable for the stallholder to do this.
These suppliers are interesting creatures.  For a start, 80% of them come from a region about 300km up the coast called 潮州 (Cháo​zhōu, loosly pronounced as "Chowjoe").  There is a strong correlation between this regional group, and the electronics trade, just as Hasidic Jews in New York have monopolised diamond trading.  Coming from the same region makes it easier for them to do business with each other, because there's the implicit assumption that you wouldn't "cheat your neighbour".

Because of this, it's hard getting a trusted relationship if you're a non-Cháo​zhōu Chinese, and even harder if you're a Westerner like me.  Symptoms of a trust issue is sellers who won't look at you, or give you outrageously inflated prices (I was offered a switch for 15x it's nominal trading price, and it was the best I could do), or they'll trade with you but it's an opportunity to shift some stock to you that's been sitting there for years, and is hence terribly oxidised.

Sellers generally only want to do business if you've done business with them before, so it's a chicken-and-egg situation.  The reason is the Chinese concept of 关系 (guān​xì​, loosely pronounced as "gwunshee", and even more loosely translated as "relationship").  I'll write another blog post about that soon.

One way to overcome this is to get an introduction from someone already doing business with them.  The sociological theory is that neither side is unlikely to do anything stupid (like cheat) to the other, because it would reflect poorly on the introducing friend.  And to put someone in a situation which makes them look bad is something you just don't do in Chinese culture.  Alternatively, an alternative explanation based on economics is that suppliers run on reputation: If I'm a big buyer and a seller just shipped some bad stuff to my small time friend, I'll now start worrying about whether the seller is going to do the same to me.  That may be enough to encourage me to look elsewhere for supplies.  A seller can't afford to lose that relationship.

About six weeks ago I started talking with the founder of a PCB manufacturer here in Shenzhen.  He has graciously allowed me to go along with his buyers to the component markets.  I was introduced to the sellers by the buyers as "a friend of the boss", and each time I'd collect the business card of the seller.  By the suppliers seeing me several times a week, and being introduced in this way, the suppliers have come to recognise me.  The plan has been for me to become familiar to them.

With only one more week left in Shenzhen, the time has come for me to line up those suppliers as my own suppliers, and bring them in on what I want to do. To help me, I had the help of "T", a Westerner friend of mine who may well play a big part in Hackvana's future, and "C" a lady friend of his who can speak 闽南语 (Mǐn​nán​yǔ​, roughly pronounced as "Min nun you"). Mǐn​nán​yǔ is the language of Cháo​zhōu.  The idea was for me to pitch the basic idea to them in Mandarin, then C would follow up in Mandarin or Mǐn​nán​yǔ as appropriate with the operational aspects.  T was introduced as the guy who would be there to do the face-to-face work, especially in the coming month.

These sellers all work in a certain way, which usually involves a good deal of face-to-face business.  This system has evolved to where it is today because it represents an economic maximum.  That economic maximum however, maybe just a local maximum - by working differently, they may be able to find an economic maximum that is higher than what they have at present.  I hope in the future to find a way to migrate sellers to a new maximum, one which is of benefit to both me and them.  However the difficulty is in making it compelling enough for sellers to do business in a new way.  If it's too much of a departure from what's already done, they won't do it.

Yesterday I broke out my ever-growing contact book, and we went to all of those suppliers in turn, and told them my plan - to start my own business.  I told each one, "Using instant messaging, I will tell you what I want, then you take the goods to a certain nearby address, and I will give you cash".  (I must say here that QQ, an instant messaging network, is huge in China.  Everyone uses it, so there's no acceptance risk in having it as part of our plan).

In this case, the departure from standard practice that I'm asking of them is to not do face-to-face business for everything.  Rather, I want them to take the goods to a certain place, and they will receive payment on the spot: Cash-on-delivery.  Cash really is king here.

The three of us all worked pretty hard and we were all exhausted at the end.  I am happy to report though, that of the thirty or so suppliers we talked with yesterday, only one wasn't prepared to do business our way.  (Curiously enough, that supplier doesn't sell regularly to my PCB making friend, doesn't have a catalog, and doesn't have a website.  That supplier can consider themselves dropped from my list).

I put the success of our day down to being able to present to the suppliers an easy-to-understand plan for operation that wasn't too different to what they already do, the goodwill I've inherited from being introduced as my PCB making friend's friend (thank you, you know who you are), and having a local to help out who could speak both Mandarin and Mǐn​nán​yǔ, in order to convey the message.

The reason I want the suppliers to do CoD is because I want to do purchasing in a way that involves no physical effort on my part.  Physical effort on my part takes time (and therefore has an effective money cost), and I don't scale. Ok, in order to deliver the purchases, the buyers may well have to use a courier, and I would expect that cost to be added to the price.  That's ok, because they are much better at sourcing cheap local labour to do the task than I'll ever be, and I'm better off spending the time I'd take in collecting stuff on something else.

What I hope for is to end up with a system where the QQ messages we send to suppliers are not sent by a human, but by our automation systems.  We want to take humans out of the loop (our loop) as much as we possibly can, except in a QC/validation role.  That's how we can scale in the future.  And I want to do it in a way where suppliers don't have to radically change the way they do things, at least not at the moment, because otherwise they won't work with me.  I consider getting all the suppliers on board with an agreement to supply via QQ and using CoD to be a vitally important part of my future plans, and I am so very happy that yesterday went so well.