My understanding is that by using an NPN transistor in conjunction with a 1k resistor in series with the b pin and having the DIM+ and DIM - connected to the C and E pins respectively, by sending a 100Hz - 3kHz PWM signal to b pin, the motor/light will Dim off and on.
The datasheet says
‧Output constant current level can be adjusted by applying one of the three methodologies between DIM+ and DIM- 1 ~ 10VDC, or 10V PWM signal or resistance.
This doesn't really specify whether there is any internal pullup that you can leverage to reach 10V or whether you need to provide your own 10V source externally, but that seems likely.
The sentence
‧Dimming source current from power supply: 100μA (typ.)
seems to suggest that there is a constant current being driven on DIM+ (used for the variable resistor case). You could perhaps leverage that by adding a 100k resistor in series with the collector. Try something like this (though I am entirely not sure it would work):
DIM+
|
\ R2
/
|
C \ R1
B|--/\/\/--digital out
E /
|
_|_ GND
with R1 at 1k and R2 at 100k.
Or alternatively
DIM+
__|__
| |
R3 \ \ R2
\ /
| |
| C \ R1
| B|--/\/\/--digital out
| E /
| |
_|____|___ GND
with R1 at 1k, R2 at 10k and R3 at 100k.
Also note that for this application there is no advantage in using a power transistor such as the TIP31CG over a regular low-current transistor, in that the current going into DIM+ is likely very limited.
reibang The motor works on full duty cycle but not half or less.
I am confused how this is related to the LED driver. Is the motor powered through the LED driver? It is possible that the motor cannot move below a certain duty cycle. What does the motor's documentation say? If you use a digital voltmeter set to DC voltage measurement across the motor's terminals, you should read a value that is approx Vext * dutyCycle (where Vext is the external voltage source connected to the motor's terminal). Make sure this reading is what you expect. If you read values lower than expected, then it may be that the resistor's value needs to be lowered, as the TIP31C has a fairly low current gain. You should be able to get as low as 330 ohm, but no lower than that.