I connected a 3v source with a 680ohm resistor to pins 1 and 2 of the opto coupler. Pin 12 stays low, it does not fluctuate. The opto coupler works fine with 4mA.
I think the problem is the fluctuating voltage on pin 1 and pin 2. As the voltage rises from 1.06v to 1.19v that must be causing the photo transistor to turn on and off.
There are a few ways to do it.
Take care of it in software. ie: write a "debounce" routine.
Or add a bridge rectifier, another resistor, and polarized capacitor.