I just blew out two ATmega328’s, so while I wait for more to arrive I thought I’d post about something that’s been on my mind. I’ve been getting my PCB’s made by OSH Park, an often-recommended source from which I’ve gotten great results so far, but the costs are starting to add up. I’ve also tried Seeedstudio, but my OSH Park orders are coming in now under the $15 Seeedstudio minimum ($10 lowest-cost option + $5 shipping), plus OSH Park turns things around faster; Seeedstudio has some great larger options, such as $20 for 10cm x 10cm boards, and they’re also great because they give you 10 copies back, but lately I’ve been sending all my orders to OSH Park.
When I first discovered OSH Park, I was pretty amazed by their $5/sq inch pricing: $5 isn’t very much! As I’ve been designing boards, though, I’m learning that neither is one square inch, at least if you’re using through-hole components. I recently had a foray into surface-mount components, where I was pretty happy with the size reduction from going to a partially-SMD design; the two boards in the picture are the exact same schematic, except with all the LEDs and passives replaced by surface mount components. I wasn’t even that aggressive about reducing the size: I stopped making changes once I hit the 5cm x 5cm Seeedstudio minimum (this was my test order with them). This got me thinking, though: with such straightforward pricing from OSH Park, it should be possible to quantify the value of using smaller components.
In order to quantify this value, I wanted to create a very simple measure of how “expensive” each package is; there are many aspects that contribute to the board size, but for these purposes I’m only considering the constraint that parts have to be non-overlapping. I was pretty generous about saying how little space a package takes up, since that makes the conclusion even stronger: I assumed that you can and will place surface-mount components under every through-hole component, which reduces the effective cost of through-hole components.
I got the footprints from a variety of sources (mostly SparkFun libraries and the builtin “ref-packages”), though I tried to be consistent about using the same source for packages that would be directly compared to each other. Again, these represent minimums and not “all-in” costs; they also assume that your boards are constrained by available board space, and not other factors such as handleability or edge connections. Here are the approximate costs I calculated; all these prices are for an order of three boards, so the cost per board depends on how many of those three you expect to use:
- Pin header: $0.05 per pin
- 6-pin header: $0.30
- 20-pin header: $1.00
- DIP package (0.3″ width): $0.07 per pin
- 8-DIP costs $0.56
- 14-DIP costs $0.98
- 20-DIP costs $1.40
- 28-DIP costs $1.96
- SOIC: $0.02 per pin
- 14-SOIC costs $0.28
- SSOP: $0.01 per pin
- 14-SSOP costs $0.14
- 32-TQFP (0.8mm pitch): $0.40
- 32-QFN (0.5mm pitch): $0.15
- Through-hole resistor (1/4W, non-mini): $0.17
- 5mm led: $0.24
- 3mm led: $0.15
- 1206: $0.035
- 0805: $0.018
- 0603: $0.012
- 0402: $0.008
- #4 standoff hole: $0.20
I was pretty surprised when I saw these numbers: using through-hole components is expensive! It looks like the biggest gains are going from through-hole to any sort of surface-mount component, with diminishing gains from using smaller surface-mount packages. For example, the 28-DIP ATmega328P, the chip on the Arduino and the microcontroller I’ve been using, costs upwards of $2 to place on the board, but you can cut this down to $0.40 if you use the 0.8mm-pitch TQFP version, and if you’re aggressive you can cut it down to $0.15 by using the 0.5mm-pitch QFN package. Same story goes for resistors: I measured the large-ish footprint I used on my Activity Monitor board to get the $0.17 number, but even a more conservatively-sized footprint costs way more than the resistors themselves! Going down to 0805 cuts this by more than 5x, though there are limited gains to be had by going smaller than that.
One look at these numbers convinced my to never use through-hole components on my custom boards again — in fact it seems like it can be cheaper to re-buy components in surface-mount packages than to order a larger board in order to reuse my existing components.
Testing down-scaling limits
I wanted to test how much I can cram parts together, and thus how cheap I can make the boards, so I created a new version of the Activity Monitor to test this. The original version I made — the one with all through-hole components — cost me $21.50 for a set of three , an amount I was ok with since it was my first board. I made this new version, however, much smaller by 1) taking out the standoff holes 2) using all surface-mount components 3) fully-using the back of the board 4) only using one header instead of the two redundant ones 5) putting components closer to the edge of the board 6) decreasing silkscreen sizes, and 7) using the full precision that OSH Park advertises (6-mil traces with 6-mil spacing, 13-mil drills). Here’s the board layout I came up with:
I’m not really sure if this will work out, but at $3.55 total for three boards, it was a no-brainer to go off and submit this to be made.
The thing I’m worried about the most is whether or not I can actually handle and manipulate a board that’s only 1.1″ x 0.65″, but if all goes well, using surface-mount components means custom boards are even cheaper than I already thought they were.