[solved - beta electron issue] SLEEP_MODE_DEEP but still using 2,7mA while it should be 0,13mA

If it doesn’t have pin markings on the side of the headers, it’s a beta.

Ok no markings on the sides

I probably have a production unit at home, ill have to test that one.

down by the antenna on the top of the board, there should be a version number… can you tell me which one?

v015

Nice, ok I’m testing that one. For future reference… if your current measures milliamps in mA and A range… it’s milliamps :slight_smile: Usually if you are getting uA, those ranges will say 0.

2 Likes

@wesner0019 So my v015 beta electron measures 1.34mA with that same SLEEP_MODE_SOFTPOWEROFF code. I believe this must have been before the extra buffer was added that disables 3.3V to the level shifters. I’ll mark this thread as solved :wink:

1 Like

Awesome! thanks

@BDub, I’ve just started testing the sleep modes with an Eseries v0.0.5 U260 and I’m getting the same results above.

When its put to sleep with SLEEP_MODE_SOFTPOWEROFF it’s measuring 1.45mA.

Could this hardware bug from the Beta electron be related to the Eseries?

The most common reason is a software problem preventing entering sleep mode. The examples here may help:

(They apply to both SLEEP_MODE_DEEP and SLEEP_MODE_SOFTPOWEROFF.)

1 Like

The below code causes minimum current to about 1.5mA

#include "application.h"
STARTUP(System.enableFeature(FEATURE_RETAINED_MEMORY));
SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(SEMI_AUTOMATIC);

ApplicationWatchdog wd(120000, System.reset, 300); //stack_size of 300 bytes is used

void setup() {
Particle.connect();
waitUntil(Particle.connected);
  delay(1000);
    Particle.disconnect();
    Cellular.disconnect();
    Cellular.off();
    System.sleep(SLEEP_MODE_SOFTPOWEROFF, 8);
}

The below code causes minimum current to about 0.45mA.

#include "application.h"
STARTUP(System.enableFeature(FEATURE_RETAINED_MEMORY));
SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(SEMI_AUTOMATIC);

ApplicationWatchdog wd(120000, System.reset, 300); //stack_size of 300 bytes is used

void setup() {
     delay(5000);
    System.sleep(SLEEP_MODE_SOFTPOWEROFF, 8);
}

So it seems there is some issue with the Particle.connect and sleeping. I am running on v0.7.0 firmware

Neither of those examples will work properly.

The first because Cellular.off() is not blocking in system thread enabled mode and you will go to sleep before the modem is fully powered down, leaving it running.

The second should have even lower current, but because you’re using SYSTEM_MODE(SEMI_AUTOMATIC) the modem is not turned on, and putting it into sleep in that state won’t get it into the lowest power mode.

If you are running 0.7.0 then 300 byte will be too little, due to some extra work done on reset in order to report reset reason and system diagnostics you should go with something about 1536 byte.

1 Like

ok thanks for the tip!

@rickkas7 do you know of any calls to verify when the cellular is turned off? Like waitfor(!cellular.powered) . I also tried e above code by removing the cellular calls and I had the same results.

I’ll have to check you tips page tomorrow to test those

We need to get this worked up into the Wiring API, but you can get a return value from the cellular HAL. You may not always be able to use the following code, but it should work right now (as of 0.7.0 & 0.8.0-rc.3). Note: these will also block with SYSTEM_THREAD(ENABLED), which might be a good thing :wink:

if (cellular_on(NULL) != 0) {
    Log.error("Could not turn cellular modem on!");
}

if (cellular_off(NULL) != 0) {
    Log.error("Could not turn cellular modem off!");
}
1 Like

Im currently using the Ugold meter to measure the current and have been trying to use the tutorial too, but the best I could achieve was about 500uA after the e0 connected to the cloud then went to sleep.

Then I looked through my hardware pcb to determine if there are any circuits that could be causing battery drain. I had a 10k pull-up on the TX line that was eating 300uA. I removed the pull-up then discovered this issue. Not sure if sleep could be affected by this.

I’ve done some minimal testing now trying to verify the battery consumption with the e0. With the minimal setup I’m still measuring around 900uA in Deep Sleep.

Can someone else please confirm this?

system version: 0.7.0
e0 version: v0.0.5

This is the test code:

#include "application.h"

SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(SEMI_AUTOMATIC);

void setup() {
  Cellular.on();
  delay(3000);
  Cellular.off();
  delay(2000);
  System.sleep(SLEEP_MODE_DEEP, 20);
}

void loop() {
}

And heres a picture of my setup:

With the E series running Tinker and powered by USB, I double-tapped the MODE button to go into soft power off mode.

Once powered off I enabled the meter in uA scale and unplugged the USB power. Consumption was 109.7 uA, what I’d expect.

2 Likes

@rickkas7 I just tried your setup (running Tinker and powered by USB, I double-tapped the MODE button to go into soft power off mode) and still can’t get it to that.

Did you perform this test at version 0.7.0?

I’m running out of ideas to try.