19 KiB
Introduction to IoT
Sketchnote by Nitya Narasimhan. Click the image for a larger version.
This lesson was part of the Hello IoT series from the Microsoft Reactor. It was delivered in two videos: a 1-hour lesson and a 1-hour office hour session that explored the lesson in more depth and answered questions.
🎥 Click the images above to watch the videos
Pre-lecture quiz
Introduction
This lesson introduces key concepts of the Internet of Things (IoT) and guides you through setting up your hardware.
In this lesson, we’ll cover:
- What is the 'Internet of Things'?
- IoT devices
- Set up your device
- Applications of IoT
- Examples of IoT devices you may have around you
What is the 'Internet of Things'?
The term 'Internet of Things' was coined by Kevin Ashton in 1999 to describe connecting the Internet to the physical world through sensors. Since then, it has come to mean any device that interacts with the physical world, either by collecting data through sensors or performing actions via actuators (e.g., turning on a switch or lighting an LED), often connected to other devices or the Internet.
Sensors collect information from the environment, such as speed, temperature, or location.
Actuators convert electrical signals into real-world actions, like flipping a switch, turning on lights, making sounds, or sending control signals to other hardware, such as activating a power socket.
IoT encompasses more than just devices—it includes cloud-based services that process sensor data or send commands to actuators. It also involves devices that operate without direct Internet connectivity, often called edge devices. These devices can process and respond to sensor data locally, often using AI models trained in the cloud.
IoT is a rapidly growing field. By the end of 2020, an estimated 30 billion IoT devices were connected to the Internet. By 2025, these devices are expected to generate nearly 80 zettabytes of data (80 trillion gigabytes). That’s an enormous amount of data!
✅ Research this: How much of the data generated by IoT devices is actually used, and how much is wasted? Why is so much data ignored?
This data is central to IoT’s success. To excel as an IoT developer, you need to understand what data to collect, how to collect it, how to make decisions based on it, and how to use those decisions to interact with the physical world when necessary.
IoT devices
The T in IoT stands for Things—devices that interact with the physical world by collecting data through sensors or performing actions via actuators.
Devices designed for production or commercial use, such as fitness trackers or industrial machine controllers, are typically custom-built. They use specialized circuit boards and processors tailored to specific tasks, whether it’s being compact enough to fit on a wrist or durable enough to withstand harsh factory conditions.
As a developer learning about IoT or prototyping a device, you’ll start with a developer kit. These are general-purpose IoT devices designed for experimentation, often featuring capabilities not found in production devices, such as external pins for connecting sensors or actuators, debugging tools, or extra resources that would be unnecessary in mass production.
Developer kits generally fall into two categories: microcontrollers and single-board computers. We’ll introduce both here and explore them in more detail in the next lesson.
💁 Your smartphone can also be considered a general-purpose IoT device, with built-in sensors and actuators. Different apps use these components in various ways, often connecting to cloud services. Some IoT tutorials even use a phone app as the IoT device.
Microcontrollers
A microcontroller (MCU) is a small computer that includes:
🧠 One or more central processing units (CPUs) to run your program
💾 Memory (RAM and program memory) to store your program, data, and variables
🔌 Programmable input/output (I/O) connections to interact with external devices like sensors and actuators
Microcontrollers are cost-effective, with prices for custom hardware versions averaging around $0.50, and some as low as $0.03. Developer kits start at about $4, with prices increasing as features are added. The Wio Terminal, a microcontroller developer kit from Seeed Studios, costs around $30 and includes sensors, actuators, WiFi, and a screen.
💁 When searching for microcontrollers online, be cautious with the term MCU, as it often brings up results for the Marvel Cinematic Universe instead of microcontrollers.
Microcontrollers are designed for specific tasks rather than general-purpose computing. You typically can’t connect a monitor, keyboard, or mouse to use them like a PC or Mac.
Developer kits often include built-in sensors and actuators, such as LEDs or temperature sensors, and may support wireless connectivity like Bluetooth or WiFi.
💁 Microcontrollers are usually programmed in C/C++.
Single-board computers
A single-board computer is a compact device that functions as a complete computer on a single board. These devices are similar to desktop or laptop PCs but are smaller, consume less power, and are much cheaper.
The Raspberry Pi is one of the most popular single-board computers.
Unlike microcontrollers, single-board computers include features like graphics chips for connecting monitors, audio outputs, and USB ports for peripherals like keyboards, mice, webcams, or external storage. Programs and operating systems are stored on SD cards or hard drives instead of built-in memory chips.
🎓 Think of a single-board computer as a smaller, cheaper version of your PC or Mac, with added GPIO (general-purpose input/output) pins for interacting with sensors and actuators.
Single-board computers are versatile and can be programmed in any language. IoT projects often use Python.
Hardware choices for the rest of the lessons
The upcoming lessons include assignments that involve using an IoT device to interact with the physical world and communicate with the cloud. You can choose from three options: an Arduino (using a Seeed Studios Wio Terminal), a physical single-board computer (like a Raspberry Pi 4), or a virtual single-board computer running on your PC or Mac.
You can find details about the required hardware in the hardware guide.
💁 You don’t need to buy IoT hardware to complete the assignments; everything can be done using a virtual single-board computer.
Your choice of hardware depends on what’s available to you and which programming language you prefer or want to learn. Both hardware options use the same sensor ecosystem, so you can switch between them without replacing most of the components. The virtual single-board computer simulates a Raspberry Pi, and most of the code can be transferred to a physical Pi if you decide to get one later.
Arduino developer kit
If you want to learn microcontroller development, you can use an Arduino device for the assignments. A basic understanding of C/C++ is required, as the lessons will focus on code relevant to the Arduino framework, sensors, actuators, and cloud libraries.
The assignments will use Visual Studio Code with the PlatformIO extension for microcontroller development. If you’re experienced with the Arduino IDE, you can use it, but instructions won’t be provided.
Single-board computer developer kit
If you prefer IoT development with single-board computers, you can use a Raspberry Pi or a virtual device on your PC or Mac.
A basic understanding of Python is required, as the lessons will focus on code relevant to the sensors, actuators, and cloud libraries.
💁 Want to learn Python? Check out these video series:
The assignments will use Visual Studio Code.
If you’re using a Raspberry Pi, you can either run it with the full desktop version of Raspberry Pi OS and code directly on the Pi using VS Code for Raspberry Pi OS, or run it as a headless device and code from your PC or Mac using the Remote SSH extension.
If you choose the virtual device option, you’ll code directly on your computer. Instead of physical sensors and actuators, you’ll use a tool to simulate hardware, providing sensor values and displaying actuator results on screen.
Set up your device
Before you start programming your IoT device, you’ll need to complete some setup. Follow the instructions for your chosen device. 💁 If you don't have a device yet, check out the hardware guide to help you decide which device to use and what additional hardware you might need to buy. Purchasing hardware is not necessary, as all the projects can be executed on virtual hardware. These instructions include links to third-party websites from the creators of the hardware or tools you will be using. This ensures you always have access to the most up-to-date instructions for the various tools and hardware.
Follow the relevant guide to set up your device and complete a 'Hello World' project. This will be your first step in creating an IoT nightlight over the course of four lessons in this introductory section.
✅ You will be using VS Code for both Arduino and single-board computers. If you haven't used it before, you can learn more about it on the VS Code site.
Applications of IoT
IoT spans a wide range of use cases across several broad categories:
- Consumer IoT
- Commercial IoT
- Industrial IoT
- Infrastructure IoT
✅ Do a little research: For each of the areas described below, find one specific example that isn't mentioned in the text.
Consumer IoT
Consumer IoT refers to IoT devices that people purchase and use in their homes. Some of these devices are incredibly useful, such as smart speakers, smart heating systems, and robotic vacuum cleaners. Others are less practical, like voice-controlled faucets that become difficult to turn off because the voice control can't hear you over the sound of running water.
Consumer IoT devices empower people to do more in their environments, especially the 1 billion individuals living with disabilities. Robotic vacuum cleaners can help people with mobility challenges maintain clean floors, voice-controlled ovens enable those with limited vision or motor skills to operate their ovens using only their voice, and health monitors allow patients to track chronic conditions with more frequent and detailed updates. These devices are becoming so common that even young children use them daily—for instance, students engaged in virtual learning during the COVID pandemic used smart home devices to set timers for schoolwork or alarms for upcoming class meetings.
✅ What consumer IoT devices do you have on you or in your home?
Commercial IoT
Commercial IoT involves the use of IoT in workplaces. In offices, occupancy sensors and motion detectors can manage lighting and heating, ensuring these systems are only active when needed, which reduces costs and carbon emissions. In factories, IoT devices can monitor safety hazards, such as workers not wearing hard hats or noise levels reaching dangerous thresholds. In retail, IoT devices can track the temperature of cold storage, alerting shop owners if a fridge or freezer goes outside the required range, or monitor shelf inventory to direct employees to restock items. The transportation industry increasingly relies on IoT to track vehicle locations, monitor mileage for road usage fees, ensure driver compliance with hours and breaks, or notify staff when a vehicle is approaching a depot for loading or unloading.
✅ What commercial IoT devices do you have in your school or workplace?
Industrial IoT (IIoT)
Industrial IoT, or IIoT, refers to the use of IoT devices to manage and control machinery on a large scale. This includes applications in factories and digital agriculture.
Factories use IoT devices in various ways. Sensors can monitor machinery for temperature, vibration, and rotation speed. This data can be used to shut down machines if they exceed certain limits—for example, if they overheat. Additionally, this data can be analyzed over time for predictive maintenance, where AI models identify patterns leading to failures and predict future issues before they occur.
Digital agriculture is vital for feeding the growing global population, especially the 2 billion people in 500 million households who rely on subsistence farming. Digital agriculture can range from inexpensive sensors to large-scale commercial setups. Farmers can start by monitoring temperatures and using growing degree days to predict harvest times. Soil moisture sensors can be connected to automated irrigation systems to provide plants with just the right amount of water, avoiding both drought and waste. Advanced setups include drones, satellite data, and AI to monitor crop growth, disease, and soil quality across vast areas of farmland.
✅ What other IoT devices could benefit farmers?
Infrastructure IoT
Infrastructure IoT involves monitoring and managing local and global infrastructure that people use daily.
Smart Cities are urban areas that use IoT devices to collect data and improve city operations. These cities often involve collaborations between local governments, academia, and businesses, tracking and managing aspects like transportation, parking, and pollution. For example, in Copenhagen, Denmark, air pollution is a major concern for residents, so it is measured, and the data is used to provide information on the cleanest cycling and jogging routes.
Smart power grids use IoT to analyze power demand by collecting usage data at the household level. This data can inform decisions at a national level, such as where to build new power stations, and at a personal level, offering insights into individual power usage patterns and suggestions for cost savings, like charging electric vehicles at night.
✅ If you could add IoT devices to measure anything in your area, what would it be?
Examples of IoT devices you may have around you
You might be surprised by how many IoT devices are around you. Writing this from home, I have the following devices connected to the Internet with smart features like app control, voice control, or the ability to send data to my phone:
- Multiple smart speakers
- Fridge, dishwasher, oven, and microwave
- Electricity monitor for solar panels
- Smart plugs
- Video doorbell and security cameras
- Smart thermostat with multiple smart room sensors
- Garage door opener
- Home entertainment systems and voice-controlled TVs
- Lights
- Fitness and health trackers
All these devices have sensors and/or actuators and connect to the Internet. For example, I can check from my phone whether my garage door is open and ask my smart speaker to close it. I can even set it to close automatically at night if it's still open. When my doorbell rings, I can see who's there on my phone, no matter where I am, and talk to them through the doorbell's built-in speaker and microphone. I can monitor my blood glucose, heart rate, and sleep patterns, using the data to improve my health. I can control my lights via the cloud, though I sit in the dark when my Internet connection goes down.
🚀 Challenge
List as many IoT devices as you can find in your home, school, or workplace—you might discover more than you expect!
Post-lecture quiz
Review & Self Study
Research the benefits and drawbacks of consumer IoT projects. Look for news articles about instances where IoT has failed, such as privacy concerns, hardware issues, or problems caused by lack of connectivity.
Some examples:
- Check out the Twitter account Internet of Sh*t (profanity warning) for examples of consumer IoT failures.
- c|net - My Apple Watch saved my life: 5 people share their stories
- c|net - ADT technician pleads guilty to spying on customer camera feeds for years (trigger warning - non-consensual voyeurism)
Assignment
Disclaimer:
This document has been translated using the AI translation service Co-op Translator. While we aim for accuracy, please note that automated translations may include errors or inaccuracies. The original document in its native language should be regarded as the authoritative source. For critical information, professional human translation is advised. We are not responsible for any misunderstandings or misinterpretations resulting from the use of this translation.