Introduction: Laptop Anti Theft Alarm System

Picture of Laptop Anti Theft Alarm System

This is an anti-theft alarm system that is mounted on the bottom of your laptop to prevent thefts, especially in public places. It uses a hidden photosensor on the bottom of the laptop such that when it receives sufficient light from picking it up while armed, it will ring a loud alarm!

As a university student, stories of laptop thefts are sadly all too common among university students, especially at libraries. It's hard to lug around your belongings with you everytime you have to go to the washroom, especially if you had too much coffee or tea to drink.

Most of us probably left our laptops to be watched by a stranger. But with this anti-theft system, you can leave it on the table and it'll ring an alarm when your laptop is removed from it.

Step 1: BoM

Picture of BoM

* Arduino

* Push Buttons

* Photosensor

*

Step 2: Design Considerations

There are a few ways of going about detecting if a laptop has been removed from it's place.

1. Ultrasonic Distance Sensor

2. Force Plate

3.Photosensor

I chose Option 3 because it is the one with the smallest form factor and will not interfere with daily use of the laptop unlike a Force plate. And the Ultrasonic Sensor would not be able to sense it as accurately as it needs to be mounted externally,

Step 3: Soldering

Picture of Soldering

Solder the voltage divider onto the LDR pins itself as shown in the picture above.

Step 4: Photosensor Wiring

Picture of Photosensor Wiring

Follow the table below for the connections between the I/Os and the Arduino

I/OI/O pinArduino Pin
Photosensor1A0
Photosensor2GND**
Buzzer*19
Buzzer*2GND**

* Order of pins do not matter for the buzzer

** The Arduino board has at least 3 GND pins

Step 5: Arm and Disarm Button

Picture of Arm and Disarm Button

Follow the table below for the connections needed for the arm and disarm button circuitry

I/OPin #Arduino Pin #


Switch - Blue 16
Switch - Blue2GND*
Switch - Green VCC 7
Switch - GreenGNDGND*

* There are multiple ground pins on the Arduino board

Step 6: Code

Picture of Code
//cosntants for the pins where sensors are plugged into.
const int sensorPin = 0;
const int buzzPin = 9;
unsigned long minute1; 
float time1;
//Set up some global variables for the light level an initial value.
int dark;  // initial value
int lightVal;   // light reading
void setup()
{
  // We'll set up the LED pin to be an output.
  dark = 300;
  //we will take a single reading from the light sensor and store it in the lightCal        //variable. This will give us a prelinary value to compare against in the loop
}
void loop()
{
  lightVal = analogRead(sensorPin); // read the current light levels
  //if lightVal is less than our initial reading withing a threshold then it is dark.
    while (lightVal > dark) {  // still sitting
    tone (buzzPin, 1000, 100);
    delay (100);
    noTone(buzzPin);  }
  }
    
}

Comments

About This Instructable

165views

2favorites

License:

Bio: Aerospace Engineer working in Software Development with a passion for Hardware.
More by TechMartian:Flying Captain America's Shield - RC PlaneWide Angle ShotsLED Ping Pong With Shift Register
Add instructable to: