Feasibility questions for a home automation setup

Hi,

I've just started an arduino prototype in order to prepare a real complete automation setup for my future house.
Current tests are OK : retrieving sensor data, actuating relays, receiving orders / sending data from / to a software server, etc.
But I'm not good at electronics, so I wonder if all could work in real life.

I plan to use two Arduino Mega for my entire home. One for basement, ground floor, garden. One other for the first floor. Each one communicate together along with a server via Ethernet. These are my doubts :

  • Push Switches : May I connect standard home push switches directly to the digital pins of the arduino, using something like a pull up resistor? Or do I need to build optocoupler circuits in order to isolate them?

  • Sensors : I'll deal with some onewire temp sensors ( DS18B20) or equivalent (DHT11) : all right, they accomodate with long wires. But I'll use some other sensors : PIR, light, tilt, etc. : Will they work with 10 meters long wires ? As far as I know, sensors typically work with 5V input, and they must output a TTL 5V signal. As far as I know, 5V isn't recommended for "long" wires. How should I do?

  • Lighting : RGB leds. I can power them with a specific 12w power supply, but I have to send color data from the Arduino, so it is the same wire length problem.

I plan to use RJ45 cat 6 wires for the sensors if needed, or CAT5 if possible (my CAT6 cable not being especially flexible). And I think I should add a 5V power source in order to prevent an Arduino 5V overload because of the sensors. Thank you for reading me and my apologies for the bad english.

May I connect standard home push switches directly to the digital pins of the arduino, using something like a pull up resistor?

Yes, if the switch is just to provide input to the Arduino.

Or do I need to build optocoupler circuits in order to isolate them?

Isolate them from what?

How should I do?

10 meters is not particularly long. The issue will be protecting the wires from external noise sources.

And I think I should add a 5V power source in order to prevent an Arduino 5V overload because of the sensors.

The sensors you list don't draw any significant amount of current, so a separate power supply should not be needed. Using one would present its own challenges.

PaulS:

May I connect standard home push switches directly to the digital pins of the arduino, using something like a pull up resistor?

Yes, if the switch is just to provide input to the Arduino.
------> All right

Or do I need to build optocoupler circuits in order to isolate them?

Isolate them from what?
------> I don't know, I was thinking that if some of these wires are noisy because of power cables running next to them, they can introduce instability on the overall Arduino circuit. Silly?

How should I do?

10 meters is not particularly long. The issue will be protecting the wires from external noise sources.
-------> All right, this is a good news. I'll try to use good shielded cables like CAT6.

And I think I should add a 5V power source in order to prevent an Arduino 5V overload because of the sensors.

The sensors you list don't draw any significant amount of current, so a separate power supply should not be needed. Using one would present its own challenges.
-------> That's good news, my point of view is that because the arduino(s) will be a critic part of my home, and because I'm going to use almost all pins, I thought it would be safer to separate the 5v source...

Fuenk:

PaulS:

May I connect standard home push switches directly to the digital pins of the arduino, using something like a pull up resistor?

Yes, if the switch is just to provide input to the Arduino.
------> All right

Or do I need to build optocoupler circuits in order to isolate them?

Isolate them from what?
------> I don't know, I was thinking that if some of these wires are noisy because of power cables running next to them, they can introduce instability on the overall Arduino circuit. Silly?

How should I do?

10 meters is not particularly long. The issue will be protecting the wires from external noise sources.
-------> All right, this is a good news. I'll try to use good shielded cables like CAT6.

And I think I should add a 5V power source in order to prevent an Arduino 5V overload because of the sensors.

The sensors you list don't draw any significant amount of current, so a separate power supply should not be needed. Using one would present its own challenges.
-------> That's good news, my point of view is that because the arduino(s) will be a critic part of my home, and because I'm going to use almost all pins, I thought it would be safer to separate the 5v source...

The only time you need optocouplers is when you are going more than 50 feet outdoors...and realistically, closer to 100 feet. The reason is, because earth is grounded, during a lightning strike, it will transfer power along the shielding and create all kinds of electrical noise that will shock the system. Drag strips have this happen all the time, the track near us goes through 2 or 3 computers a year b/c of it.

I am no expert so take my comments with a pinch of salt;

You seem to be planning on using a star topology. My concern would be the amount and complexity of wiring. There may be a trade off between having more distributed intelligence, using a bus structure, and wiring. You should look at existing home automation networks and also CAN used in vehicle automation. Also be wary of automatic control of power sockets rather than the device plugged into the socket. The system may think it is controlling a socket with a lamp attached but somebody may have plugged an electric fire or hair curling tongs in instead - so there could be a hazard.

Push Switches : May I connect standard home push switches directly to the digital pins of the arduino, using something like a pull up resistor? Or do I need to build optocoupler circuits in order to isolate them?

If the push switch is only sending a signal to the arduino then how are you controlling the actual power to devices? I just want to be sure there are no misunderstandings here. When you are switching the power you do need to ensure that you are using appropriate relays and that there is no way for your sensors and signal wiring to become "live".