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

What is home automation?


Having picked up this book, you may already have an idea of what home automation is, but just in case you don't, we'll give you a brief overview of the subject and the open source technology that is driving many projects out there today.

Home automation is more than just a remote control for your TV. Examples include programming your DVD to record your favorite shows, setting the AC unit to turn on when the temperature reaches 76 degrees Fahrenheit, and installing a fancy alarm system that contacts the police in case of a break-in.

Also known as domotics (a portmanteau between domestic and informatics), home automation can be summed up as a mechanism of removing as much human interaction as technically possible and desirable in various domestic processes, and replacing it with programmed electronic systems. It is essentially automation of home activities.

History of home automation

Concepts for home and building automation were around for decades before becoming a reality, and were featured in the writing of the 19th century science-fiction author H. G. Wells, comics, and cartoons such as The Jetsons. American industrialist George Westinghouse helped to pioneer the AC electrical system, which the X10 home automation standard would later run on, and in 1966, the company that bears his name, Westinghouse Electric, employed an engineer who developed what could arguably be called the first computerized home automation system—ECHO IV.

The Electronic Computing Home Operator (ECHO) was featured in the April 1968 edition of Popular Mechanics and had been expanded from a set of spare electronics, both in the physical sense and the literal sense, to include computing its founder Jim Sutherland's family household finances and storing their shopping lists, amid an array of other tasks.

Note

You can still read the original Popular Mechanics article online, at http://books.google.com/books?id=AtQDAAAAMBAJ&pg=PA77&source=gbs_toc_r&cad=2#v=onepage&q&f=false.

The ECHO never went commercial, and through the 1960s, hobbyists and a number of large companies such as Honeywell toyed with the idea of computerizing homes. However, it was the 1970s, much as with personal computing, that saw the birth of the modern era of home automation technology.

X10 – a standard is born

The introduction of the X10 technology standard can be arguably described as the beginning of modern home automation technology. Conceived in 1975 by Pico Electronics, who later partnered with Birmingham Sound Reproducers, X10 laid out the framework to allow remote-controlled access of domestic appliances. The X10 standard was designed to allow transmitters and receivers to work over existing electrical wiring systems by broadcasting messages such as "turn off" and "turn on" via radio frequency bursts.

In 1978, X10 products began to make their way into stores, geared towards electronics enthusiasts, and shortly after, in the 1980s, the CP-290 computer interface made its way to the market for the Mattel Aquarius computer.

The CP-290 unit allowed computers to communicate with X10-compatible home appliances. Over the years, support for Windows and Mac was included, and it gave those interested in home automation the ability to program their lighting systems, thermostats, and garage doors from their home computers.

As revolutionary as X10 has been, it unfortunately has a number of flaws. These include:

  • Wiring and interference issues

  • Commands getting lost in transmission

  • Limited scope of products supporting X10

  • Limited scope of commands available

  • Slow speed of signal transmission

  • Lack of encryption

  • Lack of confirmation messages without expensive two-way devices

By the late 1990s, home automation still hadn't penetrated the home market on a truly wide scale. However, the technological advancements of the dot-com boom were providing a whole new set of tools, protocols, and standards that addressed many of the flaws of the X10 standard.

The dot-com boom and open source – a new set of technologies

With the explosion of technologies that followed the birth of the Web in the 1990s, home computing and networking technologies were now available to the public and could be easily and cheaply installed at home. These technologies would later provide an ideal candidate to push the boundaries of what could be achieved by home automation enthusiasts, and provide the industry with the tools to build smart home appliances and systems. It was only a small step from PC-to-PC communication to appliance-to-PC communication.

Home networks running on Ethernet, and later on Wi-Fi, provided a mechanism that could allow computers and electronic appliances to communicate with one another across a home without needing to use the existing electrical wiring. In the case of Wi-Fi, no extra cabling was required.

As protocols such as FTP and HTTP became the norm to access information across the Internet, hardware developers saw the opportunity to leverage these communication technologies in open source hardware devices. While X10 appliances had no way of knowing whether a signal had been successfully sent without the purchase of costly two-way devices, web technologies provided a whole framework to return error codes and messages.

At approximately the same time when the Arduino platform was being developed, the first tablet computers were beginning to be released. From 2005 until now, there has been an explosion in mobile, tablet, and smartphone devices. This growth has been commonly referenced to as the post-PC era.

These devices have provided mobile computing platforms that can run complex software and be small enough to fit in the user's pocket. As a result of this, applications that allow the user to control consumer electronics, such as the TV, have been developed for the iPhone and Android.

Due to their size, portability, and low cost in some cases, they have provided the perfect platform to interface with home appliances and devices, and provided an extension to a medium the user is familiar with.

Alongside the explosion in hardware, there was an equivalent explosion in software. One particular product of interest that we will look at is the open source Android operating system.

Android OS is a Linux-based operating system geared towards mobile devices. As a part of the Open Handset Alliance—a consortium of 84 companies operating in the mobile sphere—Google backed and eventually purchased the Android mobile operating system. The aim has been to create an open source operating system that can compete with companies such as Apple, and provide a robust system that can work across multiple manufacturers' devices.

As a result of this, commercial manufacturers of home appliances have begun to embed the technology and software into their products, and a generation of smart devices has started to appear in stores around the world.

Commercial products

If you are interested in a smart refrigerator that can tell you the weather and keep track of your groceries, or an oven that can be controlled via your smartphone, then you are in luck. Products such as the Samsung RF4289HARS refrigerator running Android and the LG smart washing machine are paving the way for smart homes by embracing open source and web-based technologies. It is also not just appliances that are getting the makeover. Firms such as the Nest—a company founded by ex-employees of Apple—are developing smart thermostats.

Barcodes and QR codes on products now allow the consumer to scan them with their smartphones and download information about the item directly from the web. This can be extended to allow scanning and inventory management of products at home, recording data such as consumption dates of products in the refrigerator, and dynamically generating shopping lists.

This combination of hardware, software, and information now provides the potential for the home to become a part of "the Internet of Things" as quoted by Kevin Ashton.

Thanks to open source and open standard technology being used in these devices, it is easy to combine home-brewed projects built with the Raspberry Pi and commercial products by companies such as LG to build a smart home with a network of devices that can communicate with one another to combine the execution of tasks.

As we mentioned, home-brewed systems such as the Raspberry Pi can form part of this network. Let's now look at the effects of the arrival of the Raspberry Pi on the world of home automation.

Arrival of the Raspberry Pi

With the arrival of the Raspberry Pi and the Raspberry Pi to Arduino shield, there is now a set of open source technologies that combine the power of a PC, the communication and multimedia technologies of the Web, the ability to interact with the environment of a microcontroller, and the portability of a mobile device.

Coupled with the existing Arduino microcontrollers, we have the perfect set of tools to allow us to build cheap devices and systems for our homes. These devices can then interface with their commercial counterparts and can also be tailored for our own needs, while providing great tools to learn about technology.

For those familiar with the Arduino platform, the Raspberry Pi combined with its shields provides an all-in-one medium to create devices without the need for a separate PC or Mac—giving us an alternative to solutions that currently exist.

The ability of the Arduino Uno to communicate with the Raspberry Pi via an Ethernet shield over a LAN gives us flexibility in the types of projects that we can build. You will see this in the coming chapters where an Arduino Uno writes information back to a Raspberry Pi that is hosting a database.

Also, thanks to the Raspberry Pi's mission of providing an educational tool for those interested in programming, the addition of the Arduino shield will provide a mechanism for those who wish to move from writing software that manipulates the Raspberry Pi to software that manipulates their environment and provides a pathway to learn about electronics. This could have the positive effect of bolstering the ranks of Homebrew and Maker clubs with an eye towards home automation, and lead to an ever-increasing diversity of tools being produced for the public.