Alarm System

Hello everybody.

I want to create a alarm system with arduino. I just got some few problems, that i have to fix first.

Arduino rocks, and thanks for creating this.

Have a nice day :wink:

Hello and welcome Mattias!

I would love some details about your project. Always fun to hear about other people's projects :slight_smile:

Any chance you are from norway ?(no offence):slight_smile:

I think an Arduino alarm system is a great application!

First off, I would probably get some multiplexed inputs, that would increase the number of zones you could monitor (window switches, door switches, motion sensors)... also perhaps the Xbee for wireless sensors. The LCD/keypad displays would be a snap too.

Getting an alarm company to monitor the system might be an issue, you may need to figure out what kind of strings they need on the modem.

I just completed a project doing home security with arduino, a multiplexer, RFID tags and whatnot.
I'm putting it all together for exhibition shortly.
The arduino and multiplexer:

The control panel (the rfid is behind the picture)

I have been planning on creating something like that my self, the rfid in the picture frame is very clean looking, i might just have to borrow that idea my self :stuck_out_tongue:

Thats a really clean implementation zackprice.

Im working on an RFID door lock, and iv already used 9 of the 13 digital pins.

Mind you this is my first "from scratch" arduino project so it probably not the cleanest way to do it.

im hoping to have to code usable/proto'ed in the next couple of days.
as for the hardware its mostly bread boarded but i still have some work to do on that.

i REALLY like your implementation and install

BTW do you get alot of JUNK data from the RFID reader? im getting alot of random junk from the RFID read when its sitting there (using the Parallax serial reader
http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/txtSearch/28140/List/1/ProductID/114/Default.aspx?SortField=ProductName%2CProductName )
its actively reading because i havent figured out how to activate the reader based on tag proximity yet

Hello everybody, and thank you for all yours replys.

I suddenly got to work.

The only then yet i installed is a doormagnet for my door, so when the door opens, the sirene goes on for like 10 secs, and then if the door is closed again, the alarm turns off.

I got 3 leds.

Red for when alarm is on.
Green for when Door is closed and everything is OK.
And a Yellow. And for the yellow i have a little question.

Yellow:
My idea is, when the alarm is on, and the door still i open, the yellow led should just be LOW. But when the door is closed and the sirene is still on (delay(10000):wink: the yellow LED should start to blink with a delay of 100 mil until the sirene is off (as it is after 10 secounds, when the door is closed), then it should be LOW- but i dont know how i can do that - i tryed for hours last day, but notin dident work :frowning:
Look at my code:

int ledPin = 13; // choose the pin for the LED
int inPin = 2;   // choose the input pin (for a pushbutton)
int val = 0;     // variable for reading the pin status
int dor = 0;
int alarmPin = 6;
int greenPin = 7;
int yellowPin = 4;
int butPin = 3;

void setup() {
  pinMode(ledPin, OUTPUT);  // declare LED as output
  pinMode(inPin, INPUT);    // declare pushbutton as input
  pinMode(alarmPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(yellowPin, OUTPUT);
  pinMode(butPin, INPUT);
}

void loop(){
  val = digitalRead(inPin);  // read input value
  if (val == LOW) {         // check if the input is HIGH (button released)
    digitalWrite(ledPin, LOW);  // turn LED OFF
    digitalWrite(alarmPin, LOW);
    digitalWrite(greenPin, HIGH);
    
  } else {
    digitalWrite(yellowPin, LOW);
    digitalWrite(alarmPin, HIGH);
    digitalWrite(greenPin, LOW);
    delay(150);
    digitalWrite(ledPin, HIGH);  // turn LED ON    
    
    delay(10000);
    
  }
   
    digitalWrite(yellowPin, HIGH);
    delay(200);
    digitalWrite(yellowPin, LOW);
    delay(200);
}

Can anyone tell me how to do that?.

And then i have another question :slight_smile:

  • the Arduino board is only 5v - and it wont work if i put in a 9v battery to my solderless breadboard instead of the power from the arduino board. Like the sirene needs atleast 12v (a better one i want for ths project) and some moton detectors needs more power. So how am i supposed to add like 12v power supply to the breadboard? :slight_smile:

Thank you all, and MERRY CHRISTMAS!

and btw.

I saw alot of keypads im my local eletronic store, but i dont know how these works, and how can add them to my alarm system/ardunio board.

Anyone know? :slight_smile:

Mattias,

You gave a good idea of what you want the behavior of your system to be. Now, let's turn that into all of the different "states" for your system.

  • CLEAR (door closed, alarm quiet, green light on)

  • BREACH (door open, alarm loud, red light on)

  • TRIPPED (door closed, alarm quiet, yellow light on)

For each one of those states, you have to decide what the next possible state is, and how to know it's time to go to that state.

  • CLEAR: if the door is open, go to BREACH

  • BREACH: if the door is closed, and ten seconds has gone by in this state, go to TRIPPED

  • TRIPPED: if the user clears the alarm, go to CLEAR; if the door is open, go to BREACH

You can make a separate function for each state, and then the loop() code should just call the right function for the current state.

Once you get this working, and you learn more about the keypads, there's a new state to add: UNLOCKED, where it's just like CLEAR for a few seconds but it won't ring the alarm if the door is opened AND closed within a few seconds.

Thank you for your tips. :)..

I wanted the yellow led to work like this:

  • YELLOW PIN (door closed, alarm loud, yellow light on)

:D..

But right now, i try to get help from this topic: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1230039229/0, so probably can fix the issue :slight_smile:

Thank you all!