logo

Openplatform.xyz

Placeholder for our stuff related to Telecom, IT, Internet of things (IOT), ESP8266, Raspberry Pi

Home IOT Telecom IT stuff About Us Contact Us Site Map

Raspberry Script to auto turn on and off Monitor Screen using PIR motion sensor

You will need a PIR sensor like this

PIR motion sensor

Make a file named pirMotionDetect1.py

Place the script pirMotionDetect1.py in /usr/local/bin and make it executable

sudo chmod +x /usr/local/bin/pirMotionDetect1.py

Now make another script with name pirMotionDetect.sh. This will start/stop our service at boot time.

Place this file in /etc/init.d and make it executable.

sudo chmod +x /etc/init.d pirMotionDetect.sh

Now we'll register the script to run on boot.

sudo update-rc.d pirMotionDetect.sh defaults

As the script is not running at this time, we'll start it

sudo /etc/init.d/pirMotionDetect.sh start

 

All the best!

 



Suresh

Suresh Hariramani

I am an IOT enthusiast with more than 20 years of experience in the IT sector. Specializing in telecom service's; follow me for some very innovative and best in class IOT products as I unfold my knowledge and passion for the subject.


Vatsal

Vatsal Hariramani

Just me, myself and I, exploring the universe of uknownment. I have a heart of love and interests in technology, IOT and travel . And I want to share my world with you .