Hello all, got a demo what a arduino could do from a friend and i was hooked.
My house got recently robbed so my poject is going to be an alarm system for 3 rooms.
All my parts are ordered and will be here in 25days. In the meantime i wanted to ask here for advice/tips/guidance.
I have planned the alarm as follows:
-1 arduino uno with a laser pointer, armed on code through keypad, when laser is tripped buzzer go off and i get a email or something.
-2 arduino nano's in the hallways that have smoke detector to notify me when there's a fire over an rf transmitter (reciever on the uno).
I have chosen a laser pointer cuz i have a cat and i think a laser 'tripwire' in a central doorway will cancel any false flags.
I've ordered a PIR also just to make sure.
I have studied Delphi way back in the day (14years ago) so i am a bit familiar with coding.
I've attached a flowchart of the project that i have made and i was hoping you guys could take a look at the thing and tell me what you think.
Any help is welcome and if needed i can go deeper into specs !
hi i like your idea and it looks the same as "home automation" or at least its a part of it.
but your idea should work and it doesnt seem to be impossible.
and just to give some extra tips and ideas. as i'm also creating something like this.
but i'm useing a Raspberry Pi as (PHP)database.
and at the moment i have the Termp example with a Arduino ethernet and a LM35 and its send the room temperature every 30 sec.
to the database. and i can monitor everything with a internet explorer.
as i'm also planning to add a RFID door unlock, fire protection, home security, room temperature controll, room lights, and maby some other stuff.
and i'm also a beginner with everything i do have some little programming experianse.
but everything seems to be more simple then i though.
Unfortunately it is only available in Spanish, but you can always take a look at the schematics.
The project used ATmega16 and was programmed through parallel port and communicated using the serial RS232 (just imagine how old we are talking about) Nonetheless, maybe this could help you a little bit.
So i wanted to give you guys a progress update. The first part is done, only need to solder it onto a arduino mini now. The system plays a sound when smoke is detected and i also added a light that only goes on when it's dark and there is motion, that way we can move freely in the hallway at night without waking my 1.5year old son. I've pasted the code and schematics at the bottom. The second part (main hub) is almost done, schematics are also on the bottom, code will follow when it's done. I've lost some time getting multiple passwords to work and still need to figure out howto connect hallway to main hub and main hub to internet for notifications when i'm not home. Thinking to use my raspberry pi for that but i'll cross that bridge when i'll come to it...
//the time we give the sensor to calibrate (10-60 secs according to the datasheet)
int calibrationTime = 30;
//the time when the sensor outputs a low impulse
long unsigned int lowIn;
//the amount of milliseconds the sensor has to be low
//before we assume all motion has stopped
long unsigned int pause = 5000;
boolean lockLow = true;
boolean takeLowTime;
int sensorPin= A0; //smoke sensor
int buzzerPin= 12; //piezo buzzer
int smoke_level;
int pirPin = 7; //the digital pin connected to the PIR sensor's output
int ledPin = 3; //led
int ldr = A1; //light sensor
unsigned short ldrValue = 0;
void setup() {
Serial.begin(115200); //sets the baud rate for data transfer in bits/second
pinMode(sensorPin, INPUT);//the smoke sensor will be an input to the arduino
pinMode(buzzerPin, OUTPUT);//the buzzer serves an output in the circuit
pinMode(pirPin, INPUT); //sets pir as input
pinMode(ledPin, OUTPUT); //sets led as output
pinMode(ldr, INPUT); //sets lidr as input
digitalWrite(pirPin, LOW); //turns pir off on boot
digitalWrite(ledPin, LOW); //turns led off on boot
digitalWrite(buzzerPin, LOW); //turn piezo off on boot-will beep on boot if i don't put this here
}
void loop() {
activePir(); //activepir loop
smoke(); //smoke alert loop
}
void activePir() {
if (digitalRead(pirPin) == HIGH) {
ldrValue = analogRead(ldr); //get value from ldr
if (ldrValue > 800) {
digitalWrite(ledPin, HIGH); //the led visualizes the sensors output pin state when hallway is dark
}
if (lockLow) {
//makes sure we wait for a transition to LOW before any further output is made:
lockLow = false;
delay(60000);
}
takeLowTime = true;
}
if(digitalRead(pirPin) == LOW){
digitalWrite(ledPin, LOW); //the led visualizes the sensors output pin state
if(takeLowTime){
lowIn = millis(); //save the time of the transition from high to LOW
takeLowTime = false; //make sure this is only done at the start of a LOW phase
}
//if the sensor is low for more than the given pause,
//we assume that no more motion is going to happen
if(!lockLow && millis() - lowIn > pause){
//makes sure this block of code is only executed again after
//a new motion sequence has been detected
lockLow = true;
delay(50);
}
}
}
void smoke() {
smoke_level= analogRead(sensorPin); //arduino reads the value from the smoke sensor
if(smoke_level > 200){ //if smoke level is greater than 200, the buzzer will go off
digitalWrite(buzzerPin, HIGH);
delay(500);
digitalWrite(buzzerPin, LOW);
delay(500);
}
else{
digitalWrite(buzzerPin, LOW);
}
}