Surface Mount Electronics Assembly
Surface Mount Electronics Assembly

Surface Mount Electronics Assembly

Tags
electronicssolderingreflowarduino
Date
December 22, 2023
Class
Author
Z
Zach
Class Section
Documentation Type
tutorial
💡
Work-in-progress!

Introduction

We are building tpz-usb, a tiny USB-powered programmable electronic circuit!

At the end of this project you will have assembled a tiny printed circuit board, or PCB, which you can program via USB using the Arduino IDE, a free electronics development environment available here. The resulting thumbdrive-sized device hosts a color-changing LED, a touch-sensitive gold TPZ logo, and a connector for optional sensors. For this tutorial, the circuit is already designed, and the documentation assumes you have a complete parts kit and a purpose-built programming jig. However, the project is open source hardware, so you can peruse (and modify!) the KiCad files if you like and order the needed supplies off the bill of materials (BOM). As of early 2024, if you order enough stuff for 50 kits they work out to $4.49 each sans shipping.

tpz-usb_files.zip197.2KB
image

Safety

Circuit Description

tpz-usb is a simple circuit which uses cheap parts. This is intentional; we want students to fully grok the design’s functionality, and they should be able to take the finished product with them to play with offline if they wish. The circuit consists of a USB data and power connection, fabricated as exposed pads on the PCB itself; a linear regulator which drops the USB bus from 5 VDC to 3.3 VDC; a Microchip SAMD11C14A microcontroller which hosts an Arduino bootloader; a diffused RGB LED; a TPZ-themed touch pad; various passive support components, like bypass capacitors and current-limiting resistors; and a 4-pin header which provides power, ground, and I2C connections for optional offboard sensors.

image

above: tpz-usb schematic; below: tpz-usb PCB layout and 3D render. All images are screenshots from KiCad, a delightful open-source circuit design tool maintained by CERN.

image
image

What You Will Need

Bill of Materials (BOM)

sch ref
qty
part no.
link
description
U1
1
ATSAMD11C14A-SSUT
Microcontroller: the tiny computer which hosts the Arduino bootloader and can be programmed over USB.
U2
1
MIC5504-3.3YM-TR
Voltage regulator: steps down 5 VDC from USB to 3.3 VDC for the microcontroller.
D1
1
B38G3RGB-20D0010H2U1930
Multicolored (RGB) LED! Diffused so hopefully it looks good on a bare PCB. Common-anode.
R1
1
RC0805FR-07150RL
current limiting resistors for red LED channel at 10 mA, forward voltage ~1.9 V (3.3 - 1.9) / 0.01 = 140 Ω (use 150 Ω) size: 0805
R2, R3
2
RC0805FR-0747RL
current limiting resistors for green/blue LED channel at 10 mA, forward voltage ~2.9 V (3.3 - 2.9) / 0.01 = 40 Ω (use 47 Ω) size: 0805
R4
1
RC0805FR-07470KL
optional timing resistor for capacitive touch charging pin, 470 kΩ size: 0805
C1, C2
2
CL21B105KAFNNNE
ceramic capacitors for regulator 1 µF, 25 V, X7R size: 0805
C3
1
CL21B104KBCNNNC
ceramic bypass capacitor for microcontroller 0.1 µF, 50 V, X7R size: 0805
J1
1
[part of PCB]
USB connector, made out of part of the PCB
J2
1
[generic, in-stock]
optional 4-pin header for putzing; breaks out Arduino Pins 14/15, which are also I2C SDA and SCL (note lack of pull-up resistors if you do I2C things!)
PCB
1
[via PCBWay]
2-sided PCB, either milled or commercially fabricated; if the latter, try to get 2 mm thickness so the USB contacts don’t require a shim, otherwise add a card stock shim opposite the USB pads.

Here is a link for components to build 50 tpz-usb boards plus some solder paste in a Digi-Key instant cart: https://www.digikey.com/short/z3btn3p7

Common Tools

image
  • safety glasses
  • nitrile gloves
  • ventilation
  • tweezers
  • computer with the Arduino IDE
  • microscope, if you like
  • solder braid, because we all make mistakes
  • a bit of electronics workbench space
  • Atmel-ICE or other CMSIS-DAP programmer, like a Free-DAP
  • programming jig, described in the Programming section

Assembly Time!

There are plenty of ways to assemble electronics, all of which can be useful and are worth learning. The three methods shown here vary in difficulty, time, scalability, and required tools. If you have enough kits and time, consider trying each one. If this is your first time and you have a reflow oven, start with Method One!

Method One: Oven Reflow

Oven reflow is the fastest, simplest, and most reliable method for assembling surface-mount PCBs. In addition to the items from the Common Tools section above, you will need:

image
  • a temperature-controlled reflow oven, like a Whizoo Electronics Controleo3 kit
    • note: you can use an unmodified toaster oven for this if you don’t want to hack apart a 120 VAC appliance (or shell out for a commercial reflow setup)! The boards might get a bit discolored and the oven will likely have hot spots, so this may take some experimentation. A good starting point is to set the oven to ~250 C and place the populated PCBs in cold, then turn the oven on and watch the PCBs carefully. When the paste melts, turn off the oven and prop the door an inch or so. If you do this, make sure the oven is never used for food again!
    • note part two: another popular method for PCBs that only have components on one side uses a hot plate. Do a bit of internet searching if you want to go this route, as it may be a great fit for your lab.
  • fresh lead-free solder paste, like the Chip Quik SAC305 paste linked in the Digi-Key cart above
    • note: solder paste should be refrigerated when not in use, and has a finite shelf life; try to use up a syringe in a year. If necessary, you can heat the syringe up a bit in your palm to make dispensing easier.
  • a paste stencil, either ordered with your PCBs or cut out of ~10 mil (0.01” or 0.25 mm) Kapton or acetate film
  • a suitable paste squeegie, like an old CharlieCard
  • a few extra PCBs or other stock of the same thickness to support the stencil during paste application
  • some tape, most any kind will do
  • isopropyl alcohol, >70%

Step 1: Prepare for solder paste application

Get a few extra PCBs of the same thickness, or another sheet good that matches the boards you procured, and tape them down to your work surface so that they form an inside right angle which you can push the bare tpz-usb PCB against. This will allow you to reliably locate boards relative to the stencil without a lot of manual fussing each time you want to apply paste:

image

Leave the tpz-usb board in place and carefully align the stencil until the apertures line up with the pads:

image

Use a bit of tape to create a wide hinge on the stencil so it can be lifted out of the way without disturbing alignment:

image

Step 2: Apply solder paste

Insert a bare tpz-usb board, push it against the inside corner you created earlier, and flip the stencil down. Double-check that it is still aligned correctly:

image

Don a pair of nitrile gloves. Dispense a thin line of solder paste on the stencil. You can always add more, but it’s tough to get back into the syringe if you use too much:

image

Hold the squeegie at a steep angle and press down so it flexes a bit, and use it to slowly pull the solder paste across the stencil apertures. Examine the board for missed pads and, if necessary, push the paste around and re-squeegie those sections as needed. You might need to add a bit of local solder paste.

image

Carefully lift the stencil off the board. If the board sticks, flex the stencil a bit until it drops down. Set the board aside and use a bit of paper towel (or ideally, a lint-free wipe) to remove excess paste from the stencil. Finish cleaning the stencil by wiping it with a towel soaked in >70% isopropyl alcohol. Before moving on, ensure that the stencil apertures are clear of paste residue; it’s much more difficult to remove if it dries! Note that if you’re pasting a number of boards (like for a class or workshop) you can usually get away with a few between cleaning cycles, but the results will start to get messy after the third one or so. If this is the case, try to conserve paste by re-using the excess that stays on your squeegie.

image

Once the stencil is clean, you can remove your gloves and wash your hands. Take a look at the board now! The correct pads should have paste on them. It’s okay if the paste is a bit smudgy at the edges, surface tension during solder will clean this right up during reflow. If the paste is a total mess, which happens to everyone at least once, wipe the board off with the isopropyl alcohol-soaked towel, let it dry, and try again.

image

Step 3: Place Components

Time to get out the tweezers! Find a quiet spot and start placing parts on the board according to this reference image:

image

You can work in any order you like, but we suggest the following:

3a. Microcontroller

Peel back the clear cover on the tape to reveal one SAMD11C14A 14-pin microcontroller and drop it on your work surface. Flip it right-side up and pick it up with a pair of tweezers by grasping it firmly in the gap between pins:

image

Carefully press the part down so it is centered in its footprint, watching the orientation as you work. With the TPZ logo face-up, the writing on the chip should be upside-down. Adjust alignment as needed and give the microcontroller a little tap on top to secure it:

image

Double-check the chip rotation! Make sure the text is upside-down with respect to the other text on the board. If it’s flipped, carefully lift it up and rotate 180 degrees:

image

3b. Regulator

Peel back the clear cover on the tape to reveal one MIC5504-3.3 5-pin linear regulator and drop it on your work surface. Flip it right-side up and pick it up with a pair of tweezers by grasping it firmly on the sides without pins:

image

Carefully press the part down so it is centered in its footprint. Since the regulator does not have rotational symmetry, it can only be placed one way. Adjust alignment as needed and give the regulator a little tap on top to secure it:

image

3c. Capacitors

tpz-usb uses two 1 µF capacitors, which have a square profile when viewed from the side, and one 0.1 µF capacitor, which is noticeably flatter. Start by taking two 1 µF capacitors out of the tape and spilling them onto your work surface:

image

Install the capacitors in the two locations closest to the regulator. Ceramic capacitors are not polarized, so orientation doesn’t matter:

image

Now, pop out a single 0.1 µF capacitor and install it above the previous ones:

image

3d. Resistors

3e. RGB LED

Step 4: Reflow!

Method Two: Manual Paste and Reflow

[TODO]

Method Three: Hand Soldering

[TODO]

Inspection

Before plugging your tpz-usb into a computer or using the programming jig, give it a visual inspection. You can show it to your instructor, look at it under good light with your eyes, or use magnification devices (a microscope, a loupe, or a bench magnifier) to get a closer look. This is when you check for a few key things:

  • did you solder on all of the components?
  • are they the correct components?
  • are the components oriented properly, when orientation matters?
  • do the solder joints look shiny and sound?
  • are there any visible solder bridges?

If everything looks clear, move on to Programming; otherwise, loop through the Rework section as needed.

Rework

[TODO]

Programming

Bootloader

When microcontrollers leave the factory they do not have a program stored in their memory, so they don’t do anything when you turn them on. The type of chip we are using can be programmed or flashed using a protocol called Serial Wire Debug (SWD). This requires a dedicated programmer and a fussy cable. Fortunately, we can use this method once to install a bootloader which allows the chip to be re-programmed later using a free program called Arduino and no fussy cable, just a USB port. So make sure you flash the board with a bootloader before you leave, so you can re-program your tpz-usb later!

To make this part easy, we have a dedicated programming jig that connects to the SWD contacts on the tpz-usb PCB. Find the jig, connect your assembled board to its USB port, and press the board down as shown:

[TODO: image of programmer in use with tpz-usb]

USB Programming via Arduino

[TODO

Next Steps, Tangents, and Rabbit Holes

[TODO: other assembly methods, advanced programming, USB HID, milling boards, …]