Chapter 15. The Internet of Things
15.0 Introduction
The Internet of Things (IoT) is the rapidly growing network of devices (things) connected to the Internet. That doesn’t just mean more and more computers using browsers, but actual appliances and wearable and portable technology. This includes all sorts of home automation from smart appliances and lighting, to security systems and even Internet-operated pet feeders, as well as lots of less practical but fun projects.
In this chapter, you will learn how your Raspberry Pi can participate in the Internet of Things in various ways.
15.1 Controlling GPIO Outputs Using a Web Interface
Problem
You want to control GPIO outputs using a web interface to your Raspberry Pi.
Solution
Use the bottle
Python web server library (Recipe 7.17) to create an HTML web interface to control the GPIO port.
To make this recipe, you will need:
-
Breadboard and jumper wires (see “Prototyping Equipment”)
-
Three 1kΩ resistors (see “Resistors and Capacitors”)
-
Three LEDs (see “Opto-Electronics”)
-
Tactile push switch (see “Miscellaneous”)
The breadboard layout for this is shown in Figure 15-1.
An alternative to using a breadboard is to attach a Raspberry Squid and Squid Button (see Recipe 9.10 and Recipe 9.11). These can be plugged directly into the GPIO pins of the Raspberry ...
Get Raspberry Pi Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.