circuitben

Contents:

Resistors for LEDs

This is easy, but I've seen it done wrong and I like having the table, so I'll put it here.

LEDs are current controlled devices. The brightness of an LED must be controlled by setting the current through it, not the voltage across it. Like any other diode, the voltage across an LED changes little with the current through it and it varies between devices, so setting a constant voltage will probably result in the wrong brightness or a dead LED.

A typical "normal" LED drops 2.1V and has a maximum current of 20mA. In my experience, the brightness doesn't visibly change much above 10mA, and 5mA is often adequate. High-brightness and white/blue LEDs (white is blue with a yellow phosphorous coating) have different characteristics. This table only covers normal LEDs.

The resistance needed for an LED is:

R = (VSupply - VLED) / I
VLED is typically 2.1V. I is typically 0.010A.

This table shows the closest standard 10% resistor for each combination of supply voltage and LED current:

5mA10mA
3.3V220120
5V560270
9V1.2k680
12V1.8k1.0k

Multiple LEDs

Since your power supply approximates a constant voltage source and the LEDs are current controlled, each LED must have its own resistor. The voltage across two LEDs with the same current will not be the same due to manufacturing differences.

Treat each LED-resistor pair as a single unit.

Don't run multiple, switched LEDs off of one resistor or the brightness will change dramatically as you turn the LEDs on and off.

LEDs in series work fine, but you have to have a high supply voltage. Use one resistor and add the voltage drops of all the LEDs to calculate the required resistance. There are LED driver chips which use a charge pump to generate a high voltage and then regulate the current. These are often used for white or blue LEDs in cell phones and PDAs because the available supply voltages may be too low to run even one LED.

Connections

Use solder-cup connectors wherever possible. It's easier than crimping and more reusable. Don't strip the wire any longer than needed to fill the solder cup.

When you have to crimp connections, use a ratcheting crimper if you can get one. These won't let go of the connector until it has been fully crimped.

It is possible to make what looks like a crimp on small pins using pliers. Don't do this. They don't have the right shape and the wire will pull out with a little force.

For some reason, good crimping tools for small connections like pin header and D-Sub/CPC contacts are insanely expensive. Even the hand tools recommended by Digi-Key cost hundreds of dollars (I suspect there is a high margin on these). There are a lot of cheap tools for these kinds of pins, like this one:

As far as I can tell, the best way to use this tool is to throw it away and buy a better one. I have been unable to make an acceptable crimp with it. However, there is a tool made by Molex which looks similar and does work:
This tool is Molex #63811-1000 (Digi-Key WM9999-ND, Mouser 538-63811-1000). It costs about $40 from Mouser and $50 from Digi-Key. It supports a lot of sizes and actually makes good crimps. The main disadvantage is that it doesn't ratchet, so you have to squeeze really hard and assume you did it right. There is some visible difference in the shape of the crimping parts of these two tools, but the Molex tool produces vastly better crimps.

Heat-shrink Tubing

This stuff is great. It replaces electrical tape in most applications. The only disadvantage is you often can't put it on the middle of a wire when there is something already on the end. There's even waterproof heat shrink with heat-activated adhesive, but I've never used it so I don't know how well it works.