Start into Internet of Things (IoT) — Part -I

Ameya Shahu
3 min readMar 16, 2021

This blog series let you start with IoT without any hardware such as microcontroller, sensors, actuators etc.

Photo by Louis Reed on Unsplash

I have been working on IoT since the last two year. I worked on projects such as automated farming and real-time power consumption monitoring which are IoT based projects.

Presently, I am in my last semester of bachelors of engineering, so I am working on my final year project. It is related to healthcare. It also has a patient monitoring module which uses IoT primarily.

Many of my colleagues in college keep asking me how they can start with IoT and I got motivation to write this blog series. You just required your laptop for hands-on. So let’s get started.

So the first question arises: what is IoT?

I won’t go into technical definition. In simple terms, IoT enables a physical device which includes electronic devices, sensors, mechanical machineries, embedded systems etc. to connect with the internet. This helps a user of that object to monitor it or control it from anywhere in the world manually or using any automated system. IoT has lots of applications in different fields. You can refer to this Wikipedia page.

All the devices connected over the internet can communicate with each other. This communication is conducted by some set of rules which we called as protocols. There are various protocols used depending on the application such as http which is used by a web browser to access a web page, ftp is used to transfer files, smtp is related to E-mail etc.

One of such protocols is MQTT. It is considered to be a standard protocol of IoT. It is a light-weight machine to machine protocol. It passes messages from one machine to another machine. It is based on the publish-subscribe model. Let’s first understand the publish-subscribe model. Daily life example publish-subscribe model in print newspaper service. A group of journalists publish their editorials in a newspaper that has a definite name. Now, newspaper vendors circulate newspapers to houses. But, they don’t randomly circulate newspapers. They properly know which newspaper is subscribed by a particular house owner. We can say that they have a list maintained in their minds.

Similarly, In MQTT protocol we have three entities -

  1. Publisher
  2. Subscriber
  3. Broker
publish and subscribe

In the above example of newspaper service, a group of editors are publishers. Newspaper vendor is a broker and houses are subscribers. We are missing one thing here is newspaper names which help newspaper vendor to circulate newspapers. Similarly, MQTT has topics which are analogous to newspaper names. These topics help MQTT brokers to distribute messages to subscribers of particular topics.

Publisher is a thing (any IoT enabled device) which sends a message or data on a topic to a MQTT broker. Then, MQTT broker forwards that message to other things which are connected with MQTT broker and subscribes to the same topic on publisher’s published message. With respect to MQTT broker publisher and subscriber both are client. Also, a client to broker can act as both publisher as well as subscriber simultaneously.

In this part, I tried to explain basic concept. In next part we will get into code, so stay tuned for next part.

Thanks for reading till this. Your feedback is always appreciated.

Read part — II of the blog here.

--

--

Ameya Shahu

Computer Science student at Arizona State University