loading

In this tutorial i will show you , how to make a simple Inexpensive Intrusion Detection(Burglar alarm) using an Arduino Uno board . This project uses the Infrared Emitter-Detector pair to detect intrusion and triggers an alarm as soon as the object crosses the infrared field .

** To see a Similar Project Made with an LDR click here

**To see more simple arduino projects check out my blog

http://learnthroughexample.blogspot.in/search/label/arduino

Step 1: REQUIREMENT :

  1. Arduino uno R3
  2. Breadboard
  3. Connecting wires / Jumper cables
  4. Infrared Emitter and Detector pair LED(not the sensor module)
  5. PCB mount BUZZER
  6. 1kohm Resistor
  7. 10kohm PotentiometeR

** the white LED is the Infrared emitter ,While the black is the Infrared Detector .

Step 2: CIRCUIT DIAGRAM :

Step 3: SOURCE CODE:

int dtect=8;
int sense=A0;
int buzzpin=9;
void setup()
{
  pinMode(dtect,OUTPUT);
  pinMode(sense,INPUT);
  pinMode(buzzpin,OUTPUT);
  digitalWrite(dtect,HIGH);
  Serial.begin(9600);
}
void loop()
{
  int val=analogRead(sense);
  Serial.println(val);
  if(val>=1005)
  {
    buzz(50);
  }
  
  
}
void buzz(unsigned char time)
  {
    analogWrite(buzzpin,170);
    delay(time);
    analogWrite(buzzpin,0);
    delay(time);
  }

Step 4: DISCUSSIONS :

First build the circuit according to the circuit diagram provided .

Now i will explain to you how the circuit works .

  • The white Led you see in the pictures is an Infrared Emitter . You power it on like a normal LED .
  • Now if this is your first time with an IR Led , its very common that you'll mistake your LED to be spoiled as you wont find it glowing ,but that isn't the case really .
  • Infrared light is out of the visible spectrum range so even if it is glowing , you wont be able to see it with naked eyes.
  • To see if your emitter LED(White) is working properly : switch on your cell phone camera and see the LED through it , you will see that there is a purple Glow .
  • This ensures that your IR emitter (White ) is working perfectly and it is emitting light of a particular range of frequency . Now lets come to the Black LED .
  • The back LED is the IR detector. The reason that it is made black is that Black color has the highest absorption ; so it Absorbs most of the infrared light Emitted by the Emitter .
  • Now what happens if an object stands in between the Emitter and the detector ?? . OBVIOUSLY the amount of infrared radiations intercepted by the detector will now be lesser due to the obstruction .This is the catch !! .
  • When such a situation occurs , I trigger the alarm to denote Intrusion .

Now that you've got your concept right , LETS FOCUS ON THE CODE .

  • In line 10 we begin the serial communication to see the values being intercepted on the serial monitor for both the cases i.e
  • case 1.) no obstruction in the path of the emitter and the detector .
  • case 2.)obstruction in the path of the emitter and the detector .
  • for both these cases , we have to observe the values being reflected on the serial monitor , based on which we will decide for which value being exceeded we will be triggering the alarm .
  • Note that for my experiment the threshold value was set to 1005 . This might not be the case for you. Hence try to monitor the values that you are intercepting and choose your threshold accordingly .

**Well , hope I have covered all the concepts in detail regarding this project . If you face problems or if you need further detailing on any sub-topic , then please do leave me a comment .

Step 5: PROJECT VIDEO :

Thank you all for watching .

<p>Thank you so much for the time you spent putting this instructable together! My son and I put it together earlier today. We had a few minor issues, all our own (resistors in the wrong location and had to tweak the presence value for a shorter distance (we didn't use the pot). After a few min, it was all working just fine! Thank you again!!</p>
<p>my buzzer continuously sounds</p>
<p>my IR LEDs aren't working. can u help me?</p>
Can you please tell me how to learn programming arduino
<p>where is potentiometer in this circut diagram</p>
<p>Potentiometer doesnot play a much important role. test it.</p>
<p>Hi Aaryas , i haven't actually made use of the potentiometer . I have listed it as a requirement since you might have a different pair of IR-LED which work at a specific voltage level , so the Potentiometer can prove to be handy in adjusting the voltage to your IR LED . </p><p>Hope this helps. </p>
<p>0k....but if i wanna include potentiometer then where should i connect it in the circuit????</p>
bro can i use more than one pair of emitter detector...i want to make track of near abt 6 pair of ir...<br>my project topic is &quot;vehicle movemnt based smart street light with external light sensing&quot;<br>plz help me to get the code respect to this project...<br><br>thnx in advance
<p>I get the error &quot;'buzz' was not declared in this scope&quot; when I try run the code on Arduino.</p><p>Any help?</p>
<p>Can i get the screenshot of the code along with the error ? . It would be easier for me to debug that way . I guess you have either not written the code for the buzz method or perhaps you have named it something else by mistake . </p><p>Just add a screenshot and il help you out . </p>
<p>Thank you man! You helped me a lot. But I have a doubt. Why is that the amount sent by the emitter is more when there is an obstacle. For example, my emitter sends 1020 when there is an obstacle and sends 1019 when there is not obstacle?</p>
<p>Please check if you provided Vcc to the correct leg of the IR sensor . This should solve it . </p><p>Are you using these type of IR led Pairs or some other mounted sensor ? .</p><p>Do attach a picture of the IR pair , if the problem persists .</p>
<p>Hi</p><p>Thanks for sharing. </p><p>One question :) Can I use a similar approach with one pair of IR emitter and detector, to measure near distances after calibration? I wanna move an object with 2 stepper motors in a closed box, and constantly know the its distance to 2 reference walls. </p>
<p>Yep , this is very much possible with this . But i would suggest using a better precision sensor for higher accuracy . For rough distance calculation this same sketch with minor calibrations should work perfect . </p>
This may be a silly question but what role does the potentiometer play in this circuit?
<p>if you find the buzzer ringing all the time , then check the serial monitor on the arduino IDE to see the values that are being sent . </p><p>Try calibrating the value in the program to make appropriate changes , because it depends on the type of IR-LED you used for the project . </p><p>Also do check , the way you have connected the IR-LED's on the breadboard i.e make sure you put in the positive and negative legs appropriately . </p>
<p>Hi friend. How do I monitor the values my IR sensor is detecting</p>
<p>why does my buzzer sounds all the time ? whats wrong?</p>
<p>if(val&gt;=1005) { buzz(50); }</p><p>See the value ? . In my case 1005 was the calibration value . it worked for me . Perhaps you are using sensor of a different precision . </p><p>Try fiddling with the value and check . Use the serial monitor in the arduino ide and try to see the values you are getting when an object passes &amp; when no object passes , and then use the proper calibration .</p><p>Hopefully this will solve your problem . Wish you all the luck </p>
<p>why does my buzzer sounds all the time ? whats wrong?</p>
<p>Great project. Thank you for sharing, and for including all the code.</p>

About This Instructable

38,497views

35favorites

License:

More by ShrobonB:ARDUINO Burglar Alarm Using Infrared Emitter-Detector pair Grab Alarm Using arduino + LDR + piezo buzzer 
Add instructable to: