Introduction: Night Burglar Alarm Using Arduino

Hi, all it is my 5th instructable. Normally I write instructable when there is some contest in which I can use Arduino as my base component. So with this Optical contest, I got a chance to showcase a simple school project with very few and simple components yet an awesome project.

Now let's build a Night Theft Detector Using Arduino.

Step 1: Materials List

  1. Arduino mini
  2. LDR one piece
  3. Leaser
  4. AA batteries (2)
  5. AA batteries holder
  6. Slid switch (2)
  7. Mirrors (no of Reflection you required)
  8. A small box of size 6cm X 5cm
  9. One led
  10. One buzzer
  11. 5v Power Supply
  12. Earbud 5 pieces
  13. Bicycle spoke 2 piece
  14. Super Glue

Step 2: Mirror Holder for Reflection

  1. From my general store, I got the mirror with dimensions 2cm X 2cm
  2. So I printed attached 3d Printer holder for it, you can do it using icecream sticks.
  3. Using super glue I stick small pieces of earbud plastics piece on mirrors.
  4. With bicycle spoke, I made them stay on the holder.

Step 3: Buzzer/Alarm Using Arduino Mini

This system works by sensing the intensity of light in its environment. The sensor that can be used to detect light is an LDR. It's inexpensive, and you can buy it from any local electronics store or online.

The LDR gives out an analog voltage when connected to VCC (5V), which varies in magnitude in direct proportion to the input light intensity on it. That is, the greater the intensity of light, the greater the corresponding voltage from the LDR will be. Since the LDR gives out an analog voltage, it is connected to the analog input pin on the Arduino. The Arduino, with its built-in ADC (analog-to-digital converter), then converts the analog voltage (from 0-5V) into a digital value in the range of (0-1023). When there is sufficient light in its environment or on its surface, the converted digital values read from the LDR through the Arduino will be in the range of 800-1023.

After connecting the LDR to your Arduino, you can check for the values coming from the LDR via the Arduino. To do this, connect the Arduino via USB to your PC and open up the Arduino IDE or software. Next, upload the attached code to your Arduino.

After uploading the code, click the button on the Arduino IDE called “Serial monitor". This will open a new window, which prints different values on the screen. Now, test out the sensor by blocking its surface from light and see what values you get on the serial monitor.


int prevSensorValue = 0;
it will set for the first time when you turn on the device.
when you block the light there will be a fall of the sensor value, check it in the serial monitor.
For me, it was 200, so I set if the difference is greater than 150 than it will set pin 13 value to high.

It will turn on the BJT switch and the alarm will turn on for 2 mins.

Finally created an encloser using the 3d printer.

Step 4: Leaser Beam

  1. I got 3v leaser, with a diameter of 6mm.
  2. I created a holder for it, you can skip it and glue it directly if needed.
  3. Use AA batteries holder, with 2 batteries add the positive end to leaser positive wire and negative end.
  4. Once the connection is correct you will get a laser beam.
  5. Put a switch between the connection, slide switch will work well.
  6. Place it on the wall, which area you want to secure using double tape.

Step 5: Setting Up the Refelection

  1. After putting the leaser, check where the beam is falling on the wall.
  2. Put the reflection mirror there and try to make it fall on your desired place by tilting it.
  3. Repeat the step 2 with other mirrors, till you cove the whole area which you want to secure.
  4. Make the final beam to fall on the LDR.

Step 6: Demo

Once everything put together it will work awesome.

Optics Contest

Participated in the
Optics Contest