MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    PIR Sensor + Raspi

    Hardware
    4
    13
    6050
    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.
    • P
      pepemujica last edited by

      Hi everyone!
      I’ve got a doubt. I’ve been watching a few videos on youtube on how to connect the pir sensor to the raspi.
      In every video, they use an arduino or a protoboard. Is this really necesary, or with the female-female cable, the PIR sensor and the raspi is enought?

      Kind regards

      1 Reply Last reply Reply Quote 0
      • P
        PtrBld Module Developer last edited by

        Hi,

        you do not need to use an arduino or anything else. Just connect the Pir-Sensor to the raspberry pi like this:

        alt text

        P 2 Replies Last reply Reply Quote 1
        • M
          McSorley last edited by

          I have it wired a little different. I have it connected to a different GPIO Pin.

          Following this guide worked beautifully.
          https://www.raspberrypi.org/learning/parent-detector/worksheet/

          1 Reply Last reply Reply Quote 0
          • P
            pepemujica @PtrBld last edited by

            @PtrBld Thank you very much!

            1 Reply Last reply Reply Quote 0
            • P
              pepemujica @PtrBld last edited by

              @PtrBld Hi! I am trying yo use the PIR-Sensor module, but I have no result, the screen never goes black.
              I have connected the cables as the picture you post. Any idea why is not working?

              M 1 Reply Last reply Reply Quote 0
              • P
                PtrBld Module Developer last edited by

                @pepemujica said in PIR Sensor + Raspi:

                Any idea why is not working?

                Maybe you should calibrate your PIR sensor tuning. There are two little orange knobs where you can adjust the sensitivity of the sensor.
                alt text

                1 Reply Last reply Reply Quote 1
                • M
                  McSorley @pepemujica last edited by McSorley

                  @pepemujica Good way to make sure you have it connected correctly and that the PIR is operating is to try out the python code in the link I sent.

                  from gpiozero import MotionSensor
                  
                  pir = MotionSensor(4)
                  while True:
                      if pir.motion_detected:
                          print("Motion detected!")
                  

                  Keeping in mind for both this code and the module that you have the correct pin number.

                  P 2 Replies Last reply Reply Quote 0
                  • P
                    pepemujica @McSorley last edited by

                    @McSorley said in PIR Sensor + Raspi:

                    Keeping in mind for both this code and the module that you have the correct pin number.

                    How do I know in what pin are the 3 cables connected?

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      McSorley @pepemujica last edited by McSorley

                      @pepemujica www.raspberrypi.org/documentation/usage/gpio-plus-and-raspi2/

                      You have 5v, Ground, then GPIO.

                      P 1 Reply Last reply Reply Quote 0
                      • P
                        pepemujica @McSorley last edited by

                        @McSorley so, the (4) you’ve put in the example before, wich of the 3 cables is?
                        Sorry, I’m pretty new in this, and I can’t get it easyly

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 1 / 2
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy