Surface-mount electronic components are ubiquitous in production, but many hobbyists are still using old-style through-hole technology, sometimes exclusively — including me, until recently. Why have casual electronic tinkerers shied away from surface-mount devices (SMD) in favor of through-hole (TH)? TH is much older and common for prototyping, but the benefits of SMD are too big to ignore. Although optimized for automated assembly e.g. with pick-and-place systems and reflow ovens, many do-it-yourselfers have begun to move to SMD, at least partially. It does pose some different challenges than through-hole, but some things are easier, too.
This is my first foray into SMD, let’s check it out.
Requirements for surface mount: a surface
No expensive equipment is needed for surface-mount, at least in low-volume, you can get buy with not much more than a soldering iron.
Most important: a surface. Not a solderless breadboard: that is, not spring terminals as seen in Electronic project kits: hands on with a vintage 160-in-1, nor the more popular through-hole breadboards as seen in Notes on prototyping circuit boards: breadboards, perfboards, and beyond common for through-hole prototyping are not workable. Printed circuit boards are essential for surface-mount technology.
If you’re really desperate, you can solder surface-mount components without a surface: flip the device over, carefully solder on wires onto each lead. Known as dead bugging, this technique is not preferred, except only as a last resort, example from SPI interfacing experiments: EEPROMs, Bus Pirate, ADC/OPT101 with Raspberry Pi:
To keep your sanity, use a circuit board, providing an actual surface for the surface-mount components.
Even 0.1" through-hole perforated boards can work reasonably well for surface-mount. I’ll use a single-sided 5x7 cm paper copper board from:
- 99003 Free shipping 10Pcs new Prototype Paper Copper PCB Universal Experiment Matrix Circuit Board 5x7cm Brand, $1.56/10
As for the components, we’ll need an assortment of surface-mount resistors and capacitors. SMDs are available in a variety of sizes, some too small to comfortably assemble without special equipment (microscope, loupe, or pick-and-place machine).
0603 (imperial) is about the smallest generally usable for hand assembly. You can go smaller (0402 or below) but you’re going to have a bad time trying to hand-solder, or larger (0805 or above) but at greater cost and board space. 0603 is a good choice for general-purpose surface mount prototyping.
Components are sold in tape & reel packaging, in quantities of thousands:
but this is too much for my humble purposes. To solve this, one can purchase a sample book, containing a smaller quantity of components of a large number of values.
The combined resistor/capacitor sample books are quite convenient, you can put it on shelf for storage, it doesn’t take up much space, and when you need a component you can flip the pages and pick out the proper component component. No need for component cabinets or boxes. I bought this one:
- 0603 YAGEO SMD Resistor 0R~10M 1% 170valuesx25pcs=4250pcs + muRata Capacitor 90valuesX25pcs=2250pcs 0.5PF~2.2nF Sample Book
and it arrived in 11 days:
For my first project with these components, I decided to build a surface-mount version of project #9 “Electronic Woodpecker” as seen in Electronic project kits: hands on with a vintage 160-in-1. Here it is:
Not 100% surface-mount: used a through-hole resistor to replace the potentiometer (but mounted on the surface), and also a through-hole electrolytic capacitor and PNP transistor (2N4403) since that’s all I had. The 0603 components are tiny: even the solder bridges are bigger! The first version of this board was unsuccessful, the capacitances were too low to produce audio oscillations, so I soldered on some through-hole ceramic caps in parallel:
while the circuit was live, so the change in capacitance as the component cooled down could be heard through the speaker output. With the two 104 (= 0.1 µF) capacitors in parallel, the familiar woodpecker sound effect is back. Again, not a 100% surface-mount board, but a start.
To get more practice with surface-mount, I turned to:
SMD Practice Kit
Purchased this soldering practice kit: 2016 New Both Sides SMT SMD Electronic Component Welding Practice Board PCB Soldering DIY Kit Skill Training Mini Version, for 99¢ including free shipping. The kit arrived in 13 days, with the board, parts, and a manual:
The manual is not in English, but I can read the reference designators, component values, and footprints:
The board is solidly constructed and the pads come pre-tinned with solder:
Some progress soldering the board:
The seller may have included the wrong 10 kΩ resistors, are these too big?
Both 10 kΩ and 470 Ω are supposed to be 0805. For comparison, from Wikipedia Surface-mount technology: package sizes:
I have some 0603 (imperial) for comparison, which are smaller than these 0805’s. Perhaps they sent 1206 chip resistors for 10 kΩ by mistake? Anyways, carefully fitting it over the pads, finished soldering (rosin flux remaining):
A few problems. I was short or lost one or two LEDs, and also lost one diode. Let’s see it if works regardless. Powering from +5V rails on a Raspberry Pi 3, D7, D9, and D10 light up dimly:
similar to how they light up (just a pin prick, cycling on and off) when measuring their capacitance with a multimeter. Looks like I have some troubleshooting to do, but this was good practice learning how to solder surface-mount. Next I’ll build on a custom SMD prototyping board.
SMD Prototype Board
Soldering surface-mount on through-hole perfboard is passable, sometimes, but a custom printed circuit board intended for surface-mount prototyping could be more useful.
There are various adapter boards that can be purchased at cost, but why not get our own boards manufactured instead? It is easy to do these days, just upload the designs and get the boards in the mail, fresh from the factory. I started with hyves42/kicad-proto-pcb, and made a minor modification to add rounded corners (the trick is to align the grid with the board, then use the arc tool), here’s my modified version, rxseger/kicad-proto-pcb:
And an image of the layout, featuring a handful of through-holes for headers, a large area of pads for various surface-mount, and other footprints:
I went with dirtypcbs.com to get it manufactured. Submitted the Gerber files generated with KiCad, renamed outline to *.gko, drill to *.txt, paid my $14 (free shipping) and ten 5x5cm boards arrived 17 days later:
I happen to have a bunch of old surface-mount chips, sitting on a shelf gathering dust for years since I stuck to through-hole only, but now they are ready to be put to good use! First I began with some LM317M's:
or more specifically, the LM317MQDCYR, in a SOT-223 package:
The chip fits easily on the board, lining up with the larger footprints. Soldered a large gob of solder on the output terminal for heatsinking. Now to put it into a real application, from the datasheet, page 9:
Only R1 and R2 are strictly required. I used R1=240 Ω 1% and R2=1.8 kΩ 1% resistors (0603), for an expected output voltage of 1.25*(1+1.8k/240)=10.625. 24 V input, and measured the output:
TODO: why the significant discrepancy? at least it is somewhat close to 10 V. To control for inaccuracy, I later added a trim potentiometer, and was able to adjust it to very near 10 volts output.
Voltage divider for +/-
10 V is okay but I would rather divide it in half to about 5 V, then use this halved voltage as a ground reference for a bipolar ±5 V power supply.
Note that a voltage divider isn’t necessarily the best way to build a bipolar power supply. The LM317 has a negative complement, the LM337, which could be used to provide -5 V. However I didn’t have one available, too bad.
Another option, as used in hyves42/miniboard-voltagedoubler (“Makes -12V from a 12V input”) is the ICL7660 Switched-Capacitor Voltage Converter. ICL7660, MAX1044, or LTC1044 can invert, double, divide, or multiply a positive input voltage, and are frequently used to get -V from +V. This is likely the best option, but I wanted to build out of what I had on hand:
Resistors. Plenty of 1% tolerance resistors of various values from the sample book. To divide the voltage by two, we only need two resistors with identical resistances, creating the aforementioned voltage divider:
But what value, exactly? Fewer ohms will reduce the loading effect but dissipate more heat, requiring a greater resistor power rating, more ohms will have a greater loading effect but lower power dissipation. Settled on 1 kΩ, since these 0603 resistors are only typically rated for 1/10 watt. I=V/R = 10 V / 1 kΩ = 10 mA, P=I*V = (10 mA)(10 V) = 1/10 W. Wired up:
There is a problem with the simple voltage divider: loading. You can measure the voltage with your multimeter, due to its high input impedance, but actually trying to power a circuit will cause lower than expected voltage, since the load is effectively a resistor in parallel. How to solve this?
Use an LM324 opamp configured as a voltage follower:
The output voltage will match the input voltage, but can drive more current, from the power supply rails (not shown in the above schematic). Pinout:
so we’ll connect 4 (V+) to power, 11 (GND) to ground, then tie 2 (IN-A) to 1 (VOUTA), to follow the voltage given at 3 (IN+a). Only a fourth of the LM324 will be used, the other three opamps sitting unused; you could of course use a single opamp chip, but this is what I had. The circuit in action:
I measured 4.659 V on the input and 4.654 V on the output, so it is about the same, but can drive much more current. Time to make it permanent:
Surface-mounting through-hole components
The LM324 chip I have is in a PDIP16 package (plastic dual in-line package), not surface-mount. Although it is meant for through-hole, the leads can be bent for soldering as if it was surface-mount:
This is similar to gull-wing leads on real surface-mount packages:
I bent the leads and soldered the chip onto the board, wired it up to the rest of the circuit as prototyped on breadboard, but neglected to confirm proper chip orientation. Since I mistakingly mounted it backwards, this happened:
Smoke pour out of the LM324, leaving a scorch mark on the PCB, and the solder on the LM317M output tab even started melting (≥360ºF?). Always double-check the orientation of your components!
I promptly removing the LM324, then tested the LM317M by itself, but it too failed. Curiously, the LM317 fails short-circuit: the output voltage was almost exactly the 24 V input voltage; I confirmed the resistors were undamaged. This could of course cause a cascading failure damaging other components.
On my third LM317M now, I replaced it as well, along with the LM324.
Something else to keep in mind: this prototyping board has two “bus” lines along the two rows at each edge:
Pins can unintentionally short if you connect to one of these pads, believing it be isolated. Consequentially, I had to lift the leads on one end of the chip since there wasn’t enough room. TODO: maybe remove these connections on a future version of kicad-proto-pcb, possibly more dangerous than useful (on the other hand, I am using them for ground in another part of the board)?
Anyways, to get a negative voltage, the regulated 5 V is taken as “ground” (thin black wire), then the original ground (thick black wire / thin purple wire) is -5V, and the red wire is +5 V, relative. The working bipolar supply:
Not pretty, but it works. TODO: clean the board thoroughly
SMD Bicolor LED
A status indicator to show everything is working would be useful. I opted for a bicolor LED with 4 leads, to light up red and green.
I originally planned to use another LM317M configured as a constant current source, as in The Paranoid Troll: Constant Current Source/Load (LM317):
but since I burnt up a few LM317’s they are in short supply, and I am also low on PCB real estate, so I’m going with a current-limiting resistor instead (note: could also use 1/4 of the LM324 quad opamp to provide a fixed current source).
Opted for using these LEDs:
- 100pcs 0603 (1616) Green And Red Surface Mount Chip SMT Bicolor SMD LED Bead Light Emitting Diode LED Lamp, $4.86/100
their forward voltage drops are 2.0–2.2 V for red, and 3.0–3.2 V for green, maximum 20 mA current. But I’d rather have a dimmer light, not full brightness at 20 mA. First I tested with a 1 kΩ current-limiting resistor giving about 1 mA, but even that was too bright, so I added another 100 kΩ in series, providing a fairly dim but visible light. For the other side, I went straight to a 101 kΩ resistor. Here’s the dim red LED:
Looks like a single pixel (you can see it more clearly in person). Another benefit of lighting bicolor LEDs dimly is that you can make out the individual red/green components. Usually bicolor LEDs only indicate:
- red (or some some other color)
- green (or the alternate color)
but by lighting both, a fourth state is available:
- red + green
If lit too brightly, the red + green becomes washed out, appearing as reddish green. I wired the red to negative, green to positive, so you can visually see both sides of the power supply are functioning as expected. Here is green:
This is too bright, much brighter than the red, because of the higher forward voltage (~3 volts instead of ~2). A higher resistance will be required to match the brightnesses.
To quickly test for a suitable resistance experimentally, my first thought was to use a decade box, such as in this old but still functional Rubicon Cat. 1352 Portable Wheatstone Bridge (1950 vintage?):
However, the multiplier is only used for measuring resistance through X2, it is not connected through X1 and R2 for use as a rheostat. Here I have it set to 9 kΩ, it could only go up to 9.999 kΩ, even though the resistances I am looking for are orders of magnitude larger. So I guessed at adding another 100 kΩ, for a total of 201 kΩ current limiting resistance to the green LED:
Much better, you can now clearly see both green and red, and their distinction is even more pronounced when viewed with the naked eye.
Wrapping up, I soldered on some header pins wired through the back, and tidied up wiring (but still haven’t cleaned the board, there is flux everywhere). Here is the finished circuit schematic and board, ready to use:
This board could be improved by adding bypass/filter capacitors, protection diodes, short-circuit/current-limiting protection, and cleaning it. But it is now functional as a bipolar power supply, good enough for now. Success.
But can we do something more complicated, with higher pin-count?
The reverse side of kicad-proto-pcb includes footprints for larger chips, including TQFP-64. There are also standalone boards for TQFP-64, such as this ProtoAdvantage QFP-64 to DIP-64 SMT Adapter (0.5 mm pitch, 10 x 10 mm body):
or this TQFP 32pin — 100pin 0.5mm pitch breakout board from Bazinga:
I intended to solder a QFP chip on the kicad-proto-pcb board, which you may recall, looks like this:
but the TQFP64s I had, including this PIC18F6720, used a smaller pitch, wouldn’t fit:
according to Wikipedia:
To increase the number of pins, the spacing was decreased from 50 mil (thousandths of an inch) (as found on small outline packages) to 20 and later 12 mil (1.27 mm, 0.51mm and 0.30mm respectively).
oh well, using this chip or side of this proto board will have to wait for another time, when I have a compatible chip and/or board.
Addendum: Some Thoughts on Surface-mount
In conclusion, we have seen a surface-mount circuit on a perforated printed circuit board, a surface-mount practice kit, and surface-mount on a custom printed circuit board. No major difficulties were encountered while constructing these circuits, despite not using any specialized surface-mount tools, and having only prior experience with through-hole electronics.
How does SMD compare to PTH, specifically? A few opinions from my initial impression of using surface-mount follow, from the perspective of using through-hole previously.
This advantage is a slam-dunk for surface-mount, no questions asked.
You can get more components for cheaper if they are surface-mount, as compared to through-hole. Some newer components only come in surface-mount packages. Construction cost is also lower, per Wikipedia:
Making holes is a considerable part of the cost of a through-hole printed circuit board.
not to mention assembly. But this is an obvious benefit, moving on…
Pro: non-deformable leads
Through-hole components are usually manufactured with longer leads than necessary:
The idea is you can bend the leads to where you want them to go. This adds more flexibilty to board layout, but has downsides, too. Firstly, if the leads are axial (as in the capacitor and resistor shown above, but capacitors often have radial leads instead, this one is unusual), deformation is required.
To perform this component forming step, you can use a tool like this laser-cut resistor breadboard folder / resistor deformer from Thingaverse:
or just bend it manually and accept any inaccuracies, hoping for the best. If you really want to go all out, there is this hand-crank former from Kingsing:
most casual electronic hobbyists do not go this far, using only their hands, so this is not an extra expense but it is an extra step for through-hole.
Furthermore, after the long leads of the components are threaded through the board’s holes, and soldered, then they are sticking out of the bottom:
and you have to cut them off. The best way to do this is side cutters, as Dave Jones recommends in EEVblog #168 — How To Set Up An Electronics Lab. Other tools can work but won’t cut flush to the board. Either way, you definitely have to cut these through-hole leads, or not only will the board not lay flat, but it may short out the circuit. Yet another extra tool/step, generating extra waste:
With surface-mount components, you don’t have to concern yourself with any of this. The leads are always precisely the right length, never cut:
Con: board and footprints
The major downside of course with surface-mount is you need a suitable surface, i.e., a printed circuit board. The board has to have compatible soldering pads, i.e., component footprints, for what you want to use.
In my case, I couldn’t use the PIC18F because my prototyping board had a larger pitch than the chip. The kicad-proto-pcb board is compatible with a wide variety of packages, including 0603 and SOT-223/23, and some QFPs.
In contrast, nearly all through-hole components can be used with most through-hole prototyping boards. Not all, some have smaller spacing, larger holes, or unusual layouts but regardless, through-hole has an advantage over surface-mount in this department.
Surface-mount requires less solder than through-hole, in general, and can be completed faster. It is a different skill, but can be learned satisfactorily — at least for a large number of popular surface-mount package types. <0603 passives or BGA are out of scope, but there’s plenty of surface-mount technology readily available and accessible to the casual electronics hobbyist.
It was much easier than I originally suspected, and I definitely plan to construct more surface-mounted circuits in the future.