0
\$\begingroup\$

Recently I bought an Arduino Uno to discover electronics. I am a computer science student, hence the programming part is not a problem, however, I lack some knowledge about electronics.

Now I want to do some simple home automation, mainly to control the lights in my house. I was thinking about adding an Arduino controlled relay (in the central electrical box of my house) for each light I want to control.

However, for each light in my house I have a switch. Suppose, I'd add Arduino controlled relays in series with the switch (as in the figure below):

enter image description here

The problem is that with the relays being in series, I can only switch on and off the light if the switch is closed. Hence, like above, the switch is open and my Arduino controlled relay will have no effect.

Now, suppose I'd add the Arduino controlled relays in parallel:

enter image description here

In parallel, we observe the inverse problem. If the switch is open, we are able to control the light using the Arduino controlled relay. However, if the switch is closed (like above), the current will flow through it anyway, i.e. the light will glow without the Arduino controlled relay having any effect.

How does one tackle this problem in home automation systems, without the need to rewire my entire house?


PS : Excuse me if the diagrams are wrong in some way. I absolutely have no electronics background.

\$\endgroup\$
  • 1
    \$\begingroup\$ By using two-way switches and relays - wired like when you have two switches controlling one light in a stair well. \$\endgroup\$ – Majenko Aug 28 '16 at 17:15
  • \$\begingroup\$ @Majenko So basically i need to replace all switches in my house if i want to be able to control them with both, the switch and the Arduino? That's a problem.. :-) \$\endgroup\$ – Kevin Aug 28 '16 at 17:18
  • \$\begingroup\$ Yes, yes you will need to change your wiring to support additional devices controlling the system. You might consider looking at diy.stackexchange.com for what they have on lighting. \$\endgroup\$ – user2943160 Aug 28 '16 at 17:22
  • \$\begingroup\$ Yes, not only the switches, but the wires as well. \$\endgroup\$ – Majenko Aug 28 '16 at 17:23
  • \$\begingroup\$ A solution with only one relay is to use the switch as an input to the Arduino and let the Arduino do the work. Take proper care (isolation, maybe an opto-coupler) amd I would make the default (Arduino unpowered) situation have the light on. \$\endgroup\$ – Wouter van Ooijen Aug 28 '16 at 19:20
3
\$\begingroup\$

How does one tackle this problem in home automation systems, without the need to rewire my entire house?

Well, you can't avoid a bit of rewiring. The circuit you need is this: -

enter image description here

Either switch (relay or manual switch) can reverse the situation and fully control the light. I might also add that you cannot know whether your relay has activated the light or deactivated it. However, if you sensed current you could determine if the lamp had turned on providing the lamp is working. Call it extra functionality if you want.

An alternative way of wiring it is like this: -

enter image description here

Functionally it behaves as an exclusive-or gate.

If you want to add a relay to an existing installation that already does this you need a 2 pole changeover like this one shown in the middle: -

enter image description here

In fact you can continue to add 2 pole changeover switches to your heart's content to give you the same functionality but controlled from multiple positions.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thank you for the full explanation. Rewiring my parents house will be quite expensive i guess (at least for a "simple" project), however, it is nice to take this into account if i am to build my house in a near future. \$\endgroup\$ – Kevin Aug 28 '16 at 17:33
2
\$\begingroup\$

You have identified some of the problems with this type of project. Andy has shown how a two-way switch circuit is wired but that will involve extensive rewiring of the house.

I caution anyone looking at doing Arduino home automation.

  • You will end up with a system that is only understood and can only be maintained by you.
  • You're building it on a hobby platform which won't have the reliability of a light switch where 40 years trouble-free operation can be expected.
  • You need to consider how you will debug or make changes to this in 12 to 20 years time. Ard-what?

My advice is to have a look at the wireless options and see if you can do this in the ceiling fitting, etc., rather than at the fusebox.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. By careful choice of components a system can be fitted with minimum disruption to existing wiring and decor. In this example the wall switch is jumpered out and removed. A wireless push-button fitting is mounted in its place. It will be battery powered but battery is used momentarily on each button press. The ceiling fitting is replaced with the wireless receiver and control switch. This can now be controlled by the wall switch, a handheld remote or the home automation controller via your mobile phone or pad. The original switches and ceiling fittings can be replaced when moving house.

enter image description here

Have a look at the OpenHAB, 'a vendor and technology agnostic open source automation software for your home' where they have worked out protocols for a huge variety of commercially available and open-source DIY control devices. They have a Java based back-end that will run on anything from a Raspberry Pi to an industrial hardened PC with scheduling and mobile phone GUI.

enter image description here

Figure 2. The Android OpenHAB UI. IOS is available too.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.