Book Image

Raspberry Pi Home Automation with Arduino - Second Edition

By : Andrew K. Dennis
Book Image

Raspberry Pi Home Automation with Arduino - Second Edition

By: Andrew K. Dennis

Overview of this book

Table of Contents (16 chapters)
Raspberry Pi Home Automation with Arduino Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
4
Temperature Storage – Setting Up a Database to Store Your Results
Index

Preface

The world of home automation is an exciting field that has exploded over the past few years with many new technologies in both the commercial and open source worlds. This book provides a gateway for those interested in learning more about this topic and building their own projects.

With the introduction of the Raspberry Pi computer in 2012, a small and powerful tool is now available for the home automation enthusiast, programmer, and electronic hobbyist. It allows them to augment their home with sensors and software.

Combining Raspberry Pi with the power of the open-hardware Arduino platform, this book will take you through several projects in which you will build electronic sensors, and introduce you to software that will record their data for later use.

We hope you will enjoy the second edition of Raspberry Pi Home Automation with Arduino.

What this book covers

Chapter 1, An Introduction to the Raspberry Pi, Arduino, and Home Automation, introduces the technologies used in the book and provides a conceptual background to the world of home automation.

Chapter 2, Getting Started – Setting Up Your Raspberry Pi and Arduino, is a guide to your Raspberry Pi, Arduino, and the Cooking Hacks Raspberry Pi to Arduino bridge shield.

Chapter 3, Central Air and Heating Thermostat, teaches you how to build a thermostat using the Arduino platform to control your central air conditioning and heating.

Chapter 4, Temperature Storage – Setting Up a Database to Store Your Results, shows you how to build a database to store your projects' data, and explore it via your web browser.

Chapter 5, Parcel Delivery Detector, demonstrates a system using Arduino and Raspberry Pi that will alert you whenever a parcel arrives at your door.

Chapter 6, Curtain Automation – Open and Close the Curtains Based on the Ambient Light, teaches you how to integrate motors with your projects to open and close blinds and curtains using the skills learned in previous chapters.

Chapter 7, Water/Damp Detection – Check for Damp/Flooding in Sheds and Basements, helps you build systems that can check for humidity and water to indicate dampness and flooding.

Chapter 8, Wrapping Up, finishes the topic with some ideas for future projects.

Appendix, References, lists a collection of links to the resources used in this book and other interesting information.

What you need for this book

  • Raspberry Pi (version B+)

  • A SD card

  • Ardunio Uno

  • A Seeed Ethernet shield

  • Cooking Hacks' Raspberry Pi to Arduino bridge shield

  • An Arduino motor shield

  • A Pololu relay module

  • An AM2302 combined thermistor/humidity sensor

  • An LED

  • A Seeed Grove Water sensor

  • A 10K ohm resistor

  • A force resistor sensor

  • A 9V or 12V DC motor

  • A breadboard

  • Breadboard wires and power supply

  • USB cables

  • A Cat-5 Ethernet cable

  • An Internet connection with a home modem or router

  • A small electric fan

  • A small wooden disc to wrap blind cords around

  • Soldering iron or a gun with solder (optional)

  • A Windows, Mac, or Linux-based machine (optional)

  • A television or monitor with HDMI or S-video (optional)

  • A USB keyboard, USB mouse, cables for S-Video to HDMI conversion, and sponges (all of these are optional)

  • Tweezers and cable strippers (optional)

Who this book is for

If you are new to Raspberry Pi, Arduino, or home automation, and you wish to develop some amazing projects using these tools, then this book is for you. Any experience in using the Linux operating system or Raspberry Pi will be an added advantage.

This book is a step-by-step guide that will help you in setting up components and software in each chapter.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and explanations of their meanings.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Once logged in, we are going to run apt-get to install SQLite3."

A block of code is set as follows:

#!/usr/bin/env python
import sqlite3
import urllib2
import json

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

cd ~
mkdir database
cd database

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "If you see the Getting darker message, try shining your flashlight on the sensor."

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.