Motionsensor



  • Hi guys,

    I just build my first motionsensor but i think I have some problems. Everything is working and the sensors send 1 and 0 to my gateway, but my problem is that it looks like this in the serial monitor.

    1
    0
    1
    0
    0
    1
    0
    1
    1
    0
    1
    1
    0
    1
    1
    0
    1
    0
    0
    1
    0
    1
    1
    0
    1
    1
    0
    1
    1
    0
    1
    0
    1
    1
    0
    1
    1
    0
    1
    1
    0
    1
    0
    

    The problem is that I get like 10 - 20 updates / second and as you see, its 1 and 0 at the same time and its pointed at a clean wall with no motions.

    Anyone have any thoughts how to solve this?

    Cheers


  • Mod

    I had my PIR sensor triggering randomly until I powered it directly from the 5v power supply and not from the arduino 5V pin.

    Also you may add a check to report only when status actually change, add a little delay on loop function or even better a sleep like this from the examples

      // Sleep until interrupt comes in on motion sensor. Send update every two minute.
      sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
    


  • I'm running the example sketch so the sleepfunction is allready there. So it's the 5V power that's the issue?


  • Mod

    could be, if you have a MB102 you can try with that; I also read someone suggesting to have a resistor from the PIR digital pin to GND, but I haven't tried it


Log in to reply
 

Suggested Topics

  • 3
  • 5
  • 8
  • 6
  • 2

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts