Low Power shutdown mode?



  • I am using the BinarySwitchSleepSensor sketch. It uses a pin interrupt on pin 2/3 connected GND to switch. When the switch is not engaged I am getting 23-24uA. When the switch is engaged I am drawing 117uA.

    How can I reduce these numbers even further? I know there is a powerdown/shutdown mode(Cant find how to do it) and maybe adding external resistors to lower the current draw but what does everyone else recommend?


  • Hero Member

    Also, what's the lowest current draw for each mode that anyone is currently getting? That would help establish a target as to what's achievable.



  • Okay, some more news on my front. I downgraded from the latest build of Arduino to 1.0.6 and now here are my numbers for BinarySwitchSleepSensor sketch:

    Sleep mode w/o switch engaged: 2.5uA !!!!!!
    Sleep mode w switch engaged: 98-100uA.

    Now I need to find a way to have the switch engaged use very little current. Any idea's?


  • Hero Member

    Maybe I'm getting confused with the LPC810 MCU, but doesn't Arduino also support both falling and rising edge triggered interrupts? If so, couldn't you set one of those and then go back to sleep?
    c.f. http://jeelabs.org/book/1517e/



  • Here is information pertaining to interrupts and Arduino:
    http://playground.arduino.cc/Code/Interrupts

    Here is the code from the library:

    #include <MySensor.h>
    #include <SPI.h>
    
    #define SKETCH_NAME "Binary Sensor"
    #define SKETCH_MAJOR_VER "1"
    #define SKETCH_MINOR_VER "0"
    
    #define PRIMARY_CHILD_ID 3
    #define SECONDARY_CHILD_ID 4
    
    #define PRIMARY_BUTTON_PIN 2   // Arduino Digital I/O pin for button/reed switch
    #define SECONDARY_BUTTON_PIN 3 // Arduino Digital I/O pin for button/reed switch
    
    #if (PRIMARY_BUTTON_PIN < 2 || PRIMARY_BUTTON_PIN > 3)
    #error PRIMARY_BUTTON_PIN must be either 2 or 3 for interrupts to work
    #endif
    #if (SECONDARY_BUTTON_PIN < 2 || SECONDARY_BUTTON_PIN > 3)
    #error SECONDARY_BUTTON_PIN must be either 2 or 3 for interrupts to work
    #endif
    #if (PRIMARY_BUTTON_PIN == SECONDARY_BUTTON_PIN)
    #error PRIMARY_BUTTON_PIN and BUTTON_PIN2 cannot be the same
    #endif
    #if (PRIMARY_CHILD_ID == SECONDARY_CHILD_ID)
    #error PRIMARY_CHILD_ID and SECONDARY_CHILD_ID cannot be the same
    #endif
     
    MySensor sensor_node;
    
    // Change to V_LIGHT if you use S_LIGHT in presentation below
    MyMessage msg(PRIMARY_CHILD_ID, V_TRIPPED);
    MyMessage msg2(SECONDARY_CHILD_ID, V_TRIPPED);
    
    void setup()  
    {  
      sensor_node.begin();
    
      // Setup the buttons
      pinMode(PRIMARY_BUTTON_PIN, INPUT);
      pinMode(SECONDARY_BUTTON_PIN, INPUT);
    
      // Activate internal pull-ups
      digitalWrite(PRIMARY_BUTTON_PIN, HIGH);
      digitalWrite(SECONDARY_BUTTON_PIN, HIGH);
      
      // Send the sketch version information to the gateway and Controller
      sensor_node.sendSketchInfo(SKETCH_NAME, SKETCH_MAJOR_VER"."SKETCH_MINOR_VER);
    
      // Register binary input sensor to sensor_node (they will be created as child devices)
      // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. 
      // If S_LIGHT is used, remember to update variable type you send in. See "msg" above.
      sensor_node.present(PRIMARY_CHILD_ID, S_DOOR);  
      sensor_node.present(SECONDARY_CHILD_ID, S_DOOR);  
    }
    
    // Loop will iterate on changes on the BUTTON_PINs
    void loop() 
    {
      uint8_t value;
      static uint8_t sentValue=2;
      static uint8_t sentValue2=2;
    
      // Short delay to allow buttons to properly settle
      sensor_node.sleep(5);
      
      value = digitalRead(PRIMARY_BUTTON_PIN);
      
      if (value != sentValue) {
         // Value has changed from last transmission, send the updated value
         sensor_node.send(msg.set(value==HIGH ? 1 : 0));
         sentValue = value;
      }
    
      value = digitalRead(SECONDARY_BUTTON_PIN);
      
      if (value != sentValue2) {
         // Value has changed from last transmission, send the updated value
         sensor_node.send(msg2.set(value==HIGH ? 1 : 0));
         sentValue2 = value;
      }
    
      // Sleep until something happens with the sensor
      sensor_node.sleep(PRIMARY_BUTTON_PIN-2, CHANGE, SECONDARY_BUTTON_PIN-2, CHANGE, 0);
    } ```

  • Hero Member

    Yup, "They are triggered equally on RISING or FALLING signal edges..." So, it should work. 😄



  • Hate to act like the idiot here but can you explain what I should do? lol


  • Hero Member

    The higher power with the engaged switch probably comes from the pull-up. There is a current through the switch when closed. You can increase the value to reduce consumption. If you use internally pull-up the value is between 20k and 50k which gives you around (ohms law I=U/R) I=3.3/20.000=165uA



  • I did increase the value of the resistance by 60K and 100K externally, both those values dropped the current consumption but my problem was that there was not enough to power to have the Arduino read that the switch was working. So I was getting nothing basically. I put the resistor in line between the switch. Even when I had that amount of Resistance used I was still drawing 34uA or greater, still above what I am trying to get.


  • Hero Member

    @brolly759 you should remove /switch of the internal pull-up (digitalWrite). And conmect the external resistor from the Arduino pin to Vcc. 1 Mohm should be sufficient to drop current to the uA range.



  • @AWI

    So Pin 2 -> 1Mohm Resistor -> VCC
    and GND is the switch to Pin 2 ?

    Is that a minimum current the Arduino needs to read a state change?


  • Hero Member

    Yes it is. The same configuration like with the internal pull-up. digital pins



  • SO an update, I connected a 10Mohm Resistor and my current draw is only 3.1-3.2uA when the switch is engaged and 2.7-2.8uA when the switch is removed. I think that is really livable numbers. So far not getting any false positives which is great. 🙂


Log in to reply
 

Suggested Topics

14
Online

11.4k
Users

11.1k
Topics

112.7k
Posts