toc LTE power consumption more_vert What's in this document more_vert Tutorials & Examples > LTE Examples > Power consumption

LTE power consumption

There are some trade offs one can do to reduce power consumption of the LTE modem. You can limit connectivity in exchange for saving power consumption.

Let’s start with the simplest choice: Turn off or not. It’s not very sophisticated, but for completeness, let’s start with this:

Turn LTE modem off

from network import LTE
import time
import socket
import machine
import pycom

def attach():
    start = time.time()
    if lte.isattached():
        print("already attached")
        lte.attach(band=20, apn="")
        while not lte.isattached():
    print("attached after", time.time() - start, "seconds")

def connect():
    start = time.time()
    while not lte.isconnected():
    print("connected after", time.time() - start, "seconds")

def http_get(url = ''):
    _, _, host, path = url.split('/', 3)
    addr = socket.getaddrinfo(host, 80)[0][-1]
    s = socket.socket()
    s.send(bytes('GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n' % (path, host), 'utf8'))

# main
lte = LTE()
machine.deepsleep(55 * 60 * 1000) # 55m

The example above is the simple case where we attach, connect, communicate and then turn the LTE modem off: lte.deinit(). This will make sure the LTE modem uses minimal power after the deinit. However, it means that the subsequent attach procedure after waking up will take some seconds. During this attach time the modem already consumes power.

Leave LTE modem on

Depending on your use case, you may want to save the time (and energy) for reattching that you get after turning the modem off. If your device communicates a lot, then you can choose to not turn it off at all, save the time for the reattach. However, you then trade the higher power consumption during any idle time. For this, simply remove the deinit from the example:

# lte.deinit()

Power Saving Mode

A more sophisticated configuration, is the Power Saving Mode. PSM allows you to configure the period how often the device will connect and how long it will stay actively connected. During the sleep - the LTE modem will go into a low power state, but - it will stay attached to the network, thus no time is spent for attach() after waking up.

Note that the network needs to cooperate in this, so first there is a negotiation where you propose timers. Then you attach and the network will decide which timers to actually apply. Afterwards you can query the effective values.

So you see, here you not only need to make the trade off what is best for your application, but you will also need to do some testing to see which values your provider offers you and how this works out in your application in practise.

For the following example, assume you want to wake up once per hour, connect and do some processing, then go to deepsleep for 55 minutes. We would adjust the main part of the example as follows:

# main
# period 1h, active 10s
lte = LTE(psm_period_value=1, psm_period_unit=LTE.PSM_PERIOD_1H,
          psm_active_value=5, psm_active_unit=LTE.PSM_ACTIVE_2S )
lte.deinit(detach=False, reset=False)
machine.deepsleep(55 * 60 * 1000) # 55m


Previous Next