Skip to content

Turn a Raspberry PI HDMI screen on/off using a PIR

License

Notifications You must be signed in to change notification settings

martinto/pirhdmi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pirhdmi

Turn a Raspberry PI HDMI screen on/off using a PIR

This service can be used for any Raspberry PI project which has an HDMI monitor and a PIR; the monitor is switched on when movement is detected and turned off afer a configurable timeout.

Files

File Purpose
INSTALL A script which installs pirhdmi as a service
pirhdmi The service which is run
pirhdmi.service The systemd configuration
traceit.sh Run the script tracing the execution, useful for debugging

The timer is set to two minutes, to change that edit pirhdi and change the global variable ON_TIME to the number of seconds for the screen to stay on once activated.

Requirements

The script is written in python3 and a full install of Raspbian is needed to run it.

Add this to /etc/xdg/lxsession/LXDE-pi/autostart

unclutter -idle 0.5 -root &
xhost + local:
/usr/bin/chromium-browser --noerrdialogs --disable-infobars --kiosk --app=<DAKBoard GUID>

Use raspi-config to enable the overlay file system to protect the SD card.

Screen blanking must be on in raspi-config

PI Wiring

Connect the PIR power to pin 2, ground to pin 6 and signal to pin 7

About

Turn a Raspberry PI HDMI screen on/off using a PIR

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published