Install neje laser 405nm 1000mw

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Resources

http://wiki.nejetool.com/doku.php?id=laser_module_405nm_1000mw&fbclid=IwAR0UPkMRMyqp1ZHiaYHgO4O_ttJ7L1M4c8GfV4GcC2-aCtJcFl7aLjPE-xY

Operating the laser is like operating a LED from a GPIO pinout. Except you don’t need a resistor or any packages to install.

The laser only has two leads. One lead is for signal, the other is ground.

Connect the red lead to pin 12 (GPIO 18) on your raspberry pi/Jetson.

Connect the ground wire to pin 14 (Ground) on the pi/jetson.

Red to pin 12 (GPIO 18), Black to 14 (Ground)

Python3 Code.

Create a python3 file called laser.py

#!/usr/bin/env python

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

GPIO.setwarnings(False)

GPIO.setup(18, GPIO.OUT)

for i in range(0,100):
    print('Led on')
    GPIO.output(18,GPIO.HIGH)
    time.sleep(0.5)
    print('Led off')
    GPIO.output(18, GPIO.LOW)
    time.sleep(0.5)

GPIO.cleanup()
Python3 code in PyCharm.

From the linux terminal, run the program.

python3 laser.py

The laser output is very weak, shine the laser against a surface and look for a reflection.

Success! We have a laser!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.