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

Yes, you go through blinking green, blinking cyan, fast blinking cyan, and then to breathing cyan over the long cycle (30 seconds to a few minutes) if you’ve successfully entered deep sleep or soft power off.

There’s not much to the code:


void setup() {
}

void loop() {
	System.sleep(SLEEP_MODE_DEEP, 30L);
}

Thanks, yes this code works (giving me 130µA while in sleep), now I have narrowed my problem down a bit… if I add SYSTEM_MODE(SEMI_AUTOMATIC); in the beginning then I get the problem back… and I need my code to run offline and check a pressure sensor and only go online and publish the reading if it has changed…
so your code works but not this…

SYSTEM_MODE(SEMI_AUTOMATIC);
void setup() {
}

void loop() {
	System.sleep(SLEEP_MODE_DEEP, 30L);
}

can any of you guys maybe try this code and measure the current your electron consumes while in sleep_mode_deep? mine is consuming 2,8 and up to 80mA… then after a while of running it seems to get almost stable at 2,8mA… but it should be 0,13mA… any idea why this is not working in SYSTEM_MODE(SEMI_AUTOMATIC); ?

@Mquist I have been trying to achieve this deep sleep target current as well.It appears as though the issue of the current being unstable when in sleep mode is dependent on whether the Electron has connected to the cloud before shutting down. So your issue above with starting SYSTEM_MODE(SEMI_AUTOMATIC);, or in my case MANUAL is not the point, the problem will go away if you do a full Particle.connect() and then shut down.
I realise in your case, and in mine this is not a good thing because we do not want to waste power connecting to the cloud when we may just be coming up every so often to check a sensor and see if we need to connect to the cloud. The deep sleep runs the code from the start so there is no way of avoiding the connection to the cloud.
I have experimented with System.sleep(A7,CHANGE,60); and the instability of the sleep current is solved by ensuring that a cloud connection is made once, then because coming back from sleep and not deep sleep does not start the program from the beginning it is possible to avoid the cloud connection. In this case the sleep current is stable every time the unit goes to sleep. I suspect this would be so with deep sleep also, it just needs that one connection to the cloud and then the current is stable.
But why? @BDub , you seem to be a keeper of all wisdom, what is it that the Electron needs from the cloud to stop it wanting to do something extra and cause fluctuating sleep current?
@rickkas7 in order to reduce the Electron current to around the 2.7mA in sleep mode I had to turn off the battery charging and flashing red led as per your helpful post Disabling the Electron red charging LED when not using the LiPo
I also seemed to have to set the pulldown on all inputs on the Electron which were ‘floating’ when in sleep mode. This did significantly lower the sleep current, seems to make no difference in deep sleep but normal sleep it does.
I can confirm in my case it has nothing to do with the resistance of the current meter, I get the same results on high and low range and it is a very good meter.
However, no matter what I try, I cannot get deep sleep current down to fractions of a milliAmp. It stubbornly refuses to drop below the 2.7mA, which is roughly what it is in ordinary sleep mode. I have pulled apart the circuitry surrounding the Electron, cutting tracks and measuring currents to the peripherals and the 2.7mA is all being consumed in the Electron.
I will keep on trying but I suspect that @rickkas7 simple code above
void setup() {
}

void loop() {
System.sleep(SLEEP_MODE_DEEP, 30L);
}
does not work on an Electron with 0.5.3 firmware
Thanks for any help. You guys back at HQ are fantastic.

See this bug, it may be related

@wesner0019 thanks for that, there could be some linkage, it certainly seems odd that the devices need some reassurance that the cloud is still there before going to sleep. My grandchild seems to need some reassurance that I am around when he comes to visit before he goes to sleep too so maybe a child psychologist can help?

1 Like

Have you seen this thread?

On the Electron you won’t need a full Particle.connect() but only a Cellular.on() in order to fully switch it off before sleeping (odd but true - for now).
So you won’t see any data/power penalty, since you don’t actually connect to the cloud and not even to the cell tower.

Thanks @ScruffR I had not seen that other thread, I will follow the results from that. At the moment I only need the sleep state, not the deep sleep one so I think I can get it working at that level. I will be looking forward though to getting the thing down to microAmp levels for the next challenge

1 Like

@BDub I’ve been also trying to get a bare electron to the uA level during sleep but I’m only able to get it to 1.75mA

version 6.0.0
electron connects to cloud before sleeping

Any thoughts anyone?

#include "application.h"

void setup() {

}

void loop() {
  System.sleep(SLEEP_MODE_DEEP, 45L);
}

Could the internally connected VBAT to the 3.3v supply be causing this?

https://docs.particle.io/datasheets/electron-datasheet/#pin-description

Supply to the internal RTC, backup registers and SRAM when 3V3 is not present (1.65 to 3.6VDC). The Pin is internally connected to 3V3 supply via a 0 ohm resistor. If you wish to power is via an external supply, you'll need to remove this resistor. Instructions to remove this resistor can be found here ```

Try System.sleep(SLEEP_MODE_SOFTPOWEROFF, 45L); which also sleeps the Fuel gauge.

@BDub Just tried that and its at 1.63mA. I’m measuring the current directly from the battery on the + side

@peekay123 @ScruffR if you have the time could you try to verify the minimum battery consumption of the electron when its in deep sleep mode with the 0.6.0 firmware?

If you are not used to measuring uA currents on devices that can also draw 100’s of mA, you may be trying to power the Electron while measuring uA’s. That won’t give the electron enough power to turn on and correctly process the shutdown commands. If you think that’s the problem, you can try this:

  1. A precise meter with low burden voltage is required
  2. measure uA’s, but short the leads at the meter
  3. when the Electron goes into SLEEP_MODE_SOFTPOWEROFF, remove the short circuit at the meter.

@BDub, I’ll give your suggestions a try.

I am using this mulitmeter, do you think this is sufficient? If not do you have any suggestions for buying some thing to measure uA with?

http://tekpower.us/tp9605bt.html

You need something like this https://www.eevblog.com/projects/ucurrent/

I have one, could run this test for you over the weekend maybe.

@RWB, that looks pretty cool, I tried finding to buy one but it looks like it comes from AUS.

That would be awesome if you could try your meter.

Mine came from Australia pretty quickly.

I’ll try to remember to do this over the weekend. let me know if I forget.

Hard to say if that meter is quality… it’s not too cheap :slight_smile: but there’s no datasheet?

The uCurrent Gold is also what I prefer to use, along with some other meters (HP, Tektronix, Extech). The downside to the uCurrent is that it’s powered by a CR2032 battery, and really hurts when you forget to turn it off (so you get in the habit of turning it off after EVERY measurement).

@RWB @wesner0019 I just ran that code on a production Electron v0.6.0 and it’s reading 126uA on the uCurrent Gold.

EDIT: and I just shut the power off on the uCurrent :wink:

3 Likes

@BDub i just ordered up a uCurrent. Yeah thats what I thought about this tekpower meter when I got it.

Below is the manual:

http://multimeterwarehouse.com/downloadable/download/sample/sample_id/2/

@Bdub If you still have that Ucurrent gold hooked up to the Electron and can take picture of how you have it hooked up. I never was able to find a clear example of how you are supposed to properly connect the input and output on the Ucurrent. I had to look for pictures of how others had used it and hope I hooked it up correctly.