04 March 2016

Laser Trip wire Alarm using Arduino Uno

                              Hey guys ,One more project on Arduino Uno , Laser trip wire Alarm . A laser light is used as wire, when someone tries to cross the laser line the alarm will blow out and alert everyone . This project has vast application but the one application that i loved very much is military where this laser system is installed in Border areas , If there is any trespassing bomb will explode and destroy the extremists . This project may be installed in Indian border areas where it covers vast area of 15,106.7 km of land border and a coastline of 7,516.6 km. OK now lets do it  ...


Components Required :-


1. Arduino UNO
2. Photoresistor
3. Resistor (5 kilo ohm or 10 kilo ohm)
4. Wires
5. Arduino IDE software.
6. Buzzer / LED
7. Laser light





Connection :-



These three terminals can be seen on Left side(Analog) of Arduino UNO

Also connect LED/ Buzzer to 13 and gnd


Here i have used a resistor(1 kilo ohm) after the photodiode . I don't want 5v supply to damage the analog pins since the laser light which when falls on the Photo resistor reduces it resistance and the light will fall on the photodiode for sometime in Real Time (Just a precaution to safeguard my kit).



Coding :-


First of all we must find the Threshold value. i.e The value of photoresistor when the laser light displayed on it and the value when laser light is not displayed on photoresistor .


In order to find threshold value the Test program is simulated first and my code is here :

// test program
//lookforlk.blogspot.in
// we need to find the threshold value

int analogpin =0;
int ldrval=0;

void setup() 
{
 Serial.begin(9600);
}

void loop()
 {
 ldrval = analogRead(analogpin);
 Serial.println(ldrval);
 delay(2000);
}

After loading this program into arduino UNO open the serial monitor



Now we have got the Threshold value


//lookforlk.blogspot.com

//lookforlk.blogspot.com

int ledpin=13;
int analogpin =0;
int ldrval=0;
int threshold = 500;


void setup()
{

pinMode(ledpin,OUTPUT);
//digitalWrite(ledpin,HIGH);

}

void loop()
{
  ldrval = analogRead(analogpin);
  if(ldrval > threshold )
  {
  digitalWrite(ledpin,LOW);
   delay(1000);
  }
  else
  {
    digitalWrite(ledpin,HIGH);
    delay(3000);
  }

}



Thats all , Fix the laser at one end and Photoresistor at other end

Check the video

You can add mirror and make refection and increase the distance between laser and photo diode . Try something cool

No comments:

Post a Comment