Pin 3 should go to ground, while pin 4 should to your uC pin AND go to 5V through a resistor (to pull the pin high when the transistor is not on and not pulling the pin low).
Also, your 1K resistor is too small and would burn out the LED. THe datasheet says it has a 1.7V drop for 20mA if it is a IR LED and a 2.4V drop at 40mA if it is a red LED (do you know which one your device has?)
You should size your resistor so that:
R = (Vsupply-Vdiode)/Inominal
(the extra voltage from the supply that isn't dropped across the diode must be dropped by the resistor, so if you use this extra voltage that is going to appear across your resistor in the equation in V=IR, you can figure out control how much current goes through the LED).
just like when sizing a resistor for a normal LED.