Arduino 24VDC motor speed control
Figure 1. Test points for circuit debugging.

The circuit is so simple that debugging should not present a problem.


You have checked the voltage on the opto-LED. Double-check that the polarity is still right. Pin 1 should be positive with respect to pin 2.
With the LED off you should have 24 V at (1), 0 V at (2) and 24 V at (3).
With the LED on D1 should clamp the voltage rise at (2) to 5 V or so. The voltage at (1) should be a few hundred millivolts above that at (2). The voltage at (3) should be close to zero.


It's really just a matter of logically going through the circuit. When an unexpected voltage is found then you need to figure out the reason.