Reader small image

You're reading from  Arduino IoT Cloud for Developers

Product typeBook
Published inNov 2023
PublisherPackt
ISBN-139781837637171
Edition1st Edition
Right arrow
Author (1)
Muhammad Afzal
Muhammad Afzal
author image
Muhammad Afzal

Muhammad Afzal is a senior software engineer, with more than 14 years of experience working on web-based and IoT systems in multinational organizations. He always enjoys working and solving real-world business problems with technology. He provides freelance services to IoT-based product companies to write technical reviews and projects, and he also provides consultancy to organizations. In his free time, Muhammad creates videos and courses for YouTube and Udemy. He also runs a maker movement in his region for young students to boost their interest in adopting the latest technologies.
Read more about Muhammad Afzal

Right arrow

Project #2 – Creating a Portable Thing Tracker Using MKR GSM 1400

This chapter is dedicated to smart transportation and smart remote monitoring. It shows how cellular communication-enabled devices can be integrated with the Arduino IoT Cloud platform, and it also offers an example of using a global IoT SIM card for communication.

Here, we will practically explore Long-Term Evolution (LTE) technologies, which are very useful in remote monitoring and control, whether they involve asset tracking or remote operation monitoring. This project uses the Arduino MKR GSM 1400 development board, which is equipped with the latest communication bands and was specially designed for Industrial Internet of Things (IIoT) and Internet of Things (IoT) use cases. This project practically explains how you can develop a tracking solution based on cellular communications for different use cases. This chapter will help you to understand cellular communication technology, global IoT SIM cards, and...

Technical requirements

The following are the hardware components required to complete this chapter:

  • MKR GSM 1400/MKR NB 1500
  • A Hologram global IoT SIM card
  • A NEO-6M GPS module
  • A breadboard
  • Jumper cables

For coding, we will use the Arduino Web Editor, which includes a large collection of development boards and sensor libraries, as well as Arduino IoT Cloud for Thing and dashboard setup. To develop hardware and sensor designs, we need the Fritzing desktop software, and we need Arduino IDE for GPS module testing.

In this chapter, we will use the Arduino IoT SIM card for communication instead of local SIM providers. Arduino provides a wide variety of data plans for global IoT sim cards that can be chosen according to requirements. The code for this chapter is available at the book’s official GitHub repository at this link: https://github.com/PacktPublishing/Arduino-IoT-Cloud-for-Developers.

Enhancing operations with IoT asset tracking and remote control

IoT technology can be very useful for asset tracking and remote controlling and monitoring operations. By installing sensors on assets and connecting them to a central network, you can track the location and status of your assets in real time. Here are some ways in which IoT can be used for asset tracking and remote controlling and monitoring operations:

  • Asset tracking: By installing GPS trackers or RFID tags on your assets, you can track their location and movements in real time. This can be very useful for logistics and supply chain management, as well as fleet management.
  • Condition monitoring: By installing sensors on your assets, you can monitor their condition and performance in real time. This can help you identify potential problems before they become serious and take corrective action to prevent downtime and reduce maintenance costs.
  • Predictive maintenance: By analyzing data from your sensors, you...

Exploring the advantages of GSM/LTE/NB-IoT communication technologies

Global System for Mobile communication (GSM), LTE, and NarrowBand-Internet of Things (NB-IoT) are all wireless communication technologies that are widely used for mobile communications and IoT devices. Each technology has its own pros and cons, and the choice of which technology to use depends on the specific requirements and solution design.

Here are some of the reasons why GSM, LTE, or NB-IoT are often chosen over other communication technologies:

  • Wide coverage: GSM and LTE networks have extensive coverage and are available in most parts of the world, making them ideal for global connectivity. NB-IoT, on the other hand, has been designed specifically for IoT devices and offers greater coverage in hard-to-reach areas.
  • High data rates: LTE offers high data rates, making it suitable for applications that require fast and reliable data transfer. NB-IoT, although slower, still offers better data rates...

Seamless global connectivity with IoT SIM cards

Global IoT SIM cards are specifically designed for IoT devices that require cellular connectivity to communicate with the internet or other connected devices. These SIM cards provide access to multiple networks, allowing devices to roam across different countries and regions without the need to switch between SIM cards.

Global IoT SIM cards typically offer features such as the following:

  • Multi-network coverage: These SIM cards can connect to multiple cellular networks, including GSM, LTE, and other emerging technologies, such as NB-IoT and Cat-M, to provide reliable coverage in different locations.
  • Over-the-air (OTA) updates: Many global IoT SIM card providers offer OTA updates, enabling devices to receive firmware and software updates without the need for physical intervention, improving efficiency and reducing maintenance costs.
  • Data plans: Global IoT SIM card providers offer flexible data plans that can be customized...

Building blocks – sensors and development boards for IoT

The Arduino series has a wide collection of development boards that vary in size, pins, and communication technologies. In this chapter, I will use an Arduino MKR GSM 1400 development board, as it’s compact, battery-enabled, and provides the support of GSM/3G/4G. Figure 5.1 shows the pinout diagram for the MKR GSM 1400.

Figure 5.1 – Arduino MKR GSM 1400

Figure 5.1 – Arduino MKR GSM 1400

Arduino MKR GSM 1400 provides 7 analog pins and 14 digital input/output pins, with built-in battery charging and a LiPo battery connector for standby power, which helps developers build prototypes and solutions for remote monitoring/operations without worrying about power backups. For further details, please visit the official website at https://store-usa.arduino.cc/products/arduino-mkr-gsm-1400.

Arduino’s latest development board, MKR NB 1500, only supports NB-IoT, LTE-M, and Enhanced GPRS (EGPRS) for SMS. NB-IoT and...

Designing the project architecture

In the preceding sections, we discussed the module and development board in detail. Now, it’s time to cook the recipe. In hardware development, before starting to work with sensors and development boards, we need to develop the design concepts to get a better understanding of how things will connect. There is a lot of software that is available to design and develop design concepts for an electronics project, but in this case, we will use Fritzing.

In the following two subsections, we will talk about schematics and designing a project, while explaining how to connect pins with a development board and soldering. Then, we will do some tests to fetch GPS coordinates, which is very important before sending data to the cloud.

Schematic design and assembly

The purpose of your schematic design is to get a clear understanding of how sensors will connect with a development board. Schematic diagram helps you to develop a prototype on a breadboard...

Activating SIM cards for IoT deployment

After assembling the GPS module with MKR GSM 1400 and testing it, it’s time to activate the Hologram global IoT SIM card, which will act as a bridge between the device and the Arduino IoT Cloud. You can purchase the IoT SIM card from https://store.hologram.io/store/. It provides different types of SIM cards for industries, such as the Hyper EUICC IoT SIM card, which is an industrial-grade and simple SIM card for learning projects, and these are available in different sizes according to the SIM slots in the development boards. You can order its pilot SIM card for free, but you need to pay for its shipment.

After receiving the SIM card, create an account at hologram.io, where you will be able to activate and manage all your SIM cards. The Hologram dashboard provides full details regarding the data utilization of devices, packages, billing, and routes. By setting up routes, you can forward your device data to a different IoT cloud if you...

Configuring the Thing, network credentials, cloud variables, and code

After setting up the hardware, it’s time to set up the Thing in the Arduino IoT Cloud. For this project, we need four cloud variables to fetch different properties from the device. The network settings will be different as we are using a GSM series board instead of Wi-Fi. Figure 5.7 shows the complete overview of the Thing:

Figure 5.7 – A portable Thing tracker using the MKR GSM 1400 Thing setup

Figure 5.7 – A portable Thing tracker using the MKR GSM 1400 Thing setup

Set up a new Thing with the name A portable thing tracker using MKR GSM1400. Then, follow these steps to create cloud variables, an associate device, a network configuration, and finally, the code:

  1. Firstly, we need to set up four cloud variables for location, altitude feet, satellite count, and speed. The complete details regarding these cloud variables are available in the following section.
  2. Then, we need to associate the device with the Thing. In the current project...

Creating comprehensive web and mobile dashboards

After uploading the code to the device, it’s time to set up a dashboard for web and mobile to visualize the data with different widgets. The following figure demonstrates the visualization of readings with different widgets:

Figure 5.11 – The Thing dashboard

Figure 5.11 – The Thing dashboard

We have four readings from the GPS module to visualize; here, I have used three widgets, Gauge, Value, and Map, but Map is used twice as it takes two values (i.e., latitude and longitude). The Gauge widget shows Speed Per Mile, while two Value widgets have been used to display Altitude Feet and Satellite Count. The Map widget has been used to display Location based on the latitude and longitude coordinates, which are stored in a cloud-based location variable. Currently, the Map widget is only capable of displaying the location of the asset device based on coordinates; if you have multiple assets to track, then you need to set up multiple...

What next?

We still have a lot of options available to explore, but now it’s your time to use different sensors and development boards to do some more experiments and learn from them. In the current chapter, we only used one GPS module, which gave us only four parameters but, on the market, there are a lot of GPS modules that provide a wide variety of functionalities; they work under the roof as well as under clear sky, and have several accuracy features.

While monitoring an asset’s location, there are some other parameters that are very important to monitor in different industries, such as temperature and humidity, which are very important in food and medical products. CO2 and LPG gases are very important to monitor during fuel transportation. Try different sensors with a GPS module to set up different tracking prototypes for different industries.

Summary

In this chapter, we explored how to develop a GPS-based tracking system using a global IoT SIM card and GPS module. We set up the Thing, which included cloud variable creation, device association, GSM network configuration, and coding a development board. Later, we created a dashboard to visualize the Thing readings with different types of widgets to display current readings, with the most important widget of the chapter being the Map widget. It is a very interesting and important widget to display the location of IoT devices using GPS coordinates.

GPS tracking is a very important aspect that we covered in this chapter, and it helps us to develop a device for our asset tracking, which will help us in asset tracking and monitoring. This chapter demonstrated how we can display the location of a device on the dashboard, which gives you the confidence to build more solutions regarding asset tracking. In the next chapter, we will explore another long-range communication technology...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Arduino IoT Cloud for Developers
Published in: Nov 2023Publisher: PacktISBN-13: 9781837637171
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Muhammad Afzal

Muhammad Afzal is a senior software engineer, with more than 14 years of experience working on web-based and IoT systems in multinational organizations. He always enjoys working and solving real-world business problems with technology. He provides freelance services to IoT-based product companies to write technical reviews and projects, and he also provides consultancy to organizations. In his free time, Muhammad creates videos and courses for YouTube and Udemy. He also runs a maker movement in his region for young students to boost their interest in adopting the latest technologies.
Read more about Muhammad Afzal