Hacker News new | past | comments | ask | show | jobs | submit login
PCB Design Tutorial for Startups (nepsu.com)
102 points by poindontcare on July 9, 2016 | hide | past | favorite | 39 comments



A couple things that I wish people had pointed out before I got started with PCB's:

1) You will spend your life reading datasheets.

2) Datasheets lie.

3) You will spend way more time in component selection than schematic design or board layout.

4) You will spend way more time creating component footprints than in schematic design or board layout.

5) Lay out the board by hand. You will waste more time fighting an autorouter than if you just laid it out.

6) A 6 layer board is not that much more expensive than a 4 layer board and is VASTLY easier to lay out. 2 layer boards should be avoided unless you you are a masochist or every fraction of a penny really counts.

Some of the given advice is a bit off.

1) He doesn't put enough emphasis behind avoiding BGA. BGA should be avoided like the plague. Period. It will only cause excruciating pain.

2) Small QFN isn't that hard to deal with ... if you tweak the PCB footprints a touch (make sure you have .5 mm of bare copper outside the package outline and you can treat them like QFP).

3) 0603 is actually pretty small. Most people should stick with 1206/1210.


Agree on most parts. I would say you can learn to love 0603 and even 0402 if you have the right equipment. You need a proper stereo zoom microscope and then everything is big, and smaller components can save a lot of space. But don't go there until you've done the bigger stuff and actually felt a need for more room. Definitely 1206 and 0805 are plenty fine for people who aren't super in to it.

Another hard lesson I have learned is that PCB assemblers lie. Even supposedly reputable community friendly ones. If they can save money by swapping out a component for unknown alternatives, there's some nonzero chance that will happen.


I was a solder monkey for a summer a few years back, and all I had was a magnifying glass lamp [1], I was soldering resistors down to 0603.

Last semester at university I did a hardware design course (sort of by accident), at the lab, they had a stereoscopic microscope similar to [2]. I never realised what I was missing out on until I used one, apparently they're up to 10 grand a pop, so I can see why my old work didn't have one, being a pretty small shop.

[1] http://uk.farnell.com/lightcraft/lc8093led-euk/led-table-mag...

[2] http://www.visioneng.com/products/stereo-microscopes/lynx-dy...


I've seen that style but never used them. I will say that a $200 AmScope is well worth the investment. Not as nice as a high quality microscope, but vastly superior to a magnifier.


> If they can save money by swapping out a component for unknown alternatives, there's some nonzero chance that will happen.

Yeah, I don't tend to go full turnkey unless I'm doing everything in China. At which point, I fully expect that they're going to use the cheapest, crappiest components they can find, and I'm going to just have to deal with it.

Normally, I buy the components and then ship them if I'm using a US assembly house.


This is all great advice. Making component footprints is the worst. You'd think companies would release footprint files for each part along with the datasheet (formatted for different EDA suites), but they don't. Even if manufacturer footprints were available, it would not always be possible to use them, as in the case you point out with making larger custom footprints for QFN parts (a very helpful tip).

For SMT parts, I find 1206 parts to be pretty huge and generally prefer to work with 0805s if I'm hand-stuffing prototypes, but then again I'm a cheap 2-layer masochist, so the extra space over 1206 parts makes a difference. Parts 0603 and smaller are fine for pick and place robots, but for humans they tend to blow away when you sneeze. :)


I'm surprised. The 2-layer masochists I know tend to prefer 1206/1210 parts because they can use the part as a "jumper/extra layer" and sneak a routing trace (or two) in the middle between the two pads.

0805 is okay, but I seem to need a microscope for my eyes. Whereas I can just put 1210 components on a board without any magnification most of the time.


Passing a trace through the middle is a nice trick, and definitely enabled by 1206s. I'll admit to using that one, particularly for amplifier feedback circuits where one or two parts are 1206s to allow trace pass-through, and the rest being 0805s for density.


Heh, a 6 mil trace fits easily between the pads of 0603 components. I use that one occasionally.


Yeah I was about to say the same, you can route an 8 mil trace between an 0805 too IIRC. I'm a 2-layer masochist too, and I tend to use 0603s for most components and 0805s when I want to route under :)


Stereo zoom microscope off of craigslist was the best purchase I ever made.

I got a Leica, but you can get really good Chinese ones for $400. If you do much PCB assembly, they're killer.


I wish I had a stereo inspection scope...

I've seen used boom-mounted dental microscopes on Craigslist or eBay periodically, and can't help but think they would be perfect for PCB assembly.

It's amazing how precise our hands can be when we have better magnification. Sub-mm accuracy of movement, which is a weird evolutionary trait if you think about it—more accurate than our unaided vision allows.


> Sub-mm accuracy of movement, which is a weird evolutionary trait if you think about it—more accurate than our unaided vision allows.

We access our sub-mm digital accuracy generally by touch feedback rather than by sight feedback.


> Making component footprints is the worst

I feel also like the tooling for making footprints is not really that good either. What I'd love to see is full-blown MCAD style drafting system with proper constraints and parametrics etc in a footprint editor. It's bit silly that I have to draw manually the footprints for example different pincount variants for the same standard package instead of making just one base template and driving it with parameters.


this exists, but isn't free. I often use commercial software to generate component footprints


Write some scripts for FreeCAD to export to the right formats expected by EDA software?


This is all great info and advice. I just wanted to add some extra info from the perspective of an EE that works for industry (well past the point where advice 1-3 are relevant)

1) this is generally true, except if you're working on something like power electronics (and not just taking a design straight from TI or something) or on a complex mixed mode board, you can spend far more time in simulation, prototyping, and characterization of parts than in datasheets because, as you said in point 2, they lie. I've been in situations where I spent 4 weeks on research and design, only to spend 8 weeks teasing out the differences between three vendors' high power transistors across a dozen batches to figure out how variations in manufacturing changed the efficiency of an inverter.

3) this changes drastically with more complex boards. If you're making an ARM mobo, for example, you can have hundreds of parts most of which are the same (capacitors, resistors, etc). Choosing the processor and peripheral chips takes a lot less time than schematic capture and PCB design, especially if you have experience using the parts. You WILL spend way more time dealing with drivers and firmware though. I need two hands to count the number of times I've had to rewrite vendor provided firmware like standard USB or ethernet implementations because silicon companies are, most ironically, incompetent at software.

4) The more you work in EE the more this changes. A dozen EEs and I share all of our Altium footprints and we spend less than a day on footprints for a month long project, most of which is spent checking the important footprints against the datasheets before sending off to fab.

5) the ONLY time I have seen an auto router do good work (having used Electra, Specctra, cadence, and altium) is on 20+ layer PCBs like Intel motherboards. In this case, there were about 15 EEs, 5 of whom worked almost exclusively on configuring the autorouter and simulating the results. If you're starting out in PCB design, at best you'll get a few traces properly routed (probably in the wrong order) and at worst, it'll be like Jackson Pollock vomiting a bunch of virtual copper.

6) Unless you're high volume, it's almost always better to just increase the number of layers. The sunk costs for finishing a working PCB design are huge but manufacturing can be very flexible and inexpensive if you're willing to wait.


I'd like to add a couple of extras:

7) Errata documents can be very important, at least give them a quick glance before deciding on a part.

8) If you are producing any significant quantity of a board, do not use the Digi-Key or Mouser parametric search. Find manufacturers through these and other sources, then look for parts on the manufacturer website.

9) Do not use NRND (not recommended for new designs) parts if you can avoid them. These parts will cause you pain.

10) Read the datasheets for odd packages carefully. The "flags" (pads) underneath TSSOP chips can be connected to VCC, VDD, or GND.

11) There are packages even more painful than BGA (such as LGA).


1) I really don't mind BGA as long as the pitch isn't too fine and you're using a stencil.

A stencil made the biggest difference for me! I had always tried to save money in the past and just apply paste with a syringe but it's not worth it at all if you have tiny parts.

Once the paste is in place, you can drop tiny parts on quite easily.

Here's what I use for working with tiny parts, including BGA and 0402:

- stencils - they're cheap from oshstencils.com

- high quality fine-point tweezers

- 10x loupe - it's cheap and works very well for inspection

- hot air station - this is a great way to solder everything down without touching

- hot plate - I use this for preheating 6-layer boards to about 200c since they're hard to solder if you have pours

That's it! It's really only a $200-$300 investment for the basic stuff needed to do prototypes in-house.

Here's a time-lapse of me assembling something with BGA and 0402:

https://vimeo.com/168423683


+1 for oshstencils; I recently tried their new stainless steel stencils -- very nice! Stiffer than the kapton ones (less oozing underneath) and much more durable.


> 0603 is actually pretty small

I disagree, if you have a half decent soldering iron, and some form of magnification (I used to use one of those desk lamps with a magnifying glass), then 0603 is not difficult to solder at all.


I wouldn't say datasheets lie as much as Oh hey I didn't tell you that this sentence here on page 9 is super important and also this little note hidden in the table on page 13 and by the way this little schematic on page 11 of the {document that's not the main datasheet} is critical...


My God, thank you for posting this comment!

When I was getting started in simple PCB design and layout, these were the exact issues I found, and I thought I was just horribly unskilled and losing my mind!

Well the former is true, but after reading this I realize the latter was thankfully slightly less true!


Mind sharing more about BGA?


You mean, other than for me to threaten to stick a red hot poker in your eye if you use it? :)

BGA isn't "impossible" for a hobbyist. But it's a huge amount of work for very little gain.

All advice here also applies to what people refer to as CSP (chip scale package) as well.

1) BGA packages generally require better than normal PCB rules in order to actually "fan out" the signals to routing. BGA packages can put a lot of signals in a small area (that's why people like them), and you wind up needing very small pitch traces and vias to get everything out. You may even need an 8-layer board to pull it off

2) You can't really inspect BGA without X ray equipment. I don't know of any hobbyist X-ray machines yet (that actually might be a good project...)

3) BGA is prone to strange failures if you don't get ALL the balls down properly. You can get things like unpowered chip sectors because a Vdd ball is a little flaky (chip manufacturers don't always spend money reinforcing the on-chip power grid if they think you are using balls).

4) If you have a "small" (less than 40 pin) BGA, there is almost always a QFN option that is easier to work with and is almost the same size.

5) Thermal management of a BGA can be tricky. There is normally better heat flow out the top of a chip than down into a board, but BGA's normally want to push heat into the board.

That having been said IF YOU MUST use a BGA:

1) Use a contract manufacturer

Really. This is the best advice. I got some very tiny CSP chip boards done for like $50 per board for 20 boards. Even if your time is only worth $20/hour, the crossover point is 50 hours of work. You'll spend lots more than that if you're playing with BGA.

2) If you have a small number of balls, see if you can adjust the footprint such that you can hand solder things by having copper stick outside the package outline.

I can't give you any general advice as this is specific to every chip. However, I have successfully routed things like power regulators which only have a small number of balls this way. I have also routed some bigger things like FPGA's this way (you can reorganize the output pins) where I simply didn't even try to use any pins not on the outermost edges. However, you are at the mercy of the manufacturer as to how many power balls you need hooked up properly.

3) Use a reflow oven. There are lots of reflow oven things on the market for <$500. If you get things placed right, a reflow oven gives you decent results.

4) Don't try to hand rework. Accept that you're going to throw the board out if there is a short.

Yes, I'm sure lots of people have done things and been successful with BGA. However, if you do enough, you will find you are at the mercy of luck rather than consistency with BGA unless you let folks who have reflow and X-ray machines do the work.


Good points for the most part, but:

1) 1mm and 0.8 mm BGAs are very common, and most of them can be handled with 5/5 trace/space rules supported by pretty much every board house. Many experienced people are actually more nervous when dealing with QFNs than with BGAs, primarily because of large thermal pads. 0.5 mm BGAs are where life starts to suck.

2) You can get a pretty good view of BGA solder quality with a "brush light," basically a bundle of optical fibers that go between the chip and the board. E.g., http://www.gen3systems.com/downloads/products/optiliabgainsp... (300 KB .pdf). If you have problems they will usually be pretty obvious -- it won't be that common for a single ball connection to be bad.

Re: reflow ovens, you may not really need one for prototyping. Hot air tools alone are fine for many applications (see below). A reflow oven would be nice to have but there are lots of more important tools to acquire first.

Re: avoiding hand rework, this is actually terrible advice. Get a good stereo microscope (AmScope is a decent economical brand), a good iron (meaning Metcal-class), and whatever cheap Chinese hot air tools are being hawked on eBay this week. If you're in this business, you are in the rework business, whether you like it or not. Might as well get used to it. (Pro tip: after the items above, your next purchase should be a preheater.)


The T962-A reflow oven once modded/re-flashed is an excellent addition to your workshop. I've run several hundred boards through mine and the finish is really professional using stencils (from oshstencils) and hand-placed components.

I also use the oven in manual mode to warm the boards to 150C before any hand soldering of through hole components such as headers (so the ground plane doesn't suck the heat out of the soldering iron!).

(Now if I could just figure out how to do home-brew wave-soldering of the .100 headers rather than by hand).


A long article that says almost nothing. Instead of choosing trace widths and layer count and component sizes at random, take a week to read and understand the very useful book "High Speed Digital Design" by Howard Johnson. Despite the name it concerns itself more with the analog domain than with the digital. Very useful information about the behavior of traces and holes in boards.


High Speed Digital Design is a great book (a "handbook of black magic," as its subtitle professes), and it is a nice complement to Horowitz and Hill's The Art of Electronics.

You're exactly right that the former addresses way more analog details than the title suggests, and at high frequencies the analog stuff really matters. A passive component is never simply a capacitor, resistor, or inductor. We just call it one based on the dominant characteristic. At particular frequencies the characteristics can change so much that designs have to take the difference into account.

Application notes and manufacturer references also contain a wealth of information. TI's Op Amps for Everyone (a great reference in general) has a chapter (17) devoted to PCB design:

http://web.mit.edu/6.101/www/reference/op_amps_everyone.pdf

Beyond comprehensive references, you can pick up things from articles as you go; I learned the trick of using two back-to-back Schottky diodes to reduce the ground plane potential difference to <0.3V from a PDF like this one:

http://www.ti.com/lit/an/slyt499/slyt499.pdf

Trade magazines with articles are another great resource, like Circuit Cellar or EDN.


Johnson's book is good, but it is WAY overkill for the vast majority of PCB design that you can do as a hobbyist.

I can sum up what you need to know for high speed design in a nutshell:

1) True high-speed design has a sample PCB layout in the datasheet or application note. Follow it RELIGIOUSLY.

2) If you don't have any specific notes about layout, put a single 50 Ohm resistor in series on any communication link clock line (aka JTAG-TCK, SPI-SCK, etc.) at the source. Too many chips these days are capable of launching and responding to a clock edge that has GHz components on a link that's supposed to be KHz. That 50 Ohm series resistor knocks the edge rates down to where they should be.


I didn't want to be critical of it but as someone who went through the process of designing and manufacturing my own hardware product to sell a couple years ago that was my thought as well. Really long and very little insight into the real difficult parts.


As someone who has actually designed manufacturable boards I'd say the same. In addition the article has some strange recommendations:

* don't use QFN — I see no reason to, on the contrary, these are great packages (see my other post in this thread)

* 0603 minimum size for passives — huh? I see no reason not to go down to 0402, which is both easy to manufacture (assembly costs are the same, component costs are usually lower), and easy to prototype (just get a large desk magnifying glass and a good pair of tweezers and you're good to go).


Yes, it seems much more like a high-level overview than an in-depth tutorial.


Here's something I don't get: why discourage people from using QFN packages?

QFNs are only a problem if you are hand-soldering your boards with a traditional soldering iron. Which is nuts. These days everyone should have a soldering station with both traditional iron and hot air — and soldering QFNs using hot air is straightforward and easy.

Besides, the article is about manufacturing, so you aren't likely to solder those QFNs yourself. So why discourage them?

I think QFN and DFN packages are fantastic. They save lots of board space (and believe me, board space matters a lot in all designs, more than you think!), have good thermal properties, lack of leads makes for better low-inductance connections, less material means lower price. And most still have pitch of 0.5mm or more, so you can use the same design rules and same PCB pricing. Everything is great about them.

BGAs are a different matter, but not for the reason most people think: they are problematic not because they are difficult to solder, but because you need much tighter PCB parameters to be able to route all the signals. In particular, via size is the biggest problem. You need really small vias that can be placed between four BGA balls.

I dislike the hate being poured onto QFNs. I think it is a relict of the past: back when hot air was expensive and "strange" and people tried to solder everything by hand using a soldering iron, QFNs were the enemy. But these days they should not be.

The unfortunate effect of hobbyists hating QFNs is that some manufacturers (Freescale/NXP, notably) later class certain chips as "hobbyist" and don't provide QFN packaging at all. And believe me, if you're designing a wearable device, the difference in size between a QFN-64 and an LQFP-64 is monstrous. Providing no real advantages, because both have 0.5mm pin pitch.

So, while I would agree with the author that BGA packages are best avoided, I would encourage everyone to actually go ahead and use QFN/DFN packages. They are better in every respect.


Nice overview article. I have been doing PCB's for about 3 decades and here are just a couple of little tricks I have learned over the years, some are too long to go into here, but just a couple quickies maybe will help someone out:

1) Often the chip manufacture provides BSDL files which often times contain the foot print info and a lot of CAD tools have macros that will read them in and create your foot print for you.

2) There are often foot print libraries already out there you can download or are provided by the CAD software. But in either case, don't trust them, there are often errors, get your parts first, do the PCB layout, print it out on a good printer (usually the CAD SW will print it to scale and test fit everything.

3) There is a big difference between doing prototype boards and production boards. For prototype boards, make them big because you will have mistakes and will probably have to black wire (cut a trace and fix) it. I often use 2 layer or 4 layer for prototypes because it is easier to do fixes. If you CAD SW does auto layout then it is not that big of a deal as long as the board is large enough for it to route everything for you. For Production PCB's it is a different story and a lot more work to do right and I recommend farming it out if you can afford to.

4) I agree that part selection is critical but also, if you have simulation software either a separate program or in your CAD system, doing simulations can save you a lot of time. If you don't have simulation SW check into it, there are some decent free ones to learn on but to get serious you have to pay a lot.

5) For complex designs, I do separate prototype boards, one with the FPGA on it, another with the MCU and another one with the analog on it and so or, sort of a unit test approach (sort of like dev-ing SW) that way you can swap out sections that aren't working for you without throwing away a board full of parts, it is more effort but if you plan it out it can save you time and money.

6) I agree with the BGA comments, don't use those types of components unless you have a reflow oven and know how to use it, it is easier to debug QFN and QFP type packages since all the leads are exposed for inspection. You can often get parts in either package type and when you go to production you can always swap out to the smaller package later. If you have to use those for prototyping check if the manufacturer has a prototype board for it already it can be easier to just use an off the shelf one.

A lot of people say the first board is a throw away, but that can be expensive for a production one so I have learned these tricks for prototyping so when you get to production you can avoid that bad first board.


> There is a big difference between doing prototype boards and production boards. For prototype boards, make them big because you will have mistakes and will probably have to black wire (cut a trace and fix) it. I often use 2 layer or 4 layer for prototypes because it is easier to do fixes

Not only this, you can also print your own boards if you stick to two layers. Way, way, way faster than waiting days to try something out and notice you swapped Vcc and GND pins on a chip by accident.


Heck ya, if you have the capability to do your own boards, even if only 2 layer, I would do that. So much faster t !


I'm in the Bay area and a hardware hobbyist (software is my full time gig). I see tons of meetups for SW but almost nothing for electronics hardware. Any recommendations?


Also, ChipQuick is great. It's super-low melting point solder you can use to easily rework SMD components. This thing has saved my ass too many times to count as a hobbyist :) Was able to get away without a reflow station for the small stuff I've been working on.

http://www.chipquik.com/store/index.php?cPath=200




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: