Using stepper driver to trigger laser

Hi there,

I am currently designing a 3D printer laser which use stereolitography technology. I am using the open-source electronics from the Reprap program which is an Arduino Mega 2560 R3 board paired with a Ramps 1.4 board ( … e_id=0J450).

My challenge here is that I want my laser (5V DC) to be turned ON every time the stepper motor would turn FORWARD. I also want my laser to turn OFF when the stepper motor would STOP or turn BACKWARD. I currently have an external power source for the laser so what I need to do is only trigger ON/OFF the laser.

I would like to know if it would be possible to have the stepper motor signal working for a DC laser. If it can’t work only with wiring tricks, would it be possible with additional hardware?

Right now, the extruder’s motor would be a NEMA17 4 wires bipolar stepper motor.


You won’t get good results from using a stepper driver to turn on the laser, because you have no way of controlling the absolute phase of the stepper, so you can’t know which “step” signal will turn it “on” versus “off.”

You could, however, make the “step” signal control a switch (like a N-channel MOSFET transistor) that turned on/off the laser. If the duration of the “step” pulse is not long enough for the amount of power you need, you could use the “step” signal as an input to a 555 timer or similar circuit that extends the pulse length of each “step” pulse. This means hooking into the signals BEFORE the stepper motor controller, which may or may not be easy depending on how the electronics is wired/placed.


As jwatte mentioned, there probably is not an easy way to use the inputs for the stepper motor driver to drive your laser directly. It would probably require monitoring both the direction and step pins. Instead, you might try modifying the program to use one of the unused pins on the Arduino Mega and have it output a high signal in place of the stepper motor command to move forward.

By the way, you might try asking this on the RepRap Forum or other 3d printing forums. Generally they have strong communities and have many people with lots of experience hacking the RAMPS kits.

- Jeremy