Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4864
    Armel
    Participant

    Hello,

    I just ordered the Mini Ultra Pro for use in an ultra low power scenario, for which this boards seems like a perfect fit.
    Would you have the example code that gets to a 20.0 μA current consumption in sleep mode?
    By the way, thanks for creating the Low-Power library!
    Best regards,

    Armel

    #4870
    Armel
    Participant

    Hello,
    I have un some power consumption tests using the LowPower and RadioHead/RH_RF95 libraries, but I can’t get below around 1mA in standby mode – around 50x more than I would expect.
    See below my code, would you have some hints on how to get to the advertised 20uA ?
    Thanks !

    #include “LowPower.h”
    #include <SPI.h>
    #include <RH_RF95.h>

    RH_RF95 rf95(5, 2); // Rocket Scream Mini Ultra Pro with the RFM95W

    void setup()
    {
    // Rocket Scream Mini Ultra Pro with the RFM95W only:
    // Ensure serial flash is not interfering with radio communication on SPI bus
    pinMode(4, OUTPUT);
    digitalWrite(4, HIGH);

    rf95.init();
    rf95.sleep();
    LowPower.standby();
    }

    void loop()
    {}

    #4891
    Armel
    Participant

    Hi,

    In case someboy else has the same question, below is a very basic example that gets to around 20uA.
    Hope this helps!

    Armel

    #include “LowPower.h”
    #include <SPI.h>
    #include <RH_RF95.h>
    #define RF95_CS 5
    #define RF95_RST 2
    RH_RF95 rf95(RF95_CS, RF95_RST); // Rocket Scream Mini Ultra Pro with the RFM95W
    #include <SerialFlash.h> // need to add Teensy 3s crc16.h in the SerialFlash/util folder (https://github.com/arduino/ArduinoCore-samd/issues/118)
    #define FLASH_CS 4 // digital pin for flash chip CS pin

    unsigned char count = 10;

    void setup()
    {
    SerialUSB.println(“***** ATSAMD21 Standby Mode Example *****”);

    // ***** IMPORTANT *****
    // Delay is required to allow the USB interface to be active during
    // sketch upload process
    SerialUSB.println(“Entering standby mode in:”);
    for (count; count > 0; count–)
    {
    SerialUSB.print(count);
    SerialUSB.println(” s”);
    delay(1000);
    }
    // *********************

    rf95.init();
    rf95.sleep();

    pinMode(RF95_CS, INPUT_PULLUP); // required since RFM95W is also on the SPI bus
    SerialFlash.begin(FLASH_CS);
    SerialFlash.sleep();
    }

    void loop()
    {
    SerialUSB.println(“Entering standby mode.”);
    SerialUSB.println(“Apply low signal to wake the processor.”);
    SerialUSB.println(“Zzzz…”);

    // might need to be more careful about which pins we are setting as output here…
    for (byte i = 0; i <= 26; i++)
    {
    pinMode (i, OUTPUT);
    digitalWrite (i, LOW);
    } // end of for loop

    // Detach USB interface
    USBDevice.detach();
    // Enter standby mode
    LowPower.standby();
    // Attach USB interface
    USBDevice.attach();
    // Wait for serial USB port to open
    while(!SerialUSB);
    // Serial USB is blazing fast, you might miss the messages
    delay(1000);
    SerialUSB.println(“Awake!”);
    SerialUSB.println(“Send any character to enter standby mode again”);
    // Wait for user response
    while(!SerialUSB.available());
    while(SerialUSB.available() > 0)
    {
    SerialUSB.read();
    }
    }

    • This reply was modified 7 years, 4 months ago by Armel.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.