Home automation is a burgeoning trend in tech and home compelling geeks, DIYers, and businesses to discover new conveniences for modern life. This Windowsill project exhibits my exploration in home automation while solving a practical need to keep plants alive despite my comings and goings. The approach is influenced by a desire to learn C# and the resources immediately available. I chose technology that I had on hand or was free or inexpensive. Presented here is an overview on how it works, the hardware, the software and what I have learned. The data you see above is the real-time output of the system.
How It Works
The objective is to create a microclimate in which tropical plants thrive with little human intervention. The plants are located against a large bright North facing window in an arid part of the Northwestern United States. This is a high desert region of the USA. The system needs to do the following,
- maintain an elevated humidity level
- water plants
- alerts unfavorable light and temperature levels
- Webcam controller
The infrastructure is comprised of the ‘shelf’, a z-wave network of devices, and software controlling and reporting on the system.
A shelf holds both potted and hanging plants. The shelf sits in a sealed basin designed to capture runoff from watering and maintain a level of standing water. This water elevates humidity levels as it evaporates throughout the day. Spray nozzles are directed to plants and supply water from a pump sitting in a five gallon bucket below. A humidifier sits next to the shelf and provides periodic mist which can also be used to tame extreme temperatures.
The pump and humidifier were initially plugged into simple digital timers, but have been modernized by using an AEOTEC Smart Strip. This Z-Wave power strip talks to the PC through the AEOTEC Z-Stick receiver. An AEOTEC MultiSensor is used to send environmental data back to the computer, which, potentially could trigger additional actions (like heating/cooling, etc…). The PC is a Samsung Slate with Microsoft Wedge keyboard and mouse. This creates a compact work station and Z-Wave network where devices can send and receive data. The PC triggers actions like turning on and off power strip outlets to control water and humidity. Finally there is a web cam pointed at the shelf. All off this hardware is controlled by home automation software that is open source and free for anyone to download.
The Home Automation Software
Microsoft’s prototype Home Operating System (OS) is free and open source. The process of downloading, compiling, and running Home OS is quick and easy. Getting the Z-Wave devices recognized and running is also simple. Customizing the OS and apps, however, presents endless hours of tinkering. Adapting the pre-packaged modules to achieve my objective required writing additional code. This took the most time and presented the steepest learning curve. Of course it needn’t be so, but I chose this route to not only learn about home automation, but also a new programming language.
The OS comes with a number of premade drivers and apps that work with a Z-wave dongle and multisensor (among other devices). Upon starting the platform, devices can be added, assigned to apps, and manipulated through a browser GUI. The platform runs a heartbeat which pulsates roughly every four minutes – you can configure the interval. Included also is a very handy logger class that I used heavily. It sends messages to stdout which you can see on the command line in real-time. I made and continue to update the system, but what you see here is a result of,
- Update the HomeOS platform to report out the activities of my devices prefixed with a unique word. This enables learning and serves as a debugging tool.
- Update the pre-packaged sensor app to package and transmit sensor data (temperature, luminosity, and humidity) to a database residing on a web server.
- Create a WordPress page that loads and displays charts of sensor data in real time (this page)
- Update the pre-packaged switch app to recognize and control the smart strip and learn (guess) how to get this working. This will enable a randomized watering schedule with duration and frequency parameters, which is more natural compared with set daily times.
One final aspect of the system that is really cool is that in comes with some Azure hosting and blob storage. The browser interface can run locally and/or on Azure. This is handy for working with the OS remotely. It is securely accessed with your Microsoft account. In this case, the web camera app was used to control the web camera and view the system while away from home.
At the end of the day, the system works. It has been running smoothly for over a year as of this writing. The plants are thriving because they receive adequate moisture on a consistent, but random schedule. In addition, I am more confident with C# syntax and have an appreciation for the benefits and complexity of the object oriented paradigm. This accomplishment is the culmination of a vision to solve a problem, access to tools, and the motivating factor of learning and applying a new skill.
Click here to see what is growing