androbi-com / LoRa-E5-Mini-EndNode

22 stars 9 forks source link

stop2 mode, current consumption #4

Closed eivholt closed 2 years ago

eivholt commented 2 years ago

First of all, thanks for sharing this project! I am trying to reduce current consumption when idle and looking for suggestions. I don't know the hardware or the libraries well enough to decide if I have hit a limit with the Lora-E5-mini. In stop2 mode, with LED's disabled and no sensors connected it consumes 190uA. I am powering the board through BAT-connectors using an Otii Arc. It is set to 3.7v, but 4.55v makes no difference. Logging is enabled, but to my previous experience this has marginal impact. The AP2112 seems to have a typical quiescent current of 55uA. The Lora-E5 states "2.1uA (WDT on)", does this sample use watchdog timer to resume? Any suggestions are appreciated!

image

eivholt commented 2 years ago

Trying to understand the project further, what are DBG3 and DBG4, where are these physically located on the Lora-E5-mini and what can signal can I probe?

Am I correct USART1 is used for Serial debug? And USART2, radio?

androbi-com commented 2 years ago

I have not yet tried to check current consumption. For what I see from your output you still could remove UART (and maybe I2C) from the config, but I don't know if this makes a difference in low power mode. A comment in the code says

Not retained periph: ADC interface DAC interface USARTx, TIMx, i2Cx, SPIx SRAM ctrls, DMAx, DMAMux, AES, RNG, HSEM

So these are all switched off I guess. 190uA is not too bad, but it should be possible to improve. I would test if SDA and SCL are on 3.3V when in low power mode. The pull-up resistors for these two lines could well take this current when SDA or SCL are low.

eivholt commented 2 years ago

Thanks for the suggestions! I just removed I2C but have yet to do new measurements. I noticed WWDG is not activated in the config, could this be an opportunity to achieve less consumption in stop mode? I have a lot to read up on :)

androbi-com commented 2 years ago

I am not sure about DBG3 and DBG4, I'd guess these are default pins to be used on the original board for debugging with the logical analyzer or scope. I have included GPIO_PIN_10 and GPIO_PIN_5 to indicate low power mode in stm32_lpm_if.c, but I don't remember if this worked. USART1 is virtual Com port and I used USART2 for communication with a sensor. But, I think these are deactivated anyhow in low power mode. I also have very little experience with STM32 so I have a lot to learn too ;)

androbi-com commented 2 years ago

Just a thought, for getting a base reading for power consumption it is probably a good idea to write a very simple "hello world" type app for this device. It should have only a minimal configuration and go into stop mode. Then measure the power consumption, this should be about the best we can get with the device without changing the hardware (the AP2112 is a candidate). The LoRaWAN Endnode is a relatively complex app and there might be processes that hinder entering low power mode.

eivholt commented 2 years ago

Good suggestion. I do have a spare Lora-E5 SoC that I could try to program and power without any other, or minimal, number of components if needed.

eivholt commented 2 years ago

I wonder if the cp2102N USB-to-UART-bridge might be in USB Suspend-mode, even when not powered through USB. Is so it would consume about 200uA. I am not sure how to read the mini schematics, the suspend-pins certainly don't seem to be connected. Maybe someone with better electronics skills than me could shed some light.

androbi-com commented 2 years ago

I have made a simple blinky with stop mode and I get 90uA. I still have to tie floating GPIOs to GND to see if this makes a difference, but with the hardware the Lora-E5-mini offers I'd say it will be difficult to get much lower values (say below 50uA). One could try to find a better LDO with the same footprint, but I don't know if this is worth the time. This has to be elvaluated always having in mind how often LoRa packets are sent (the current for sending is about 1000 times higher and is often the principal energy sink).

androbi-com commented 2 years ago

I have now run the same blinky/stop2 code on my Penguino STM32WL MAMWLE-C1 board and I get 9uA (after cutting JP2 and JP7). So the Seeed board is definitively limited in this aspect. Both boards have the same MCU, but the Penguino is clearly better designed. I should be able to adapt my LoRa EndNode code to the Penguino I hope, I'll give it a try.

You can check out the blinky/stop2 here https://github.com/androbi-com/STM32WLE5JC-Blinky-StopMode.

Closing this issue for now, any power related issues better in the blinky/stop2 repo I think.

polihedron commented 2 years ago

Hi there, @eivholt and @androbi-com I managed to measure 2-3uA by removing AP2112 from pcb, and connecting 3V 2.4Ah battery to 3V pin, I run the LoRaWAN End Node app from Seeed-LoRa-E5

Screenshot_23 Screenshot_22

In my case when LDO reg. was unpowered at 5V and got connected output 3V3 to baterry, current consumption was about 420uA in STOP2 mode.

Screenshot_21

androbi-com commented 2 years ago

Great news @polihedron ! It would be good to find a better LDO with same or similar foot print.

eivholt commented 2 years ago

Thanks for sharing your results @polihedron ! I will reproduce this on my stand-alone LoRa-E5 SoC. Are you transmitting on HF in this test, e.g. 868 MHz or similar?

polihedron commented 2 years ago

@eivholt yes, EU868MHz, ABP, no debug, app log enabled, no sensors just dev Lora-E5 mini, code almost the same as LoRaWAN End Node app example. good luck! @androbi-com regarding to LDO, I'm thinking about some small jumper or schotky diode between mcu and ldo. I notice that I still need that ldo to flash mcu with stlink.