Not sure if that looks correct with the tranny, would pop a resistor in on the base to start with and is the emitter going to gnd on the chip and your 5v is the load output coming off it?

Heres a good link to help you choose the config if using a tranny you need but remember that using a tranny will invert the signal and to allow this in your code.

http://www.kpsec.freeuk.com/trancirc.htm

Regards

Sean.