With the advent of affordable smart home technology, it has never been easier to transform your home. There are many useful gadgets available off the shelf to do this, and the prices of many of these items have dropped as more competitors join the market.
Still, a much cheaper and more rewarding option is to make your own custom smart home system. In this article we will cover the basics of how a Smart Home system works, and give a few examples of simple DIY Arduino projects anyone can make.
DIY Smart Home: An Overview
There are several ways to approach automating your living space, though most setups will use an Arduino or a Raspberry Pi as the brains of the operation. In many cases you will find the perfect solution can be a combination of the two, though today we will concentrate on the Arduino side of things.
The Arduino in these examples controls our chosen appliance when triggered. YouTuber EEEnthusiast has a simple example of turning on an LED with a push button to visualize the order of actions.
In the example above, the Arduino reads the input voltage from the button using digitalRead. When the voltage is read as HIGH, it turns the LED on by using digitalWrite to set its pin to HIGH. When the button is not pressed, the LED is off or LOW.
This simple example is essentially the heart of any automated system. All you need to do is change the inputs and outputs to something useful.
Don’t worry if you’ve never used an Arduino before — our beginner’s guide covers everything you need to know.
There are several ways to instruct your micro-controller to perform a task. The first is InfraRed (IR). This method may have its benefits for you if you are using an Arduino board with no internet connectivity. You can salvage the parts from old electronic components, and quickly get remote control up and running. This in-depth guide by YouTuber GreatScott! is not only a great primer for using IR in your projects, but includes a complete build to control a 12v RGB LED strip!
Connecting to the Internet
The second method involves connecting your micro-controller to the internet. There are several ways to approach this. If you are using an official Arduino or clone, you may need to buy an Ethernet or Wi-Fi shield, though there are ways round this. A much better option is to get a board which already has connectivity built in. The NodeMCU is perfect for this, and we frequently sing the praises of this little board with good reason!
Whichever way you get your board online, you will need a web service in order to communicate with it. While you could set up your own server, there are services out there which will do it for you. In the past we have covered how to get started with OpenHAB, which is a powerful and highly customization home automation tool — though its complexity makes it not for the faint hearted!
For a simpler service, both Thinger and Blynk allow communication with an Arduino over the web. Both provide the ability to control your micro-controller from a smartphone, or by making a web request (perfect for users of IFTTT).
For a quick primer on Blynk, check out our getting started guide.
Bluetooth is another common way to remotely communicate with your Arduino. In most cases you will need to get a Bluetooth shield in order to connect, and at under $3, they are a cheap option if you want to take this route.
For a quick introductory project using Bluetooth with Arduino, check out the following video from Tinkernut Labs.
Light It Up
Now that you can talk to the board remotely, it’s time to take care of the output side of the equation. The LED in our original example is not too useful in a real life scenario. By replacing it with a relay or a MOSFET, you can control higher powered items.
We have covered how relays work to control appliances in the past, and have used MOSFETS in our previous tutorial on connecting LED strips to an Arduino. The section of the video about 12v strips gives an example of the most common way you would use one in a power controlling circuit:
When shopping for these components, it’s worth noting that they need to be logic level in order to work with your board. With MOSFETS this is usually denoted by the letter ‘L’ in the name (in the example above, IRLZ44N was used). For relays, it is worth looking into cheap pre-made relay units for use with micro-controllers.
Ready, Set, Automate!
Now that you understand the basics of making DIY smart home appliances, lets look at some examples.
YouTuber passxxxa uses the aforementioned Blynk service along with an Arduino Uno, an Ethernet shield, and a relay, to control a light. This video shows how easy it can be to get started with home automation. Beware: playing with mains A/C can be deadly, be sure to know what you are doing before messing with it!
Youtuber BRUH Automation used a NodeMCU along with a servo to create web controlled automated blinds for under $15!
While not strictly remote control, Radio-Frequency Identification (RFID) is another interesting way to control smart objects. Learn how to use it to make a self locking door with an Arduino Uno and a solenoid in our DIY smart lock tutorial:
CarLeeToes combines IR control with web control in his tutorial on how to control your air conditioning from a smart phone. The project takes you through the process of “sniffing” out the IR codes from the air conditioner’s remote, and how to use them in conjunction with a web server in order to send the correct signals from your Arduino. Check out the video of it in action (in Spanish, but the tutorial on Instructables.com is in English):
Once you start playing with DIY home automation, you start to see ideas everywhere. Using an Arduino or similar board is a fantastic way to get started. Arduino is only one side of the story however, as the Raspberry Pi is equally well suited for these kind of projects, and getting started controlling relays can be pretty easy.
Have you been working on something we haven’t thought of? Are you dreaming up the perfect home automation system for your house? Let us know in the comments section below!