Trouble with PIR sensor
I’ve been really struggling with setting up a PIR sensor. All I want is for the PIR sensor to turn off the TV monitor, not just the HDMI port which seems to be what most of the modules do. Has anyone done this with their mirror that could help me out? Or is there another option for having monitor turn off when not being used? The mirror will be in my room and I obviously don’t want it on 24/7.
cruunnerr last edited by cruunnerr
Maybe with a relay?
edit: but the normal MMM-PIR module can use a relay, too
This post is deleted!
This post is deleted!
Try these commands in the *.sh files:
vcgencmd display_power 1
vcgencmd display_power 0
I need to update my post ^^
I don’t have a relay at the moment but I’m going to order one. In the mean time, I tried part 2 of your guide to test if I could get the PIR sensor working but it’s not. The HDMI port is disabled after 120 seconds of no presence in the sensor. When I wave my hand in front of the sensor to turn the pi back on, the HDMI port activates but I only get a black screen. Any suggestions for what to do?
I really appreciate the help. Been struggling with the PIR sensor for a week now. Is there a specific relay I should be looking for? I managed to get everything working with the PIR sensor, but once the TV turns off after there is no input detected, the PIR sensor can’t turn the tv back on. So it is not the most viable solution.
did u try what i posted?
U said, u tried part 2 of the tutorial. So u should have a “monitor_on.sh” and a “monitor_off.sh”
Try to change the content to the following:
sudo vcgencmd display_power 1for monitor_on.sh
sudo vcgencmd display_power 0for monitor_off.sh
sudo tvservice -p && sudo chvt 9 && sudo chvt 7for monitor_on.sh
sudo tvservice -ofor monitor_off.sh
If these don’t work at all u should go for the relay.
U could use every relay u want, but u should search for a 3 - 5V relay because otherwise u need to install a transistor.
I got a relay and followed your guide to connect it. The relay has an LED light on it but it doesn’t seem to trigger. I still have all the code setup for turning off the HDMI port with the PIR sensor, so I’m not sure if thats the problem. Any suggestions?