O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Raspberry Pi 3 Home Automation Projects

Book Description

?With futuristic homes on the rise, learn to control and automate the living space with intriguing IoT projects.?

About This Book

  • Build exciting (six) end-to-end home automation projects with Raspberry Pi 3,
  • Seamlessly communicate and control your existing devices and build your own home automation system,
  • Automate tasks in your home through projects that are reliable and fun

Who This Book Is For

This book is for all those who are excited about building home automation systems with Raspberry Pi 3. It's also for electronic hobbyists and developers with some knowledge of electronics and programming.

What You Will Learn

  • Integrate different embedded microcontrollers and development boards like Arduino, ESP8266, Particle Photon and Raspberry Pi 3, creating real life solutions for day to day tasks and home automation
  • Create your own magic mirror that lights up with useful information as you walk up to it
  • Create a system that intelligently decides when to water your garden and then goes ahead and waters it for you
  • Use the Wi-fi enabled Adafruit ESP8266 Huzzah to create your own networked festive display lights
  • Create a simple machine learning application and build a parking automation system using Raspberry Pi
  • Learn how to work with AWS cloud services and connect your home automation to the cloud
  • Learn how to work with Windows IoT in Raspberry Pi 3 and build your own Windows IoT Face Recognition door locking system

In Detail

Raspberry Pi 3 Home Automation Projects addresses the challenge of applying real-world projects to automate your house using Raspberry Pi 3 and Arduino. You will learn how to customize and program the Raspberry Pi 3 and Arduino-based boards in several home automation projects around your house, in order to develop home devices that will really rejuvenate your home.

This book aims to help you integrate different microcontrollers like Arduino, ESP8266 Wi-Fi module, Particle Photon and Raspberry Pi 3 into the real world, taking the best of these boards to develop some exciting home automation projects. You will be able to use these projects in everyday tasks, thus making life easier and comfortable.

We will start with an interesting project creating a Raspberry Pi-Powered smart mirror and move on to Automated Gardening System, which will help you build a simple smart gardening system with plant-sensor devices and Arduino to keep your garden healthy with minimal effort. You will also learn to build projects such as CheerLights into a holiday display, a project to erase parking headaches with OpenCV and Raspberry Pi 3, create Netflix's "The Switch" for the living room and lock down your house like Fort Knox with a Windows IoT face recognition-based door lock system.

By the end of the book, you will be able to build and automate the living space with intriguing IoT projects and bring a new degree of interconnectivity to your world.

Style and approach

End to end home automation projects with Raspberry Pi 3.

Table of Contents

  1. Preface
    1. What this book covers
    2. What you need for this book
    3. Who this book is for
    4. Conventions
    5. Reader feedback
    6. Customer support
      1. Errata
      2. Piracy
      3. Questions
  2. Creating a Raspberry Pi-Powered Magic Mirror
    1. What is the Raspberry Pi?
      1. Purchasing the Raspberry Pi
      2. Setting up the Raspberry Pi
    2. Moving on to the LXTerminal
      1. Basic Linux commands
      2. Helpful commands
    3. The Magic Mirror
      1. Downloading the Magic Mirror repository
      2. Installing Node.js
      3. Installing Grunt
      4. Working with the configuration file
      5. Editing the configuration file
      6. Understanding the module
      7. Installing third-party modules
    4. Summary
  3. Automated Gardening System
    1. Items required for the project
      1. Waterproof junction box
      2. Arduino Pro Mini 5v ATMEGA328P
      3. USB FTDI connector
      4. 5V power supply
      5. 5V relay
      6. Soil humidity sensor (hygrometer)
      7. Photoresistor
      8. Submersible pump
      9. Drip irrigation system
      10. Water reservoir
    2. Setting up gardening system code (reading humidity)
      1. Setting up the Arduino IDE
      2. Testing the Arduino Pro Mini
        1. Connecting the Arduino Pro Mini to the USB FTDI connector (FT232RL) and your computer
        2. Deploying your code
      3. Reading the humidity sensor
        1. Connect the humidity sensor to the Arduino Pro Mini
        2. Uploading the sketch and testing humidity measurements
      4. Connecting the pump power and control
      5. Connecting the relay to the control circuit (Arduino Pro Mini)
        1. Connecting Arduino to the relay
        2. Uploading the relay test sketch to the Arduino
      6. Triggering the pump with the hygrometer
      7. Adding another sensor (photoresistor) to optimize your gardening
        1. Connecting the photoresistor
        2. Updating the sketch to add photoresistor readings to the decision-making
    3. Connecting it all together
    4. Summary
  4. Integrating CheerLights into a Holiday Display
    1. Items required for this project
      1. Adafruit HUZZAH ESP8266 breakout
      2. USB FTDI connector
      3. WS2811 NeoPixels LED strip
      4. 5V and 3.3V (optional) power supply
      5. 1000μF capacitor
      6. Logic level shifting IC
      7. 400-600Ω resistor
      8. JST SM or JST PH connectors (optional)
    2. Getting the CheerLights code set up
      1. Set up the Arduino IDE
      2. Installing the NeoPixel library
      3. Testing the ESP8266
        1. Connect the ESP8266 Huzzah to the USB FTDI connector (FT232RL) and your computer
        2. Switching the ESP8266 Huzzah into deployment mode
        3. Deploying your code
    3. Connecting it all together
      1. Connecting the data pins
      2. Power the NeoPixels
      3. Power up the ESP8266
    4. Programming the ESP8266 Huzzah for CheerLights
      1. Let's try a simple single-color display
      2. Let's try some interesting modifications
    5. Summary
  5. Erase Parking Headaches with OpenCV and Raspberry Pi
    1. Introduction to smart parking systems
    2. Sensor devices for smart parking
      1. Presence sensor
      2. Ultrasonic sensor 
      3. Camera
      4. Configure the camera
      5. Accessing our Raspberry Pi via SSH
    3. Machine vision systems
      1. Introduction to machine vision
      2. Testing the camera
      3. Installing OpenCV on the Raspberry Pi
      4. Detecting the vehicle plate number
      5. OpenALPR
      6. Integrating the library
        1. Programming the script for Python
      7. Cloud API
      8. PHP REST API script for OpenALPR
      9. Architecture of the parking system
    4. Logging spaces in a database
      1. Configuring a MySQL database server
      2. Installing MySQL
      3. Installing the MySQL driver for PHP
      4. Testing PHP and MySQL
      5. Installing phpMyAdmin for administrating databases
      6. Configuring the Apache server
      7. Entering the phpMyAdmin remote panel
      8. Integrating the Raspberry Pi and camera into the database
      9. Programming the script software
      10. Node Express app for openALPR
    5. Amazon Web Services IoT
      1. AWS IoT components
      2. Accessing AWS IoT
      3. Services
      4. Setting up the Raspberry Pi with AWS IoT
      5. AWS IoT connections
    6. Integrating the system
      1. Future parking systems
    7. Summary
  6. Building Netflix's The Switch for the Living Room
    1. Setting up the Particle Photon
      1. Getting started
      2. What's in the box?
      3. The architecture of the Particle Photon
      4. Requirements
        1. Software
        2. Hardware
        3. Wi-Fi settings
      5. Specifications of the board
      6. Connecting your Particle Photon to the internet using the setup web application
      7. Blinking an LED
        1. Hardware
        2. Software
        3. Testing the code
    2. Hardware and software requirements
      1. Hardware configuration
    3. The architecture of the home automation system
    4. Reading IR signals
      1. Sensor IR receiver
      2. Hardware connections
      3. Code to read IR signals
    5. Programming the button
      1. Testing the code for remote control for a Netflix TV
      2. Testing the code for a Philips TV
    6. Assembling the electronics
      1. The circuit to be built
      2. The final circuit
      3. The circuit layout
    7. Controlling smart lights
      1. Getting started
        1. Step 1
        2. Step 2
        3. Step 3
      2. The Philips Hue API
      3. Turning a light on or off
      4. Changing the intensity of the lights
    8. Sending notifications with IFTTT
      1. Parts of an IFTTT
      2. Enabling sensors with Particle Photon
      3. Creating the IFTTT applet
      4. Sending notifications
    9. Future ideas for projects
    10. Summary
  7. Lock Down with a Windows IoT Face Recognition Door System
    1. Getting started: Installing and configuring Windows 10 IoT on the Raspberry Pi 3
      1. Preparation
        1. Installing Windows 10 Desktop
        2. Getting the package to install Windows 10 IoT Core
        3. Downloading and installing Windows 10 IoT Core
      2. Deploying Windows 10 IoT Core on Raspberry Pi 3
        1. Downloading and flashing the image
        2. Connecting the board to the network
      3. Attaching the MicroSD card on Raspberry Pi 3
      4. Putting them all together
      5. Ethernet and Wi-Fi connection
    2. Installing Visual Studio
      1. Enabling the Developer Mode on Windows 10 Desktop
    3. Creating a first example
      1. Writing our first application
      2. Loading the project in Visual Studio
      3. Connecting the LED to your Windows IoT device
      4. Hardware pins
      5. Hardware connections
      6. Deploying the app
      7. Developing the code
        1. Timer code
        2. Starting GPIO pins
        3. Modify the state of a pin
      8. Running the application
    4. Applications for the Internet of Things
      1. Real-life examples of the Internet of Things
      2. Smart home devices
      3. Wireless bulbs
      4. Smart refrigerators
      5. Applications of the Raspberry Pi in the Internet of Things
      6. Media center using the Raspberry Pi 3
      7. Cloud storage using Raspberry Pi 3
      8. Tracker using Raspberry Pi 3
      9. Web server using Raspberry Pi 3
      10. Gateway for Bluetooth devices using Raspberry Pi 3
    5. The architecture of the security system
      1. Materials required
      2. Hardware connections
      3. Initial setup
      4. Software required
      5. Software setup
      6. Software development
      7. Running the interface
      8. Integrating the system and putting it all together
    6. Future ideas
    7. Summary