Book Image

Raspberry Pi Home Automation with Arduino

By : Andrew K. Dennis
Book Image

Raspberry Pi Home Automation with Arduino

By: Andrew K. Dennis

Overview of this book

<p>Low-cost and high-performing, with a massively diverse range of uses and applications, the Raspberry Pi is set to revolutionize the way we think about computing and programming. By combining the Raspberry Pi with an Arduino board you'll be able to revolutionize the way you interact with your home and become part of a rapidly growing group of hobbyists and enthusiasts.</p> <p>This essential reference will guide you through a series of exciting projects that will allow you to automate your very own home. With easy-to-follow, step-by-step examples, diagrams, and explanations you will not only find it incredibly productive but also highly engaging and informative.</p> <p>Assuming no prior knowledge, our detailed practical examples will guide you through building hardware and software solutions using the Raspberry Pi and Arduino. You will learn how you can use thermistors and relays to keep cool and stay in the shade whilst also utilizing electrical motors and photoresistors. These meticulously designed tutorials will form the basis of automating your entire home and getting you started with dozens of potential projects.</p>
Table of Contents (17 chapters)
Raspberry Pi Home Automation with Arduino
Credits
About the Author
Acknowledgement
About the Reviewer
www.PacktPub.com
Preface
3
Getting Started Part 2 – Setting up Your Raspberry Pi to Arduino Bridge Shield
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 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.

What this book covers

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.

What you need for this book

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.

Who this book is for

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.

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 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".

Note

Warnings or important notes appear in a box like this.

Tip

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 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

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.