-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MKR WAN 1310 sleep current #79
Comments
By changing the pin mode from |
Hi @zuyan9 , |
Hello @facchinm You are right, my bad, for MKR WAN 1310 Using TimedWakeup example in ArduinoLowPower, I am able to achieve 15uA sleep current. I played with pinMode a bit and imported this sketch to Atmel Studio 7 too. The measured sleep current results are interesting.
I don't know why there are huge differences in some cases, the sketch code and ArduinoCore-samd are exactly the same, maybe difference in the bootloader? |
@zuyan9 those look like mkr wan 1300 numbers unless you made a hardware modification to the 1310? |
This is for MKR WAN 1310, I did cut the solder jumper under the battery connector and supply external 3.3V. |
I'm using an MKRWAN 1310 with jumper cut, with the following sketch: #include "ArduinoLowPower.h"
#include <LoRa.h>
#include <MKRWAN.h>
LoRaModem modem;
void setup() {
for (int i=0; i < 15; i++) {
pinMode(i, INPUT_PULLUP);
}
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
delay(3000);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
}
void loop() {
USBDevice.detach();
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
LowPower.deepSleep(8000);
LoRa.begin(868E6);
LoRa.beginPacket();
LoRa.print("D:");
LoRa.endPacket();
LoRa.end();
digitalWrite(LORA_IRQ_DUMB, LOW);
digitalWrite(LORA_RESET, LOW);
digitalWrite(LORA_BOOT0, LOW);
} I get a sleep current of 16uA (!) on the first sleep, however, after the LoRa send has occurred the sleep current sticks at 300uA. I've tried a variety of things to get the LoRa modem / Murata unit to shut down ( modem.dumb(), modem.sleep() ) but nothing seems to cause it to come back to the state it was in when the board is first powered on. The data sheets say that deep sleep should only be a small number of uA. I've also found the 'Grasshopper' boards (too late for this project as I now have 6 MKRWAN 1310s...) which directly control the stm32 within the MuRata module and they explicitly do an stm32.stop() after sending and then see 2-3uA sleep currents from it. At this point I'd be happy with the 100uA sleep talked about up thread. I think what is needed is for the MKRWAN library to either be able to send an AT command that triggers deep sleep (modem.sleep() appears to hang my board and leave it using 20mA) or attach to the STM32 and cause it to 'stop' - unfortunately I can't find a complete set of AT commands for the unit to get further (I suspect Murata control access to those who have the dev kit for the module) and I'm really struggling to see how direct commands to the STM32 work - although I can see that the firmware updater does this. |
@amasidlover yes 16uA of sleep current should be achievable. The firmware for the module can be found in mkrwan1300-fw, it's based on (a rather old version of) ST's I-CUBE-LRWAN with some modifications. It is possible to figure out the AT commands by reading the code (or refering to I-CUBE-LRWAN manual, but some commands have changed). Murata has their own module firmware too and they have a different set of AT commands. It is not publicly available and it's not used here for Arduino. I don't think the sleep current variation is due to the module, I suspect it has something to do with ArduinoCore-samd but have yet to identify that. |
Try to add this lines : For me, it's works and I save 300 µA ! pinMode(LORA_IRQ_DUMB,INPUT);
pinMode(LORA_RESET,INPUT);
pinMode(LORA_BOOT0,INPUT); My send function : void LoRa_sendMessage(String message) {
LoRa.begin(868E6);
LoRa.beginPacket();
LoRa.print(message);
LoRa.endPacket();
LoRa.sleep();
digitalWrite(LORA_IRQ_DUMB, LOW);
digitalWrite(LORA_RESET, LOW);
digitalWrite(LORA_BOOT0, LOW);
pinMode(LORA_IRQ_DUMB,INPUT);
pinMode(LORA_RESET,INPUT);
pinMode(LORA_BOOT0,INPUT);
} |
Hi guys, hi @zuyan9 did you find a solution to this. I have a WAM1310, powered by a 3.7V LiPo battery and the sleep current is 4mA. Can you please tell |
@Dicko87 Using the on-board PMIC you should be able to achieve a sleep current a bit more than 100uA. To achieve a better result requires you to disable the PMIC and supply power to the board using an alternate method. Regarding your 4mA situation, you need to pay very close attention to two things:
For instance, if you leave USB enabled you will not be able to achieve the low power numbers mentioned in this thread. Similarly, the pin states can affect current consumption and causing unnecessary current to source or sink from an IO pin. |
@sslupsky thank you very much for your reply. Can you please tell me how I would use the on-board PMIC or point me to a resource that explains what to do. Thank you very much. |
Would be great to have an example with the low power logic inside. Is there something out there? |
Hello guys,
On the MKR WAN 1310 product page, it says
However I am not able to achieve that, I got around 450uA by cutting the jumper and using LowPower.deepSleep(), similar to the results in this discussion.
Is there any way to achieve lower sleep current?
Thanks
The text was updated successfully, but these errors were encountered: