sensor-experiments

Introduction

This experiment demonstrates how to detect the interruption of a laser beam using a photodiode and an Arduino.

Components Needed

No Ads Available.

Circuit Setup

  1. Connect the photodiode or phototransistor to an analog pin on the Arduino (e.g., A0).
  2. Place the laser pointer and sensor so that the laser beam hits the sensor.

The sensor detects changes in light intensity when the laser beam is interrupted.

Code for Laser Beam Interruption Detection

Upload the following code to your Arduino to detect the interruption of the laser beam:


const int sensorPin = A0;
int sensorValue;

void setup() {
  Serial.begin(9600);
}

void loop() {
  sensorValue = analogRead(sensorPin);
  if (sensorValue < 100) {
    Serial.println("Laser Beam Interrupted!");
  } else {
    Serial.println("Laser Beam Intact");
  }
  delay(500);
}
            

Explanation

The photodiode detects the laser light, and the Arduino reads the intensity. When the laser beam is interrupted, the intensity drops, and the Arduino triggers a detection message.

Troubleshooting

Contact Us

If you have any questions or inquiries, feel free to reach out to us at Microautomation.no@icloud.com .

Follow our Socials for the newest updates!