• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 detecting motion even when there's no movement

Scheduled Pinned Locked Moved Troubleshooting
2 Posts 2 Posters 1.6k Views 1 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.
  • M Offline
    Mitchfarino Module Developer
    last edited by paviro Sep 11, 2016, 11:08 AM Jul 29, 2016, 9:39 PM

    Hi All

    I’ve just hooked up my PIR sensor to my Pi3

    I ran a variant of this, and it was constantly detecting movement even when I was covering it up, so nothing should have been detected.

    Is there an issue with my sensor? Or is that standard? Or can I turn down the sensitivity in some way?

    import RPi.GPIO as GPIO
    import time
    GPIO.setwarnings(False)
    GPIO.setmode(GPIO.BOARD)
    GPIO.setup(3,GPIO.OUT)     #Define pin 3 as an output pin
    
    while True:
            GPIO.output(3,1)   #Outputs digital HIGH signal (5V) on pin 3
            time.sleep(1)      #Time delay of 1 second
    
            GPIO.output(3,0)   #Outputs digital LOW signal (0V) on pin 3
            time.sleep(1)      #Time delay of 1 second
    

    Edit from admin: Please use Markdown on code snippets!

    1 Reply Last reply Reply Quote 0
    • K Offline
      KirAsh4 Moderator
      last edited by KirAsh4 Jul 30, 2016, 5:55 AM Jul 30, 2016, 12:10 AM

      I don’t have a PIR sensor to fiddle with … however, why are you setting pin 3 HIGH, and as an OUTPUT? If it’s to power the PIR sensor board, don’t, use either pin 1 or 17, those have a constant 3v3 on them (or if you know your sensor can tolerate 5V, use pins 2 or 4). If it’s to read from the PIR sensor, it needs to be set as an INPUT pin so it can detect when the sensor triggers it.

      A Life? Cool! Where can I download one of those from?

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      1 / 1
      • First post
        1/2
        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