Laser Diode

Z2M Part: EDD-00001-A

Control a laser diode module with Arduino.

Circuit Diagram
Circuit diagram for Laser Diode
Wire Connections & Pin Configuration

Wire Color Connections:

Red → 5V to Laser VCC
Black → GND to Laser GND
Yellow → Digital Pin 10 to Laser IN/Signal

Pin Configuration:

Arduino 5V → Laser module VCC
Arduino GND → Laser module GND
Arduino Digital Pin 10 → Laser module IN/Signal (or laser anode via 100Ω resistor)
Arduino Code
Edit
int laserPin = 10; // Laser diode connected to pin 10

void setup() {
  pinMode(laserPin, OUTPUT); // Set pin as output
}

void loop() {
  // Turn ON laser for 0.5 seconds
  digitalWrite(laserPin, HIGH);
  delay(500);

  // Turn OFF laser for 0.5 seconds
  digitalWrite(laserPin, LOW);
  delay(500);

  // Gradually increase laser intensity (PWM 0–255)
  int i = 0;
  while (i <= 255) {
    analogWrite(laserPin, i); // Set intensity
    delay(50);                // Wait for smooth fade
    i += 5;                   // Increment intensity
  }
}

Instruction Details

Wiring: Connect laser module VCC to 5V, GND to GND, IN/Signal to Digital Pin 10. For raw diode: anode via 100Ω to Pin 10, cathode to GND.
Library: Not required (built-in).
Upload Code: Tools → Board → Arduino Uno. Tools → Port → select your COM port. Click Upload button.
View Output: Laser turns ON/OFF based on code. Never point at eyes or skin.

How to Use

  1. Connect the required components as per the Pin Configuration above
  2. Open Arduino IDE and create a new sketch
  3. Copy and paste the code above
  4. Select your Arduino board and COM port from Tools menu
  5. Click the Upload button to upload the code to your Arduino
  6. Open Serial Monitor (if applicable) to see the output

Components Required

  • Arduino Uno
  • Laser Diode Module (or Laser + 100Ω Resistor)
  • Breadboard
  • Jumper Wires

Category: LEDs & Display