Total Pageviews

Tuesday, May 31, 2016

Arduino alarm system with delay (2)

   In this article I put a keyboard for activate and deactivate a alarms system with Arduino board and PIR sensor.
   My schematic is:
and sketch is alarm_system_2a.ino !
   My alarm work in next steps:
- after power on, alarm is OFF, blue led is on
- after you introduce the code (1234* or better #1234* because # clear buffer for old activity) system go to stand-by state, green led is blinking;
- after 20 seconds, system is in waitting (watching) mode, green led is permanent on;
- if PIR sensor detect movement, system begin to countdown, red led flash;
- if you indroduce code, system will be off (blue led in on)
- after 10 seconds (if you not enter the code) buzzer is on (led onboard is on), red led is permanet on
- after 10 seconds, system go to waitting mode, if is movement again, countdown and after buzzer is on, etc;
   You can see 2 movies with states of this alarm system:

Arduino alarm system with delay

   At polish site named I found an article about alarm system using a Arduino board and PIR sensor.
   Base schematic is 
and sketch for alarm is at page 3 in article.
   After I translate name of variables and study original sketch, I made some changes:
Note: I use internal led from Arduino board instead buzzer.
   My sketch is alarm_system_1a.ino and I have next states:
- switch is open, blue led is on, alarm is deactivate;
- switch is close (D2 at GND), green led is blinking, alarm is in stand-by
- after 20 seconds, green led in on, alarm is waitting
- if PIR sensor detect a movement, red led is blinking, alarm countdown 
- after 10 seconds, if switch is still close, red led is on, buzzer is active
- after 10 seconds, alarm return to waitting, if is movement, alarm countdown and repeat the cycle
- if switch is open, system in off.
   You can see a movie named Arduino system alarm with delay with all states: