@CREATIVUSS

CODE : #include <Servo.h>

const int trigPin = 6;
const int echoPin = 5;

const int redLED = 2;
const int greenLED = 3;
const int buzzer = 4;

Servo scanner;
int angle = 0;
bool sweepingRight = true;

long duration;
int distance;

void setup() {
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

  pinMode(redLED, OUTPUT);
  pinMode(greenLED, OUTPUT);
  pinMode(buzzer, OUTPUT);

  scanner.attach(9);
  scanner.write(90); // Başlangıç ortada
  Serial.begin(9600);

  Serial.println("Sistem başlatıldı. Tarama başlıyor...");
}

void loop() {
  // Servo sağdan sola/soldan sağa sürekli dönsün
  if (sweepingRight) {
    angle++;
    if (angle >= 150) sweepingRight = false;
  } else {
    angle--;
    if (angle <= 30) sweepingRight = true;
  }

  scanner.write(angle);
  delay(40); // Tarama hızı (yavaşlatıldı)

  distance = getDistance();
  Serial.print("Mesafe: ");
  Serial.print(distance);
  Serial.println(" cm");

  if (distance > 0 && distance <= 15) {
    // Nesne algılandı - Alarm efekti
    for (int i = 0; i < 3; i++) {
      digitalWrite(redLED, HIGH);
      tone(buzzer, 1000);
      delay(100);
      digitalWrite(redLED, LOW);
      noTone(buzzer);
      delay(100);
    }
    digitalWrite(greenLED, LOW);
    Serial.println("Nesne algılandı! Alarm aktif.");
  } else {
    // Nesne yok
    digitalWrite(redLED, LOW);
    digitalWrite(greenLED, HIGH);
    noTone(buzzer);
    Serial.println("Nesne yok. Sistem normal.");
  }
}

int getDistance() {
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  duration = pulseIn(echoPin, HIGH);
  return duration * 0.034 / 2;
}

@LorenzoRodriguesRamos-h4r

Juliana tem pessoa tá aí aí acontece que ele vai aparecer ele vai olhar bacana aí acontece Quando ele chegar mais perto ele fica vermelho

@BABLUKUMAR-mp8nb

Full video upload karo bro

@weworkthiswork

Perfect🎉❤

@vikas.mvikas.m834

Circuit diagram

@brn5218

How to assemble?

@ДаниилМитяй-э1н

Hi! How can this system be adapted to react to frequencies and turn them into antiphase (that is, into silence)?
For example, 440 hertz sounds.
The radar detects it and shifts the wave by half the wave period, thereby turning the original source into silence. Make silence from the first sound with the second sound at the same frequency.
Or better yet, so that the radar would aim at many frequencies and muffle unnecessary noise in the apartment.

@prajaktasapkal1065

How to make model plz upload the vdo

@Whisperss223

🎉🎉

@daisy-s5m1f

🎉🎉🎉

@jumbo999614

Do you have tutorial?

@İnventor-s5e

❤️👍

@imranayan5063

❤🎉