Introduction: My Home Assistant (Automation System)!
Here is how I automated my Home. I needed a means to;
- manage my solar power system including the ability to switch to/from utility supply should I need it.
- manage the food and water to my three doggies.
- control the outside lights.
- provide metering for the power consumption within the home.
- remotely control/monitor the home.
- Provide voice annunciation for key events (yes I love having my home talk to me like a person).
- a couple other functions.
Now I simply don't have the time or energy to learn how to use those awesome arduino, raspberry pi, Micro controllers etc. Those are for extreme minds (respect!). I can't wrap my head around those things. On technical note, those stand alone microcontrollers are not good at multitasking which is what I need out of a proper automation design.
So, how did I automate my home? Read on for my solution!
Step 1: The Labjack U3 Hv!
This USB digital acquisition board is the cornerstone to my home automation needs! It is supported in Windows and several software packages support it! I got this from Amazon for approximately 130usd.
It has digital I/O, analog I/O, counters, timers, The CB15 extension board brings out more IO from a labjack u3. A single labjack u3 hv has proven sufficient for all my automation needs.
The wiring is straight forward. I used shielded cat5e cables for noise reduction. All the 0VDC busses are tied to the GND terminals of the labjack u3 (I used the shield of the cat5e cables as the 0VDC lines).
Any switches (pushbutton or momentary) I wired between a digital input and GND. When a switch (NO) is physically actuated, the logic input for the digital input goes to FALSE.
To have this beauty working i used a Windows pc (the more energy efficient the better), the driver from the labjack website and a software suite to create the program for decision making.
Read these instructables concerning the actual pc I had used to automate the home.
I housed the labjack u3 and other components within a wall mounted ABS enclosure. Here's the instructable on how I did that:
Step 2: FLOWSTONE!
This graphical programming suite is made by dsprobotics and supports the labjack u3 plus many other automation device across multiple manufacturers.
For me it's the perfect means to create an automation program and interface to My labjack u3. It supports line based programming with ruby but I stuck with the visual based object oriented programming.
I learned flowstone in one weekend via the online tutorials at their website.
It's very easy once you know about basic programming and electronics. Make sure to have your labjack u3 handy to play around with.
Step 3: Initializing the Labjack U3.
The first screenshot shows the mandatory primitive and module needed to get the labjack u3 ready for data. The I/O config sets up parameters for the channels. For example in my setup, all my analog inputs are set to special (SP) to allow the maximum range of 20VDC.
Digital channels are assigned as input or output (the default is input). For example on channel 5 (i.e. FIO5) I have it set as a digital output: DO5. If I wanted it as a digital input it would be: DI5, or you can omit it and leave it as default input. If I wanted it as an analog input it would be: AI5. Sorry guys and girls, no analog out on the FIO channels!
So its pretty easy to configure the labjack u3!
Step 4: Reading My Lifepo4 Battery Bank.
The labjack u3 can accept a maximum of 20vdc on 4 of its dedicated analog inputs. My Lifepo4 battery bank goes up to 29.1vdc so I used a 10k-ohm potentiometer to divide the voltage to 14vdc maximum.
Via software I used basic maths to bring the voltage reading back to the real value. I also can tell how many minutes the charge controller has been on constant voltage mode (how "full" the battery bank is"). Its all about voltage levels in this section of my flowstone schematic.
Here is the link to my Lifepo4 battery bank.
Step 5: Switching of Real World Devices.
I used a couple of these relay cards to turn on and off devices such as lights, motors, automatic transfer switches, valves and so on.
Once a relay pin is tied to 0v that relay coil will turn on. Basically in FLOWSTONE once I send a logic of false to a digital output, the relay wired to that output will turn on. Each relay has NO and NC contacts so the world of possibilities are made available!
Very easy to do and any amount of creativity can be used to control home devices.
Step 6: Metering of Power.
I used DC hall sensors to obtain a voltage reading that is proportional to the current supplied by the charge controller and also the load on the batteries. I already have the voltage reading of the lifepo4 bank so power consumption is an easy calculation (V x I).
My instuctable below details how I wired the hall sensors.
Step 7: Scheduling of Events.
Flowstone has a time module to give information from year down to millisecond. Very convenient to have and use. A Tick is used to drive regular output of the Time module and that information I used to trigger my dog feeder/waterer and external lights. Also at night the counter for constant voltage mode "minutes" reading is cleared.
All made possible with the time module.
Step 8: Analog Output.
The Labjack u3 has two DAC outputs: 0 to 5VDC. This is very handy for controlling, for example, a PWM controller that accepts 0 to 5VDC input. I used this to control the speed of my solar water pump. Take a read of my instructable on it!
Step 9: Voice Annunciation.
Yes my automation PC speaks to me (or anyone listening) concerning key events. The sound is routed through the surround sound speakers for the PC (yes its also my home entertainment system).
All I used is a text to mp3 online site to create the voice alerts. Next I used a separate program to play the mp3. Send a False to True logic state via the Bool to True Trigger and The Exec module will pull up the mp3 and play it with the program specified. Quite easy!
Step 10: Remote Access.
I used Teamviewer to access the home automation pc. I can do this from my phone or another PC. It's completely free for personal use. Very easy to setup and works like a charm.
Step 11: The Graphical User Interface.
The GUI is so easy with flowstone and its fully customizable in terms of scaling, colors, text etc.
Any switch, level meter, LED, text box, string box in the flowstone schematic will show up on the GUI. To make a free standing EXE to run in windows, just click the EXE button at the bottom of the GUI page. You can include you own custom ICON for the EXE file as well.
So that's a summary on how I created my home automation system using a windows PC, labjack u3 hv, flowstone, relays cards, wiring, miscellaneous items and some skills! I hope you enjoyed reading this.
PS: I uploaded the latest schematic file I used to make my home automation system for your cannibalizing pleasure!