Arduino - Simple Security Idea.

Introduction: Arduino - Simple Security Idea.

About: computoman.blogspot.com Bytesize articles instead of a trilogy in one post.

What I wanted was a simple motion sensor that I could use semi-remotely. You can get airfresheners, pir sensors and all kinds of things to work, but I wanted something simple and cheap that could be used remotely. Pir sensors cost close to ten dollars each retail. Harbor freight had a whole setup for just ten dollars (on sale) for the price of a pir sensor, so I could not pass it up. 

Note: Try this at your own risk. Get a professional to help if you are unsure.

Update: There is now a product from Seeed that is a clone of the arduino. Stores are discounting the regular arduino simce the Seeeed items are about half the cost of the Arduino.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: What's Needed.

Arduino.
LDR.
1K resistor.
Wire.
Black tape.
Driveway Alert system.
3 "C' cell batteries
1 9V battery
Moc
2 - 330 ohm resistors
1 - 3k resistor
Breadboard for testing
1 parallel port break out cable.

Step 2: Main Circuits.

There are two circuits here. One from the Arduino to the receiver and the other from the Arduino to the pc. I did not want to have to deal with rs232 circuits so just a simple signal to the parallel port should do the job.

Note: resistor from the Arduino to the MOC could be as low as 330 ohms.

Step 3: The Code.

Arduino
[code]
int ldr = 0;             //analog pin to which LDR is connected
int ldr_value = 0;        //variable to store LDR values
int ledPin = 12;  

void setup()
{
pinMode(ledPin, OUTPUT);      // sets the digital pin as output
}

void loop()
{
  ldr_value = analogRead(ldr);          //reads the LDR values
  if (ldr_value > 50)
     {
      delay(50);                  //wait
      digitalWrite(ledPin, HIGH);   // sets the LED on
      delay(5000);                  // waits for 5 seconds before rearming
      digitalWrite(ledPin, LOW);    // sets the LED off
     }
}
[/code]

PC (freebasic)
[code]
do until 0 <> 0
do until (res AND 64) = 6
res = INP(&H379)
rem 64 is for pin 10 if it goes high
loop
rem execute whatever code you want to let you know there was motion.
rem bti sends a twitter to the set up account.
shell "echo  there was motion | bti"
rem Timing loop before rearming.
for z = 1 to 500000
next z
loop
[/code]


Step 4: Test It.

It works!

Be the First to Share

    Recommendations

    • LED Strip Speed Challenge

      LED Strip Speed Challenge
    • Sculpting Challenge

      Sculpting Challenge
    • Clocks Contest

      Clocks Contest

    2 Discussions

    0
    AustinJim
    AustinJim

    7 years ago on Introduction

    Hi, thanks for the project. Why not communicate with the PC over the usb port of the Arduino instead of the parallel port?
    Jim

    0
    Computothought
    Computothought

    Reply 6 years ago on Introduction

    Thanx. Do not want to over tax the ussb port. Less electronics required and easiier to program than the usb.,.