The Opto you're using has a Triac type output, which is meant to switch AC voltages.
You need one with a Transistor output, could be either NPN or PNP, but NPN is more common. Then with a pull-up resistor on the collector and the emitter to ground ... it should work.
Bookmarks