Make a touchless Doorbell | Using arduino uno with ultrasonic sensor | Plugin Electronics

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 มี.ค. 2024
  • Material Required:
    Arduino Uno
    Jumper wires
    buzzer
    Ultrasonic sensor
    Breadboard
    Arduino Uno cable
    Power Bank or 9v Battery
    ----------------------------------------------
    Subscribe : )
    ----------------------------------------------
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 4

  • @PluginElectronics458
    @PluginElectronics458  หลายเดือนก่อน

    Code:
    const int trigPin = 4;
    const int echoPin = 5;
    const int buzzerPin = 8;
    void setup() {
    pinMode(trigPin, OUTPUT);
    pinMode(echoPin, INPUT);
    pinMode(buzzerPin, OUTPUT);
    }
    void loop() {
    digitalWrite(trigPin, LOW);
    delayMicroseconds(5);
    digitalWrite(trigPin, HIGH);
    delayMicroseconds(10);
    digitalWrite(trigPin, LOW);

    int duration = pulseIn(echoPin, HIGH);
    delay(50);

    int distance = duration / 29.1;

    if (distance < 20) {
    digitalWrite(buzzerPin, HIGH);

    } else {
    digitalWrite(buzzerPin, LOW);
    }
    }

  • @kritikasharma-bg6de
    @kritikasharma-bg6de หลายเดือนก่อน

    thank u soo much sir!!!!!! this worked for me on the very first try. please upload other projects like this. thank you once again !!!!!!

  • @nitheeswar2129
    @nitheeswar2129 2 วันที่ผ่านมา

    Bro ur cheat
    Its not working
    Its play automatically within 5 sec