Optimizing for low energy consumption for IoT is never limited to the efforts made at the hardware level. It is about the efforts at all instances of that stack if the goal is to achieve smart usage of the resources and thus a long-lived application. In this article, we take a look at the communications layer in the IoT stack, how the actual data can be transmitted and investigate the differences in power consumption when using different IoT protocols.
Every IoT module offers a different set of protocols, see an example of protocols in Fig 1. The key when choosing the protocol is to find the right balance between speed, reliability, security and power consumption.
You can choose between sending pure data, UDP or TCP-based data. With UDP you cannot really guarantee that the packet reaches its destination. However, you can with TCP as it is connection-oriented. This means that when you send several packets, each packet needs to be acknowledged and any packet lost needs to be resent.
Higher-level protocols MQTT and HTTP go on top of the TCP and they use the same mechanisms as TCP as well as more overhead which means more time-on-air and more energy spend. The additional layer, the security layer, means having to do hand-shakes, perform key exchanges and crypto operations, which consumes additional power.
Fig 1: IoT protocol examples
Let’s have a look at a use case and compare the energy consumption for different protocols.
Let’s assume we are working with a static ENS22 module with NB-IoT that always sends the same 40 bytes of data – a string including a timestamp, an identification number, and a counter number. Just like a smart meter would do. To compare, we send over different types of protocols and count the packets on the destination server.
Connecting the module to Otii Arc we can easily see the power consumption of sending this specific information in the Otii Software application. Below you can see the example of the power consumption for sending the 40 bytes of data with a non-IP protocol compared to a TCP protocol. The energy consumption is measured from when the socket is open to the point in time when the module is ready to go to sleep.
Fig 2: Power consumption of a UDP protocol resulting in 435 uWh
Fig 3: Power consumption of a TCP protocol resulting in 858 uWh
So, if we take a look at table 1, comparing all the different protocols, we can see that the power consumption varies.
The MQTT and HTTP protocols have similar energy performance of circa 1 mWh, in this use case.
Adding the security levels, DTLS and TLC for UDP and TCP, respectively, increases the consumption. Especially in the case of UDP, the added security level DTLS (PKI) where the key for the authentification is requested after receiving the data can lead to 4 times more energy consumption. Using security protocol DTSLS (PSK) saves energy since the authentification is based on a pre-shared key, e.i. the key is known on both sides of the communication prior to the communication.
The non-IP option is interesting as it consumes the lowest energy. It is however not transferred to the internet, the internet protocol is missing, hence it is not obvious how to extract that data. Non-IP doesn’t leave the network but terminates in the MNO’s server. The MNO will then offer different possibilities to access this data either via a gateway functionality or a simple web interface. The big advantage here is that the power you need to access data and protocol does not affect the module’s power. So, for sure the most energy-efficient option – if you ignore additional costs that the network provider might charge for this service.
It’s safe to say that using different protocols can have a major impact on the power consumption of your device. However, at the end of the day you need to consider all three aspects – network registration, coverage and choice of protocol. You want to make sure that you know your application and use case well. This is key for you to decide on the best possible option for making your device long lived and keeping the energy consumption to the lowest.
For more in-depth information and further examples, check out the video with the expert on that topic Marcus Pihl on our youtube channel:
Power Analyzer, Log Sync & Power Supply in one Product. Otii Arc comes with the featured-packed standard Otii software (perpetual license).