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:
This table shows the closest standard 10% resistor for each combination of supply voltage and LED current:
| 5mA | 10mA | |
|---|---|---|
| 3.3V | 220 | 120 |
| 5V | 560 | 270 |
| 9V | 1.2k | 680 |
| 12V | 1.8k | 1.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:


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.
- Use the smallest tubing which will fit easily over the connection.
- Don't forget to put the heat shrink on the wire before any connectors.
- Buy lots of it. I mean a hundred feet each of different sizes. Don't buy the little variety packs that cost $3 and give you a couple of feet, because you'll primarily use one or two sizes and run out. Buy spools from Mouser or Digi-Key. It's cheap.
- Use a heat gun. Not a lighter or soldering iron.
- If the heat gun only has HIGH and LOW settings, use LOW unless you're very careful. It's not a hair dryer - HIGH is for destroying things.
- Don't use clear heat shrink. It looks like an uninsulated connection.