Home Automation

The Goal
The goal of this project was to have a fully self-contained, offline, yet still feature rich home automation system. In the past, there have been smart home devices that have stopped working when the company went out of business or decided to put access to the device behind a paywall. For that reason I did not want to have to rely on any external services to be able to operate my home automation devices. Also, there is no need to send a command to turn on a light switch out to the internet, when the device sending the command and the light switch are on the same network. For those reasons I have created my own ecosystem, utilizing both off the shelf and DIY hardware like the Raspberry Pi and Arduino. Aside from access to the system from outside of my home, which obviously requires an internet connection, this system is fully functional offline without any reliance on external services.
How it Works
The main interface for the system is written in PHP, HTML, CSS, and JavaScript. It is then hosted on a Raspberry Pi and served via a web server. This interface allows remote control of what I like to call "modules" comprising of an Arduino, an Ethernet shield, and a custom shield. The custom shield has the hardware to interface with whatever I want to control or monitor. The main interface then query’s these different modules, via Ethernet using the Raspberry Pi as a proxy server. This allows remote control of the modules from the internet, without having the modules directly exposed to the internet. More information about some of the different modules can be found under "Electronics Projects" in the navigation bar at the top of the page. The Raspberry Pi also has Node-RED installed on it. Node-RED acts as the backend server and runs all of the logic for different automations. It can also send alerts to my phone or email for things like when the dryer is done, when a water sensors gets tripped, or even when the power goes out. I started out writing scripts in python, but they were hard to maintain and edit remotely. I then found out about Node-RED an am very glad I switched. It is very powerful, extendable, and easy to use all at the same time. The Raspberry Pi also does logging of things like temperatures and power usage. The logged data can then be shown on different graphs using Grafana.
How it Started
This whole project started out when a friend of mine got into a bad habit of forgetting to turn off his pool pump at night. After his electricity bill doubled, he asked me if I could figure out a solution. Originally we considered a simple timer, but I figured I could make something more robust than that. A little bit before this happened, I had discovered the Arduino and its Ethernet shield. I decided that this would be a good first project to use an Arduino for to use to it as the base for the pool pump controller. Originally I created a simple html file that could be copied onto and loaded in a web browser for remote control. This worked for a little while, but soon I realized there were too many restrictions in having the html file separate from the Arduino. I also had ideas for other things I could control, and knew I needed a better way to view and control the devices I wanted to create. Enter the Raspberry Pi. I had heard other people talking about the Raspberry Pi, and after doing some research, I decided to use it as a server to host the html file. And that’s how it started, an Arduino to control a pool pump via a Raspberry Pi.