In this chapter, you will be introduced to the basic building blocks of an IoT project. You will briefly get to know various protocols, architectures, and development boards for IoT prototyping. The main purpose of this chapter is to show you what's out there, so you can decide which technologies might be of interest for your next project and give you a head start on further exploration. If you feel overwhelmed by the number of new technologies and options available, don't be. You don't need to understand everything here, but hopefully you will come back later to look up one or more topics if you stumble upon them elsewhere. This chapter neither tries to be a complete reference, nor can it be. It would go completely beyond the scope of this book—which is to teach you how to build IoT prototypes with Arduino and MQTT....
You're reading from Hands-On Internet of Things with MQTT
Building blocks of IoT connectivity
One thing all IoT devices have in common is connectivity. In most cases, this means that the device can connect to the internet; in some cases, it might communicate with a local smart hub via another technology such as Bluetooth, which is connected to the internet itself, and sometimes devices from a local network, for example, via radio (see the ZigBee and Thread sections). In each case, there is a communication channel, so devices can either send out data, receive commands, or both.
Having a device that is connected to the internet or another device is much use. It needs to be connected to input and output components. With sensors as input components alone, there are a gazillion possibilities. If you haven't done so already, you should have a look at the sensor category for Sparkfun, one of the best-known shops (https://www.sparkfun...
Understanding protocols and communication
In this section, we will have a look at four common protocols and technologies used for communication between IoT devices. ZigBee and Thread are both technologies that use radio to transmit information. ZigBee has long been the preferred way to transmit information between devices locally (without using the internet, but using radio signals), but is about to be replaced by Thread.
CoAP and MQTT, on the other hand, communicate over the internet. They are both intended to be used with constrained devices and have different areas where each protocol shines. We won't go into too much detail about CoAP and will concentrate on MQTT, starting with Chapter 3, Getting Started with MQTT, instead.
ZigBee
Exploring microcontrollers for IoT
There are a multitude of microcontrollers available on the market today that are well suited for IoT prototyping. For simple projects where you just want to read a sensor value and log its value in the cloud, most microcontrollers with internet access will do a great job. In more complex projects, where you need a filesystem and more features than you would typically find on a regular computer, a microcontroller might not be enough, and you may need a development board running a full-grown operating system such as the Raspberry Pi (https://www.raspberrypi.org) or Asus Tinker (https://www.asus.com/de/Single-Board-Computer/Tinker-Board/):
These development boards come with display connectors and USB ports to connect hard drives, webcams, a keyboard, or a mouse to, and are able to run programs written in various...
Summary
In this chapter, you were introduced to a lot of different principles, protocols, and microcontroller boards used in IoT prototyping. We've learned what constitutes the client-server architecture. Next, we looked at how the frontend and backend play together and how machines communicate with one another using APIs. Finally, we learned about the frameworks that use web development technologies such as HTML, CSS, and JavaScript to build desktop and mobile apps, which can communicate with your prototype. We also had a look at various communication methods; devices can transmit information not only over the internet, but also by using radio signals.
One of the most common modules for integrating radio-communication into your project is called XBee, and uses the ZigBee specification. Some devices also ship with Thread support—an upcoming radio-based protocol...
Questions
- Name three development boards suitable for IoT prototyping.
- Does it matter if a development board runs on 3.3V or 5V?
- Name four protocols used in IoT development.
- What are over-the-air updates?
Further reading
- Arduino MKR WiFi 1010: https://store.arduino.cc/arduino-mkr-wifi-1010
- Asus Tinker: https://www.asus.com/de/Motherboards/Tinker-Board/
- Amazon dash: https://www.amazon.com/Dash-Buttons/b?ie=UTF8&node=10667898011
- Cordova: https://cordova.apache.org/
- CRUD explanation: https://www.codecademy.com/articles/what-is-crud
- Electron: https://electronjs.org/
- Flutter: https://flutter.io/
- Smart button: https://flic.io/
- Grove: http://wiki.seeedstudio.com/Grove_System/
- If-This-Than-That (IFTTT): https://ifttt.com/
- IFTTT Webhooks: https://ifttt.com/maker_webhooks
- Ionic: https://ionicframework.com/
- MQTT versus CoAP video: https://www.youtube.com/watch?v=pfG8uEDZj5g
- NodeMCU version overview: https://frightanic.com/iot/comparison-of-esp8266-nodemcu-development-boards/#v2
- OpenThread: https://openthread.io/
- Particle: https://www.particle.io/
- Particle device cloud: https...