24 comments

[ 5.4 ms ] story [ 59.8 ms ] thread
This is very interesting, thanks for sharing it.

I've been looking at home automation solutions and I want to make my own - I want to be able to control every switch and socket in my house, so I'd need very inexpensive nodes. I was thinking small microcontrollers (like the ATtiny85) with a one-way RF module plus a relay. I'd like to keep each node under $10 if possible. Then I'd have one (or more?) Raspberry Pi-like nodes that would broadcast commands to the nodes.

My main problem is: how would I power the modules that would control switches? I want to avoid a power brick running to the nearest socket at all costs, and a battery is a pretty bad solution. Any ideas?

Look at www.nodo-domotica.nl. They are exactly what you're describing.

Except that this method is not a good idea to control lights and sockets. This sort of setup is unreliable and has all sorts of limitations. It's basically the X10 of the 1990's, reimplemented poorly. Of course there are all sorts of alternatives that have been developed, like ZWave and Zigbee. But they're not DIY projects.

For 10$ or under, you can buy an off the shelf 433 mhz setup from cheap suppliers.

There are literally thousands of people who try to build their own, and the result is usually of the quality as described in the linked article. What this woman is doing (turn AC on and off through cutting off power) will wreak havoc on her AC as it will turn off all the circuitry AC's have to gradually control temperature. She notes this as a 'todo' in her description, which is roughly equivalent to saying 'yeah I build this soap box car and I ran it down the hill, now all I need is to put in pedals and then I can go off racing Nascar'. Uh, no, not even close.

Look, I see the appeal in building something yourself, but not in something that is both as simple and ill-functioning as this - what's the point of building something badly that you can buy COTS from any hardware store for only slightly more than what she spend on this thing? Internet-enabled remote controls for AC's can be bought for 75$ or less, and they interface with the circuitry of the AC directly and let you control temperature set point, fan movement and everything else without putting undue stress on the machine.

I do more or less agree with you, but:

> what's the point of building something badly that you can buy COTS from any hardware store for only slightly more than what she spend on this thing?

Tinkering. Hacking. Learning.

> turn AC on and off through cutting off power) will wreak havoc on her AC

I don't know alot about AC's (I generally eschew them), but there is one line in the article:

Make sure that your AC is always set to be ‘on’, we’re bypassing the air conditioner’s normal on/off control system.

I can't image they've got a complicated startup sequence if they've got an "always-on" setting? Or am I wrong?

I think he means an air conditioner with a physical on/off switch. If the unit has an electronic control that needs an "on" press to turn it on after power is applied, this external relay won't work.
I just did a similar thing that the linked tutorial uses for controlling lights. I use an arduino+RF emitter to control store bought RF controlled mechanical relays (3 for $20) and an rpi to host a server (used as ios mobile bookmark) that talks to the arduino. It's a pretty easy setup and the RF emitter with an antenna gets through walls. But I'm not sure it'd scale to a whole house, and much less reliably.

You can also build your own wifi controlled outlets using sparkcores like in this tutorial[1]. That author addressed your question about powering the modules that control the switches by "stripping apart an old USB power adapter, and soldering up AC wire from the power cable as well as an additional two wires to the back of where the USB port was soldered to the board on the +/- power pins."

Googling around you can find other sites like [2] for building your own controllers. But to be honest if you're looking for a whole home solution that's reliable and safe it's probably best to use some pre-bought kit for that purpose like Insteon - but I could defintely be wrong. Good luck!

[1] https://www.hackster.io/daniel0524/building-a-wifi-outlet [2] http://www.openhomeautomation.net/

If the switches are for lights, you could consider some other options. X10 is pretty dated, but the upside is the cost of 'socket rockets' is pretty low. Anyhow, for a project like this, I don't have automation as much as I have control but I built a simple system to talk to a handful of protocols. https://github.com/dandroid88/webmote

Low cost, long enough range and not wired can be a bit tricky. If you are ok replacing sockets, putting an adapter in, replacing switches etc you can get the features you want, but probably not at your desired cost point. Those solution would steal a bit of power from the 110 lines. If you are trying to hack something with some relays, I would suggest a sleepy radio, plus a thing called a latching relay. A latching relay allows you to connect/disconnect without continuously applying power and instead only applying power when changing the configuration. Still though, the batteries are going to be a pain once you start using anything electromechanical or radios unless you are really careful at each step.

I am using Insteon hardware for the purposes you describe. However, the nodes are about 5x your desired cost.
The esp8266 is a WiFi + micro for £5 which should be able to do all this if attached to a relay. Small DCDC converter to power it. I think it can make HTTP requests and has GPIO.
As most of the times, there are about a hundred different – not all of them necessarily better – ways to achieve the goal of this project. No issue there.

Putting part of such a project to $SHAREDHOSTINGSERVICE however, that's were I'd stop.

Then again, more sensitive stuff floats around on the intertubes.

(Also, not serving it by yourself feels like stopping halfway, and not in the hackers-do-take-shortcuts-way).

This is awesome.

Making a Smart Water Heater utilizing the existing hot water system in our homes would be very useful as well, and I would like to know if there are any efforts in this area.

There could be two ways (independently) that energy could be saved:

1) The water level in the tank could be varied by time depending on various parameters

2) The temperature level of the water could be varied by time as well. ( Keep it above freezing throughout the night, and trigger the heater at 5 am so that when I get to my shower at 6 am, I have hot water).

You're headed in the direction of a tankless/on demand heater (which are more efficient than tank heaters, but I guess not always cheaper overall).
An issue with the tankless system is that the chimney has to be updated, adding to the cost and complexity of the project.
Just a warning on point two. Decreasing the temperature of a water heater too low can result in bacteria growing in the tank.
And a clarification on point one, you can't change the water level in a hot-water heater. Outgoing hot water is always replaced by incoming cold water.

What you could do is use a second electric water heater as feeder tank to the primary one, and only raise the setpoint above vacation-idle when electricity prices drop very low or below zero (if you're in an area that offers real-time electricity pricing).

I wonder if any efficiency gains can be found by connecting the heat dump (outside heat exchanger) of the AC to the input of the hot water system?

The issue would be balancing the need for cold water to make the AC efficient and this being any use for heating up the water. Maybe with a larger smart tank that can vary the levels of water, or a secondary tank with pre-warmed AC water which can then be used by the hot water tank.

Cool hack, but an on/off switch is quite limited in this context.

There's a startup (sensibo.com) that's building a full HW/SW solution for controlling and monitoring IR-operated air conditioners.

(full disclosure: I'm friends with the founders and backed their indiegogo campaign)

I enjoyed the article. Thanks! But have to ask a serious question, after telling a story. Note: I am not a licensed engineer.

Sometime in the late 80's, I worked in a lab where we needed to heat an assembly to a certain temperature, while turning off the heat during data collection to minimize stray magnetic fields. I thought, a sensor, controller, and a relay. The process delivered a lot of power to the heater, due to a necessarily short duty cycle (heating in between data points).

Guess how relays fail -- open or closed?

Guess how experiments melt.

The relay failed closed. There was probably an inductive kick in the system because it was fed by a Variac. It got so hot that it melted the solder in the vacuum joints, and set us back a month.

Since then, I have always considered any system where a single fault failure can result in the uncontrolled release of power (electrical, heat, steam, momentum, hydraulic, etc.) to be dangerous.

One of my techniques is to incorporate two controllers with different set points, so the second controller only operates as a backup. I usually wire the second controller so that it shuts down the system altogether if its set point is reached. Another technique is to design the system so it can survive running uncontrolled at full power indefinitely, but that often results in massive over-design.

Now the question: I suggest taking a long hard look at your design, and answer what could happen if: 1) The relay gets stuck in either position. 2) Your code causes the same to happen. A possible measure for the air conditioner is to set its built-in thermostat to a temperature just below your intended operating point. That way, if the relay gets stuck, the a/c will go to a reasonable temperature and just sit there. Even if you conclude that it's safe after all, you will have done a useful analysis that should become a habit.

I don't want to be a wet blanket, but I'm somewhat of a safety freak due to my early experiences.

Also, the specs for that relay don't necessarily apply to inductive loads such as motors.

Good concerns.

One thing to add here is that often times in household HVAC system the thermostat relay doesn't handle the current for the heating/cooling element. Rather, it is the on/off relay for the main relay inside the heating/cooling device.

Yes, that's a good point. I'd still be cautious because a bug in your program could make your system run amok. And it could go either way with a home furnace: Shutting down during the winter could be as bad as running full-on, due to the danger of pipes freezing.

At the very least, thinking through a failure mode analysis is a good mental exercise -- especially for folks who are accustomed to living in the world of pure software.

Interesting that you mention HVAC. I have had my furnace control board fail last month. The failure was in the power relay gating the power to the blower motor (which is a pretty hefty 1kW load). The relay had melted to a lump of charred plastic, and the circuit board around the relay pins turned into a hole. I guess no matter which way it failed there would've been no serious consequences (blower motor stuck on) so I classified the incident as "neat." :-)
Presumably the AC still has a thermostat. For this application it would be set to be much higher than the set point but it would effectively serve as the second controller. Failing that, the worst that could happen is that the space would get cold. The compressor motor itself would be thermally protected.
Can't you pick relays that fail open or closed, as desired? By virtue of the applied voltage=closed nature of this relay, doesn't it fail open usually?
What I observed in one case was that there was an arc due to the inductive kick, which eventually roughened the contacts and caused them to weld together. So under that failure mode, whatever contacts are carrying the load would be the ones to fail shut.

There are relays designed to control motors, and designs for the circuit surrounding the relays to prevent the arc. In the case of solid state relays, every one I've ever seen fail, failed shut.