## Sunday, August 19, 2012

### Various Sizes of Resistors

Today, let's talk about resistors and their power ratings.  Resistors are possibly the most basic component of electronics; given an input voltage, they allow a current to flow, and given an input current to flow, they produce a voltage.  The relationship between the voltage and current is linear (a straight line), (mostly) frequency independent (unlike capacitors or inductors), and only dependent on its resistance (expressed in ohms).
The most common resistor is the 1/4W through-hole resistor.  The more common style is that shown on the right, where the length of the body is concave with four or five colored bands indicating the resistors value.  The resistor on the left is an older style where the body is a straight cylinder and formed from a darker colored epoxy.
It isn't unusual to meet these two equations in your first class or book on electronics. The first is Ohm's law expressing the linear relationship between the voltage across a resistor and the current through it (E stands for voltage, and I for current, confusingly enough).  The second equation expresses the relationship between voltage, current, and the power delivered.  For example, when a light bulb says that it is a 100W light bulb, this means that the product of the voltage you provide and the current it draws happens to be 100W.  (Quick aside: you will often see AC electrical equipment like transformers or inverters rated in volt-amps, VA, instead of Watts. Looking at these equations, you'd want to say that VA and W are the same, but the sticky subject of reactance means this is rarely the case.)
Since we all love algebra so much, it's possible to combine these first two equations into two other forms of the power equation, which are generally more useful when you're dealing with resistors and how much power they use. These are nothing profound, and need not be memorized since they're easily derived from the first two.  That being said, I would be remiss not to mention the mnemonic my physics professor taught us:
"Twinkle twinkle, little star. Power equals I squared R"

So great, but what does this have to do with our 1/4W resistors that we all know and love? Every electrical component has a maximum power rating, which is how much power the manufacturer claims it can handle before melting, exploding, catching fire, releasing its magic smoke, etc. Going on YouTube, it's easy to find countless demonstrations of components dramatically exceeding their power ratings.
So why not just buy giant 100W versions of every resistor value you'll even need and never have to deal with these stupid power calculators or worry about stuff catching fire? Because higher power resistors get expensive, and big, fast. Often, when you're trying to get a project to fit inside your pocket or backpack or clothing, even 1/4W resistors will start being larger than you'd like, so it's not unusual to spend some time doing the calculations to see how small you can go.  Shown is a 1/8W resistor below our handy reference 1/4W resistor.  Surface mount resistors will get WAY smaller still (measured on the order of tens of thousandths of an inch long), with even lower power ratings still.

Example: As seen in this picture, we have two 10k 5% (brown-black-orange-gold) resistors. We want to use these in a circuit where we know that they'll have at most 10V across them.  Which, if either, can we use without having to worry about them catching on fire?

In the last form shown, power = voltage squared divided by the resistance, so 10V * 10V / 10,000 ohms = 0.01W = 10mW.  Seeing as how these are rated for 0.25W and 0.125W, respectively, we can use either and never have to worry about them catching fire.

On the other hand, if we later decided we needed to replace these 10k resistors with 1k resistors, running the calculations again show that P = 10V * 10V / 1,000 = 0.1W, which still technically is less than either, but 0.1W is getting pretty dang close to 0.125W, so that 1/8W resistor is going to start getting pretty dang hot and probably quite a bit less reliable.

These power ratings are nominal ratings.  When the manufacturer says that their resistors can handle 1/8W, they mean it can handle 1/8W in some specific scenario, usually involving 25C ambient temperature and unrestricted air flow around it for cooling.  Leave something in a car, and ambient will rapidly go up, and lint, dust, and sleek packaging inevitably interfere with air flow around components.  Exactly how close you can drive components to their specified power ratings will always depend on your specific project, but I generally try and keep them at least 25% away from their upper limits. Every engineer will have their own preferences on the matter, so don't bother trying to reach a consensus.
So what happens when you realize that you really do need a resistor that can handle more than 1/4W? Well, you get a bigger resistor... OR, you build a bigger resistor using lots of smaller ones.  Shown is two 1/2W resistors below our 1/4W reference.  Notice how they're slightly larger, both in their bodies and in the thickness of their lead wires.  This helps them by giving them more area to transfer heat to the environment through, and stay well below their critical catch-on-fire-or-explode temperatures.

If you go someplace online like Digikey and poke around in their resistor catalog, you'll probably be able to see that 1/2W resistors are generally more expensive than 1/4W resistors, since people generally use less of them, they're bigger, etc.  It's actually not unusual for it to be cheaper to buy several 1/4W and solder them together to make something that can handle 1/2W. If you see a lot of 1/4W resistors which all seem to be really redundant in a circuit, this very well may be why.  Something to consider as we continue to talk about higher power resistors.
Here we see two 2W resistors, again above our handy reference 1/4W resistor.  I have a fondness for the 1W and 2W epoxy resistors, because they start getting kind of comically large. The much thinner black resistor is mostly ceramic, and instead of being a thin film of metal, is often made by simply winding a long wire around the body.  As you go up in power, the difference between a resistor and an inductor start to become less and less, which can be a problem some times...
Now we're getting up into some serious resistors.  These are 5W resistors.  You can see that the two on the left are made by cementing a resistive element into a ceramic channel.  You'll also notice that this is the end of those silly color coded bands; high power resistors are usually large enough that you can simply print their values on.  The black resistor is 0.25 ohms, and I plan to use it as a current sense resistor (since it can handle +4A, and will only drop 1V, which is an easy range to measure).

Poking around in our electronics catalogs, you should notice that prices have now started to climb into the \$0.25-\$3 range. Compared to the 1-3 cents per 1/4W resistor, this starts to hurt, so you want to make sure you really need these high power resistors before you start throwing them in a project all willy-nilly.
I'm not even joking. Incandescent light bulbs actually make great power resistors. It's not unusual in places like auto shops to find a 2x4 with a couple E27 light sockets and a set of jumper cables screwed to it, for load-testing lead-acid batteries.  A 100W light bulb is expecting to be used with 120VAC, but all that means is that it's a (120V * 120V / 100W =) 144 ohm resistor that can handle 100W, which happens to get really bright when it gets hot.  Buying a traditional 100W power resistor compared to going to Ace and buying a light bulb is a little silly (and very expensive) when you can get what you need with a network of 144 ohm resistors for a fraction of the cost.

Granted, that's not quite right... (Thanks Mats in the comments for reminding me) Resistivity isn't constant over temperature, which is part of why using the proper power rating of resistor is so important. If you unscrew a 100W light bulb and put an ohm meter to it, you'll get something more in the range of 10 ohms.  Rather odd, until you consider that tungsten has a positive thermal coefficient of resistivity.  As soon as you turn it on, the metal filament gets hot and the resistance very quickly rises to the 144 ohm level you'd expect. If you think about it, this is why you usually see light bulbs fail when you first turn them on.

For one project, I did need a high power resistor that didn't make much sense to build from light bulbs, so it was time to bite the bullet and buy some serious ceramic wire-wound power resistors.
That is four 2 ohm 20W power resistors wired in series-parallel, such that together they still make 2 ohms, but divide the power load between them (two 2 ohm resistors in series make a 4 ohm resistor; two 4 ohm resistors in parallel make 2 ohms again, with 1/4 of the power dissipated in each resistor).  So by putting the four of them together, we get an 80W resistor! But even that wasn't enough power handling capacity to load-test the traction batteries I was working with.  That liquid they're sitting in is mineral oil, which does a much better job of removing heat from these resistors than air, keeping them below their catch-fire temperatures (at least for long enough to meet my needs; the oil eventually gets just as hot and then you're in a world of hurt).  In the end, this means this 2 ohm resistor can handle quite a bit more than 80W; exactly how much more is a complicated question, but applying the ever-useful engineering saying "when in doubt, make it stout," I'm pretty comfortable saying that this can probably handle the ~100W I needed it to.

Of course, even this behemoth mason-jar-resistor can be dwarfed by many power resistors, which can grow to the size of a roll of paper towels for really high power needs.  In the past, I've worked with power resistors the size of your forearm in the 64VDC electrical system of diesel-electric locomotives.

Rest assured, you can always find a bigger resistor if you need one. It just might get really expensive...

## Wednesday, August 15, 2012

### Halted Grab Bag Party

I was at my favorite surplus electronics store today picking up some fuses, when I found a big box of stapled-shut ziplock grab bags for \$3.95.  As always, it's the luck of the draw, but this one certainly paid for itself.  I picked it out because it appeared to have some sort of kit in it (a jungle bird sounds circuit?!).
The linear voltage regulator selection out of this bag is flawless; 6x 7805, 2x 7812, 7912, 7909, and 2x 7905.  Also shown is a high power TIP 29 bipolar transistor and a ceramic insulating plate.  The plate is useful when you need to attach a heat sink to a TO-220 package like these, since the metal tab is usually electrically connected to the center pin.  For linear voltage regulators, this isn't problematic because the center pin is ground and heat sinks are usually grounded (or even just the physical chassis of a piece of equipment).  Unfortunately, pretty much everything except voltage regulators can't have their middle pin grounded, so you use a ceramic plate like this and non-electrically-conductive bushings or bolts to attach the TO-220 to the heat sink thermally, while keeping it electrically isolated.

A DIP chip extractor, which has two nicely shaped claws to help pull DIP ICs out of sockets without destroying any of the pins on them (which everyone does with a screw driver eventually).
Edit: Thanks Randy for making me take a second look at it; he's probably right that this is a PLCC extractor.  Not nearly as useful as a DIP extractor...

Assorted Molex connectors, 0.1" header, DIP sockets, and an IDE ribbon connector.  The ribbon connector operates by that each position has a small blade on it, and the back of the shell snaps the ribbon in place, so that the blades pierce the insulation.
Various connectors and hardware. 2.1mm power barrels, an SMA jack, 1/4" mono audio jack, etc.
A decent selection of discrete components.  The four cans on the top left were kind of interesting; the traditional PNP compliment to the 2N2222 transistor is the 2N2907, which used to come in TO-18 packages (like the smaller transistor right below them) and now come in the plastic TO-92 package.  These are 2N2905 transistors, which are also PNP transistors, with exactly the same specs as the 2N2907, but come in this larger TO-39 package.  I had never seen them before, and will thoroughly enjoy using them in some project needing moderate-power PNP transistors.

I couldn't definitely figure out what the trip temperature is for the thermoswitch on the bottom left. The markings are "L170 430-1590 9418," which seem to suggest 170.
Yay totally random hardware! The CAT5 punch-down block is certainly worth something. What the heck is that expansion card bracket? The best theory I can come up with is that you can snap out as many of the bars as you need to fit whatever size DB connector your card has? Not sure...
And a handful of unexciting DIP logic...
Except for this Toshiba TD3420AP chip...
My Google-fu weirdly failed me once again on this one.  I have no idea what it is.

Edit: Thanks Robin and Jose O for both figuring out that this is a dual quad-input NAND gate.  This makes this chip really interesting, because any manufacturers deviating from the de-facto 74YXX naming scheme for TTL logic was a long time ago and usually short lived.  The contemporary part number for this IC would be 7420. I think this very well may be the second piece of non-Schottky bipolar logic I own (I have about 10' of 74LS logic; I've been meaning to return all the logic I used for my TTL clock to the lab I borrowed it from...)

So, overall, for \$4 this grab-bag easily paid for itself.  Grab bags are a great way to spend an evening sorting parts to build the diversity of both your knowledge and your junk box.  When you work out how much time I spent sorting and researching these parts, maybe it wasn't such a great deal, but it was certainly educational and enjoyable, which is what's important about any hobby.

If you don't happen to be in the south bay area, many online retailers also sell grab bags, such as SparkFun or The Electronic Goldmine.

## Friday, August 10, 2012

### Tour of CircuitCo PCB Solutions

During my recent trip to Dallas, TX, my friends at Texas Instruments were nice enough to arrange a meeting for me with Clint Cooley and Bob Smith at CircuitCo.  CircuitCo is a contract manufacturer, who happens to be the company that manufactures TI's ARM-based Beagle boards.

The main focus of my visit was discussing how best for a prototyping and manufacturing company like CircuitCo to interact with the online community.  There have been an increasing number of open source or amateur electronics projects that have managed to find a market large enough to overwhelm the original design's ability to build it.  CircuitCo is the perfect type of company to go to once you realize that trying to build a couple thousand of your widget on your kitchen table really sucks; they have a small scale RPM plant at their main location in Richardson, TX, but have additional manufacturing capacity outside of the United States.  In addition to their manufacturing capabilities, they also offer engineering services, so even if your design isn't quite ready to be manufactured yet, they can probably help you out.
After our meeting, they were kind enough to take Larissa and me for a tour of their in-house manufacturing.  As this tour happened in early July, the new BeagleBone rev 6 had just come out, so that's what they happened to be working on at the time.
They have what is the largest pick and place capabilities I've ever seen in person.  A single conveyor took boards straight through two PnP cabinets and straight into the reflow oven.  In addition to the spooled components you see being fed in from the front, these also support components in trays, which are on the far side of the machine, and automatically swapped out when empty.
Pick and place video:

As one of the last parts of the manufacturing process, BeagleBones are burnt in for 24 hours. Quite a pack of beagles...
After burn-in, some units may be kicked to rework, before being packaged and stacked on pallets.
The rev 6 boards fix a lot of small issues with the previous BeagleBones, but probably one of the most noticeable is the revamped packaging.  The two hardware bugs I particularly appreciate being fixed is the Ethernet LED actually meaning something, and the moving of infamous resistor number R150 farther away from the mounting holes.

In the end, it was a very interesting day, and I'm excited to see what CircuitCo is going to help make happen in the future.  They already run BeagleBoardToys, which is dedicated just to expansion capes for Beagles. I look forward to the day when I may need their services; they seem like a fun group of people to work with.

Disclaimer: TI and CircuitCo have given me free BeagleBone samples.  I'm working on a rather neat little demo using a couple of them, which I look forward to being able to show here once I get it working. I promise that I only speak well of CircuitCo because I honestly thought they were nice guys.