Arduino Forum

Community => Exhibition / Gallery => Topic started by: gtr_stitch on Jan 28, 2013, 05:50 am

Title: "Security" System = Arduino+PIR+LCD+DS1307
Post by: gtr_stitch on Jan 28, 2013, 05:50 am
Hello again...

I've been working on a project that has interested me ever since I got my hands on the Uno - my "home "security" system" (I put security in quotes mainly because, well, it's not really security, more so monitoring/indication). Anyways, I finished the project some time ago, and just a while ago, added the DS1307 RTC to it (just to add a little functionality/style, if you will). So, here is me showing it off a little bit :) it's by no means perfect, and as usual, I welcome feedback and criticism. By no means does this project really secure anything. I would not recommend setting this up as a serious home security measure (unless you have the resources, in that case, more power to you!)
Here is the sketch;
Code: [Select]
  Author - Gtr_Stitch

#include <LiquidCrystal.h>
int piez = 8;
volatile int state = LOW;

LiquidCrystal lcd(4,5,6,7,9,10);
#include <Wire.h>
#include "RTClib.h"

void setup(){
  pinMode(11, OUTPUT);
  lcd.print(" PLEASE WAIT...  ");
  delay(30000); // give the PIR time to calibrate
  lcd.print("    *ACTIVE*    ");

void indicator(){
  digitalWrite(11, HIGH);
  digitalWrite(11, LOW);

void trip_door(){
   lcd.print("  BREACH  DOOR  ");

void trip_motion(){
    lcd.print("     MOTION     ");

void loop(){
  int door = digitalRead(2);
  int pir = digitalRead(3);
  if ( door == LOW){
  else if ( pir == HIGH){
  else {
  DateTime now =;
  lcd.print(now.hour(), DEC);
  lcd.print(now.minute(), DEC);
  lcd.print(now.second(), DEC);

void sound()
  tone(8, 500, 500);

void sound2()
  tone(8, 750, 500);

In a nutshell, the Uno monitors the PIR and a magnetic reed switch attached to the door downstairs. If either is tripped, a buzzer and a flashing led indicates motion or the door is open. When all is quiet, I query the time from the RTC, and a simple clock keeps the time. Pic down below. I used a very long cat5 cable to reach from downstairs to my computer desk. Because of the cat5's length, I've had some issues with interference, which I'm working on.

In another project, I fashioned a combination lock out of five push buttons and a servo. Maybe later on I'll incorporate that into this project. But that's another story :)
'Til next time!

Title: Re: "Security" System = Arduino+PIR+LCD+DS1307
Post by: gtr_stitch on Apr 24, 2013, 09:51 pm
okay then...
Title: Re: "Security" System = Arduino+PIR+LCD+DS1307
Post by: cyclegadget on Apr 25, 2013, 05:05 am

Sorry that you did not get any responses. So many posts, so little time. You are on the right track. You have got a project to work that is practical and useful! You have also did a good job sharing your code and you provide a picture. I applaud your work and appreciate that you shared it!

Don't worry to much about responses, they do not always represent the majority of people's opinions.
Title: Re: "Security" System = Arduino+PIR+LCD+DS1307
Post by: codlink on Apr 25, 2013, 05:05 pm
I agree, with cycle, I come on this forum a few times a day and this is the first time I have seen this post.

Anyway, congrats on the working system!  You should post up a little tutorial on instructables or somewhere.  Lots of people have trouble getting a "security" system working.
Title: Re: "Security" System = Arduino+PIR+LCD+DS1307
Post by: OptoLcd on May 10, 2013, 12:55 pm
Thanks for this.
I have all the parts and hope to try your code out when I finish my current project.


Title: Re: "Security" System = Arduino+PIR+LCD+DS1307
Post by: JimboZA on May 10, 2013, 05:48 pm
I would probably add an electrified net like Wolowitz rigged up for Sheldon's and Leonard's apartment....
Title: Re: "Security" System = Arduino+PIR+LCD+DS1307
Post by: RudiAhlers on Jun 11, 2013, 10:06 am

Would you mind telling me which PIR you're using?
Title: Re: "Security" System = Arduino+PIR+LCD+DS1307
Post by: dex1337 on Nov 07, 2015, 08:13 am
Hello sir,
               Ive been working on a similar project to attach 4 PIR sensors to my 16,2 LCD.
Can you please b kind enough to guide me with required modifications to your source code? I'm a total beginner in embedded electronics.
Thanking you
Title: Re: "Security" System = Arduino+PIR+LCD+DS1307
Post by: b-james on Nov 07, 2015, 10:55 pm
How come pictures don't automatically appear any more?
Title: Re: "Security" System = Arduino+PIR+LCD+DS1307
Post by: CrossRoads on Nov 07, 2015, 11:46 pm
dex1337, you're asking on a 2+ year old topic, don't be surprised if there is no response.

b-james, Attached pictures used to open, now you have to click them. I don't know why that was changed.
One can also use the (http://tags to insert a link to a picture hosted elsewhere, here's an example of a link to a website with url tags and to a picture with img tags:<br>[url=[/ur]<br><img src=][/ur]<br><img src=[/url])image and link tags to embed a link and display a picture hosted elsewhere: (