Newbie question but I need to be able to run an infrared line laser from my Raspberry Pi3. I found this one (but would like alternatives): 25mW Infrared Line Laser but it doesn't have enough specs for someone with my knowledge to determine what kind of connector let alone how to connect it to a RPI3.

enter image description here

Any hints?


This laser draws 110 mA at 5V, while RPi GPIOs only provide 16mA at 3.3V. You'll need to amplify your GPIO signal to power the laser. Most probably, the black wire is (-) and red one is (+), so the correct way to wire it to your RPi could be:


simulate this circuit – Schematic created using CircuitLab


It looks like there are literally only 2 wires. And the website says 5V! You're in luck, https://www.myelectronicslab.com/wp-content/uploads/2016/06/raspbery-pi-3-gpio-pinout-40-pin-header-block-connector-.png

This is the pinout of the raspberry pi. Use whatever language you are most familiar with... I like to use Javascript and Node, so: https://www.npmjs.com/package/onoff

Cut off that adapter if you want, and put the black to ground and the other to a GPIO pin.

Done. It works.

  • That may work but remember the Pi GPIO are ALL 3V3 so it may not. Either way it would be better to use PWM with at most 60% duty cycle on the GPIO to prevent GPIO overload (you are recommended to draw no more than 16mA from a GPIO). – joan Feb 7 '17 at 9:28
  • Hang on - plugging a laser into two live GPIO pins is going to be very dangerous! Make sure it's facing away from you and not directed at any reflective surfaces; I'd consider fixing it to s mount of some kind before you power it up in case you slip when plugging it in. I'd be inclined to have a physical on/off switch too. Hopefully the laser will come with some safety guidelines to follow. – Deleuze Feb 7 '17 at 9:41
  • Well said Deleuze. joan - You are right, but it should be tested first. Also, I am assuming he would use a resistor, but PWM is another option. – Craig O'Connor Feb 7 '17 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.