Optoisolator not outputting (DC switching)
Start small, one step at a time (old rule!). Check your overall logic with a single red led in series with the opto coupler. This is a way of seeing the internals working. The led will show you what is happening inside the opto coupling. If led logic works, go diagnose the arduino.