Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Slim Node as a Mini 2AA Battery PIR Motion Sensor

Slim Node as a Mini 2AA Battery PIR Motion Sensor

Scheduled Pinned Locked Moved My Project
36 Posts 12 Posters 24.5k Views 19 Watching
  • 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 MikaelK

    Hello !

    @Tom71 Had you had the bigger PIR sensor, you could have adapted the delay manually, but it seems this smaller device doesn't offer that possibility. But I think you could wake up the node on a "CHANGE" interrupt instead of only "RISING" as in the example. For this PIR, it would happen approx 8s after last movement detection. Maybe you could add a 12s sleep phase before sending the zero ?

    @m26872 I've read somewhere that a short distance between the nrf24l01 and the motion sensor could lead to perturbations, and I wonder if you've tested a bigger separation between them and also got those false trips ? They are very close to each other on your example, which makes me wonder.

    Mikael

    m26872M Offline
    m26872M Offline
    m26872
    Hardware Contributor
    wrote on last edited by
    #10

    @Mikael-Kermorgant said:

    Maybe you could add a 12s sleep phase before sending the zero ?

    Yes, but keep in mind that sending of "0" will also trig a new false motion signal, so sleep for another >8s before sleep with interrupt.

    if you've tested a bigger separation between them and also got those false trips ?

    Yes, when I breadboarded this setup, I had them approx. 10cm apart with exactly the same behaviour. I also did test with supply from different boosters (and only LED-resistor as load on motion output). Similar separation and no nRF, all together lead to my conclusion.

    M 1 Reply Last reply
    0
    • m26872M m26872

      @Mikael-Kermorgant said:

      Maybe you could add a 12s sleep phase before sending the zero ?

      Yes, but keep in mind that sending of "0" will also trig a new false motion signal, so sleep for another >8s before sleep with interrupt.

      if you've tested a bigger separation between them and also got those false trips ?

      Yes, when I breadboarded this setup, I had them approx. 10cm apart with exactly the same behaviour. I also did test with supply from different boosters (and only LED-resistor as load on motion output). Similar separation and no nRF, all together lead to my conclusion.

      M Offline
      M Offline
      MikaelK
      wrote on last edited by
      #11

      @m26872 Thanks for the input.

      @Tom71 Have you looked at your controller software if you could manage the "no Motion state" after 20sec ? I'm using domoticz and I could set an "Off delay", avoiding the emission of a zero from the sensor.

      Tom71T 1 Reply Last reply
      0
      • M MikaelK

        @m26872 Thanks for the input.

        @Tom71 Have you looked at your controller software if you could manage the "no Motion state" after 20sec ? I'm using domoticz and I could set an "Off delay", avoiding the emission of a zero from the sensor.

        Tom71T Offline
        Tom71T Offline
        Tom71
        wrote on last edited by
        #12

        @Mikael-Kermorgant I'm using fhem. It is possible, that I can set an offline state after 20sec with fhem. I will try this.

        1 Reply Last reply
        0
        • siodS Offline
          siodS Offline
          siod
          wrote on last edited by
          #13

          Hi guys,

          I am wondering, if it wouldn´t be a good idea to use the PinChangeInt Library to wake the arduino from sleep by pin change interrupts. Wouldn´t this be the most power efficient variant? Or did I understand sth. wrong with the pin change interrupts? Thanks for your help in advance!!

          still learning...

          1 Reply Last reply
          0
          • L Offline
            L Offline
            LastSamurai
            Hardware Contributor
            wrote on last edited by
            #14

            I have build a small sensor platform and I am currently running it off of a CR2032 coin cell (small and cheap). I used the same motion sensor as in this thread to build a motion detector. Everything seems to work fine until the voltage drops below ~2.8V, then it starts to trigger constantly. I guess the problem is the low voltage.
            Has anyone found a working setup with a low(er) voltage? Or successfully used a boost converter with a pir (creates false positives as well for me, although I will try that later too).

            Otherwise I would have to use 2xaa (too big) or CR123A (still kinda big and not very cheap) too ;(

            m26872M 1 Reply Last reply
            0
            • L LastSamurai

              I have build a small sensor platform and I am currently running it off of a CR2032 coin cell (small and cheap). I used the same motion sensor as in this thread to build a motion detector. Everything seems to work fine until the voltage drops below ~2.8V, then it starts to trigger constantly. I guess the problem is the low voltage.
              Has anyone found a working setup with a low(er) voltage? Or successfully used a boost converter with a pir (creates false positives as well for me, although I will try that later too).

              Otherwise I would have to use 2xaa (too big) or CR123A (still kinda big and not very cheap) too ;(

              m26872M Offline
              m26872M Offline
              m26872
              Hardware Contributor
              wrote on last edited by
              #15

              @LastSamurai Since I tested it ok down to 1.6V with one AA, I have a feeling that the issue could be voltage stability rather than level. Maybe you could try two CR2032 in parallel ?

              L 1 Reply Last reply
              0
              • m26872M m26872

                @LastSamurai Since I tested it ok down to 1.6V with one AA, I have a feeling that the issue could be voltage stability rather than level. Maybe you could try two CR2032 in parallel ?

                L Offline
                L Offline
                LastSamurai
                Hardware Contributor
                wrote on last edited by
                #16

                @m26872 Great idea, that might help. I am currently trying out another battery, and if that doesn't work I will try 2 in parallel.

                1 Reply Last reply
                0
                • JonnyDev13J Offline
                  JonnyDev13J Offline
                  JonnyDev13
                  wrote on last edited by
                  #17

                  @m26872, am I understanding correctly that you did not need to step the voltage up to 5v in order to use this PIR sensor? If that's correct, do you know if the HC-SR505 works the same way? I will probably buy some of these smaller ones, but I have HC-SR505s on hand right now and would want to try it soon.

                  m26872M 1 Reply Last reply
                  0
                  • JonnyDev13J JonnyDev13

                    @m26872, am I understanding correctly that you did not need to step the voltage up to 5v in order to use this PIR sensor? If that's correct, do you know if the HC-SR505 works the same way? I will probably buy some of these smaller ones, but I have HC-SR505s on hand right now and would want to try it soon.

                    m26872M Offline
                    m26872M Offline
                    m26872
                    Hardware Contributor
                    wrote on last edited by
                    #18

                    @JonnyDev13 This IS the HC-SR505 (5V Mini PIR). With the voltage regulator and diode removed.

                    Did you mean that you have the larger HC-SR501 ? In that case I don't know. I only remember that you'll need to remove the v-reg and diode in the same way to make it run on 3.3V. And I think @bjornhallberg reported successful results from longterm use of a batterypowered outdoor one.

                    JonnyDev13J 1 Reply Last reply
                    0
                    • m26872M m26872

                      @JonnyDev13 This IS the HC-SR505 (5V Mini PIR). With the voltage regulator and diode removed.

                      Did you mean that you have the larger HC-SR501 ? In that case I don't know. I only remember that you'll need to remove the v-reg and diode in the same way to make it run on 3.3V. And I think @bjornhallberg reported successful results from longterm use of a batterypowered outdoor one.

                      JonnyDev13J Offline
                      JonnyDev13J Offline
                      JonnyDev13
                      wrote on last edited by JonnyDev13
                      #19

                      @m26872, yes you are correct. I have the larger ones. I must have copied and pasted the wrong part number. Thanks for the quick response. That's helpful information!

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        Komaandy
                        wrote on last edited by
                        #20

                        Hello everybody,

                        I´m struggeling with getting this sensor
                        to work.
                        The node registers with the GW, but doesnt submit the tripped reading.
                        Not even a permanent on or something. Just nothing. So i dont know how to troubleshoot here.
                        The PIR HC-SR505 is functional. I tested it with a testscript on a UNO.
                        And the 2AA Slimnode is functional as well. When using the node as a binary switch it works perfectly fine,
                        Just the combination 2AA Slimnode and HC-SR505 doesnt work.

                        Anybody has an idea ?

                        Thanks in advance Komaandy

                        AWIA 1 Reply Last reply
                        0
                        • K Komaandy

                          Hello everybody,

                          I´m struggeling with getting this sensor
                          to work.
                          The node registers with the GW, but doesnt submit the tripped reading.
                          Not even a permanent on or something. Just nothing. So i dont know how to troubleshoot here.
                          The PIR HC-SR505 is functional. I tested it with a testscript on a UNO.
                          And the 2AA Slimnode is functional as well. When using the node as a binary switch it works perfectly fine,
                          Just the combination 2AA Slimnode and HC-SR505 doesnt work.

                          Anybody has an idea ?

                          Thanks in advance Komaandy

                          AWIA Offline
                          AWIA Offline
                          AWI
                          Hero Member
                          wrote on last edited by AWI
                          #21

                          @Komaandy how are you powering the circuit?
                          The pir sensor is very sensitive to power fluctuations and not suited for below 3v. Also for 3v you need to "modify" the sensors power circuit. You should be able to find a lot of information when searching for the sensor.

                          1 Reply Last reply
                          1
                          • K Offline
                            K Offline
                            Komaandy
                            wrote on last edited by
                            #22

                            @ awi, so i desolderd and bridged the two mentioned components, and with the standard " Motion Detector " sketch it transmits tripped readings now :)
                            I power the circuit via a UNO ( 3,3Volt) or via 2 AA batterys ( 3,1 Volts -> meassured via multimeter)

                            but when using the given sketch in this thread only battery readings are transmitted...

                            KR

                            Komaandy

                            1 Reply Last reply
                            0
                            • K Offline
                              K Offline
                              Komaandy
                              wrote on last edited by
                              #23

                              Hello, when running the "Motion Detector sketch from the mysensors-examples" on these nodes with the 1Mhz bootloader with 2aa batteries some nodes freeze after appr. 24h .
                              Some continue working, i cant find the problem.
                              Does anybody have a idea what could cause those freezes ?
                              Thanks in advance

                              m26872M 1 Reply Last reply
                              0
                              • K Komaandy

                                Hello, when running the "Motion Detector sketch from the mysensors-examples" on these nodes with the 1Mhz bootloader with 2aa batteries some nodes freeze after appr. 24h .
                                Some continue working, i cant find the problem.
                                Does anybody have a idea what could cause those freezes ?
                                Thanks in advance

                                m26872M Offline
                                m26872M Offline
                                m26872
                                Hardware Contributor
                                wrote on last edited by m26872
                                #24

                                @Komaandy Have you tried to add a sleep(3000); before the last sleep(...)?

                                1 Reply Last reply
                                0
                                • K Offline
                                  K Offline
                                  Komaandy
                                  wrote on last edited by
                                  #25

                                  @m26872 Thanks for your answer and thanks for this superb node :) :)
                                  No, i didnt put the additional sleep in , where should I put this ? Im a little confused...

                                  /**
                                   * The MySensors Arduino library handles the wireless radio link and protocol
                                   * between your home built sensors/actuators and HA controller of choice.
                                   * The sensors forms a self healing radio network with optional repeaters. Each
                                   * repeater and gateway builds a routing tables in EEPROM which keeps track of the
                                   * network topology allowing messages to be routed to nodes.
                                   *
                                   * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
                                   * Copyright (C) 2013-2015 Sensnology AB
                                   * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
                                   *
                                   * Documentation: http://www.mysensors.org
                                   * Support Forum: http://forum.mysensors.org
                                   *
                                   * This program is free software; you can redistribute it and/or
                                   * modify it under the terms of the GNU General Public License
                                   * version 2 as published by the Free Software Foundation.
                                   *
                                   *******************************
                                   *
                                   * REVISION HISTORY
                                   * Version 1.0 - Henrik Ekblad
                                   *
                                   * DESCRIPTION
                                   * Motion Sensor example using HC-SR501
                                   * http://www.mysensors.org/build/motion
                                   *
                                   */
                                  
                                  // Enable debug prints
                                  // #define MY_DEBUG
                                  
                                  // Enable and select radio type attached
                                  #define MY_RADIO_NRF24
                                  //#define MY_RADIO_RFM69
                                  
                                  #include <MySensors.h>
                                  
                                  unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
                                  #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
                                  #define CHILD_ID 1   // Id of the sensor child
                                  
                                  // Initialize motion message
                                  MyMessage msg(CHILD_ID, V_TRIPPED);
                                  
                                  void setup()
                                  {
                                      pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
                                  }
                                  
                                  void presentation()
                                  {
                                      // Send the sketch version information to the gateway and Controller
                                      sendSketchInfo("Motion Sensor", "1.0");
                                  
                                      // Register all sensors to gw (they will be created as child devices)
                                      present(CHILD_ID, S_MOTION);
                                  }
                                  
                                  void loop()
                                  {
                                      // Read digital motion value
                                      bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
                                  
                                      Serial.println(tripped);
                                      send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
                                  
                                      // Sleep until interrupt comes in on motion sensor. Send update every two minute.
                                      sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
                                  }```
                                  m26872M 1 Reply Last reply
                                  0
                                  • K Komaandy

                                    @m26872 Thanks for your answer and thanks for this superb node :) :)
                                    No, i didnt put the additional sleep in , where should I put this ? Im a little confused...

                                    /**
                                     * The MySensors Arduino library handles the wireless radio link and protocol
                                     * between your home built sensors/actuators and HA controller of choice.
                                     * The sensors forms a self healing radio network with optional repeaters. Each
                                     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
                                     * network topology allowing messages to be routed to nodes.
                                     *
                                     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
                                     * Copyright (C) 2013-2015 Sensnology AB
                                     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
                                     *
                                     * Documentation: http://www.mysensors.org
                                     * Support Forum: http://forum.mysensors.org
                                     *
                                     * This program is free software; you can redistribute it and/or
                                     * modify it under the terms of the GNU General Public License
                                     * version 2 as published by the Free Software Foundation.
                                     *
                                     *******************************
                                     *
                                     * REVISION HISTORY
                                     * Version 1.0 - Henrik Ekblad
                                     *
                                     * DESCRIPTION
                                     * Motion Sensor example using HC-SR501
                                     * http://www.mysensors.org/build/motion
                                     *
                                     */
                                    
                                    // Enable debug prints
                                    // #define MY_DEBUG
                                    
                                    // Enable and select radio type attached
                                    #define MY_RADIO_NRF24
                                    //#define MY_RADIO_RFM69
                                    
                                    #include <MySensors.h>
                                    
                                    unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
                                    #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
                                    #define CHILD_ID 1   // Id of the sensor child
                                    
                                    // Initialize motion message
                                    MyMessage msg(CHILD_ID, V_TRIPPED);
                                    
                                    void setup()
                                    {
                                        pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
                                    }
                                    
                                    void presentation()
                                    {
                                        // Send the sketch version information to the gateway and Controller
                                        sendSketchInfo("Motion Sensor", "1.0");
                                    
                                        // Register all sensors to gw (they will be created as child devices)
                                        present(CHILD_ID, S_MOTION);
                                    }
                                    
                                    void loop()
                                    {
                                        // Read digital motion value
                                        bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
                                    
                                        Serial.println(tripped);
                                        send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
                                    
                                        // Sleep until interrupt comes in on motion sensor. Send update every two minute.
                                        sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
                                    }```
                                    m26872M Offline
                                    m26872M Offline
                                    m26872
                                    Hardware Contributor
                                    wrote on last edited by m26872
                                    #26

                                    @Komaandy said in Slim Node as a Mini 2AA Battery PIR Motion Sensor:

                                    I meant like this (look in code below), but it's just a wild guess.

                                    /**
                                     * The MySensors Arduino library handles the wireless radio link and protocol
                                     * between your home built sensors/actuators and HA controller of choice.
                                     * The sensors forms a self healing radio network with optional repeaters. Each
                                     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
                                     * network topology allowing messages to be routed to nodes.
                                     *
                                     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
                                     * Copyright (C) 2013-2015 Sensnology AB
                                     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
                                     *
                                     * Documentation: http://www.mysensors.org
                                     * Support Forum: http://forum.mysensors.org
                                     *
                                     * This program is free software; you can redistribute it and/or
                                     * modify it under the terms of the GNU General Public License
                                     * version 2 as published by the Free Software Foundation.
                                     *
                                     *******************************
                                     *
                                     * REVISION HISTORY
                                     * Version 1.0 - Henrik Ekblad
                                     *
                                     * DESCRIPTION
                                     * Motion Sensor example using HC-SR501
                                     * http://www.mysensors.org/build/motion
                                     *
                                     */
                                    
                                    // Enable debug prints
                                    // #define MY_DEBUG
                                    
                                    // Enable and select radio type attached
                                    #define MY_RADIO_NRF24
                                    //#define MY_RADIO_RFM69
                                    
                                    #include <MySensors.h>
                                    
                                    unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
                                    #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
                                    #define CHILD_ID 1   // Id of the sensor child
                                    
                                    // Initialize motion message
                                    MyMessage msg(CHILD_ID, V_TRIPPED);
                                    
                                    void setup()
                                    {
                                        pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
                                    }
                                    
                                    void presentation()
                                    {
                                        // Send the sketch version information to the gateway and Controller
                                        sendSketchInfo("Motion Sensor", "1.0");
                                    
                                        // Register all sensors to gw (they will be created as child devices)
                                        present(CHILD_ID, S_MOTION);
                                    }
                                    
                                    void loop()
                                    {
                                        // Read digital motion value
                                        bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
                                    
                                        Serial.println(tripped);
                                        send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
                                    
                                        sleep(3000);  // Sleep 3s to make sure everything is stable before we start to sleep with interrupts.
                                    
                                        // Sleep until interrupt comes in on motion sensor. Send update every two minute.
                                        sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
                                    }```
                                    1 Reply Last reply
                                    0
                                    • siodS Offline
                                      siodS Offline
                                      siod
                                      wrote on last edited by
                                      #27

                                      @m26872 said in Slim Node as a Mini 2AA Battery PIR Motion Sensor:

                                      Removing the 7133-regulator did not affect anything significantly due to its very low quiescent current (see datasheet, perhaps useful in some other project?)

                                      ok, does that mean one does not have to remove the voltage regulator and the diode? @AWI is saying one must modify the PIR and now I am irritated...

                                      still learning...

                                      m26872M 1 Reply Last reply
                                      0
                                      • K Offline
                                        K Offline
                                        Komaandy
                                        wrote on last edited by Komaandy
                                        #28

                                        @siod
                                        I removed both to make the smaller ( HC-SR505 ) work with ~3Volt and bridged these contacts as shown in the picture
                                        0_1496861069519_11^^.PNG
                                        They work perfectly fine for me and are not too sensitive.
                                        Actually they dont even react on my cats, which is nice, because the "bigger" HC-SR501 always did... :)

                                        1 Reply Last reply
                                        1
                                        • K Offline
                                          K Offline
                                          Komaandy
                                          wrote on last edited by Komaandy
                                          #29

                                          And with the "bigger" HC-SR501 all one need to do is obviously to connect the VCC to the pad or pin.
                                          For me at least it is working pretty fine as well. No false positives or anything else negative.
                                          Of course you have to remove the jumper first.

                                          0_1496861876718_pir_motion_sensor_arduino.jpg

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          8

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular