Basics of IoT

In this chapter, we will be controlling devices in our home using our smartphones, but before doing this, we should understand the basics of this technology. The first topic of this chapter is IoT—the overused jargon in the modern world. It is something that everyone wants to know about but no one does. IoT can be related to a technology, where your refrigerator will tell you what items are low in supply and will order it automatically for you. Poor thing! This technology has some time to invade our houses. But IoT does not mean this alone. IoT is a very wide term, something which can be applied to almost all the places for optimization. So what is IoT then?

Let's break this acronym, Internet of Things sometimes also known as cyber physical systems. Now, what is Things? Any electronic object that has the ability to collect or receive data without human intervention can be called a thing here. So this thing can be your mobile, a pacemaker, a health monitoring device, and so on. The only if is that it should be connected to the internet and has the ability to collect and/or receive data. The second term is Internet; the internet refers to the internet, Duh! Now, all of these IoT devices send and receive data from a cloud or a central computer. The reason why it does that is because any IoT device, whether big or small, is considered a resource-constrained environment. That is, the resources such as computing power is much less. This is because the IoT devices have to be simple and cheap. Imagine you have to put IoT sensors on all of the street lights to monitor traffic. If the device costs $500, then it would be impractical to install this kind of device. However, if it could be made for $5-$10, then no one would bat an eye. That's the thing with IoT devices; they are extremely cheap. Now the flip side to this story is that they do not have a lot of computing power. Hence, to balance this equation, instead of computing the raw data on their own processors, they simply send this data to a cloud computing device or perhaps a server where this data is computed and the meaningful result is taken. So, this solves all our problems then. Well, no! The second problem with these devices are that they can be battery operated, use-and-throw devices as well. For example, where temperature sensors are installed all across the forests; in such situations, no one and absolutely no one will go and change the batteries every week. Hence, these devices are made in such a way that they consume little to almost no power, thereby making the programming very tricky.

Now that we have understood the IoT concepts, in this chapter, we'll be making our home IoT enabled. This means, we will be able to receive and collect data from the sensors from our home, see it on our mobile devices, and if needed, we can control the devices using your smartphones as well. There is one thing though, instead of computing it on cloud, we will simply be uploading all of our data onto the cloud and just accessing that data or sending our data to the cloud from where it can be accessed. We will be talking about the cloud computing aspect in a different book as this can be a whole new dimension and will be out of the scope of this book.