It looks to me like more and more people have the same couple of questions; they aren't
exactly the same, but they are close enough to put in a tutorial. This one is called "Everything you need to know about lights, fans, and switches."
We are going to first touch on basic electronics, then dive into common computer parts and how they work, and finally touch on how to connect them together for some cool effects. This
will not cover any functional or stylistic aspects of these parts, just the electrical part. This means I'm not going to tell you where to put your fan, but I will cover how to wire it up.
Okay, le's dive into Part 1:
Basic Electrical Theory
Our world is made up of elements, which in turn are made up of atoms. Atoms are generally known to be made of Protons, Neutrons, and Electrons. The part we care about here, in this electronics tutorial, is (you guessed it): electrons! These exist in all matter.
Electronics is the use of electricity to do work. Electricity is the movement of electrons.
To get electrons flowing you need a few things.
First, they need a path to follow. Stuff is either an
insulator or a conductor. Without going into detail, electrons move through conductors a lot easier then they move through insulators.
Resistance, which we will cover in more detail later, is the measure of how easily electrons flow through a material or circuit.
The second thing electrons need is a potential, or power source (those electrons aren't going anywhere by themselve). For this, we could use a battery, or in our case, a computer PSU.
(Technically, the ATX PSU doesn't generate electrical potential; it just converts it from wall current (120V AC). For our intent and purpose, you can think of the PSU as your potential.) The basic idea is that the PSU pushes electrons through some resistance, which means it takes energy, thus it does work! (Take Physics 101 for the technical terms)
We need one last thing, however before we can put those electrons to work: a complete circuit for them to flow around. Without this, no electrons flow (this is bad). Here is a metaphor: in a water cooling setup, what would happen if you broke off the hose right after the pump? All the water would leave, and no longer flow around the loop. Electrons are the same way; if you don't have a complete circuit, no electrons will flow.
Figure 1:
Measurement
Okay, we have electrons flowing around our circuit, or "electron loop."

Now, just how many electrons are there? Scientists over the years have come up with some nifty ways of "counting" electrons.
Here are the basics:
How many are there?
Current (A, or I) -– the number of electrons passing a given point. The measure of current is
Amperage; one Amp is 6,280,000,000,000,000,000 electrons passing a point in one second. No, you don't need to remember that

. To compare this to water flowing through a pipe, current is how wide the pipe is.
How hard are they pushing?
Voltage (V, or E) -– electrical pressure or force. If we go back to water flowing through a pipe, this is the water pressure. Voltage is measured in
Volts, or
Electron Volts.
How much work are they doing?
Power (P, or W) -– the work preformed by an electric current. To get power, you just multiply I x V, or current times voltage. The unit of measurement is a
Watt. (For Example, a 120 Watt light bulb running at 120 Volts uses 1 amp, 120V x 1A = 120W) To compare this to water/pipe, imagine a water wheel. A super fast, super small water wheel running off a small pipe can output the same wattage, horsepower, or BTU (however you wish to measure power) as a bigger, slower wheel running off a wider river.
How much restriction?
Resistance (Ω, or Ohm) -- the degree to which a conductor resists the flow of current. One Ohm (often represented by the Omega) is the resistance of a circuit in which 1 Volt will force 1 amp through. Except for superconductors, everything resists the flow of current. Some things are designed to resist even more. This would be like putting a crimp in our pipe.
One of these scientists (as mentioned above) was named Ohm (the SI unit for resistance is named after him). Ohm wrote a universal law for dealing with Voltage, Amperage, and Resistance. This is going to be one of the only formulas I am going to put in this guide, and thus, the most important. In other words,
LEARN THIS FORMULA.
V = I x R
This is the most basic rendition of Mr. Ohm's law. It states that if you're working with a constant voltage (our case, 12V), to increase current, you must decrease resistance. To decrease current, you must increase resistance. This is an inversely proportional equation (Algebra 2ish). Again, this is very, very important.
Using our l33t algebra skills, we can do some fun stuff with Ohms law:
I = V / R
To keep a constant current, if you increase voltage, you must also increase resistance. This is directly proportional. Also super important (think of an LED).
R = V / I
If you don't change the resistor when you increase voltage, current increases. Another directly proportional function. I can't stress how important these are.
Here is a visual of resistance; you can figure out the voltage using Ohm's law. However, you can see that the bigger the opening, the less work it will take for the water to flow, and thus the faster it will go (i.e. higher voltage):
Applied Electronics
Most (non-electrical-engineering) people don't care about the theory, so I'll focus more on getting down to business. Let's start with some common applications.
A switch
A switch is like a wire with a break in it that can connect or disconnect by flipping back and forth. It sounds silly, but a lot of people don't know how to wire up a switch. Well, it is not rocket science:

And now you know! Just insert the switch between the positive* wire of the power supply and the positive wire of the device you'd like to switch.
If you have a few Molex extensions laying about, there's an easy way to add a switch to control 12 volt accessories. Credit for this goes to
Gangoke.

Remember - if the stuff on the other end uses 5 volts as well (for example, a DVD drive), then switching just 12 volts is a bad idea. In this case, it's best to use a double-pole (DP) switch that switches both 5 and 12 volt rails.
*While it's technically possible to switch the ground wire, it is considered bad form in a computer since the case is grounded, and devices (like hard drives, optical drives, etc...) that have metallic enclosures sometimes ground though the chassis as well as the molex connector. Disconnecting the ground from these devices will essentially raise the resistance of the circuit rather than disconnecting it. In short, just switch positive.
The 7 volt trick
Ever wanted to run a fan slower, but didn't have a speed controller? Or perhaps you've got more fans than channels. The 7 volt trick lets you do this with no parts what-so-ever. Here's the deal:

When the switch is in the "12v" position, current flows from the 12v rail in the PSU through the fan(s) to ground. This is how 99% of 80/92/120mm fans are set up when they come with a Molex connector, and this will run the fan at full speed. When the switch is in the "7v" position, power flows from the 12v rail in the PSU, through the fan, then back to the 5v rail in the PSU. This may seem counter intuitive, but it works! Actually, the
Zalman ZM-MFC1 speed controller uses this technique for the two three-position switches.
The reason this works is that current tends to flow from a high potential to a lower potential. In a computer, ground is the lowest potential, so all voltages with greater potential flow to ground. As discussed above, voltage is a measure of potential, and 5 volts has less potential than 12 volts. Thus, current will flow from a 12 volt potential to a 5 volt potential, and a device hooked between these will "see" 7 volts.
There's still some confusion on this, so I drew a diagram:

Imagine it as a few batteries lined up. Say you have three 'D's in series. Measuring all three will show 4.5 volts. If you want 3 volts, you can (A) tap the second one and keep your ground, OR (B) keep the first one and tap "negative" to the third. Either way will show a legitimate 3 volts.
In a computer power supply, there are a few switching transformers. Although usually they are not center tap like the one I've drawn, they have a common ground and thus work the same way. Here, the 5 volt bus has a few windings, and the 12 volt bus has more. In the same was as the batteries, if you want 7 volts you can (A) insert a new tap in-between 5 volts and 12 volts, OR (B) keep the 12 volt positive and use the 5 volt as "negative".
Technically, if you wanted three speeds, you could do the same thing but use the +3.3v rail (found on the ATX-20/24 connector) in place of the 5v rail, but this would not be as convenient since there are more Molex connectors than ATX connectors.
LEDs (Light Emitting Diodes)
I love LEDs! LEDs are the little lights that are found in almost every electronic device around. They can be purchased in any color, brightness, size, and beam pattern one can imagine. The common types are best found on eBay - I buy packs of 1000 white LEDs for $30-40. That's right, one thousand. What could I do with 1000 LEDs? How bout
this, or
this, or if you want 2500 lumens,
this? Anyway, if you've never worked with them before they can be intimidating. LEDs have pretty narrow voltage/current ranges that they work in, and will either not light up or explode instantly otherwise. Luckily (good) computer power supplies are very stable and are perfect for LED projects.
There are a bizillion LED tutorials out there. Some of the best are by Rob Arnold (Linear), such as "
Why do I need a resistor?" and
Can I use a brighter LED?" His
single and
series/parallal LED calculators are invaluable, and will save you many burnt out LEDs and noob-flame-outs.
I see a lot of people running a resistor on each LED. While this is a perfectly acceptable (abet inefficient) method, it can get tedious for larger arrays. For example, if I wanted the same light output as a CCFL, I'd want 50-60 LEDs, and that's a lot of resistors. Using LEDs in series is the first step. Here's some typical values of how many LEDs one can use in a series chain at 12 volts:
[pre]
Color Forward Voltage LEDs in series(12v) Resistor (ohms)
Red 1.5-1.6 8 68-100
Yellow 1.8-2.2 6 100-120
Green 2.4-2.8 5 100-120
Blue 3.2-3.4 4 68-120
White 3.4-3.6 3/4* <100/120-168*
[/pre]
* Use 4 if brightness is not an issue, 3 will be brighter (higher fV) but require more precise resistor choice
Then, several series chains can be connected, like this (for white LEDs):
That's how my massive LED arrays are built, lots and lots of series chains...
Special Projects
Some assorted special projects that are useful time to time:
Toggle (not momentary) ATX power switch
Some really cool toggle switches are out there (i.e. military style w/flip cover) but a motherboard would flip out (pun intended) if you used one as a power button. I came up with this many years ago, and have built several. This circuit uses two relays, one to interface with the motherboard and the other for turn on/off functionality.

Heres how it works:
1) When the switch is off, power can't flow through the lower 5v relay, so it is in the "up" position. In the off state, the rightmost capacitor is fully charged and no current flows through the circuit. The left capacitor is discharged by the 10k resistor.
2) When you first flip the switch on, the lower relay energizes. This connects the left (discharged) capacitor to +5v through the upper relay. (Also, the right capacitor is no longer connected to power and starts discharging through it's 10k resistor)
3) While the capacitor is charging, the upper relay is energized, which effectively "pushes" the virtual "push button". With a 470uF capacitor, this takes about 3/4 second. A 1000uF capacitor will engage the relay for about 1.5 seconds.
4) When the capacitor reaches ~70% charge, the charge current decreases and is no longer sufficient to keep the relay coil energized. The cap keeps charging, and even when it's done there is still *some* current flow - like .5ma from the 10k resistor and internal capacitor leakage - but the relay requires ~50 ma to close the contacts so it un-latches. This "releases" the "push button".
5) The computer sees a "open-close-open" event just like you pushed the power button on the front and powers up - except the toggle switch remains on!
6) When you decide to shut off the computer, you flip the toggle switch off. This works just like the power on, but with the right capacitor rather than the left. For the second or so that it takes to charge the right capacitor, the upper relay is energized and the power button is "pushed". Since the computer was on, this will send it the power-down command.
For those so inclined, this circuit is a low parts count implementation of a time-integrating indication function.
More to come... Eventually
Reserved for part3.... Coming soon to a XFN by you