Book Image

Internet of Things from Scratch

By : Renaldi Gondosubroto
Book Image

Internet of Things from Scratch

By: Renaldi Gondosubroto

Overview of this book

Develop the skills essential for building Internet of Things solutions with this indispensable guide. In an era where industries heavily rely on IoT, this book will quickly familiarize you with its foundations, widespread use, implementation guided by best practices, and the crucial technologies that allow it to work effectively. Starting with the use of IoT in real-life scenarios, this book offers comprehensive insights into basic IoT hardware, protocols, and technologies. You’ll then learn about architecting and implementing solutions such as wireless sensor networks, cloud computing with AWS, and crucial security considerations. You’ll understand how these systems are operated and monitored over time and work with simple to complex, industry-grade systems, adhering to best practices. In later chapters, you’ll be apprised of future IoT trends and strategies to manage the risks and opportunities that come with them. You’ll also get to grips with a diverse set of tools, including hardware such as ESP32 and Raspberry Pi, and software such as Mosquitto and ChatGPT for generative AI capabilities. By the end of this IoT book, you’ll be able to independently build and design complex, industry-standard solutions fully aligned with best practices.
Table of Contents (22 chapters)
1
Part 1: Getting Started with the Internet of Things
6
Part 2: Developing and Optimizing IoT Systems for Smart Environments
11
Part 3: Operating, Maintaining, and Securing IoT Networks
16
Part 4: Delving into Complex Systems and the Future of IoT

Defining systems and processes for smart objects

As stated many times within the chapter, devices and sensors must be connected to the internet to be able to efficiently perform their tasks and utilize their data. By definition, a smart object is an object that needs to be able to communicate and interact with other devices and systems, making them a key component of IoT, as we want them to perform without the need for human intervention. As part of this, we need to understand the why, what, and how of every system and process that we define as part of the interaction of smart objects. In this section, we will define these systems and processes and show how we can properly define flows to transfer information from one part of the system to another, ensuring that our use case’s goals are met. We will then delve deeper into this in the next chapter.

Defining a problem

Throughout this book, you will encounter different kinds of problems that require you to understand your environment and make appropriate decisions. As part of this, you need to consider what your intended goal is. It could be something as simple as the following:

I want to automate my home’s lighting system to turn on from 9:00 to 18:00 and turn off/on every other hour when I am not at home.

This is a broad goal, but it certainly is the start of being able to narrow down what kind of system we intend to build. Next, we will look at a three-step model for realizing that goal, allowing us to further build on the picture that we have put forward and consider what types of components we will need.

The three-step model for working on IoT systems

In this section, we can model the actions that we will take to reach our goal through three key activities:

Sense

In this activity, we define what we want to measure and how we look toward measuring it. Understanding the parameters specifically is important. Are we measuring temperature? Humidity? We need to have this understanding and list them before considering options for sensors that we can use to measure these parameters.

Configure

Based on the data obtained, we then must continually use it to determine which data is relevant and which is not while iteratively building on the system based on what is being sensed. This is where we convert data into information and manage it according to what we obtain.

Actuate

After configuration, we set rules to ensure that we are notified if any thresholds are crossed and send a signal to the actuator to act. Actions can include turning off lights when we need to or turning up the thermostat when the temperature gets too cold. This is where information is then converted into action.

Creating the flow

Defining a flow diagram of the path that your data will take from its acquisition to the action that will be triggered as part of readings is crucial to starting any IoT network. This is also part of understanding what outcomes we would like to get out of the network design, which are most notably increasing the quality of life based on the automation that can be done and ensuring we save costs in the process.

The following figure is a sample design flow of how data is transmitted, from data acquisition to triggering an actuator to take action and generate reports based on analysis results:

Figure 1.10 – Sample design data flow diagram

Figure 1.10 – Sample design data flow diagram

In this diagram, data is acquired as part of data acquisition and is accordingly converted into telemetry data within the smart object it is based in, which then transmits this to a data management service. This data management service may accordingly store data within a storage service. This is then forwarded on to analytics, where the data is further analyzed and the results are stored accordingly. From here, it may go on further to trigger an action to be done by an actuator and a report may be generated, allowing for further interpretation of the results to be done. This flow is common in most systems, as they most likely contain a large portion of these components, if not all of them, particularly if they are industry-standard ones. This flow will be something that you can refer to when you work on the IoT weather station exercise in the next section.

With this, we have built on our high-level overview of the simple IoT diagrams we looked at in the last section and now understand how simple flow diagrams for transmitting data from source to destination for smart objects are created. We will dive more into the specifics in the next chapters and explore how we can further build on these diagrams to account for many other factors. Next, we will see how we can use our knowledge so far to build a mini weather station.