Drv8825 as led driver

OK. I’ve got a few drv8825 drivers sitting around. They are way too complicated, but I wonder if this would work.

Short the step, dir pins to ground.
Adjust the pot to be a small current, like 100mA.
Wire up the microsteps however you want.
Connect the EN pin to a microcontroller.
Connect some LEDs (without resistors) to coil A.

What would happen if the microcontroller turned on EN? Assuming their first step was +A and not -A, +B, -B (but whatever it is, we could switch it). Would it just send the set current through the LEDs, or are the drivers smarter than that? I wonder what the frequency of it switching on and off is, if it’s fast enough to not destroy the LEDs when on.

I just so happen to have a bunch of drv8825s and some LEDs I want to power. I had this idea, and I probably won’t even try it, but I am curious if it would work.

I think this would basically work, the only complication I can think of is it is probably expecting somewhat of an inductive load, and it could be monitoring the current rising during the on cycle and falling during the off cycle. It could get confused if the load has low inductance. A simple inductor in series could resolve that.

The inductor would also help smooth the current spikes.

So after the initial step the driver holds it in place. So depending on where it is on the step cycle you could have varying brightness? If you had two LEDS you could see them vary in brightness as you stepped slowly forward? So sort of visual indicator of the driver working…I want one.

So can we just tap into a working stepper and try it?

I was thinking of not stepping at all. My guess is that any reasonably movement would end up being completely lost in the noise.

At one point, I did make a little board to put into a driver port with some leds driven by the EN, DIR, and STEP lines. Those were kind of neat.

This is just to turn the leds on and off from a microcontroller, while keeping the raw leds on a constant current drive.

I think what Ryan is saying is with LEDs on coil A and other LEDs on coil B, you could switch between them. If you had full-step mode for example, a single pulse on the step pin would turn off A and turn on B. Microstepping would allow partial blend of two strings of LEDs.

If you hook in series with a physical stepper then you don’t have to worry about the driver getting confused by a low-inductance load.

Maybe hook strings forward and backward in series, on both coils, with protection diodes, and you can make a neat little color cycle. If you do it right you might even be able to run the LEDs while the motor is doing real work. Not sure how you would tap off a fraction of the motor current, but it should be possible with only dumb components.

1 Like

It’s just that at 10mm/s, and 12.5 whole steps/mm, it will be cycling one whole step 1/125th sec, so you won’t be able to really see any interesting patterns. Both LEDs will just be on halfway all the time.

You will lose the voltage drop of the LED. So you’ll lose torque at even lower speeds.

It is interesting though.

bummer

Yes, true. Not ideal.

Heres another angle, suppose you have servos with encoder feedback, and suppose the LED brightness varies with motor current. You could wire e.g. red/blue on the X motors and green/white on the Y motors, and from the color and intensity you would know the approximate direction and magnitude of the cutting load.

Of course the servos have digital controllers and you could just read out the current and drive a display, but why do something the easy way?