On this website, you’ll find a lot of articles to get you started with DIY home automation. You can learn how to build a simple wireless motion detector with Arduino. You will also find a project about how to control a relay from anywhere with the Raspberry Pi. You will also learn how to connect your garden to the cloud via WiFi. But what about building a complete home automation system? A system that integrates several of these elements? That’s what I will cover in this article.
In the second half of 2013, I spent time building a complete home automation system based on Arduino. And some of you funded this project on Indiegogo. The result is now available as a video course on our store, and many of you got access to the course already. I now want to publish a series of articles to share my advices about how to build a complete home automation system. I also want to explain how to use the source files of this project with step-by-step tutorials. We will start with a fundamental question in this article: how to choose the right technologies for your project?
Indeed, in the realm of open-source hardware, there are many, many options to choose from. Arduino or Raspberry Pi? WiFi or Bluetooth? Sending data to the cloud or processing data on a local server? It is quite easy to get lost in front of all these options. To help you out with all these choices, I will guide you through what’s possible. And to do so, I will decompose the making of a complete home automation system into simple steps.
We’ll start by general considerations about the platform. Then, we will move to sensors & actuators, and we will talk about the topic of connectivity. I will also tell you about interfaces. Finally, we’ll go through the topic of building your own boards and cases for your project.
That is the main question you have to answer first when building your own home automation system. You have to decide what platform(s) you are going to use. And I put an “s” at the end of platform because depending on your project, you are going to use more than one.
I can see two things here. The first one is what are you going to use to interface with the physical world (sensors, actuators). And the second thing is what will be the “brain” of your system.
For the first question, how to interface with the physical world, my advice is simple: Arduino. There are so many tutorials out there about Arduino that this should be no-brainer.
Then, for the “brain” or central unit of your system, you have options. First, there are two cases where you don’t need a central unit. If the system you intend to build is small (just one or two sensors), you don’t need a central unit to coordinate things. The second case is when all your devices interact with the web and to a cloud-based service. But we’ll see that in the end of this article.
Otherwise, you need some system to control all your sensors and actuators. This unit will run the software and the interface to control all the modules that you built for your home. And for that, I recommend using either the Raspberry Pi, a BeagleBone Black, or … your own computer. The first two are better to build an autonomous system, whereas your computer will be more flexible. I usually test all my software on my computer first, before uploading it to a Raspberry Pi.
This is where you have the most degrees of freedom. Many sensors & actuators (motors, relays …) can be interfaced with all platforms I mentioned before. What I recommend is to take components that were already used with Arduino by many people. This way, you can find nice libraries for these components. It also means that you will have no problems finding relevant tutorials around these components. And that can save you a lot of time when developing a new project. Of course, I can’t make a list of all components I would recommend for home automation, but here are the components I use the most:
- Temperature only: TMP36 (analog), DS18B20 (digital)
- Temperature & humidity: DHT11
- Motion: HC-SR501 PIR motion sensor
- Relay: 5V SPDT relay
One more thing on components: make sure they are all working with the same voltages levels. It can be a real hassle to use both 3.3V and 5V devices on the same system.
Then, when you have a platform and some components connected to it, you need to think about how you are going to connect these things. Once again, there are many options. I recommend reading my article about wireless solutions for home automation. I recommend using WiFi if you are thinking about integrating your modules with the web. But if you want to keep things more local, go for XBee or RF modules. Bluetooth is also a good option to consider. Ethernet can also be a solution, but I don’t really like the idea to have cables running around in my house for every module I want to install.
For all these solutions, you will usually find nice breakout boards, libraries and tutorials on the web. You will also need to have the same kind of connectivity both on your Arduino modules and your central unit. WiFi and Bluetooth are easy to integrate on a Raspberry Pi and usually come built-in in your computer. But it is more tricky for XBee or RF modules which require extra hardware.
Now that we settle things about the hardware, it’s time to think about the interface. And here again, there are two main trends at the moment.
The other solution is to send all data coming from your modules to a cloud-based service. With this solution, you can run your home automation system from anywhere. This is done using services like Carriots or Xively. The nice thing about this solution is that it is really easy to setup without having to code the interface itself. It also means that your data can be accessed from anywhere. Just get a web connection on your phone, connect to your cloud service, and voila, and can monitor your home remotely. There is one main disadvantage of this solution. If your Internet connection goes down, you don’t have access to your home automation system anymore. This solution can also add security issues.
Of course, nothing forbids you to use both in your system. You can build a local interface running on a central unit. With that, you are able to read some basic data and control actuators like relays. And in the same time, you send data to the cloud to have nice recording and displaying capabilities. This hybrid solution is what I would recommend for a good home automation system.
Custom boards & cases
Finally, there is the question if you should build your own boards and cases for your system. One solution is to build your system using Arduino boards and some components on a breadboard. But it’s better to go further and design your own custom boards. The first solution is easier, but usually it won’t look great or professional. To do something professional that looks nice, you will have to build your own boards. These board will integrate all the components we mentioned before. Or at least, you can design & 3D-print cases for your project so it doesn’t look too messy. This is something I will cover in greater details in the last articles of this series.
I hope this article will give you the motivation to build your own home automation system. Or that it helped you if you are considering building such a system. If you have any questions or remarks about a point I made in this article, please share it in the comments section below!