diy dorm alarm systems - computer sciencereiser/179-fall2009/studentwork/... · diy dorm alarm...

6
DIY Dorm Alarm Systems This project will allow one to install into his or her dorm room adjacent to a door and have it lock the door via a solenoid rod that will obstruct the door when motion in the room is detected, therefore capturing the uninvited guest. To construct this device one will need: Arduino Duemilanove - Small Motor / Solenoid - Aluminum Project Enclosure - Several NPN Transistors - ..... ":::: ::::: ::::: ::::: Small Breadboard - ll mH lH \\\\ ::::: ::::: ::::: ::::: ::::: Two LEDs - Red/Green -

Upload: others

Post on 12-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DIY Dorm Alarm Systems - Computer Sciencereiser/179-fall2009/studentWork/... · DIY Dorm Alarm Systems . This project will allow one to install into his or her dorm room adjacent

DIY Dorm Alarm Systems This project will allow one to install into his or her dorm room adjacent to a door

and have it lock the door via a solenoid rod that will obstruct the door when motion in the room is detected, therefore capturing the uninvited guest.

To construct this device one will need:

Arduino Duemilanove ­

Small Motor / Solenoid ­

Aluminum Project Enclosure ­

Several NPN Transistors ­

..... ":::: ::::: ::::: :::::

Small Breadboard - l~ ~ ~ ~l~mHl~~lH~m~~\~\\\ ~~mm~~H~m~\H\~~~\ln ::::: ::::: ::::: ::::: :::::

Two LEDs - Red/Green ­

Page 2: DIY Dorm Alarm Systems - Computer Sciencereiser/179-fall2009/studentWork/... · DIY Dorm Alarm Systems . This project will allow one to install into his or her dorm room adjacent

PIR Motion Detector-

Piezo Speaker ­

Push Button Switch ­

Other Additional Wires and AC adapter for Arduino ifnot included in kit.

Total Estimated Cost of Parts: $20 not including Arduino and Computer for sending And receiving information.

1) Begin by modifying your aluminum project box to accommodate the Arduino and drill holes for the LEOs, piezo buzzer and solenoid.

2) Then install all parts into the box but do not seal the box up.

3) Connect the various wires to the pins indicated in the code below to the various components. Ensure that attention is paid to polarity and use other proper techniques when wiring up the components.

4) Don't forget to give the motion sensor power. Open up the front plate cover and read instructions provided with the sensor for further information that will assist in wiring.

5) Based on the configuration of what type of door the security system will be on will determine the placement of the solenoid.

6) Once Wiring is finished use the Arduino code provided to ensure that it is wired correctly then feel free to change up the code and make it your own unique project.

Page 3: DIY Dorm Alarm Systems - Computer Sciencereiser/179-fall2009/studentWork/... · DIY Dorm Alarm Systems . This project will allow one to install into his or her dorm room adjacent

USE THE FOLLOWING PHOTOGRAPHS TO GET AN IDEA OF WHAT THE ABOVE TEXT MEANS

The above image uses a rotational motor to represent where the solenoid would be since one was not available at the time that this particular project was constructed.

BELOW IS THE CODE TO BE INPUTTED INTO THE ARDUINO INTERFACE SOFTWARE AND TRANSFERRED TO THE DEVICE

const int analogPin = 0; const int speaker = 13; canst int analogPinl = 1; const int digital Pin =3;

const int digitalPin2 =10; const int threshold = 600;

Page 4: DIY Dorm Alarm Systems - Computer Sciencereiser/179-fall2009/studentWork/... · DIY Dorm Alarm Systems . This project will allow one to install into his or her dorm room adjacent

void setupO {

pinMode(speaker, OUTPUT); pinMode(digitalPin, OUTPUT);

}

void loopO {

int analogValue =analogRead(analogPin); int analogValue2 = analogRead(analogPinl);

if (analogValue >= threshold) { digitalWrite(speaker, LOW); digitalWrite(digitalPin2, HIGH);

} else {

if(analogValue2 <= threshold){

digitalWrite(speaker, HIGH); delay(700); digitalWrite(speaker, LOW); delay(400); digitalWrite(speaker, HIGH); delay(700); digitalWrite(speaker, LOW); delay(400); digitalWrite(speaker, HIGH); delay(700); digitalWrite(speaker, LOW); delay(lO); digitalWrite( digitalPin, HIGH); delay(lOOO); digitalWrite(digitalPin, LOW); delay(lOOO); digitalWrite( digitalPin, HIGH); delay(2000); digitalWrite(digitalPin, LOW); delay(SO);

} else{ digitalWrite(speaker, LOW);

Page 5: DIY Dorm Alarm Systems - Computer Sciencereiser/179-fall2009/studentWork/... · DIY Dorm Alarm Systems . This project will allow one to install into his or her dorm room adjacent

}

} }

The attached schematic will greatly assist in wiring up the parts. To open the file please download the Eagle Schematic Program - It is free and available for Macs and pes and is a great program to have for future reference and use.

NOTE: Prior basic knowledge of the Arduino is recommended for this project.

Page 6: DIY Dorm Alarm Systems - Computer Sciencereiser/179-fall2009/studentWork/... · DIY Dorm Alarm Systems . This project will allow one to install into his or her dorm room adjacent

" HLMP6 ~

(l) ::J

0 r 0 m

.......

» I

0

» ...... a. s.

to < 0 0

CI) (l) ::J en 0 ......

81 rn

• 01

0------- < -0 0 OJ CI)

::J :E0 ;::+» ()

:::r -L

o

(JJKC;~ 12u 1 <a 0

~P1

r I

... 0r·.)

01 " < 0

U'-­ 0dLMP6

::0 (l) a. r m 0

.:;...

0

s: 0-0 ......