Skip to content

ChrisBaehrig/MM-PIR-motion-poweron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MM-PIR-motion-poweron

This powersaving program starts automatically the RaspberryPi. It use a PIR-Sensor which triggers the booting pin to start the MagicMirror. After a waiting time the MM shutdown for power saving.

drawing

Requirements

Connect your PIR-Sensor to the Pin 3 of Your RaspberryPI. An BD137 Transistor inverts the Signal for the Interrupt to start the RP. Raspberry Pi try reading the output from the PIR motion sensor. The sensor outputs a digital HIGH (5V) signal when it detects a person.

What you will need

Example PIR-Sensor: https://www.amazon.de/dp/B07V6BY66P/

Wireing

Connecting PIR-Sensor:

drawing

drawing

More infos to the Wake up function of the RaspberryPI:

https://howchoo.com/g/mwnlytk3zmm/how-to-add-a-power-button-to-your-raspberry-pi

Installation

Just clone the files into a new directory Powermanagement .

mkdir Powermanagement
git clone https://github.com/ChrisBaehrig/MM-PIR-motion-poweron.git

Integrate Powermanagement to System

  1. Give permissions for run:
    chmod +x time-shutdown.py
    
  2. Crete Batch for PM2 command:
    cd ~
    nano timeshut.sh
    
  3. Write into file following command:
    sudo pm2 start time-shutdown.py
    
  4. Save with crtl + o and close crtl + x
  5. Give permissions for run:
    chmod +x time-shut.sh
    

Add to PM2 for autostart

  1. Start PM2:
    pm2 start time-shut.sh
    
  2. Save to PM2:
    pm2 save
    
  3. Check PM2 tasks:
    pm2 monit
    
    and
    sudo pm2 monit
    

Stop autostart:

pm2 stop time-shut
sudo pm2 stop time-shutdown.py

Changelog

[1.0.0] - 2022-10-10

  • Initial release

Acknowledgements

Many thanks to

  • MichMich for the MagicMirror development

Disclaimer

The Projekt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Releases

No releases published

Packages

No packages published

Languages