Git Product home page Git Product logo

raspi-alarm's Introduction

Raspberry PI Alarm

Yet another Raspberry PI alarm system. It monitors an area using a passive infrared sensor and if motion is detected, the camara captures 4 pictures which are then sent to a configurable Telegram group or user. Moreover, the system's main functions are controlled using a Telegram bot.

overview.png

Tech stack

The main program builds upon Python's asyncIO library and is using aiogram3 to interact with Telegram, picamer2 to control the camera and finally pigpio for interfacing with the GPIO.

Used hardware

  • Raspberry PI >4
  • Camera Module 3
  • Passive infrared motion sensor
  • Physical push button
  • Leds and corresponding resistors
  • Enclosure
  • Raspberry PI relays board
  • (Optional) Piezo Buzzer

Setup

  • Get your telegram bot token by talking with @botfather
  • Create group, get group ID
  • Add your bot to this group
  • Clone this repository and install requirements:
    # Install OS requirements
    sudo apt install -y python3-libcamera python3-kms++
    sudo apt install -y python3-prctl libatlas-base-dev ffmpeg libopenjp2-7 python3-pip libcap-dev
    
    # Enable "remote GPIO"
    # raspi-config->Interface Options -> Remote GPIO
    
    # Enable pigpiod service on boot
    sudo systemctl enable pigpiod
    
    # Create a new python virtual env inside the cloned repository
    python3 -m venv --system-site-packages venv
    
    # Activate venv
    source venv/bin/activate
    
    # install requirements
    pip install -r requirements.txt
    
    # Edit .env.dist and copy
    cp .env.dist .env
  • Adjust the systemd service file and copy to /usr/lib/systemd/system
  • Enable on boot: sudo systemctl enable raspi-alarm.service

Wiring

wiring_diagram.png

Closing words

This software was written with the best of intentions and I take no responsibility for any potential damage resulting from its use. Feel free to study, use and adapt.

raspi-alarm's People

Contributors

sirtoobii avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.