|
|
PRACTICAL ELECTRONICS
AN ASSORTMENT OF ELECTRONIC TOPICS
OF SOME INTEREST TO MODEL RAILROADERS
The brief articles on this page are intended to (hopefully) inform and enlighten model railroaders on a range of practical electronic topics, with the overall goal of increasing your comfort with circuits and construction projects, thereby further adding to your enjoyment of the hobby.
These aren't long, techno-babble-laden tomes. You should be able to read any of them twice in 10-15 minutes. As always, I'm open to suggestion -- if there's a topic (or two...or more) that you'd like to know more about (or think other would like to know more about), please EMAIL ME with your ideas and requests. No promises, but if they seem to be of general interest, I'll try to do them.
Here's what you'll find further down the page:
- Ohm's Law (and it's applications to model railroading)
- Using Olde PC Power Supplies
- Creating Small Value Resistors
- A Simple Constant-Current Source
OHM'S LAW
...AND ITS APPLICATIONS TO MODEL RAILROADING
THE BASICS
Back in 1826, George Simon Ohm found that for a given circuit at a given temperature, a definite ratio existed between the potential difference (voltage) and the current. If the voltage were doubled without changing the temperature, the current would also be doubled. This ratio of voltage to current is called the resistance, R, of the circuit. Thus,
V / I = R = a constant
If V is measured in volts, and I is measured in amperes (amps), then R is in ohms. Hence, the ohm is one volt per ampere.
The relation between V, I and R is called Ohm's Law, in honor of good ol' George. The law should be familiar in all three of its possible forms:
R = V / I
I = V / R
V = I x R
By extension, we can also calculate the power, P, dissipated by a resistive element:
P = V x I
By simple substitution, we arrive at the other two common expressions for power:
P = V² / R
P = I² x R
These expressions for power apply to Direct Current (DC) circuits. Calculating the power in an Alternating Current (AC) circuit is somewhat more complex, and beyond the scope of this discussion.
You may want to write V = IR on the back of your hand (note that in the product "IR," the "times" sign is implied). From V = IR, you can quickly factor the other expressions -- they'll serve you well. And don't wash that hand.
A MODEL RR EXAMPLE
Suppose you want to put a 1.5 volt, 30ma "grain of wheat" incandescent bulb in your locomotive to replace that distasteful yellow LED; what size resistor would be needed to operate the 1.5V bulb from the 12V rails? With Ohm's Law, you know that R = V/I, and we calculate that we need to "drop" 10.5 volts (12 - 1.5); so, R = 10.5 / 0.030 = 333.3 ohms. Note that I is always expressed in amperes, so 30 milliamperes (ma) is expressed as 0.030 amperes. So 333 ohms will do the trick; in checking the charts of standard resistor values, we find 330 ohms -- an ideal choice. What about power dissipation rating of the resistor? P = V² / R = 10.5² / 330 = 0.334 watts. Good practice says we should use a resistor of at least double the power we calculate, or 0.668 watts; the next-largest standard rating is 1 watt. "Oh, no!," you cry, "I can't fit a 1 watt resistor inside my cherished Mikado -- what else can I do?" There are several choices:
- choose a higher-voltage and/or lower-current bulb;
- cheat the system a bit -- you know that you won't have the
full 12 volts on the rails at all times (unless you're into train
racing), so you might use a 1/2 watt resistor; a liitle calculating
shows that this is just fine up to 10.6 volts on the rails, and
feel comfortable with this; only experience will help you make
these determinations (and don't forget that the resistor's power
rating is always double the calculated dissipation);
- use two or more lower-wattage (and hence smaller) resistors to
yield the desired value -- by connecting two 160 or 180 ohm
1/2 watt resistors in series (see "Series & Parallel Connections,"
below), we get the equivalent of a 320 or 360 ohm, 1 watt
device...and either combination would be OK here; or, we
might connect two 680 ohm, 1/2 watt resistors in parallel,
yielding 340 ohms at 1 watt. Perfect.
SERIES & PARALLEL RESISTORS
Often, we can't find (or even purchase) the particular value of resistor we need for an application. Further extensions of Ohm's Law show us that we can create just about anything we want thru series or parallel connections. If we connect any two resistors in series, the resistance of the combination is simply the sum of the two individual resistances:
R(series) = R1 + R2
This may be extended to as many resistors as you like (eg, R1+R2+R3+...+Rx). If we now connect any two equal value resistors in parallel, the resistance of the combination is simple one-half the value of one of the individual units (eg, two 100 ohms resistors in parallel yield a 50 ohms resistance). But, if we connect two unequal value resistors in parallel, it gets just a bit more complicated:
R(parallel) = (R1 x R2) / (R1 + R2)
This is often expressed verbally as "the product over the sum." Let's test the formula by using the same two 100 ohm resistors as above: R(parallel) = (100 x 100) / (100 + 100) = 10000 / 200 = 50. It worked! What resistance would be produced by paralleling a 100 ohm unit with a 50 ohm unit? R(parallel) = (100 x 50) / (100 + 50) = 5000 / 150 = 33.3 ohms. For more than two units in parallel, just calculate the equivalent value of the first two; then calculate that value in parallel with the third unit...and so on.
"What's the power rating of series or parallel combinations of resistors?" you're asking. For two equal-value resistors in series OR in parallel, it's double the lowest rating -- for two 1/2 watt resistors, you get 1 watt equivalent. For series or parallel combinations of non-equal value resistors, it's not quite so trivial -- you'll need to calculate the power dissipation in each resistor, and ensure that it's not more than half of the unit's rating.
(Hint: for series resistors, the current is the same thru each, so use P = I² x R to calculate power; for parallel resistors, the voltage is the same across each unit, so use P = V² / R for the calculation.)
RESISTANCE OF COPPER WIRE
Almost any connection you make will use copper wire (either stranded or solid); the size of wire is commonly expressed as AWG 16 or AWG 20 (AWG is the abbreviation for American Wire Gauge); the larger the AWG number, the smaller the diameter of the wire (go figure!)...and the higher the resistance per foot of that wire.
You may wonder why some folks make such a fuss over using one wire size (gauge) vs. another -- it's Ohm's Law again! Suppose we're connecting a new MRC throttle (rated at 3 amps) to our layout, and that the longest wire to the most-distant track feeder is 15 feet; is it OK to use #20 wire for this connection? A quick perusal of the tables tells us that #20 (AWG 20) wire has 10.15 ohms per 1000 feet at 20°C...or 0.01015 ohms/foot; so, 30 feet of the stuff (out and back, remember) has 0.3045 ohms of resistance. If we have a 3-loco consist pulling 40 HO-scale cars thru the most-distant block, we could easily be drawing 1.5-2 amps thru the #20 wire (plus any car lighting current). Ohm's Law tells us that we'll "drop" V = IR = 1.5 x 0.3045 = 0.457 volts in the wire (or 0.609 volts @ 2 amps). This is probably OK, but why waste a half a volt or more? If we use #18 wire (0.0064 ohms/foot), we'd only drop 0.29 volts @ 1.5 amps...and with #16 wire (0.004 ohms/foot), only 0.18 volts.
Moral: use larger wire.
For the sake of completeness, you'll surely want to know that #22 wire is 0.016 ohms/foot; #24 is 0.026 ohms/foot; #14 is 0.0025 ohms/foot; and #12 is 0.0016 ohms/foot. All this at 25° Centigrade...close enough for our purposes.
NOW...armed with a working knowledge of Ohm's Law and it application, you're ready to confront the Electrical Dragon. Good luck!
USING OLDE PC POWER SUPPLIES
POWER IN YOUR HANDS
In your hand you’re holding a power supply salvaged from someone’s now-retired (or even brand-new) Personal Computer. You’re thinking how handy this could be around your layout -- lots of clean DC power at useful voltages. Maybe it’s small and light enough that you can stash it almost anywhere without a fan. Can it really be this easy?
Almost. PC supplies accomplish lighter weight and lower power dissipation via a design technique called the “switching regulator.” Switching regulators depend on sophisticated closed-loop control circuits to maintain tightly regulated outputs; what you need to know is that these circuits depend on each output having a minimum load. At home in that old PC, each output was properly loaded; your layout may or may not provide adequate loading -- if it doesn't, you'll need to lend a helping hand. Keep reading.
Whatever you do, DON'T OPEN THE METAL CASE that the supply lives in! There's nothing inside you need be concerned with...and careless poking around could be fatal. If it has a fan, leave space around the case for it to breathe; if it doesn't, don't worry about it. Newer supplies are usually smaller than older supplies; they may have a different set of output voltages, but you'll likely not care...so long as it does have the ones you want.
ADEQUATE LOADING?
Without a minimum DC load, a switching regulator may become unstable and oscillate. Oscillation is bad, bad, bad! It will likely cause your circuits to malfunction. Fortunately, the necessary loading is as simple as a few resistors. Generally, 10% of the rated load current is adequate loading. So, if you have a 5 volt output rated at 10 amps, you need to provide at least 1 amp worth of loading - it can be lighting, a DC or DCC throttle, or, if nothing else, a plain ol’ resistor. What value resistor will provide a 1 amp (10% of 10 amps) load? Once again, it’s Ohm’s Law to the rescue: R = V/I = 5 volts / 1 amp = 5 ohms. Wow! But it’s a BIG 5 ohm resistor: P = V²/R = 5² / 5 = 5 watts dissipation; hence, a 10 watt resistor (which will need ventilation). And you need to load each output. A typical PC supply will have +5 and +12 volt outputs, plus probably -5 and -12 volts; many newer supplies will have hefty +3.3 volt outputs, and some will also output 15 volts. Just remember, you need a load of at least 10% of rated output all the time. A throttle set to zero presents virtually no load,even though when the train is moving, you may be drawing much more than 10%; so, you must provide a resistive load to ensure that the 10% minimum is always met on every output.
[Hint: always use the next-smallest standard resistor value; eg, if you calculate 17 ohms, use 15]
[Another Hint: PC supplies usually have multiple common wires which are (almost) always black, and are actually connected together inside the supply -- these are interchangable. The other voltages will use red, orange, yellow, etc.]
AN EXAMPLE
Suppose we have a supply with the following specs:
+5 volts @ 10 amps
-5 volts @ 0.5 amps
+12 volts @ 1.8 amps
-12 volts @ 0.2 amps
Let's calculate a 10% loading for each of the outputs:
from above, the 5V supply needs a 5 ohm, 10 watt resistor
for -5V, R = V/I = 5/0.05 = 100 ohms @ P = V²/R = 25/100 = 0.25W (use 1/2)
for +12V, R = 12/0.18 = 67 ohms (use 62) @ P = 144/62 = 2.3W (use 5)
for -12V, R = 12/.02 = 600 ohms (use 560) @ P = 144/560 = 0.26W (use 1/2)
If you've been paying attention, you're probably muttering something like, "Where am I going to get a 62 ohm, 5 watt resistor?" It's a good question. Unless you have a very well stocked parts bin, you're going to have to make a few "adjustments." Good ol' Radio Shack offers several "wirewound" resistors with higher power ratings. [Note: wirewound resistors are inductive, so never use them in AC circuits.] 50 ohm, 10 watt units are available (271-133), so what if we tried a 50 ohm unit in place of the 62 ohm critter we calculated? Well, we'd draw a bit more current (which is fine), and we'd dissipate a bit more power (more current) -- how MUCH more power? P = V²/R = 144/50 = 2.88 watts (use 6W, minimum), so the 10 watt rating would be plenty. Problem solved.
But we're not done yet -- the two 1/2 watt units are easy enough to come by, but what about that 5 ohm, 10 watt thing we just breezed by so quickly? A quick perusal of RS's stock will reveal no such animal; but, recalling the formulas for series and parallel resistors,
R(series) = R1 + R2
R(parallel) = (R1 x R2) / (R1 + R2)
we might try using two 10 ohm, 10 watt units (RS 271-132) in parallel. Doing the math, R(parallel) = (10 x 10) / (10 + 10) = 100/20 = 5 ohms. Just what we need (and it can dissipate 20 watts, so we're in good shape all around).
On the above schematic, you'll notice a few things we've not discussed. You do need to connect your supply to the AC mains, thereby requiring a line cord (I strongly urge you to use the 3-wire type), an on/off switch, and a fuse (with holder). I also suggest a "power on" indicator of some sort; I prefer using LED indicators on the DC side of things, but you could also use a pilot lamp designed for the 115 volt AC side of things (or even a power switch with a built-in indicator). Be careful when connecting things to the AC mains -- shocks can hurt...and in some cases might be fatal! If in doubt, have a knowledgeable friend do this for you.
A special word about using two or more PC supplies on the same layout:
Many of these critters have transformers which are not used in the "traditional" way, and may therefore lack isolation from the AC mains; if you use two or more, it's critical that they each use 3-wire power cords to ensure that the cases are at earth ground (and NO cheater plugs). Note that it's a very good idea to use the 3-wire cord even if you're using only one supply. Now...if your home has only the older 2-wire outlets and you want to use multiple supplies, you MUST provide a reliable earth ground for that third wire; if you're unsure how to do this, please consult a qualified electrician.
BUT...I DON’T HAVE AN OLD PC SUPPLY…
If you’re actually one of the seven people in North America in this condition, you can always buy a surplus PC supply (Jameco has tons of ‘em). They’re dirt-cheap…especially considering what you’re really getting for just ten or twenty bucks. Generally, it’s cheaper (and easier) than building your own supply. Just remember to tame the beast.
CREATING SMALL VALUE RESISTORS
WHO CARES?
Actually, several folks have asked me how to make accurate resistors of less than 10 ohms...and even less that ONE (1) ohm. As you're thinking "Why, oh why?," think about accurately measuring current flows in the multi-amp realm (current scales in analog multimeters can be notoriously inaccurate), perhaps creating a high-power load resistor for that old PC power supply, or limiting current in high-current applications. Don't get me wrong -- this is NOT an everyday need; but when you need one, you need one. Just file this away for future reference. Someday, you'll thank me. Maybe.
OK...HOW DO I DO IT?
If you want something simple like a high-power 10 or 5 ohm resistor, just trot down to Radio Shack and pick up a couple of their 10 ohm, 10 watt critters (271-132). Need 2, 1 or ½ ohm units? Try RS's 1 ohm, 10 watt parts (271-131). But how do you make a convenient 0.25, 0.2 or 0.1 ohm resistor? You could parallel four, five or ten of those 1 ohm pieces, but maybe you'd rather not. What if you need 0.17 ohms, because that's what you calculated; trust me, making this one from standard pieces gets ugly.
Enter small gauge solid copper wire. Remember the discussion about such things in the Ohm's Law article above? Well, here's a excuse to apply the theory. #30 wire, commonly used for wire-wrapping, is very useful (and available at RS as 278-501, -502, or -503...in colors). The resistance of #30 solid copper wire is only 10.5 ohms per 100 feet (at 25° C); that's 0.105 ohms per foot, so 12 inches of this stuff would make a great 0.1 ohm resistor (actually, 11.43 inches is exactly one-tenth of an ohm, but 12 inches in within 5%, and that's pretty close). How about that 0.17 ohm beastie I postulated above? Think 19.43 inches of #30; I'd probably settle for 19½", and be very satisfied. Here's a table of the resistances of 100 feet of some common solid copper wire sizes (@ 25°C):
WIRE GAUGE (AWG #) | OHMS/100' |
| 18 | 0.651 |
| 20 | 1.04 |
| 22 | 1.65 |
| 24 | 2.62 |
| 26 | 4.16 |
| 28 | 6.62 |
| 30 | 10.5 |
Radio Shack (and most other electronics suppliers) have spools of #18 thru #22; category 5 (Cat5) networking cable, telephone cable and most intercom cables use #24; wire-wrapping is #30 -- it's all out there, but you may have to hunt a bit. Finally, here's the simple formula for finding the exact length of wire you need given the resistance/100 ft from the table above:
LENGTH of WIRE (INCHES) = [1200 / (OHMS per 100ft)] x RESISTANCE DESIRED
Let's try the formula for the length of #30 wire (@ 10.5 ohms per 100 ft) that would give 0.1 ohms:
LENGTH of WIRE (INCHES) = [1200 / (10.5)] x 0.1 = 11.4286 inches
Easy, huh? Just remember that the resistance is measured between the points where you actually attach a larger wire to the smaller wire from which we're making that resistor; in other words, don't cut that #30 wire exactly 11.43" long -- you gotta' leave room to solder your #20 wire (or whatever) to it...or to attach you alligator clips. Power dissipation should not normally be an issue, so long as you're not over 10 amps; to make sure you're not overdoing it, just feel the wire -- if it's too hot to touch or melting the insulation, you may be overdoing it. If the insulation IS melting, I'd suggest using two paralleled pieces of wire, each twice the length calculated (or 3 pieces of 3X the length, etc.).
A SIMPLE CONSTANT-CURRENT SOURCE
WHY?
I'll admit that we're getting pretty esoteric here, but bear with me -- constant-current sources do have their place in the world of model trains. If you think back to the discussion on Ohm's Law, you'll know that the current through a resistor varies according to (a) the voltage, and (b) the resistance. But what if you want the current to be constant regardless of typical voltage variations -- such as the headlamp in a locomotive? Enter the "Constant-Current Source" (CCS), a handy way to sorta' "amend" Ohm's Law on a case-by-case basis.
For power supply voltages greater than 12 volts and output loads less than 1mA, R1 = 10K is a good starting point. Then, if we assume the transistor is OFF, the output current will all flow thru R2, producing a voltage equal to I(out) x R2. If I(out) increases such that the voltage drop across it exceeds the voltage required to forward-bias the Base-Emitter
junction of the transistor (about 0.65V), then the transistor will begin to turn ON, causing current to flow from its Emitter to its Collector, and hence to ground. This "shunts" current away from the output, thereby causing the output current to remain virtually constant right at the value where conduction begins. If we let R2 = 6.2K, then the magical value of output current is given by I(out) = V/R =
0.65/6200 = 0.000105A, or about 0.1mA.
DO I REALLY CARE?
You're probably wondering, "What am I gonna' do with a constant current of only 100uA?" Practically speaking, not too much...although it is a good value to produce a linear voltage ramp on a capacitor (remember: if you charge a cap thru a
resistor, the voltage will increase exponentially, not linearly; sometimes it matters). Let's try to think of something a bit more useful here: suppose we wanted to illuminate an LED with a constant 15mA (0.015A); what values of R1 and R2 would be called for? Using the formula R = V/I, we'd calculate R2 = 0.65/0.015 = 43.3 ohms, so we'd hunt for a 43 ohm resistor, and probably end up setting for 39 or 47 ohms (or even paralleling two 82 ohm units to produce a closer fit of 41 ohms). If we're using a 12V supply, then we'll want R1 to drop the "leftover" voltage; we've got 2.2V on the LED and 0.65V across the transistor, so the remaining 12-2.2-0.65 = 9.15V would indicate R1 = 9.15/0.015 = 610 ohms. Did you spot the fly in the ointment? It's the assumption of a 12V supply; if it were constant, then we wouldn't need the CCS... resistor would work just fine. But now imagine that the supply varies between 6 and 12 volts, but we want 15mA thru the LED at all times (ie, constant brightness) -- if we recalculate the minimum voltage across R1, we get V = 6-2.2-0.65 = 3.15; so R1 needs to be R1 = 3.15/0.015 = 210 ohms (use 220 or 200). Give this a try in the old laboratory just to convince yourself it really works: vary the supply voltage from 6 to 12 and observe the constant brightness of the LED. Once you're convinced, you can amaze your friends (or in my case, our Basset Hounds, who watch everything I do on the bench very closely).
Updated 5-5-07
|