Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Internet of Things from Scratch

You're reading from   Internet of Things from Scratch Build IoT solutions for Industry 4.0 with ESP32, Raspberry Pi, and AWS

Arrow left icon
Product type Paperback
Published in Feb 2024
Publisher Packt
ISBN-13 9781837638543
Length 438 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Renaldi Gondosubroto Renaldi Gondosubroto
Author Profile Icon Renaldi Gondosubroto
Renaldi Gondosubroto
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Preface 1. Part 1: Getting Started with the Internet of Things
2. Chapter 1: An Introduction to IoT Architecture, Hardware, and Real-Life Applications FREE CHAPTER 3. Chapter 2: Understanding and Designing IoT Networks 4. Chapter 3: Integrating Application Protocols 5. Chapter 4: Examining Communication and Connectivity Technologies 6. Part 2: Developing and Optimizing IoT Systems for Smart Environments
7. Chapter 5: Realizing Wireless Sensor Networks within Smart Spaces 8. Chapter 6: Creating Applications on the Edge 9. Chapter 7: Working with Cloud Computing to Power IoT Solutions 10. Chapter 8: Designing for Interoperability 11. Part 3: Operating, Maintaining, and Securing IoT Networks
12. Chapter 9: Operating and Monitoring IoT Networks 13. Chapter 10: Working with Data and Analytics 14. Chapter 11: Examining Security and Privacy in IoT 15. Chapter 12: Exploring and Innovating with Open Source IoT 16. Part 4: Delving into Complex Systems and the Future of IoT
17. Chapter 13: Developing IoT Solutions for Digital Transformation within Industry 4.0 18. Chapter 14: Architecting Complex, Holistic IoT Environments 19. Chapter 15: Looking Ahead into the Future of IoT 20. Index 21. Other Books You May Enjoy

Choosing between IoT hardware

Choosing optimal hardware for an IoT project is imperative, especially when it comes to creating industry-grade implementations. Related hardware and software for IoT go through a standardized design process: requirements specification, conceptual design, prototyping, testing, and finally the rollout of the hardware and software that are part of the system. Some platforms, such as ESP8266 microcontrollers, facilitate easy prototyping and deployment, but this convenience often comes at the expense of lower processing power when compared to other options.

There are many factors to consider, but they can be categorized into four different factors: data acquisition, data processing, connectivity, and power management.

Data acquisition

Data acquisition is a major part of IoT systems, as many components of a system, in the form of sensors, function to collect data in the environment to provide real-time results and/or feedback. This data is often obtained at a fixed rate within a time known as the data sample rate and transmitted to a remote output device to be read in and sent for further processing.

Sensors are devices within an IoT network that are used to detect and measure physical quantities such as humidity, pressure, speed, light, and temperature. This data is obtained from the environment and sent through to the IoT platform either wired or wirelessly.

The way we interact with sensors also differs from use case to use case. As an example, instead of monitoring the environment, some sensors may instead monitor its internal state; these are known as proprioceptive sensors. There can also be sensors that allow personnel to interact directly with them via buttons or touchscreens while recording the actions that are done; these are known as-machine interfaces.

When evaluating which sensor to use, multiple factors come into play. The first and most obvious one is functionality. What are you going to use the sensor for? If you are going to measure changes in the environment for temperature and humidity, for example, you would consider the DHT11, which is a temperature and humidity sensor developed by Adafruit. It comes standardized in many development kits, including the one that this book uses. However, just because you have obtained a sensor that does what you need it to do does not mean that you have found the optimal sensor.

There are many options that need to be considered that are offered by sensors, which is why comparing sensors by their specifications is very important. The condition in which the sensor can operate is another important consideration. Where will you use it? Will it be used at room temperature or in extremely hot or cold environments?

The next consideration is the accuracy and precision of the sensor. Precision is the repeatability or consistency of the measurement. With high precision, a sensor will be able to produce results that deviate very slightly from one another when the same measurement is taken multiple times with the same conditions put on it. On the other hand, with low precision, a sensor would produce results that would deviate more from each other despite the same conditions put on it. This often comes as a trade-off with accuracy, which is how close the measured value is to the actual value of the physical quantity that is being measured. High accuracy for a sensor can produce results that are very close to the actual value, while low accuracy for sensors outputs results that deviate further from the true value. It is important to understand that a sensor can be precise but not accurate and vice versa. Optimally, we would like the sensor to be both precise and accurate, but there are often trade-offs between the two.

Finally, we must consider the resolution of the sensors. The resolution determines the smallest change within the physical quantity that the sensor is capable of detecting. For example, if a temperature sensor has a resolution of 0.1°C, this means that the sensor can detect changes in temperature as granular as 0.1°C. Hence, higher resolutions for sensors allow them to detect smaller changes within the physical quantity, while lower resolutions are only able to detect larger changes. It is also important to note that other factors aside from the sensor may also affect the resolution, such as the accuracy of the analog-to-digital converter (ADC), which converts the sensor’s output to digital form, and the accuracy of the software that processes the data sent by the sensor, which affects the overall resolution of the measurement system.

For example, we can compare the DHT11 and DHT22 sensors that are both developed by Adafruit. The following are the specifications for them from the Adafruit website:

Figure 1.7 – Comparison of DHT11 and DHT22 sensors from Adafruit

Figure 1.7 – Comparison of DHT11 and DHT22 sensors from Adafruit

At first glance, they both provide the functionality of being able to measure temperature and humidity, but they both have different specifications that can meet your deployments’ needs differently. When comparing the specifications, we can see that despite there being many factors that are the same between them, each has its own set of advantages. The DHT11 has a lower cost and a better resolution compared to the DHT22, while the latter has higher accuracy and works over a larger temperature range than the former. Depending on our priorities, this will affect how we choose one sensor over another with these specifications.

These sensors then lead to the next part of the consideration of hardware for the architecture, which is within data processing.

Data processing and storage

Data processing and storage is a crucial part of working with data as part of the IoT. Once we have obtained the data, we must determine how we can analyze, interpret, and work with the data. In different use cases, data is processed in different places of the architecture; the device obtaining the data may process the data itself while in other use cases, it may transmit the data to other places first, such as gateway devices or cloud applications, for the purpose of conducting further analysis.

The processing power and storage size that an IoT application needs rely on the performance needed by the consumers of the data; consumers may use different services of applications that utilize the data either for further processing or as an end goal. These may include factors such as memory, number of cores, clock speed, or processor specifications; all determine the device’s capability for data processing.

Two distinct scenarios arise when considering where to process and store the data:

  • Battery-powered devices: Consider a simple device such as a temperature sensor powered by batteries. Such dummy devices aren’t typically designed for local data processing and storage. The simpler the design, the lower the power consumption and, subsequently, costs.
  • Externally powered devices: Devices with an external power source, such as machines or electricity meters, can afford to have local data processing and storage. This arrangement not only reduces service latency but also conserves wireless backhaul bandwidth, enhancing the overall efficiency.

On the capacity side, this is what makes the consideration of non-volatile memory—the temporary data storage before data is transmitted upstream—imperative; we want to account for being able to hold data while considering the different environments that the device may be in. Is the data in environments of intermittent internet connectivity meaning there may be a chance of data loss if it relies fully on the internet to continuously store data in an upstream provider? Do we do data processing within the device itself? These are all questions that we need to consider when carefully choosing the hardware we need.

Connectivity

Connectivity to networks is a crucial element of IoT devices. There are different types of connectivity to consider. It may be wired or wireless, depending on its use case. Wired communication is usually used for stationary devices and connected via the Ethernet, such as with smart buildings or home automation. On the other hand, wireless communication includes technologies such as Wi-Fi, Bluetooth, WAN technologies (such as LoRa), NB-IoT, and cellular networks. Don’t worry if you don’t know these terms; we’ll talk more about them in the upcoming chapters and ensure that you have a thorough understanding of them and how to make the best use of them depending on your individual use case!

In connecting such devices together over a network, there are two main methods of communication: serial and parallel. With serial communication, data is transmitted one bit at a time over a singular communication line. Serial communication is usually used when the distance that the communication must be based on is relatively long or when the data rate is relatively low. Furthermore, it is used when there are a limited number of available communication lines or when the complexity of the system needs to be minimized. It uses protocols such as the RS-232 or the RS-422 protocols. Some examples of when serial communication would be used are as follows:

  • Communication between a microcontroller and a sensor
  • When two computers are located at a long distance from one another

In parallel communication, multiple bits are transmitted at the same time through multiple communication lines. It is normally used when the communication distance is short and the data rate is high. Furthermore, it is often seen in systems where the number of bits that are transmitted simultaneously is huge. It includes protocols such as IEEE, 1284, and PCI. Some examples of parallel communication’s uses are as follows:

  • Communication between two computers that need to exchange large amounts of data quickly
  • Communication between a computer and a printer

We will cover connectivity in more detail in Chapter 4, Examining Communication and Connectivity Technologies, when we talk about connectivity and communication solutions.

Power management

Power management is a critical consideration within any IoT network. This is particularly true for devices that rely on a wireless power source, which usually depends on batteries or solar cells. There are mainly three main power consumption factors: the sensor, the microcontroller unit, and the wireless backhaul. Aspects that we need to consider include the cost, performance, and battery life of a device. There are multiple approaches that are often used to manage this effectively:

  • Cloud computing: Letting the cloud handle processing and storage is often a great solution for reducing the power consumption of the device, as it will allow it to process data minimally when communicating with the cloud or to simply just perform its data collection when needed and sleep when it is not required for usage at a particular moment.
  • Sleep modes: Microcontrollers and other types of hardware can often enter a sleep mode when there’s low power consumption. It often is up to the user to configure the device to sleep and wake at certain times, which necessitates them to know the periods of high consumption and low consumption or simply to set a threshold and let the device detect on its own. This often reduces power consumption significantly.
  • Power-efficient hardware: Using power-efficient hardware is a very important consideration and may be why some pick one microcontroller over another. This factor is listed on the specifications of the microcontroller, sensor, or other peripherals, as choosing such efficient devices would minimize costs, especially when working with a network filled with them. However, this may come with performance trade-offs, which is why it is important to look at all the specifications carefully to see whether the trade-offs are ones you can afford to make and consider what you really would like to prioritize.
  • Power management integrated circuits (PMICs): PMICs are chips that are used to manage the power consumption of a device. They are used to regulate the power supply to various components within the system, ensuring that only the portion that is allocated to the components gets through. This can be a powerful tool to regulate your system.
  • Energy harvesting: Some energy harvesting methods, such as solar panels, are also effective ways of making use of power in a natural and cost-effective way. This would help you extend the device’s battery life while also reducing the need to purchase batteries. However, this would depend on the environment of the device, as not all environments are conducive to this practice. For instance, not all areas have constant sunlight; solar panels would not work in these cases, and alternative means must be considered.

As can be seen from this section, all of the outlined factors depend on one another. This also leads to certain trade-offs, as it is often not possible to find the ideal device that can satisfy all four factors perfectly while still saving costs. It all depends on what your use case is and to what extent you would like your IoT system to meet it.

With this, you will have understood much more about selecting IoT hardware. As can be seen, sometimes some decisions are not as easily made when there are important trade-offs to consider, but it is often important to prioritize what you want to get out of it instead of trying to achieve the best of everything. In the next section, we will discuss how we can start designing simple IoT system diagrams.

You have been reading a chapter from
Internet of Things from Scratch
Published in: Feb 2024
Publisher: Packt
ISBN-13: 9781837638543
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.
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 $19.99/month. Cancel anytime
Banner background image