Search This Blog

Beginning Embedded Electronics - 6

Say it with me - 'Yes, I really can solder that'. Yes, you really can solder that and anything else.

First, we will solder a through-hole component kit. Here are the ground rules for soldering:

  • Rule 1: Irons get hot. Don't poke your lab partner in the eye with it.
  • Rule 2: You need to wet your sponge. This may seem counter-intuitive, just do it. I hate seeing people ruin irons because they're too lazy to get the sponge wet. This wet sponge is used to clean the corrosion on the tip of the iron. A dry sponge does nothing but damage the tip. Every time you pull the iron from the stand, it's a good idea to swipe the tip on the sponge just to clean it off and get a nice silver tip - it will allow you to solder much quicker and much cleaner.
  • Rule 3: The point on the iron-tip is NOT the hottest part. This takes some practice but learn to use the side of the tip near the point. It's all about getting the heat to flow from the iron to the joint. If you sit in one spot for a long period of time and nothing is flowing, take a step back, clean your tip, add a bit a solder to the tip, and try soldering the joint again.
  • Rule 4: The soldering iron is only there for heat, not solder. You use the iron to heat two things - the part and the board, and then you add solder to the two heated parts. You do not add a glob of solder to the tip and then rub this mess against the two things you're trying to solder together. Use the side of the iron (remember, not the point) to heat the two parts while adding solder from the opposite side.
  • Rule 5: Perfectionism kills. If you solder a joint, and it looks alright, let it be. Do not solder, then touch up, and re-solder, and then have to touch up a third time. This heating/reheating stresses the PCB (printed circuit board). You will quickly delaminate the board, lifting traces, pads, and destroying the board. Do this for fun on your own time.
  • Rule 6: This is really getting ahead of ourselves here, but it's good to hear as many times as possible. When soldering joints that have a lot of thermal weight, heat the joint up for an additional 5-10 seconds. When you solder to a big part or a pad that has a lot of copper attached to it (very common with GND connections), it takes a few extra seconds for the iron to pump enough heat into the part to get it to the correct temperature to form a connection. If you notice your iron tip feels 'sticky', or if you see the solder balling to the pin instead of flowing to the joint, this is because one part of the joint is not hot enough. Hold the iron on the joint for a few extra seconds and allow the solder to flow correctly.

Here is a short video to demonstrate how to clean your iron tip, solder a through hole component, and clip off the extra leads.

Now about irons:

This is my cheap-o Sunkko iron. It was under $100, it can solder lead-free solder just fine, and I use the standard included iron tip. You don't really need a digital read-out for home use, but do get an iron that has an adjustable temp dial. I set mine temp to about 350C for leaded solder. Notice my sponge is wet!

A cold iron tip. You can see the barrel and upper area of the iron are discolored by heat over time. No problem. You do not need an needle-sized iron tip to solder SMD devices. This is a common fallacy. This tip works very well!

Here's my solder. I stole this from work because 1) It's leaded and we use lead-free for production. 2) It's 0.020" diameter which is really too thin for production. Because it's so thin, the assemblers would have to use many many inches of solder to solder larger joints (like DB9 connectors). Smaller diameter solder helps you control how much solder goes into very tight pitch joints but it's not magic - it is not required. Just don't buy the solder at the hardware store that they sell for copper pipe plumbing, that stuff is ridiculously thick.

This solder is SN63PB37 meaning it's 63% tin and 37% lead. It's also called 'rosin core solder' because it has an organic core of rosin. As you melt the solder into the joint, a small amount of rosin inside the core will come out and help the solder flow. Rosin basically changes the surface tension of the solder allowing it to flow better (we're talking about liquid metal after all). Rosin will burn off and that's the small amount of smoke you see while you're soldering. Standard rosin smoke is not harmful! It has been known to irritate some people's eyes but I've never known anyone to have a problem with it. When in doubt, get a fan or open a window. Lead is known to be a carcinogen. In general, don't eat the solder. Wash your hands before you eat and you should be safe.

This is a 1lb spool which should last me until 2020. $18.95 from JB Saunders. JBSaunders is a surplus shop in Boulder, CO. They sell some handy tools and supplies but it's not your standard hobby shop - it can be tricky to get help some days. Solder aficionados may watch the DOM (date of manufacture) and claim that solder will go bad at some point. I have no idea. I imagine the rosin may change slightly over time but this solder is probably good for many years to come.

http://www.sparkfun.com/tutorial/BeginningEmbedded/6-SolderingBasics/BEE6-1.jpg

Here is a hot iron, with a blob of oxidized solder on the tip.

A quick double swipe on the sponge and the tip is clean and shinny. This is the iron you should be soldering with! Keep your tip clean and shinny. Clean it often. Wipe it on the sponge every time you take it out of the base. Add a bit of solder to the end of your cleaned tip to increase heat flow

That's the starters. Soldering takes practice! Just go and get your hands dirty already.

The Shifter board assembled

You will be assembling the 'Shifter board'. (Please note: the component placement on the shifter board in the photos in this tutorial might not be the same as the shifter board you purchase. Make sure to follow the silkscreen indicators on the board you receive for proper component placement.) This board is a MAX232 equivalent circuit meaning it does some dirty tricks to convert RS232 signals to TTL level signals. It does this with a few pennies worth of parts instead of a proper MAX232 IC.

The benefits of the shifter board vs. a conventional MAX232 circuit:

  1. The shifter board is smaller than a MAX232 DIP with its charge-pump caps

  2. Cheaper

  3. Works at voltages down to 2.5V (compared to the MAX232 that only works at 5V)

Problems with the Shifter board:

  1. It's a bit dirty, meaning it does not follow the proper RS232 +/-12V convention (shifter board only puts out -3V to +5V)

  2. It will not operate faster than 115200bps (some MAX232 ICs can operate up to 1 mega-bit per second)

  3. It only has TX/RX where a MAX232 has TX/RX/CTS/RTS (additional control lines)

In response to problem 1 - I've never come across a modern computer that the shifter board does not work. This is because the RS232 ports on modern computers are designed to deal with poorly designed serial devices! So even though our shifter board can't quite get to the -12V and +12V, the computer can still understand what it's trying to say.

Problem 2 - Windows simply can't handle serial speeds faster than 115200bps (well, not without some serious finagling). The shifter board works fine at this speed so the MAX232 has no real advantage for the every-day application.

Problem 3 - Almost all the serial interfaces you will be building, hardware flow control (CTS/RTS = clear to send and ready to send) is rarely used. The shifter circuit is simple. Replicate it twice if you want flow control.

So let us build up this kit and replace the MAX232 circuit in the breadboard with our shifter circuit. Always lay out all your parts to make sure you've got everything you need.

Plated through-hole (PTH) resistors have color bands on them. Surface mount device (SMD) resistors have readable numbers on them. I can't read the color bands on resistors to save my life, but your multimeter can! The shifter kit is easy to tell which is which - there are five 10k resistors and two 220Ohm resistors.

Resistors are non-polarized meaning they can be inserted into the board either way. You can pre-bend the resistor leads if you like. After the resistor is inserted into the board, bend the legs out the other way so that it stays in place. Pull out your iron and solder the resistor from the bottom side of the board.

Hold the iron against the PCB and the leg of the component. Insert solder into this trio. It should melt as you add it. If not, re-orient the iron to get better heat conduction. It's not hard, just practice. Once you've got the two joints soldered, clip off the legs.

Clip off the legs. Don't worry about clipping the legs absolutely flush. Doing so can stress the mechanical nature of the joint and the PCB.

The kit has various indicators showing the assembler how to orient parts. Pay close attention to these and the resistor values.

Notice the small pool of solder at the base of the resistor legs we just soldered in? This is good. Enough solder was applied to come through the holes from the bottom of the board to fill all the way through the via.

The single diode in the kit is polarized so you'll need to get the orientation right. In the picture above, the black line on the diode matches with the white line on the silkscreen.

Soldering the diode like this would be bad. Make sure you get the component flush against the PCB, within reason. Some components (like the transistors we're about to solder) ride above the PCB. Solder up the rest of the resistors.

All the resistors and diode

Soldered and trimmed. Notice the small amounts of residual flux - it's the clear, shiny, sticky material left of the board.  For production assemblies, this flux is cleaned off with a light solvent or rubbing alcohol. Flux is slightly acidic and will degrade solder joints over a period of years. For our purposes, this flux is ok and shouldn't cause any problems.

Solder in the electrolytic capacitor noting the '-' sign polarization matching with the silk screen.

LEDs installed. Note the flat side of the LED matches the silkscreen polarization.

Install the 2N3904 and 2N2906 transistors. Note the flat side of the BJT transistor matches the flat side of the silkscreen. Make sure you get the correct '3904' and '3906' labeled parts in the correct spot.

Here is a short video to demonstrate how to clean your iron tip, solder a through hole component, and clip off the extra leads.

Install and solder the DB9 connector.

You can see now why it would have been a bad idea to solder the DB9 connector first. The PCB would have been at an angle during soldering.

Solder in the four connection wires - VCC, GND, TX, and RX. Pick your own color scheme. I only recommend that red and black go to VCC and GND respectively.

The shifter board, all assembled!

Guess how we're going to test it? A loop-back jumper of course! Plug the shifter board into your breadboard, VCC and GND, and insert the TX/RX wires into one row, shorting them together.

Power your board, pound some characters into hyperterminal and verify that you get an echo. You should see the TX and RX LEDs blink briefly. Congrats! You now have a serial connection for all your future breadboard prototypes! This should open up some significant space on your breadboard and allow you to skip building a MAX232 circuit for future breadboard projects.

In the end, I use the shifter board on all my breadboard prototyping and a conventional MAX3232 circuit on my PCB designs. Sorry to confuse you so much. When you solder together as many prototype PCBs as I do, you really want to limit how many solder connections you have to solder. Inserting through-hole components for the shifter circuits takes much more time than a MAX3232 circuit. I also like the MAX3232 circuit because it has fewer parts that could break.

No comments: