AI agents & screen readers: for a machine-readable, text-only catalogue, start at /llms.txt. Products are available as Markdown (/products.md, /products/{handle}.md) and JSON (/products.json, /products/{handle}.json).
Store

Little Bird

$4.05 |
In stock
No reviews yet

Laser Detector Module Want to set up your own laser tripwire? These little modules make it super simple. Just hook one up to your Arduino, line it up with a ...

Stock availability

Ready to ship from Sydney
17 in stock
Available with leadtime
100 available
Estimated Delivery
Arrives
Disclaimer
View Markdown
Secure checkout
Laser Detector Module
Want to set up your own laser tripwire? These little modules make it super simple. Just hook one up to your Arduino, line it up with a laser pointer, and you’ve got a working laser detection system. Add a buzzer or LED and it’ll trigger the moment someone breaks the beam. Perfect for security projects, spy gadgets, or just a fun electronics experiment.


Here is some quick code to get you up and running.  Shine a laser at the Sensor

Add power to 5V to VCC, Ground to GND and plug your middle pin into D2

Add a Buzzer on D8 and GND



// --- Pins ---
const int RX_DO_PIN   = 2;   // Receiver DO -> D2
const int LED_PIN     = 13;  // On-board LED for feedback
const int BUZZER_PIN  = 8;   // Active buzzer -> D8

// --- Tuning ---
const unsigned long STABLE_MS = 40;  // require this much stable time to accept change
const unsigned long POLL_MS   = 2;   // sampling interval

// Set this to true if your module needs a pull-up (some boards are open-collector)
const bool USE_INPUT_PULLUP = true;

void setup() {
  if (USE_INPUT_PULLUP) {
    pinMode(RX_DO_PIN, INPUT_PULLUP);
  } else {
    pinMode(RX_DO_PIN, INPUT);
  }
  pinMode(LED_PIN, OUTPUT);
  pinMode(BUZZER_PIN, OUTPUT);
  digitalWrite(BUZZER_PIN, LOW);   // buzzer off
  Serial.begin(115200);
}

// Helper to read "laser seen?" abstracting the optional inversion
bool rawLaserSeen() {
  int v = digitalRead(RX_DO_PIN);
  if (USE_INPUT_PULLUP) {
    return (v == LOW);   // LOW means detected when pull-up is used
  } else {
    return (v == HIGH);  // HIGH means detected on actively-driven outputs
  }
}

void loop() {
  static bool stableState = false;     // debounced belief
  static bool lastSample  = false;     // last raw sample
  static unsigned long lastChangeMs = 0;

  bool sample = rawLaserSeen();

  if (sample != lastSample) {
    lastSample = sample;
    lastChangeMs = millis();           // raw level changed; restart stability timer
  }

  if ((millis() - lastChangeMs) >= STABLE_MS && sample != stableState) {
    stableState = sample;

    if (stableState) {
      Serial.println("Laser detected");
      digitalWrite(LED_PIN, HIGH);
      digitalWrite(BUZZER_PIN, LOW);   // <<< turn buzzer on
    } else {
      Serial.println("No laser");
      digitalWrite(LED_PIN, LOW);
      digitalWrite(BUZZER_PIN, HIGH);    // <<< turn buzzer off
    }
  }

  delay(POLL_MS);
}

Jargon buster

Plain-language definitions for the technical terms used above.

GND
GND is the ground or reference connection (0 V) for a circuit. When connecting two devices together, their grounds must be joined so both agree on what counts as a low or high signal.
LED
A light-emitting diode (LED) is a small electronic component that emits light when current flows through it in the correct direction. Because it only conducts one way, its polarity matters, and a through-hole LED must be soldered the correct way around to light up.
VCC
VCC is the positive power-supply connection on a chip or module. Connecting it to the correct supply voltage is needed for the part to power on and helps avoid damaging the electronics.
Stella
Stella Expert

Ask me anything about this product

Maddy, co-founder of Little Bird

Need help? We're here for you!

Hi, I'm Maddy. My team and I are ready to help with your order or any questions.