S6 Makerspace (Distance Alarm)

Introduction: S6 Makerspace (Distance Alarm)

We did a Distance Sensor, that buzzes when anything is 15 cm close to the Distance Sensor, the use of our project is when you need privacy on your room, when someone enter your room, the buzzer is going to Buzz.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Add the Coding on the Arduino Board


int duration:

int distance:

int const trigPin = 9;

int const echoPin = 10;

int buzzer = 2;

void setup( ){

pinMode(trigPin , OUTPUT);

pinMode( echoPin , INPUT);

pinMode( buzzer , OUTPUT);


void loop( ){ digitalWrite(trigPin, HIGH); delay(2);

digitalWrite(trigPin, LOW);

duration = pulseIn (echoPin , HIGH);

distance = (duration * 0.034)/2; if(distance < 15){ digitalWrite(2, HIGH);


else{ digitalWrite(2, LOW);



Step 2: Materials Used:

- An Arduino Board

- A Buzzer (5-Volt)

- A Distance Sensor

- 6 Female & 6 Male Wires

- The Arduino Programs

Step 3: Copy the Image Below Using the Correct Materials

Be the First to Share


    • Backyard Contest

      Backyard Contest
    • Silly Hats Speed Challenge

      Silly Hats Speed Challenge
    • Arduino Contest 2020

      Arduino Contest 2020