LED glowing when the driver's ground is cut off
What's Happening:

Internal to the module, there are some diodes to protect the inputs. Typically these are ESD diodes, but they will conduct DC current if you reverse bias them. It's not a strong power source, and you have resistor limiting of it, so it's not very bright. The current flows from D1, into the driver VDD (weakly powering the module and LED), to the GND net, through the internal ESD diode, out to R1, and then to ground either through the DAC or R2. Note that this will make the DIM pin voltage less than the effective VSS of the module, which would command a full intensity. It may also be possible that the base-emitter junction is going into avalanche and your current is going that way. Typical V_eb max values are about 5V, and if the circuit worked you could be seeing up to 24V there.

When Q1 is shorted, that increases the current flowing through R1 by placing R_L in parallel with the module. This effectively reduces the voltage available to the module by a bit, and pushes the available supply below the minimum required for operation.



What should you do:

This module has an enable pin! You can get the desired functionality with minimal changes by putting a pull-up to 3.3V or 5.0V (either one works), and then using your microcontroller-enabled MOSFET. If you want to have the pull-up with the 24V supply, then you'll need to make a voltage divider to reduce the voltage (the PWM pin can't tolerate 24V). You could also get rid of R5 and replace it with a 3.0V Zener diode to be safe. Since most microcontrollers start with inputs disabled, you might be able to do away with everything except the voltage divider resistors. In that case, you could omit M1 and R2 in the schematic below, and directly connect your PIN5 to the enable.







simulate this circuit &ndash; Schematic created using CircuitLab

Other notes:


Make your R4 - Q1 - R_L circuit independent of this circuit (e.g. connect the emitter of Q1 to GND)
Your resistor divider as drawn will not actually divide the output voltage (unless R1 is big enough that the input current of DIM will cause a measurable drop). Use the topology below (or omit it entirely, you're not going to hurt it with 5V).
Check Q1 before you use it again. It may have been damaged.
If you want to know where the current was really going, measure the voltage drop across R1 and across R4. One of these will have a measurable drop. Measure the voltage difference between VDD and GND to see how much voltage the module was actually getting.