Skip to content

bbbenji/doorpi2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DoorPi

Overview:

The aim of this project is to create a low-cost, customizable security system using a Raspberry Pi and Python3. The Pi uses sensors to detect if a door has been opened and a camera to record the entry. The alarm can be armed or disarmed using an NFC card or via the web interface. The alarm status is indicated by sounds and addressable LED animations. The alarm will send an email notification if not disarmed within a set amount of time. Here is a video of the system in action.

Spec:

  • If an NFC card is scanned and the NFC ID is valid:
    • If the alarm is armed:
      • The alarm status changes to disarmed.
      • The remaining tasks in the entry routine are canceled.
      • The sensors stop scanning and the camera is turned off.
      • The disarm routine is started:
        • The disarmed LED animation is displayed.
        • The disarmed sound is played.
    • If the alarm is disarmed:
      • The alarm status changes to armed and the arm routine is started:
        • The countup LED animation is displayed.
        • The arming sound is played.
        • After 18 seconds, the alarm LED animation is displayed and the armed sound is played.
      • After 20 seconds, the sensors start scanning and the camera is initialized.
  • If the alarm is armed and any of the sensors are tripped:
    • The alarm is triggered.
    • The camera records for 7 seconds and continues to record 7 second clips whenever the sensors are tripped.
    • The entry routine is started:
      • The countdown LED animation is displayed.
      • The entry sound is played and then played again after 7 and 14 seconds.
      • The alarm LED animation is displayed.
      • The notification sound is played.
      • A notification email is sent.
  • If the alarm is armed via the web interface:
    • The sensors immediately start scanning and the camera is initialized.
  • If the alarm is disarmed via the web interface:
    • The sensors immediately stop scanning and the camera is turned off.
    • The remaining tasks in the entry routine are canceled.

Dependencies:

  • sqlite3
    • Contains NFC IDs and user info for web interface login.
    • NFC IDs and user passwords are hashed and salted using passlib.
  • celery
    • Celery workers execute all tasks in routines, including playing sounds, displaying LED animations and sending emails.
  • rabbitmq
    • Message queue for celery.
  • libnfc and nfc-eventd
    • Reads NFC cards and sends the NFC ID the alarm system.
  • pygame-mixer for python3
    • Plays sound files.

Config

  • Systemd service files are included for nfc, celery, and the alarm.
  • The included nfc-eventd.conf file is configured to run bin/nfc_script.sh whenever an NFC card is scanned.

Parts:

Licensed under GNU GPLv2

About

Raspberry Pi Alarm System

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 74.5%
  • Other 14.0%
  • HTML 8.3%
  • JavaScript 2.1%
  • Other 1.1%