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 the topic and building their own projects.
With the introduction of the Raspberry Pi computer in 2012, a small and powerful tool is now available to the home automation enthusiast, programmer, and electronic hobbyist that allows them to augment their home with sensors and software.
Combining the Raspberry Pi with the power of the open source Arduino platform, this book will walk you through several projects for building electronic sensors and introduce you to software that will record this data for later use.
Chapter 1, An Introduction to the Raspberry Pi, Arduino, and Home Automation, introduces you to the technologies used in this book and provides a background to the world of home automation.
Chapter 2, Getting Started Part 1 – Setting up Your Raspberry Pi, teaches you about the Raspberry Pi and how to set it up, ready to use on your projects.
Chapter 3, Getting Started Part 2 – Setting up Your Raspberry Pi to Arduino Bridge Shield, provides you with a guide to setting up your Raspberry Pi to Arduino bridge shield and downloading the necessary libraries.
Chapter 4, Our First Project – A Basic Thermometer, helps you to build a thermometer and introduces you to a variety of electronic components.
Chapter 5, From Thermometer to Thermostat – Building upon Our First Project, expands upon our Thermometer project, turning it into a working thermostat that can switch relays on and off.
Chapter 6, Temperature Storage – Setting up a Database to Store Your Results, explores storing data output from your Thermostat, and then accessing it via a web browser.
Chapter 7, Curtain Automation – Open and Close the Curtains Based on the Ambient Light, teaches you how to integrate motors into your projects for opening and closing blinds and curtains, using the skills learned in previous chapters.
Chapter 8, Wrapping up, provides an overview of other technologies you can use in your project and a look towards the future of home automation.
Appendix, References, lists a collection of links pointing you towards the resources used in this book and other interesting information.
For this book, you will need the following components and software:
A computer running Mac OS X, Windows, or Linux
A Raspberry Pi computer
An SD card
HDMI cable
Access to an HDMI television or HDMI computer monitor
A USB keyboard and mouse
USB power supply for the Raspberry Pi
Cooking Hacks Raspberry Pi to Arduino bridge shield
Electronics breadboard
10K resistor
Thermistor
Photo resistor
Jumper wires with male connectors
An LED
9V DC motor
9V battery with connector for screw terminals
Arduino Motorshield
A soldering iron
A desoldering iron/gun
Other software required for the projects in this book will be downloaded from the Internet with step-by-step instructions in the relevant chapters.
This book is aimed towards the amateur home automation enthusiast who has some basic skills in programming and is looking for some simple projects to get started with. An in-depth knowledge of electronics is not required, and the book provides a step-by-step guide to setting up components and software in each chapter.
No prior knowledge of the Linux operating system or the Raspberry Pi is needed, although exposure to these technologies will certainly be helpful.
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 an explanation of their meaning.
Code words in text are shown as follows: "The previous program contains two functions, void setup()
and void loop()
."
A block of code is set as follows:
void setup(void) { printf("Starting up thermometer \n"); Wire.begin(); }
Any command-line input or output is written as follows:
mkdir arduPi cd arduPi
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Select the Accessories option from the menu".
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 <[email protected]>
, 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.
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.
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.
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 would 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/support, 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 on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
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 <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]>
if you are having a problem with any aspect of the book, and we will do our best to address it.