Arduino Forum

Products => MKR Boards => MKRGSM1400 => Topic started by: PCJohn on Jan 25, 2020, 11:21 am

Title: Getting minimal power consumption
Post by: PCJohn on Jan 25, 2020, 11:21 am
Hi all,

I would like to get consumption of my MKRGSM 1400 (bought in Nov 2019) bellow 1mA. I want to have it running on battery for weaks or months. I am measuring the current out of battery when USB is disconnected, but I can not get there. Here is what I managed:

Consumption out of LiPo battery (no USB connection):

simple program with delay() loop: 21.2mA
simple program with deepSleep() loop: 8.87mA (with peaks (11mA?) on deepSleep wake up)

Then, I cut the wire of the LED as it can not be controlled by software:

simple program with delay() loop: 18.7mA
deepSleep but with green LED off: 6.37mA

So with the deep sleep, we can reach good savings, while cutting the wire around the green LED that is constantly shining, saves another 2.5mA. Anyway, we are still far from 1mA.

Then, I started to consider that maybe GSM chip is not sleeping properly, although I did not initialized it yet. Here is what I get:

GSM::lowPower() and GSM::shutdown() called without any GSM::begin(): 6.37mA
GSM::begin() connecting current: 13.2mA
GSM connected and delay() loop: 28.9mA (with peaks (50mA?) about each two seconds, GSM probably doing something)
GSM connected, GSM lowPowerMode, and delay() loop: 14.8mA (with peaks (29mA?) about each two seconds)
GSM connected, GSM lowPowerMode, and deepSleep() loop: 2.2mA (with peaks (8mA?) about each two seconds)

I am estimating that average consumption with GSM lowPower and deepSleep is about 3mA. This is actually much lower than what I get with not initialized GSM, e.g. 3mA vs. 6.37mA. It is funny to see that connecting to GSM actually lowers the module consumption :-) . Is it a hardware design bug? Is there a software workaround?

All my testing was done using on-line arduino editor and compiler.

Anyway, reaching 3mA is already quite nice, although desire to be better is still here :-) .
Title: Re: Getting minimal power consumption
Post by: lavignema on Mar 27, 2020, 06:19 pm
According to the SARA-U2 datasheet the low power mode is disabled by default. It is enabled with the AT+UPSV command. If you examine the GSM library the low-power function only toggles the DTR line to high for power save activation. This tells me that the somewhere during initialization the AT+UPSV=3 command is issued to the SARA chip. It also stands to reason that the DTR line is held low unless you ask for low power mode to be activated. To get to absolute minimum consumption I also disconnect from the cellular system until I need to send or receive something. The radio modem is a power hungry beast.
Title: Re: Getting minimal power consumption
Post by: PCJohn on Aug 01, 2020, 07:08 pm
Thanks for the information. I went through GSM source code and and made debug prints of AT commands. I found out that all things related to low power mode are properly implemented and already reflected in my measurement above.

Few more interesting results: My 2.2mA in GSM connected+GSM lowPowerMode+deepSleep() loop were ruined by sms.available() a voice.getVoiceCallStatus() calls, when added to my app. Almost 30mA spikes appeared. If I used only voice.getVoiceCallStatus(), spikes were reduced to just about 9mA. So, I start consider to use RI (Ring Indicator) pin of cellular modem to trigger interrupt when there is SMS or incoming call instead of frequent call of these power-hungry functions. Unfortunately, Arduino left RI pin non-connected. So, no real low power with Arduino GSM MKR 1400 yet.