Minimizing Electron power usage; radio? peripherals? threading?

OK, I am trying to reduce the power consumption of Electron in a project due to the amount of heat that it is putting off, sometimes up to 50 deg C on the surface of the radio. The thermal emissions is the biggest problem, but of course any added battery lifetime would be an added bonus.

Looking at the code, it seems like the power-saving mode for the cell modem is already switched on by default. In my application, data is being sent every 10 seconds, so the time overhead of powering down the radio and reconnecting (20-30s) is too large to duty cycle the radio. But since the radio is such a major consumer, I am definitely interested in any insights on how to reduce consumption further.

As for the peripherals: after looking at the STM32F2 manual, it appears that the default state for the all the RCC clock enable bits to the various peripherals is 0, so is there any room for saving power by specifically powering down every peripheral not used?

And lastly, the hard one: does the background RTOS drop back to an idle hook, and does that idle hook put the CPU to sleep, or switch to a slower clock? I am reading the system code, but it is a lot to take in.
If the application as SYSTEM_THREAD(ENABLE) and then uses the generic delay() function, will this actually suspend the application and fall back to the idle (and possibly sleep) state when needed?

1 Like

Ping @BDub, @mdma

@apullin I’m sending data every 2 mins and sleeping in between with no issues.

When I wake up I get instant reconnection, data sent, and then back to sleep in like 1 to 2 seconds usually.

Can the processor sleep in between those 10-second data burst or do you need it away collecting data in between data sends?

@RWB Are you just doing System.sleep(seconds) ? I was pretty sure that I tested this and determined that it took 20-30 seconds for the cellular connection to be ready again, but I will certainly revisit this now and test again. If I can duty cycle the radio down to 10-20% on time and still work at 10s period, that would be perfect.

I actually would want the application to continue running, since I have many async events (implemented as many timed loops) running at ~1hz.

However, some other tests show that that even with the cellular off completely, the STM32 and other components on the board still burn ~40mA, which per the data sheet makes me believe that the micro’s sleep mode (core off) is not being used in the idle hook …

If you want the processor to keep running then I don’t know of any functions for turning the cellular modem off into any sleep modes.

I am sending data to Ubidots via their MQTT library and its super quick when connecting after waking up mainly because the modem is standby mode and not actually turned OFF.

I’m using this sleep mode:

System.sleep(D0, RISING,sleepInterval * 2, SLEEP_NETWORK_STANDBY); //Put the Electron into Sleep Mode for 2 Mins + leave the Modem in Sleep Standby mode so when you wake up the modem is ready to send data vs a full reconnection process.

1 Like

What is your power draw in this sleep mode? I’m doing this and still pulling ~20mA of power.

The key is feeding 3.3v to the BAT input line to get the lowest power consumption.

1 Like