I rescind my warning and apologize to johnwasser. By using separate resistors on each output, he is mitigating the problem of switching the outputs asynchronously. Indeed it forms a crude digital to analog converter where each pin turned on provides a portion of the current.
However I believe that 100mA is the total package limit for output pins, and prudence would to with the more conservative design using the external transistor switch.
The method is as simple as using most any NPN transistor (like 2N2222, etc.) and a base resistor, say ~500 ohms or so. As shown in the third circuit in the illustration.
So in the illustration, R4 is the base resistor (500~1000 ohms), T1 is the NPN switching transistor (2N2222, etc.), R3 is your LED current limiting resistor, and LED4 is your IR LED.
The value of R3 can be calculated conveniently online here: http://led.linear1.org/1led.wiz
The "Source voltage" is whatever you are powering the LED from. You said 5V.
The "Diode forward voltage" you said is 1.28V
The "Diode forward current" you said is 100mA
So if we plug those values into the calculator, it says that R3 should be a 39 ohm resistor, and it needs to be capable of handling 1 Watt.
Note that you can use lower-power resistors in parallel to get the 39 ohms @ 1 Watt.
Thanks all your comments.
IR transmitter: 276-143 High-Output Infrared LED, 1.28V and 100mA
IR detector: PNA4602
* Length: 5.20mm/0.21in
* Width: 6.98mm/0.28in
* Height: 7.86mm/0.31in
* Weight: 0.43g/0.02oz
According to the calculator (http://led.linear1.org/1led.wiz
), I need 39 ohms and 1W.
In this case, I guess I do not need to use a transistor. Just simply connect (5V)---Ohm--IR LED--GND
Is that true? or I still need to use a transistor?
Now, I have NPN transistors (2N222A 2N3904 2N4401 from radio shack)
The problem is I do not have the resistor(39ohm 1W)..