Book Image

Internet of Things Programming Projects

By : Colin Dow
Book Image

Internet of Things Programming Projects

By: Colin Dow

Overview of this book

The Internet of Things (IOT) has managed to attract the attention of researchers and tech enthusiasts, since it powerfully combines classical networks with instruments and devices. In Internet of Things Programming Projects, we unleash the power of Raspberry Pi and Python to create engaging projects. In the first part of the book, you’ll be introduced to the Raspberry Pi, learn how to set it up, and then jump right into Python programming. Then, you’ll dive into real-world computing by creating a“Hello World” app using flash LEDs. As you make your way through the chapters, you’ll go back to an age when analog needle meters ruled the world of data display. You’ll learn to retrieve weather data from a web service and display it on an analog needle meter, and build a home security system using the Raspberry Pi. The next project has a modern twist, where we employ the Raspberry Pi to send a signal to a web service that will send you a text when someone is at the door. In the final project, you take what you've learned from the previous two projects and create an IoT robot car that you can use to monitor what your pets are up to when you are away. By the end of this book, you will be well versed in almost every possible way to make your IoT projects stand out.
Table of Contents (21 chapters)

To get the most out of this book

To get the most out of this book, I will assume the following:

  • You have purchased, or will purchase, a Raspberry Pi Computer, preferably a 2015 model or newer.
  • You have had some exposure to the Python programming language, or are eager to learn it.
  • You have a basic familiarity with electronic components and how to use a breadboard.
  • You have purchased, or are willing to purchase, basic electronic components.

In terms of hardware requirements, you will need at least the following:

  • A Raspberry Pi Model 3 (2015 model or newer)
  • A USB power supply
  • A computer monitor
  • A USB keyboard
  • A USB mouse
  • A microSD RAM card
  • A breadboard and breadboard jumpers

Additional pieces of hardware will be introduced at the beginning of every chapter.

In terms of software requirements, you will require the Raspberry Pi NOOBS image (https://www.raspberrypi.org/downloads/noobs/). Additional software, accounts, and Python packages will be presented along the way. Any piece of software, web service, or Python package we use in this book is free of charge.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Internet-of-Things-Programming-Projects. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "In order to access Python 3, we type the python3 command in a Terminal window."

A block of code is set as follows:

wind_dir_str_len = 2
if currentWeather.getWindSpeed()[-2:-1] == ' ':
wind_dir_str_len = 1

Any command-line input or output is written as follows:

pip3 install weather-api

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "From the View menu, select Object inspector and Variables."

Warnings or important notes appear like this.
Tips and tricks appear like this.