Book Image

Hands-On Internet of Things with MQTT

By : Tim Pulver
Book Image

Hands-On Internet of Things with MQTT

By: Tim Pulver

Overview of this book

MQ Telemetry Transport (MQTT) is a lightweight messaging protocol for smart devices that can be used to build exciting, highly scalable Internet of Things (IoT) projects. This book will get you started with a quick introduction to the concepts of IoT and MQTT and explain how the latter can help you build your own internet-connected prototypes. As you advance, you’ll gain insights into how microcontrollers communicate, and you'll get to grips with the different messaging protocols and techniques involved. Once you are well-versed with the essential concepts, you’ll be able to put what you’ve learned into practice by building three projects from scratch, including an automatic pet food dispenser and a smart e-ink to-do display. You’ll also discover how to present your own prototypes professionally. In addition to this, you'll learn how to use technologies from third-party web service providers, along with other rapid prototyping technologies, such as laser cutting, 3D printing, and PCB production. By the end of this book, you’ll have gained hands-on experience in using MQTT to build your own IoT prototypes.
Table of Contents (16 chapters)
Title Page

Prototyping for the greater good

Building IoT devices can also contribute to the greater good in a non-commercial setting. In 2018, a non-governmental organization consisting of engineers and developers called Rainforest Connection (https://rfcx.org/developed an IoT device to help to protect the Amazon rainforest from illegal deforestation. As it reduces the levels of greenhouse gases in the atmosphere, the rainforest plays an important role in our climate, and, according to Rainforest Connection's CEO Topher White, illegal deforestation accounts for nearly one-fifth of all the greenhouse gas emissions every year. Up to 90% of the deforestation of the Amazon rainforest is done illegally. Saving the rainforest could be the cheapest and fastest way to slow down climate change:

African jungle (source: Depositphotos)

In collaboration with the indigenous Tembé tribe, Rainforest Connection developed a device called Guardian to detect illegal deforestation and prevent it from happening. The devices are based on recycled smartphones, which have many of the ingredients of an IoT device on-board—a microprocessor, sensors, and a way to communicate via the cell phone's network over the internet.

The Guardians are hung inside the trees, their microphone transmitting the ambient sound via the cell phone network 24/7, forming a huge grid of microphones. In the cloud, where all of this data is assembled, a machine learning model based on Google's open source TensorFlow library comes into play. It was trained to detect the sound of chainsaws and trucks used in deforestation operations. Whenever one of the microphones detects a sound like this, disturbing the natural sound collage, the machine learning algorithms can identify it and the relevant information, such as GPS data, can be forwarded to the authorities.

In March 2018, the Planet Guardians program was launched by Rainforest Connection. Students from Los Angeles helped to build new Guardian devices to be added to the grid, and it is expected that these will help to protect 100,000 acres of rainforest throughout the year 2020 (you can go to https://www.blog.google/technology/ai/fight-against-illegal-deforestation-tensorflow/ and https://www.prnewswire.com/news-releases/rainforest-connection-introduces-one-of-the-largest-programs-ever-launched-by-students-to-protect-the-worlds-rainforests-300617270.html for more information).

Similarly, devices equipped with GPS and a sensor are used to detect earthquakes—once an earthquake is detected by the sensors, people can be warned accordingly.

The same principle can be used for other areas as wellas an early warning system for tsunamis or avalanches, for example.