Pages: [1]   Go Down
Author Topic: Simple and clean home automation project needs your help...  (Read 863 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I'm building a new house, and I'm thinking of controlling all electricity with arduino. The goal is to make it easy to install the whole thing (star-shaped installation), to offer flexibility if the house changes shape or function, to offer the possibility to control plugs with switches, to implement some simple scenarios such as "all lights off with the press of a button" or controlling ventilation. For later I'm thinking about intelligent scheduling of charging electric cars based on forecasted solar panel production, stuff like this, but for now I just want a cheap and reliable way to switch lights and plugs.

I can think of two ways of doing this, with 2 MEGA arduinos.

First way:  


Second way:


I have questions about:

0) Which deign would you advise. Or maybe can I do this with only 1 mega and use something to extend the number of I/Os ?
1) Which switches should I use for it to be easy to install (no soldering if possible) and cheap. Can I use any SPST-NO Off-Mom push button ? Do you know of some beautiful ones ?
2) Are ethernet-like cable adequate here? Am I going to be able to cross 15+m while still keeping noise down ?
3) How do I program Arduinos for this ? In particular for the com between the 2 arduinos ?
4) Are opto-isolated relay boards OK for connecting my loads to arduino ?
5) What do I use for connecting the PWM out to my dimmable loads ?

Thanks a lot !


* PrincipleArduino2.png (41.38 KB, 483x347 - viewed 25 times.)

* PrincipleArduino.png (36.55 KB, 399x504 - viewed 84 times.)
« Last Edit: October 22, 2012, 05:24:51 pm by mmahaux » Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9637
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Thanks a lot !

You're welcome!
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Sr. Member
****
Karma: 2
Posts: 260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

0) Which deign would you advise. Or maybe can I do this with only 1 mega and use something to extend the number of I/Os ?
You should only need one Mega, Shift Registers are the answer ;-)

1) Which switches should I use for it to be easy to install (no soldering if possible) and cheap. Can I use any SPST-NO Off-Mom push button ? Do you know of some beautiful ones ?
Go to your Hardware Store, they should have some momentary wall switches from different brands.
(I'm using Busch+Jaeger switches. Don't know if they are available where you live, but you can just plug the cables into them without any soldering.)


4) Are opto-isolated relay boards OK for connecting my loads to arduino ?
Yes, they should be fine. But notice you'll probably need a seperate power source for them.
« Last Edit: October 22, 2012, 06:05:12 pm by kduin » Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 129
Posts: 8531
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

While processing-wise you probably don't need two or more Megas I prefer a networked model closer to your second picture. It is more complex because you need a protocol to talk between nodes but it distributes the processing and if one box fails the others carry on (or they should if the system is design well).

Personally I've never liked the central master with a 1000 wires running around the house but software-wise it's a simpler model and a lot of people prefer it.

Do you plan to have momentary push buttons to control lights etc? If so where's the redundancy? How do you turn a light on when the Mega shits itself or you upload a new program version and it has a bug that takes 3 days to fix?

_______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks both for your replies.

I'm thinking of using shift registers to have all my outputs plugged to only one MEGA, and have a second MEGA just for when the first one fails, or needs an update. Chained Registers are easy to plug to another board, maybe I could even use a series of switches to choose which MEGA is live... Then I still have to move the 50 inputs in an easy way from one board to another. What kind of hardware is used for that ? A big breadboard with jumpers that are attached 10 by 10 or so ?

Would you say this is redundant enough ? If I have to wire it all a second time in the old way, I'll just stop here...
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 129
Posts: 8531
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Then I still have to move the 50 inputs in an easy way from one board to another. What kind of hardware is used for that ?
50-way ribbon cable.

But when you swap all the controlled devices in the house will turn off (or on depending on the wiring).

Quote
Would you say this is redundant enough ?
Well you're thinking along the right track in some ways, but what about my example of the push button light switch, how do you operate a light (or any other device) if the system is broken?


______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Well you're thinking along the right track in some ways, but what about my example of the push button light switch, how do you operate a light (or any other device) if the system is broken?

Well, I thought if one arduino is down, I switch on the other one. But then if something else goes down... Well, I don't know  smiley-roll Is there any other project similar to mine somewhere ?
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 129
Posts: 8531
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But then if something else goes down
Which it will one day, unless your code is a lot better that mine smiley

All such systems should be fail safe or fail to manual. How will you ever sell the house with an Arduino controlling everything?

I really don't know how other people get around this, they either don't care or have thought of something clever, I should know as I used to work in building control smiley, but a long time ago.

Rather than having the Mega decide about every light switch I can see a module where the button toggles a relay, one pole of the relay is an input to the master controller so it knows what's going on. The master can also toggle the relay remotely so when it is working it can automate the process but nothing actually relies on the master.

Quote
Is there any other project similar to mine somewhere ?
There would have to be, home automation is one of the most popular subjects around here I think. That said I don't know where to look.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Idaho, US
Offline Offline
God Member
*****
Karma: 19
Posts: 917
Special User
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A lot of people get away with violating codes because they already live in a house and they are making minor modifications. It's still illegal, but slips under the radar. In new construction, you are under a lot more scrutiny. How is your city/county electrical inspector going to feel about nonstandard light switches and control systems? Will he expect them to be UL (Underwriters Laboratory) listed? Will your system meet the NEC (National Electrical Code)? Will you satisfy UBC (Universal Building Code) requirements? Part of the reason commercial home automation systems are so expensive, is because they have to hire lawyers to interpret the metric truck-load of laws they have to comply with. Are you prepared to similarly retain or become a legal expert?

Realize that if someone is injured or killed in your house, even after you sell it, you could be spending a very long time in federal prison. I'm not just talking about direct electrocution or fire, but also consider if someone got injured in the dark because your system malfunctioned when they tried to turn the lights on. For sure don't expect your homeowner's insurance to cover it.

But, assuming you have complied with all local and federal laws, I would do as Graynomad suggests: have the system be 100% operable via dumb electromechanical latching relays and low voltage switches. Momentary press a switch one way to energize one coil and latch one way, momentary press the switch the other way to energize the other coil and latch the other way. Then add circuitry to allow your Arduino to sense whether a given relay is ON or OFF, and add more circuitry to allow the Ardiuno to energize one coil or the other. Now if you unplug your Arduino, everything still works.

BTW -- while codes are more relaxed when dealing with low voltage, you still have to interface with mains / line voltage at some point. For example, you can't have low voltage wires in the same enclosure as line voltage unless the low voltage wire insulation is rated to 600V or more, and unless all connections (wire nuts, screw terminals, etc) maintain a separation between low- and line-voltage by a certain minimum distance. There are other gotchas too, these are just a couple of examples. You have some homework to do.
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 159
Posts: 2916
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

As others noted, you definitely MUST follow electrical code guidelines for something like this, so you have to start there.

However, for something like this, it seems the best way to go is a distributed system, with communications between multiple smart nodes. The code may specify the sort of comms busses that can be used in houses, but I am thinking a CAN buss might be good, as used in autos. RS232 won't cut it for long distances, but RS485 may, and CAN buss is really popular now.

As I understand it, in the old days they used to have the audio/etc links to the seats in passenger airlines all individually wired back to a central hub, requiring miles and miles of copper, but then they went to using a comms buss arrangement with local processors in each seat, so they could get by with stringing only a simple daisy-chained connection from seat to seat.

Sounds like a good way to automate a house.
Logged

Pages: [1]   Go Up
Jump to: