Stufin
Home Quick Cart Profile

Laser Module

Buy Now

Operating temperature range

-20C to 70C

Storage temperature range

-40C to 85C

Relative humidity

5% to 95% non-condensing

Laser class

Class 1, Class 2, or Class 3B, depending on the module type and application

Compliance

Meets relevant safety and regulatory standards, such as IEC 60825, FDA, and CE

applications

  • Robotics and automation
  • Sensing and measurement systems
  • Machine vision and inspection
  • 3D scanning and printing
  • Gesture recognition and tracking
  • Obstacle detection and navigation
  • Spectroscopy and analytical instruments
  • Medical and healthcare devices

By providing a high-precision, compact, and reliable laser source, the Laser Module enables a wide range of IoT applications that require accurate measurement, detection, and illumination capabilities.

Pin Configuration

  • Laser Module Documentation
  • The Laser Module is a self-contained unit that emits a concentrated beam of light, commonly used in various IoT applications such as distance measurement, robotics, and sensing. This documentation explains the pinout and connections of the Laser Module.
  • Pinout:
  • The Laser Module typically has 4-6 pins, depending on the specific model and manufacturer. The following is a general pinout explanation:
  • Pin 1: VCC (Power Supply)
  • Function: Provides power to the Laser Module
  • Voltage Range: 3.3V - 5V (dependent on the module's specifications)
  • Connection: Connect to a power source (e.g., Arduino, Raspberry Pi, or a dedicated power supply)
  • Pin 2: GND (Ground)
  • Function: Provides a reference point for the module's circuitry
  • Connection: Connect to the ground pin of the power source or a common ground point in the system
  • Pin 3: EN (Enable)
  • Function: Enables or disables the laser emission
  • Active State: High (typically 3.3V or 5V)
  • Inactive State: Low (typically 0V)
  • Connection: Connect to a digital output pin of a microcontroller (e.g., Arduino) to control the laser emission
  • Pin 4: PW (Pulse Width Modulation)
  • Function: Allows for adjustment of the laser's pulse width and frequency
  • Connection: Connect to a PWM (Pulse Width Modulation) output pin of a microcontroller (e.g., Arduino) to adjust the laser's output
  • Pin 5: OUT (Laser Output) [Optional]
  • Function: Provides a signal indicating the laser's operating status
  • Connection: Connect to a digital input pin of a microcontroller (e.g., Arduino) to monitor the laser's status (e.g., to detect when the laser is enabled or disabled)
  • Pin 6: VIN (Voltage Input) [Optional]
  • Function: Allows for an external voltage source to power the laser
  • Connection: Connect to an external voltage source (e.g., a battery) to power the laser module
  • Connection Structure:
  • To connect the Laser Module to a microcontroller (e.g., Arduino), follow this structure:
  • 1. Connect VCC (Pin 1) to a power source (e.g., Arduino's 5V output).
  • 2. Connect GND (Pin 2) to a common ground point (e.g., Arduino's GND pin).
  • 3. Connect EN (Pin 3) to a digital output pin of the microcontroller (e.g., Arduino's D2 pin).
  • 4. Connect PW (Pin 4) to a PWM output pin of the microcontroller (e.g., Arduino's D3 pin).
  • 5. If available, connect OUT (Pin 5) to a digital input pin of the microcontroller (e.g., Arduino's D4 pin).
  • 6. If required, connect VIN (Pin 6) to an external voltage source (e.g., a battery).
  • Important Notes:
  • Ensure the power supply voltage and current meet the Laser Module's specifications to prevent damage.
  • Use appropriate Wiring and connectors to connect the pins, taking care not to short-circuit or damage the module.
  • Follow proper safety precautions when working with laser modules, as they can cause eye damage or injury.
  • By following this documentation, you should be able to successfully connect and utilize the Laser Module in your IoT project.

Code Examples

Laser Module Documentation
The Laser Module is a compact, high-precision optical component designed for IoT applications requiring accurate distance measurement, object detection, or optical communication. This documentation provides an overview of the Laser Module's features, specifications, and code examples to demonstrate its usage in various contexts.
Features and Specifications:
Wavelength: 650 nm (visible red light)
 Output Power: 5 mW
 Beam Divergence: 1.5
 Operating Voltage: 3.3 V - 5 V
 Communication Interface: UART, I2C, or PWM
 Distance Measurement Range: 10 cm - 100 cm
 Accuracy: 1 cm
Code Examples:
### Example 1: Distance Measurement using UART (Arduino)
In this example, we will use the Laser Module to measure the distance between the module and an object using the UART interface with an Arduino board.
```c
#include <SoftwareSerial.h>
#define LASER_MODULE_RX 2  // UART RX pin connected to Laser Module's TX
#define LASER_MODULE_TX 3  // UART TX pin connected to Laser Module's RX
SoftwareSerial laserSerial(LASER_MODULE_RX, LASER_MODULE_TX);
void setup() {
  laserSerial.begin(9600);
  Serial.begin(9600);
}
void loop() {
  laserSerial.write(0x01);  // Send measurement command to Laser Module
  delay(50);
  int distance = laserSerial.read();  // Read measurement result (0-255, where 255 represents 100 cm)
  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");
  delay(500);
}
```
### Example 2: Object Detection using I2C (Raspberry Pi)
In this example, we will use the Laser Module to detect the presence of an object using the I2C interface with a Raspberry Pi.
```python
import smbus
bus = smbus.SMBus(1)  # I2C bus 1
laser_module_address = 0x20  # I2C address of Laser Module
def read_object_detection():
  data = bus.read_byte(laser_module_address)
  if data == 0x01:
    print("Object detected!")
  else:
    print("No object detected!")
while True:
  read_object_detection()
  time.sleep(0.5)
```
### Example 3: PWM Modulation for Optical Communication (ESP32)
In this example, we will use the Laser Module to transmit a PWM-modulated signal for optical communication using an ESP32 board.
```c
#include <WiFi.h>
#define LASER_MODULE_PWM 18  // PWM pin connected to Laser Module
void setup() {
  pinMode(LASER_MODULE_PWM, OUTPUT);
  ledcSetup(0, 1000, 10);  // Set up PWM channel 0 with 1 kHz frequency and 10-bit resolution
  ledcAttachPin(LASER_MODULE_PWM, 0);  // Attach PWM pin to channel 0
}
void loop() {
  char data[] = "Hello, IoT!";  // Data to be transmitted
  for (int i = 0; i < strlen(data); i++) {
    ledcWrite(0, data[i]);  // Modulate PWM signal with data byte
    delay(1);
  }
  delay(100);
}
```
These code examples demonstrate the versatility of the Laser Module in various IoT applications. Always follow safety guidelines when working with lasers, and ensure proper electrical connections and power supply to the module.