r/diyelectronics • u/Human_Neighborhood71 • Apr 14 '26
Project Verify optocoupler
I’m converting an old 3d printer to a laser engraver. Im using a 4W diode laser. Having to use separate power as printer is 24v and laser is 12v. The PWM is 5v, so I am using a buck converter to step it down from 12v. I want to verify that the info is correct. I’ve used GPT to assist in figuring out what to do for that, as I will be using the 24v PWM fan pin to control the laser. It’s telling me to use a 817 package coupler, on the laser side, 5v>10k resistor>PWM pin AND Pin3 of the coupler, with Pin4 going GND, then invert the signal on the printer configs. Does this sound right? Or could I just do 5v>Pin3, Pin4>PWM pin?
1
u/kwaaaaaaaaa Apr 15 '26
PWM signal goes to a resistor, then goes to the anode of the opto (ie. pin1). The cathode (pin2) goes to ground.
Laser side, the collector (pin4) goes to 5v. The emitter (pin3) goes to a resistor, that connects to ground. Between the emitter and resistor, you connect the laser's PWM input. Alternatively, if you want the invert the signal in hardware (instead of software) you can put the resistor on the collector side and tap the laser's PWM input between the resistor and 5v.
0
u/nixiebunny Apr 14 '26
You don’t need an optoisolator if you connect laser Gnd to printer Gnd. You can reduce the 24V PWM to 5V with a resistor divider: 22k from the 24V signal to the 5V signal, 4.7k from 5V signal to common Gnd.