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
- Arduino mini
- LDR one piece
- AA batteries (2)
- AA batteries holder
- Slid switch (2)
- Mirrors (no of Reflection you required)
- A small box of size 6cm X 5cm
- One led
- One buzzer
- 5v Power Supply
- Earbud 5 pieces
- Bicycle spoke 2 piece
- Super Glue
Step 2: Mirror Holder for Reflection
- From my general store, I got the mirror with dimensions 2cm X 2cm
- So I printed attached 3d Printer holder for it, you can do it using icecream sticks.
- Using super glue I stick small pieces of earbud plastics piece on mirrors.
- 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
- I got 3v leaser, with a diameter of 6mm.
- I created a holder for it, you can skip it and glue it directly if needed.
- Use AA batteries holder, with 2 batteries add the positive end to leaser positive wire and negative end.
- Once the connection is correct you will get a laser beam.
- Put a switch between the connection, slide switch will work well.
- Place it on the wall, which area you want to secure using double tape.
Step 5: Setting Up the Refelection
- After putting the leaser, check where the beam is falling on the wall.
- Put the reflection mirror there and try to make it fall on your desired place by tilting it.
- Repeat the step 2 with other mirrors, till you cove the whole area which you want to secure.
- Make the final beam to fall on the LDR.
Step 6: Demo
Once everything put together it will work awesome.