Skip to content

Castle-Oak/Raspberry-Pi-Door-Alarm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi Door Alarm

This is an example of a door alarm written in Python on Raspberry Pi.

Installation

  • Copy alarm.py to the pi's home directory.
  • Add your Pushover API creds to AWS SecretsManager. Replace TOKEN and USER_KEY with the token and user key from Pushover. Take note of the ARN. You'll need this to start the script. aws secretsmanager create-secret --name api_key --secret-string "{\"token\": \"TOKEN\",\"user\": \"USER_KEY\"}"
  • Open crontab. crontab -e
  • Add the following line to your crontab. Replace $SECRET_ARN with the name of the secret in AWS SecretsManager. @reboot sleep 120 && python3 /home/pi/alarm.py $SECRET_ARN >> /home/pi/alarm.log 2>&1

Software

  • A Raspberry Pi with Rasbian Lite installed
  • Network connectivity
  • Python3
  • The follwing Python modules: boto3, gpiozero
  • AWS SecretsManager (To store Pushover API credentials)

Hardware

  • Magnetic Reed Switch
  • Raspberry Pi Zero, Raspberry Pi 2 or better
  • Soldering Eequipment (Iron, Solder, thin guage wire)

Solder the the leads from the magnetic reed switch to GPIO2 and ground, polarity is not important.

About

A door alarm for Raspberry Pi written in Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages