LASER tripwire security system

Поделиться
HTML-код
  • Опубликовано: 26 окт 2024

Комментарии • 18

  • @RICHIEURKAI
    @RICHIEURKAI 2 года назад +1

    Can u plz share code

    • @CRAIGANDREWURKAI
      @CRAIGANDREWURKAI  2 года назад +1

      Yes Thambi, I have added the link for code in the description

    • @RICHIEURKAI
      @RICHIEURKAI 2 года назад

      @@CRAIGANDREWURKAI Thanks Anna

  • @Shradhakapoorrrrrr
    @Shradhakapoorrrrrr 2 года назад +2

    भैया इसका code share करो please

    • @CRAIGANDREWURKAI
      @CRAIGANDREWURKAI  2 года назад

      I have added the link for code in the description

  • @kishandattani2338
    @kishandattani2338 2 года назад +1

    the code is different in video and in the link
    please can you give the code which is there in the video?

  • @Kishan_Narrator
    @Kishan_Narrator 6 месяцев назад

    so here is the code
    int LDR = A0; // LDR analog pin
    int Buzzer = 9; // Buzzer pin (Arduino pin D9)
    int RLED = 7; // Red LED pin (Arduino pin D7)
    int BLED = 6; // Blue LED pin (Arduino pin D6)
    int PushButton = 5; // Push button pin (Arduino pin D5)
    int LDRVal = 0;
    bool buzzerActive = false; // Flag to track buzzer state
    void setup() {
    Serial.begin(9600);
    pinMode(LDR, INPUT);
    pinMode(Buzzer, OUTPUT);
    pinMode(RLED, OUTPUT);
    pinMode(BLED, OUTPUT);
    pinMode(PushButton, INPUT_PULLUP); // Enable internal pull-up resistor for the button
    }
    void loop() {
    LDRVal = analogRead(LDR);
    Serial.println(LDRVal); // Print LDR value to Serial Monitor
    // Check if LDR value is below a threshold (673) to activate the buzzer
    if (LDRVal < 673 && !buzzerActive) {
    // LDR intensity is below threshold and buzzer is not active
    buzzerActive = true; // Activate the buzzer
    digitalWrite(Buzzer, HIGH); // Turn on buzzer
    tone(Buzzer, 500, 500); // Generate tone at 500Hz for 500ms
    digitalWrite(RLED, HIGH); // Turn on red LED
    delay(500);
    digitalWrite(RLED, LOW); // Turn off red LED
    digitalWrite(BLED, HIGH); // Turn on blue LED
    delay(500);
    digitalWrite(BLED, LOW); // Turn off blue LED
    }
    // Read the state of the push button
    bool buttonPressed = digitalRead(PushButton) == LOW; // Check if button is pressed (inverted due to INPUT_PULLUP)
    // Check if the push button is pressed to stop the buzzer
    if (buttonPressed && buzzerActive) {
    buzzerActive = false; // Deactivate the buzzer
    digitalWrite(Buzzer, LOW); // Turn off buzzer
    digitalWrite(RLED, LOW); // Turn off red LED
    digitalWrite(BLED, LOW); // Turn off blue LED
    }
    delay(100); // Delay for stability
    }
    and here is tinkercad link
    www.tinkercad.com/things/9v0IkzmwNJZ-copy-of-iot-laser-security-breach/editel?sharecode=DJCBuNGght1hTVH_AIzKQ31fFcpLDsXZX06tx8dKW-4

  • @subhashsargar5676
    @subhashsargar5676 2 года назад +2

    Can u share this code plz

    • @CRAIGANDREWURKAI
      @CRAIGANDREWURKAI  2 года назад +1

      I have added the link for code in the description

  • @pranitrajendramagdum5378
    @pranitrajendramagdum5378 3 года назад +1

    Can i get the code for this

    • @CRAIGANDREWURKAI
      @CRAIGANDREWURKAI  2 года назад

      I have added the link for code in the description

  • @debangshu_devotedtomusic
    @debangshu_devotedtomusic 2 года назад

    cypher found

  • @shubhojitpal6370
    @shubhojitpal6370 2 года назад

    wrong code in the link

  • @surajshinde1383
    @surajshinde1383 2 года назад +2

    Can you share code please

    • @CRAIGANDREWURKAI
      @CRAIGANDREWURKAI  2 года назад +1

      I have added the link for code in the description