Thief Detecting device (Arduino )


Hello! I am Shlok Jain. I have made here a thief detecting robot. It's a very easy task to make this

If you hane not viewed my youtube video then go and view it. Here it is.

Also don't forget to like, share, and subscribe my channel.



MATERIALS   REQUIRED 


1:      Arduino UNO board

2:      Ultrasonic sensor

3:      Buzzer (optional)


STEPS    TO    MAKE   IT.



STEP 1 :

Connect the ultrasonic sensor with the arduino uno board with ultrasonic sensor like this:

If you are using buzzer then connect negative terminal to GND and positive terminal to pin 13.



STEP 2:

Connect the arduino board with computer by cable that comes with it.


STEP 3:

Download Arduino IDE from https://www.arduino.cc/en/software .


Now paste the given code in that application

and click that arrow symbol on upper left corner to upload the code.



int trig=7;                 //giving names to trigger
int echo=9;                 //giving names to echo

void setup() {

  pinMode(trig,OUTPUT);    //defining pins   
  pinMode(echo,INPUT);
  pinMode(13,OUTPUT);
}

void loop() {

  long duration,dist;

  digitalWrite(trig,LOW);            //clearing trigger for further functioning
  delay(2);

  digitalWrite(trig,HIGH);           //throwing sound from trigger for 10ms
  delay(10);

  digitalWrite(trig,LOW);            //turning off trigger

  duration=pulseIn(echo,HIGH);       //calculating time in echo pin using pulseIn() function
  dist=0.034*duration/2;

  if(dist<80)
  { digitalWrite(13,HIGH);           //if object is 80cm or less turn led on
   }

  else { digitalWrite(13,LOW); }     //else turn it off
 }


STEP 4:

Now we will test it put anything ahead sensor 
The orange light will blink and if you have applied buzzer it will produce sound.


So we are done!!!!!!!!


MY OTHER PROJECTS


Distance measuring robot-
https://arduinoprojectswithshlok.blogspot.com/2021/02/distance-measuring-device-arduino-based.html




Comments

Popular posts from this blog

Arduino IDE Dark Theme | Change Arduino IDE theme to dark

Automatic Barrier Opening System using arduino