From Zero To IoT Hero: Getting started with u-blox MQTT Anywhere

The world of IoT is vast and ever-evolving. With the increasing demand for cellular-based IoT projects, there's a need for services that not only provide secure networks but also focus on energy efficiency. In this article, our very own Electromaker Educator Robin Mitchell investigates how much energy you can save in your next IoT project using u-blox's latest Thingstream service and the Mikroe MQTT Anywhere Kit.

The problem with power consumption with IoT

Now, in traditional computing devices like computers and servers, power consumption when connecting to the internet is not a major concern. This is because these devices almost always have some kind of stable, reliable power supply (such as the mains). Furthermore, because of this permanent connection, wireless communication (which is historically power-hungry) is easy to implement from an energy point of view.

However, in the case of IoT devices, this is far from the case. As these devices can often be dependent on tiny batteries, solar panels, or energy harvesters, every joule of energy must be accounted for.

This means that hardware engineers need to make sure their designs consume as little energy as possible, and I mean, as little as possible. Considering that internet protocols are often complicated, and that wireless communication requires a lot of energy, you can see that wireless internet communication and tiny energy sources don’t exactly go together. 

Can software help reduce power consumption?

But it's not just the hardware that needs optimization. Software also plays a crucial role in reducing energy consumption. Methods that engineers can deploy include turning off peripherals in chips and putting devices into sleep mode. However, there's a significant area of software that has lagged behind in energy conversion: transmission protocols. Many of the protocols and connection methods used in IoT devices have been borrowed from computers, servers, and mobile phones, which have considerably more energy available. 

tcp-ip protocols package size

Consequently, these protocols, such as TCP/IP and HTTP, are not designed to minimize connection time or optimize energy usage. Furthermore, modern connections must incorporate robust security measures to protect the device and transmitted data. This need for security further complicates the energy consumption aspect. As a result, energy-starved IoT devices have to wake up, establish a connection, perform DNS requests to determine target availability, set up security protocols, send data, and then close the connection. What should be a simple task of sending 12 bytes of data quickly becomes a few thousand bytes and consumes valuable CPU time.

Fortunately, u-blox has a brilliant solution that addresses these energy challenges and revolutionizes the way IoT devices communicate. Let's take a closer look at their IoT-Communication as-a-service...

Thingstream - an IoT service delivery platform

So, is it all doom and gloom? Should we just give up on designing cellular IoT devices because traditional internet protocols such as wireless energy consumption are just too damn high? Well, thanks to u-blox, the answer to that is a big fat no! u-blox solution, called Thingstream, which consists of a cloud-based MQTT broker and a global roaming SIM card with a private Access Point Name, or APN. 

mqtt-anywhere-thingstream

What is MQTT Anywhere?

When used with an IoT device, the u-blox SIM card provides that device with a cellular connection, but unlike a traditional internet connection where all data being transmitted routes through public servers, any data sent to and from the IoT device to the APN is entirely private. This means that when sending data to the APN, it doesn’t require encryption from the device's point of view (this encryption is done via the SIM card and connection, entirely hands-free).

Secure IOT communications.jpg

At the same time, as data transmitted across the APN is also entirely private (not exposed to the internet), there is no need for encryption at this level either. 
These message packets then arrive at an MQTT broker, and from there, can be shared across the internet, or to other devices inside the APN. The result of all of this is that the number of bytes transmitted by the device is reduced from kilobytes to a handful of bytes per message. 

mqtt-anywhere-kit-page-thickbox_default-12x.jpg

The MQTT Anywhere kit in all its glory

Therefore, this means that devices can wake up, connect, send a message, read data directly via the APN, and then go back to sleep, consuming far less energy than they normally would. Now, the beauty of this service is that it is hardware-agnostic, meaning it can work seamlessly with various IoT devices. 
However, for the sake of this demonstration, we will be using a u-blox device (I know it’s a bit cheeky, but hey, they made the service, I think it's only fair that they get to show off their SARA-R422 module). 

Advantages of using u-blox Thingstream

1 - Energy Efficiency

The energy efficiency achieved by u-blox IoT-Communication as-a-service is just one of its many advantages. Firstly, by reducing the amount of data sent and eliminating the need for security certificates and DNS lookups, the cost of data transmission is significantly lowered. Remember that almost all IoT cellular services will charge based on the number of bytes or messages you send, and in the case of messages, they will often be limited in size (meaning that one message can actually end up being counted as two).

2 - Cost Saving

Secondly, the pricing is convenient, with messages bought in packs at a consistent cost, regardless of location. These messages can be used anywhere in the world, regardless of message length or the number of bytes transmitted (within reasons, you can’t stream your favorite Netflix shows and expect that one episode is one message!)

3 - Simplifies IoT

Thirdly, long-term calculations of economic feasibility become much simpler compared to pay-per-byte models with varying rates worldwide. Moreover, this service reduces the complexity of IoT devices as security is handled by the APN and the SIM card. This integration simplifies the development process and streamlines the deployment of secure IoT solutions (integrating strong security can be a complex task). Oh, and it's important to note that the price of this service not only includes secure connectivity but also encompasses the MQTT broker and SIM management platform, providing a comprehensive solution for your IoT communication needs.

The Hardware Breakdown  - Mikroe MQTT Anywhere Kit

The foundation of any technological marvel lies in its hardware. For our exploration, the primary board in focus is the 'Flip and Click' from Mikroe. This versatile board boasts four distinct slots, each designed to accommodate different devices using the Mikroe bus.

mqtt-anywhere-kit-youtube
Check out the video about to see an overview of the hardware we will use in our experiment

Complementing the Flip and Click is another piece of hardware, also a brainchild of Mikroe. This hardware harnesses the power of the u-blox SARA-R422 module, a formidable component capable of supporting both LTE and GNSS.

To enhance signal strength, an antenna is integrated, connecting directly to the LTE port. But the real magic lies in a starter kit provided by u-blox. Within this kit is a SIM card, specifically designed for the Mikroe module.

One can't help but marvel at the design of the starter pack. Its unique opening mechanism is, without a doubt, a design masterpiece! The SIM card within comes in various sizes, but for our exploration, the smallest one takes precedence as it seamlessly connects to the module. A unique number on the back of this SIM card plays a pivotal role, especially if one lacks a redemption code, typically found on the module's back.

thingstream-simcard-pack
We loved the SIM card pack design almost as much as the Thingstream service itself!

Once the SIM card is snugly placed into its holder, the next step involves inserting it into slot A, ensuring its upward orientation. The final touch involves screwing in the antenna, completing the module setup.

HTTP vs. MQTT: A Power Consumption Analysis

The video below shows a comparison between sending an HTTP request and the Thingstream service in terms of power consumption. Using specialized software provided by the u-blox team, Robin showcased the stark difference in energy usage between the two protocols. The Thingstream service emerged as the clear winner, consuming almost half the energy of HTTP. Check out the video below for a full rundown:

http-vs-thingstream
The power analysis graph clearly shows that using the Thingstream service results in less energy consumption

 

Final thoughts on u-blox Thingstream

As we conclude our exploration of u-blox's IoT-Communication as-a-service, it's crucial to understand that cellular communication can be complex, and traditional internet protocols may not be suitable for energy-constrained IoT devices. 

uBlox's private APN solution, combined with the lightweight MQTT-SN protocol, mitigates these challenges. It reduces complexity, eliminates the need for additional encryption layers, and offers a seamless IoT cellular service, all while saving a whole load of energy. 

If you're interested in exploring this innovative solution further, we highly recommend visiting the uBlox website, where you can find both hardware and software solutions for any cellular project you can think of, but don’t forget, they also have other interesting features including GNSS and short-range radio

If you are interested in purchasing the MQTT Anywhere kit we used in the video, you can find it in the Electromaker Store.

Leave your feedback...