MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    PIR-Sensor - put your mirror to sleep if not used

    Scheduled Pinned Locked Moved System
    utilitygpiomotion-sensorpower-saving
    56 Posts 32 Posters 106.7k Views 47 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MorningstarM Offline
      Morningstar @AAPS
      last edited by Morningstar

      @AAPS
      (Raspi 3)
      Just connect the PIR sensor Pins with three of these connector cables (female on both sides) directly to the GPIO pins on the PI, without soldering.
      alt text

      You need to know the pin assignments of your PIR sensor. I used:
      (4) +5V
      (6) GND (ground)
      (32) GPIO12
      i think you can also use (15) instead of my (32) then you don’t need to change the pin in the config file.
      alt text

      Hope that helps.

      A 1 Reply Last reply Reply Quote 2
      • A Offline
        AAPS @Morningstar
        last edited by

        @Morningstar Thanks! Where could I buy everything? Amazon?

        yawnsY 1 Reply Last reply Reply Quote 0
        • yawnsY Offline
          yawns Moderator @AAPS
          last edited by

          @AAPS
          Yes, Amazon, ebay, electronic stores in your city. And there are dozens of online shops for raspberry, arduino and all kinds of add-ons.

          1 Reply Last reply Reply Quote 0
          • A Offline
            AAPS
            last edited by

            Is this the right cable to use? https://www.amazon.com/Icstation-Female-Jumper-Cable-Connector/dp/B01F59QFMM/ref=sr_1_2? ie=UTF8&qid=1486697807&sr=8-2&keywords=female+to+female+Rainbow+%2F+DuPont+Wire

            MorningstarM 1 Reply Last reply Reply Quote 0
            • MorningstarM Offline
              Morningstar @AAPS
              last edited by

              @AAPS
              Yes that’s the right one.

              1 Reply Last reply Reply Quote 0
              • G Offline
                Goldjunge_Chriz
                last edited by

                Is it possible to switch the monitor on and off with the PIR? I would like to hide the sensor and turn on the monitor with a hand movement and then switch it off again with a new hand movement. The sensor should be hidden so that it registers only this hand movement and no other movements in the room. If the manual movement for switching off is once forgotten, the monitor should turn itself off after 30 minutes, for example.

                Is this possible?

                strawberry 3.141S 1 Reply Last reply Reply Quote 0
                • strawberry 3.141S Offline
                  strawberry 3.141 Project Sponsor Module Developer @Goldjunge_Chriz
                  last edited by

                  @Goldjunge_Chriz you might want to use the gesture module of mochman for it

                  Please create a github issue if you need help, so I can keep track

                  1 Reply Last reply Reply Quote 0
                  • G Offline
                    Goldjunge_Chriz
                    last edited by

                    Does it work well? I thought that with the PIR could be easier since I do not need any special gesture, only some individual movement.

                    1 Reply Last reply Reply Quote 0
                    • I Offline
                      illskool
                      last edited by

                      Hello,
                      1st off I’m a total noob at coding so please forgive me. I have been able to set up my mirror and get several modules up and running. However, I am having quite a bit of difficulty with the PIR-Sensor. I have it wired directly to the GPIO(pins 2, 6, 15). I installed the MMM-PIR-Sensor via paviros instruction. At first I got the white screen. Somehow that issue is gone. Now I can’t get the module to work. I know the PIR sensor is working, because I am able to run a python script to detect motion. The script just keeps in running though even when I walk away from the sensor. Maybe the sensor is faulty?

                      Any help would be greatly appreciated.

                      Thanks in advance

                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        Mar @DirkS
                        last edited by

                        @DirkS

                        Hey Dirk, i was having some issues and was using “/opt/vc/bin/tvservice -o” and “/opt/vc/bin/tvservice --preferred && sudo chvt 6 && sudo chat 2” to turn my screen on and off as that seems to be what everyone is using. This worked reliably since i started using the PIR sensor.

                        All of a sudden this started making my screen go white when it issued the monitor on command…and the screen would stay white for a few minutes and sometimes it would come back.

                        Using your “vcgencmd” commands in place of the previous in my monitor on/off scripts everything is back to working again.

                        I had a couple questions. Firstly i didnt understand what you mean by hdmi_blanking=1…what does this do/should i put this in my boot/config.txt?? And secondly what is the difference between the two ways of toggling the monitor?

                        (I did ask my question here: https://forum.magicmirror.builders/topic/1780/white-screen-after-screen-resumes-from-pir-or-sometimes-randomly-can-still-access-via-ssh-requires-restart-sometimes/4 incase but stumbled upon this after.)

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 6
                        • 4 / 6
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Sam, technical setup by Karsten.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy