When soldering headers, usually single and double pins, I flip the board over so the pin rests on the surface and then solder them. They never come out straight. It would be great if someone has figured out how to do this correctly?
Solder ONE PIN. Reheat the solder while pushing down to make sure the element is flat. When convinced, solder the rest of the pins. As a last step, reheat the original joint just to make sure it wasn't moving as it cooled, which is a bad thing for a solder joint. This technique works equally well for through holes and SMT.
I've used a PCB cradle with a foam cushioned arm that works pretty well. You can hold down elements and then rotate the board.
If these are boards that you are designing, then is there something you can do to make it easier to solder header on straight. If you stagger the holes like this:
...then the header will essentially lock into place when you insert it. Doing it this way, you probably won't even need any special soldering techniques.
If you're using Eagle, SparkFun's library has many pin header footprints that "lock" like shown.
I have a few techniques that I use from time to time:
- Solder one pin while holding the opposite end. Reheat the solder and straighten.
- Use painters or masking tape to hold the pins in place, especially when the pins aren't on the board edge. Again, solder one pin, then straighten as needed.
- If you have the PCB in a vise or "helping hands", use another helping hands to hold the pins in place. Depending on your setup, you can solder the pins in straight with no further adjustment (check before you solder additional pins).
- If you're soldering a lot of something to a board, and making multiple boards, it may be worth your time to make a jig. I do this for LED's as well as various connectors/headers. The jig can be wood or plastic (beware of ESD, though). I use a drill press to make holes of the correct depth. Populate the board with the headers, place the jig over it to hold the pins/LEDs and then turn the whole thing over. The jig will hold the PCB in place as well as keep components straight. This depends quite a bit on your board design, so your mileage may vary.