Laser Transmitter

Hi pigs,
this one is a simple project to do with a laser transimitter.

This is a laser transmitter:
uau

what we want to do is to send signal to our laser with raspberry...
What we need?

  • jump wires...
  • laser transmitter 

ok, follow this connections:

Raspberry GND  pin ---------- laser transmitter negative pin
Raspberry 3.3v   pin ---------- laser transmitter positive pin (in the module on photo the positive pin is the pin in the middle)
Raspberry GPIO 22 pin ----- laser transmitter signal pin








this is the connection :



now let's code:

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

laserStatus = 1

GPIO.setup(27, GPIO.OUT)
GPIO.output(27, laserStatus)

try:
    while True:
        if(laserStatus == 0):
            laserStatus = 1
            print "Laser On"
        else:
            laserStatus = 0
            print "Laser Off"
        GPIO.output(27, laserStatus)
        time.sleep(0.5)
except KeyboardInterrupt:
    GPIO.cleanup()



ok let's see how it works


 stay tuned for the next project!
(download code from github!)

Commenti