Driving a 5mw 3.3vdc laser through a PC817 with XIAO digital output?


Please forgive and redirect me if I have posted to the wrong area.

I have been playing with operating a 5mw 3.3vdc laser diode by driving it with a PC817 (opto-coupler) that is activated by a digital output pin on my XIAO. I have read that a series resistor is required in line with the LED to limit current but the LASER seems to be already struggling to emit enough light to see across a room.

As Ohm’s Law does not have much application here, can someone recommend the easiest way to drive a laser diode with a XIAO? I would rather remain “digital” and avoid discreet components like transistors, etc. The PC817 seems to have more than enough power output on the spec sheet but it drives the laser at a relatively low output level. I am open to any and all suggestions.