Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Raspberry Pi Home Automation with Arduino - Second Edition
Raspberry Pi Home Automation with Arduino - Second Edition

Raspberry Pi Home Automation with Arduino - Second Edition: Unleash the power of the most popular microboards to build convenient, useful, and fun home automation projects , Second Edition

eBook
$13.98 $19.99
Paperback
$32.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Raspberry Pi Home Automation with Arduino - Second Edition

Chapter 2. Getting Started – Setting Up Your Raspberry Pi and Arduino

This chapter aims to provide a quick overview on setting up the Raspberry Pi and Arduino. In order to use your Raspberry Pi, you need to start by installing an operating system on an SD card. Once this is in place, you can install extra software to write code.

Setting the up Arduino is much simpler. All you need is to download the IDE and plug the Arduino into your computer via a USB cable. We will start this chapter by walking through the Raspberry Pi setup.

The SD card – our Raspberry Pi's storage device

A secure digital (SD) card is a form of a portable, high-performance storage medium available for electronic devices ranging from cameras to PCs.

The Raspberry Pi comes equipped with an SD card slot, allowing us to insert an SD card and use it as our device's main storage mechanism, much like a hard disk on a PC. While you can use other storage mechanisms such as a USB drive or USB external hard drive, the SD card is small and thus lends itself better to embedded devices such as those found in home automation projects.

There are various brands of SD cards in the market, and they come in a wide range of sizes. The Raspberry Pi supports larger SD cards such as those with 64 GB of storage space. For the projects in this book, you should be using a card with a minimum of 2 GB storage.

Note

The official Raspberry Pi website provides a handy guide to SD cards, at http://www.raspberrypi.org/documentation/installation/sd-cards.md.

We...

Preinstalled SD card versus a blank SD card

Since the Raspberry Pi was released, a number of websites have been offering preloaded SD cards that come installed with one of the operating systems that are available for the Raspberry Pi. These are a good option for amateur enthusiasts looking to get started with the Raspberry Pi, who do not want to go through the setup process and are happy with a single, preloaded operating system.

Note

The official Raspberry Pi store sells a preinstalled card. You can find it at http://swag.raspberrypi.org/products/noobs-8gb-sd-card, preinstalled with New Out Of the Box Software (Noobs).

Another option is to purchase a blank SD card and follow the instructions in this chapter.

With this in mind though, if you do not have a home PC or Mac to use in order to format a blank SD card, we recommend purchasing a preformatted card. This should come loaded with the Debian Wheezy Raspbian OS, as this is the version of Linux we will be using throughout the book.

A note on Noobs

Noobs is an operating system installation manager that you can add to your SD card. It makes the setup of your Raspberry Pi simple and provides you with an option to try out different operating systems.

If you decide to try out Noobs, we recommend selecting Raspbian in order to follow along with the examples in this book.

Note

The Raspberry Pi website provides an introduction and guide to Noobs at http://www.raspberrypi.org/help/noobs-setup/. You can also download Noobs from http://www.raspberrypi.org/downloads/.

If you have not installed Raspbian via Noobs, then keep reading. Otherwise, you can jump directly to the Raspberry Pi SSH setup section later in this chapter.

Downloading Raspbian

The download links for the Raspbian operating system can be found on the Raspberry Pi download page, at http://www.raspberrypi.org/downloads/.

There are a couple of options with regards to the method of downloading this file: over a torrent or as a ZIP file.

Once the file is downloaded, you can move on to the steps to set up the SD card and install the operating system.

Setting up the SD card and installing Raspbian

Installing an operating system is a two-step process. This involves formatting the SD card to the FAT filesystem format, and copying and pasting the image to the card.

File Allocation Table (FAT) is a method used for recording which sectors of a disk files are stored in and which sectors are free to be written to. It has its origins in the 1970s, when Bill Gates and Marc McDonald developed it for use on floppy disks. Due to its robustness and simplicity, it is still found on SD cards today and is the format we will need in order to install Raspbian.

When you purchase an SD card, you might notice that it is already formatted to FAT, as this format is popular with devices such as digital cameras. Many manufacturers ship the card so that it is ready to go out of the box and no further formatting is required. However, we recommend formatting your card if you did not purchase the official SD card.

To format and copy the downloaded Raspbian image to...

Arduino

Our first task is to install the Arduino IDE. The Arduino IDE is where we will write the code and upload it to the microcontroller.

Note

This piece of software can be found at http://arduino.cc/en/main/software.

Here, you will find the installation instructions for your operating system, including Linux, Windows, and Mac OS X. It is also possible to install the Arduino IDE directly on the Raspberry Pi. The following instructions will provide an overview of this process.

Installing the IDE on your Raspberry Pi

If you wish to install the IDE directly on your Raspberry Pi, you can do this via the command line. This will be necessary if you don't have a second computer on which you can install the Arduino IDE.

Once you have the Terminal window open, type the following command:

sudo apt-get install arduino

Accept any prompt that appears on the screen. The installation takes up about 81 MB of space.

Now that the installation is complete, you will be able to open the Arduino IDE on your Raspberry...

The SD card – our Raspberry Pi's storage device


A secure digital (SD) card is a form of a portable, high-performance storage medium available for electronic devices ranging from cameras to PCs.

The Raspberry Pi comes equipped with an SD card slot, allowing us to insert an SD card and use it as our device's main storage mechanism, much like a hard disk on a PC. While you can use other storage mechanisms such as a USB drive or USB external hard drive, the SD card is small and thus lends itself better to embedded devices such as those found in home automation projects.

There are various brands of SD cards in the market, and they come in a wide range of sizes. The Raspberry Pi supports larger SD cards such as those with 64 GB of storage space. For the projects in this book, you should be using a card with a minimum of 2 GB storage.

Note

The official Raspberry Pi website provides a handy guide to SD cards, at http://www.raspberrypi.org/documentation/installation/sd-cards.md.

We will now look at the...

Left arrow icon Right arrow icon

Description

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

Who is this book for?

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

What you will learn

  • Set up the Raspberry Pi and the Cooking Hacks Arduino bridge shield
  • Work with electronic components to build small circuits
  • Develop applications that interact with your circuits
  • Use thermistors, FSRs, and photoresistors to monitor and control your surroundings
  • Communicate with your Raspberry Pi from an Arduino Uno via Ethernet
  • Send yourself email updates when a parcel arrives at your home
  • Control your own mains power with a relay shield and even connect a motor to your Raspberry Pi
  • Build a device that checks for damp/flooding using the Arduino bridge shield and Raspberry Pi

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 25, 2015
Length: 148 pages
Edition : 2nd
Language : English
ISBN-13 : 9781784393939
Vendor :
Raspberry Pi
Category :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Feb 25, 2015
Length: 148 pages
Edition : 2nd
Language : English
ISBN-13 : 9781784393939
Vendor :
Raspberry Pi
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 110.97
Raspberry Pi Home Automation with Arduino - Second Edition
$32.99
Raspberry Pi Android Projects
$38.99
Building a Home Security System with Raspberry Pi
$38.99
Total $ 110.97 Stars icon

Table of Contents

10 Chapters
1. An Introduction to the Raspberry Pi, Arduino, and Home Automation Chevron down icon Chevron up icon
2. Getting Started – Setting Up Your Raspberry Pi and Arduino Chevron down icon Chevron up icon
3. Central Air and Heating Thermostat Chevron down icon Chevron up icon
4. Temperature Storage – Setting Up a Database to Store Your Results Chevron down icon Chevron up icon
5. Parcel Delivery Detector Chevron down icon Chevron up icon
6. Curtain Automation – Open and Close the Curtains Based on the Ambient Light Chevron down icon Chevron up icon
7. Water/Damp Detection – Check for Damp/Flooding in Sheds and Basements Chevron down icon Chevron up icon
8. Wrapping Up Chevron down icon Chevron up icon
A. References Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
(5 Ratings)
5 star 40%
4 star 0%
3 star 0%
2 star 40%
1 star 20%
Francis Perea Jun 03, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A really practical book, plenty of interesting projects even connected to the cloud. A must read if you are interested in home automation nowadays. Even better than the first edition.
Amazon Verified review Amazon
nhevilwench Apr 23, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Raspberry Pi Home Automation with Arduino Second edition is an updated version of the original book.I purchased the original a while back when it was one of the few books tackling the subject and worked through the projects, so was interested to see what the new edition contained. I have both the paperback and Kindle edition. I found it easier to read the Kindle edition on a monitor while working with the Arduino IDE. It's also a lot cheaper.Unlike the first edition we are also introduced to using the Arduino Uno. I found this to be a really great addition as truly provides a guide to using an Arduino Microcontroller with the RPI.As with the 1st edition is one of Packt's shorter format books (approx. 150 pages) geared towards beginners.Like the original, the book starts off with an introduction to Home Automation to give you a flavor of what can be done.Following this in Chapter 2. we learn how to setup our Pi, Arduino and connection bridge. Compared to the first edition, this chapter is far more concise and points the reader in the direction of locations where they can get apps like NOOBs to speed up the install process. Also removed from this chapter was the information on Berryboot, which I had used originally to setup my Pi.Chapter 3. guides the reader through setting up a thermostat that can interact with an HVAC system and finishes up with creating some code that outputs the temperature data. This acts as a lead in for Chapter 4. We are also given some ideas on how to expand the device using other components such as a potentiometer.In Chapter 4. we setup our Raspberry Pi to pull data from the Arduino and store it into an SQLite DB. The setup of the Raspberry Pi is the start of building a central device that the Arduino projects in the book will interact with.Following this we install HTSQL (as with the first edition) in order to be able to query the temperature data from a web browser. This is a nice touch and I am glad they included it in the second edition.Chapter 5 combines some of the techniques from Chapters 3 and 4 in order to build a parcel detection device using an Arduino that communicates with the Raspberry Pi. The end of the chapter also provides a guide to hooking in the device to using some of the parcel delivery services APIs for providing a better view of what has been delivered.Following this in Chapter 6 we learn how to build a curtain control device using the Raspberry Pi and Cooking Hacks bridge shield. This chapter was particularly useful for me as I have a number of Raspberry Pi's.Based upon the chapters so far I was able to build out a thermostat and parcel delivery device using a couple of Uno boards and cheap components. However in this chapter I also got to re-use a PI from my cluster and the Cooking Hacks shield I purchased with the first edition.On finishing the chapter I now had a small network of 2 Arduino's and 2 RPI's, with one acting as the central "brain" of the system.Chapter 7 contained some projects that were not in the original edition. Here we learn how to build our a damp and water detection device, that can communicate with the RPI.By the end of chapter 7 I had a pretty neat little system working.Chapter 8 like the first edition was a wrapping up chapter with ideas for other projects to expand the system.Conclusion:This was a great improvement over the first edition. It had more projects in and some updates to the originals. I would recommend purchasing this over the first edition as it also contains updates to the code to work with the new version of the arduPi library.Pros:1. Great projects2. Working "system" by the end of the book3. Great for re-using existing components, both RPI and Arduino if you have them4. Simple to follow5. Lots of ideas in each chapter for expanding the systemCons1. Paperback edition is expensive2. More chapters would be nice
Amazon Verified review Amazon
K.Peck Jan 23, 2018
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Not as advanced as I expected. Spent 10 minutes with it and now it will sit on my shelf. Oh well...
Amazon Verified review Amazon
leonardo bandiera Apr 26, 2016
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Non il massimo molto generico mi aspettavo qualcosa di più concreto e più progettuale.Non adeguato per un target tecnico.
Amazon Verified review Amazon
Adam Apr 21, 2015
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
This book is junk. Save your money and watch youtube. This is nothing more than a collection of tutorials on driving a motor and reading a sensor with Arduino. And just so we can say we used a Raspberry PI in the book, we'll use it to query the Arduino to get the reading from its sensor. There are only a handful of very basic projects with minimal real application. The author does not look at integrating with any of the major existing home automation frameworks nor does he even attempt to develop his own.The title of this book encompasses material that could fill thousands of pages. We could be monitoring and graphing power usage of the home and analyzing the data based on time of day, time of year and outside temperatures. We could be creating touch screen interfaces with Raspberry Pi's to act as control consoles throughout the house. We could be discussing random operation of power outlets and light switches to simulate someone being home and deterring burglars.But instead, the book wastes pages on the history of the devices and basic setup like installing Raspian on the Pi and downloading the Arduino IDE. Really? because there aren't already a million other books and free tutorials that cover this.This book is just trying to ride the popularity wave of these devices and adds absolutely no value to a market that is already over saturated with this material.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.