MKR NB 1500 Lowest Power Consumption

Hello,

I need your knowledge and expertise on an MKR NB 1500 board. Because of my limited ARM Cortex programming knowledge, I would appreciate the structured answers.

The idea of the project is simple, a battery-powered DAQ system that will read and save data every hour and send it once a day. All the other time should be in sleep mode with all peripherals off-powered (if that's possible). I don't need all these Arduino facilitations (USB, battery charger, LEDs, etc.).

With all these in mind, I have modified the board accordingly. I desoldered the BQ24195L IC and the unnecessary LEDs. I connected the AP2112K LDO directly with the battery and uploaded a basic code to put the MCU in deep sleep mode and measure the current.

#include <Arduino.h>
#include <ArduinoLowPower.h>

void setup() 
{
  delay(3000);

  // I/O PINS INITIALIZATION
  for (uint32_t i=21; i>=15; i--)  {
    pinMode(i, INPUT_PULLUP);
  }
  pinMode(14, INPUT_PULLDOWN);
  pinMode(13, INPUT_PULLDOWN);
  pinMode(10, INPUT_PULLUP);   // SPI - MISO
  pinMode(9, OUTPUT);          // SPI - SCK
  digitalWrite(9, LOW);
  pinMode(8, OUTPUT);          // SPI - MOSI
  digitalWrite(8, LOW);
  pinMode(7, INPUT_PULLUP);
  pinMode(6, OUTPUT);          // BUILT_IN LED
  digitalWrite(6, LOW);
  pinMode(5, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
  pinMode(2, INPUT_PULLUP);
  pinMode(1, INPUT_PULLUP);
  pinMode(0, INPUT_PULLUP);
  pinMode(SARA_PWR_ON, OUTPUT);
  digitalWrite(SARA_PWR_ON, LOW);
}

void loop() {
  LowPower.deepSleep();
}

So, the power consumption has dropped to around 0,58 mA, which is too high relative to the MKR Zero's 123 uA using the same code. I have read all the datasheets and the sum of average power consumption should be way less.

What do you think it's going on, and what can I do to reduce the power consumption?

I would say the modem is the key. You don't even communicate with it in your sketch. The modem is a computer on it's own with cpu, os, memory, everything. This needs power, especially the antenna. You can try (out of the box)

#include <MKRNB.h> // or create a serial instance to communicate with the modem
MODEM.send("AT+CFUN=0"); 
MODEM.waitForResponse(2000);

// sets the MT to minimum functionality(disablebothtransmitandreceiveRF circuits by deactivating both CS and PS services)

or

MODEM.send("AT+UPSV=4"); 
MODEM.waitForResponse(2000);

// For a power save function etc.

Or load the SerialSARAPasstrough sketch and send these commands manually to the modem to measure the power save effect.

Please read the UBlox AT commands manual for this commands.

Hello, first of all, thanks for the reply, sorry for the late response I was very busy lately.

Yeah, I'm not communicating with the modem because I don't even switch it on. So, in this case, the module doesn't initialize any subsystem and shouldn't draw any current for anything more than the minimum required.
Even if I switch on the module, connect to the network, send some data and then power it off according to the datasheet, the power consumption never drops below my initial measurement of 0.58 mA.

Maybe something has to do with the communication BUS that the module is sharing with the MCU. I have seen a similar problem with some I2C sensors, but I have to investigate it more.

The modem is connected over UART and USB, not I2C (26, 27) nor I2S (34-37).

I think you have to turn it off tru the AT console with you sketch, otherwise it's on.

How does the AT+UPSV=4 works? Do I have to bring it back to 0 before accessing the network?
I am trying to figure out what's the best method of lowering power consumption. My application is just there monitoring MQTT for incoming commands and then do something. I guess I can't put my NB 1500 to sleep otherwise it will miss the command?

Check the U-Blox documentation.

I'm far away from the mcu but out of the memory i would say the AT console is still 'online', waiting for new commands after sent to power sleep. If you turned off the radio i would say you have to go thru the whole connection establishing process again.

Within the loop, after set all up in the void setup():
Something like (i'm using https://github.com/256dpi/arduino-mqtt.)

THIS IS JUST A DRAW FOR THE RE-CONNECTION, NOT A WORKING EXAMPLE (You will probably find more mature sketches in the internet):

MODEM.send("AT+CFUN=1"); // Full functionality
  MODEM.waitForResponse(20000);
 MODEM.send("AT+CREG?");
String response = "";

    if (MODEM.waitForResponse(2000, &response) == 1) {
      if (response.startsWith("+CREG: ")) {
        if (response.endsWith(",1")) {
         
          Serial.println("connected");
          if (client.connected() == 0) {
     
            gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD);
     
            client.connect("user", "channel", "password");
        
          }
        } else if (response.endsWith(",5")) {
 
          Serial.println("connected roaming");

          if ((client.connected() == 0) && (Cloud == true)) {
 
            gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD);

        client.connect("user", "channel", "password");
   
          }
        } else if (response.endsWith(",3")) {

            Serial.print("MOBILE ACCESS DENIED");
          }
}
1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.