I have a crazyish idea to completely automate my home, beginning with my bedroom and expanding outwards. The main problem that I have run into is that I don't know how to do this.
One thing I want to do is control lighting in my room, but still be able to control it via physical switch. I would need a switch that switches from one wire to another every time it is flipped, so that either switch can always alter the state of the lights. Should I use a relay for this? Are there any other options? What relays would you suggest? How do I protect the arduino?
Another thing that I would want to do is completely hide the arduino, wiring, motors, locks, etc.
Obviously, this would require a lot of wires, some breadboards, and cutting into my wall. When making a circuit so spread out, where should I place components such as batteries, resistors, transistors, etc?
Just have a look at one of the many domitics/home automation frameworks out there like Domoticz. Beginning from scratch nowadays is just a bad idea. It's so much work...
You could use a relay yeah. But have a look at how the frameworks do it. Why is the "must switch directly with the physical switch" thing a hard requirement? It's a stubborn misconception a home automation can't use switches as an input. It's all about making them smarter and context aware. But switches itself are just fine.
And protect the Arduino? From who? You? The boogeyman?
tyler_newcomb:
Obviously, this would require [..], some breadboards,
No, no breadboards! Breadboards are to test things. When you want to make a permanent installation you make a PCB. Might be a complete designed PCB or just some experimental PCB boards onto which you solder your design
tyler_newcomb:
Obviously, this would require a lot of wires, and cutting into my wall.
Al depends on the design Wireless is also an option.
tyler_newcomb:
When making a circuit so spread out, where should I place components such as batteries, resistors, transistors, etc?
You don't make a spread out circuit. You make multiple smaller circuits aka nodes that communicate with each other.
No, no breadboards! Breadboards are to test things. When you want to make a permanent installation you make a PCB. Might be a complete designed PCB or just some experimental PCB boards onto which you solder your design
Depending on the complexity and your soldering skill, you might build a permanent protoboard using protoboard with 22 guage to 30 guage wire soldered point to point.
Controlling mains voltage safely is going to be a challenge. You have stated that you don't know how to achieve your objective so I assume the same for electrical work.
Design and build your project on the bench and use LEDs as the load. Get your project working on low voltage (batteries).
Once you are happy with the design, get an electrician to do my wiring.
I would not recommend you touch the house wiring. If you want something connected, pay an electrician to install or connect and test it. As stated, your house and you and your family's life are at stake.
This is no place for amateurs.
...but still be able to control it via physical switch. I would need a switch that switches from one wire to another every time it is flipped, so that either switch can always alter the state of the lights.
The "trick" is momentary switches. A normal home automation switch/dimmer like [u]this[/u] has a spring-loaded rocker with two momentary contacts... one momentary contact for on/dim-up and another one for off-dim-down. [u]This one[/u] looks like a regular-old toggle switch, but again it's spring-loaded and it sits in the middle waiting for someone to push it up or down.
The internal circuit simply holds the current state unit another command comes-along either locally or remotely.
Should I use a relay for this? Are there any other options? What relays would you suggest? How do I protect the arduino?
It can have a relay or a solid state circuit. Of course, the dimmer is solid state.
Building a remote-controlled wall switch like that presents some difficult engineering & assembly challenges, and it's safer, so I always recommend that you buy your switches/dimmers even if you want to build your own controllers.
...I've got a combination X-10/Insteon system with about 10 controlled lights & outlets, a master timer/controller and a few manual remote controllers. I didn't build any of it myself.
The added SPDT relay replaces ONE of the two switches, so if the relay in in the ON position , the switch can disconnect the load if it is moved to the OFF position. If the relay is in the OFF position, the switch can connect the load to the line by placing it in the ON position. This arrangement is due to the fact that the Line is switched by the lefthand switch and the Neutral (don't know what it's called in Europe) is switched by the righthand switch. Since the relay would replace either the LINE or the NEUTRAL switch,
there is no functional difference between the switch and the relay. Either one can defeat the operation of the other. Basically, the decision to apply power must be unanimous.
Thanks for all the feedback! I think the route I will go is start out doing it with small scale, using LEDs to simulate lights and smaller servos to simulate big ones.
DVDDoug, you mentioned momentary switches. Is there a way that I could have two momentary switches and control the 120V directly by logic? or would I need to still use multiple servos or 120V switches?
Also, I do have experience with 120V and with arduino, I just have never interfaced the two. I do know an electrician though, so I'll drag him into it.
Septillion, I meant protect the whole circuit from any overload or surge or any other stuff that could go wrong.
DVDDoug, you mentioned momentary switches. Is there a way that I could have two momentary switches and control the 120V directly by logic? or would I need to still use multiple servos or 120V switches?
Also, I do have experience with 120V and with arduino, I just have never interfaced the two. I do know an electrician though, so I'll drag him into it.
Septillion, I meant protect the whole circuit from any overload or surge or any other stuff that could go wrong.
If you use Solid State Relays, there is no difference between turning on an SSR and turning on a led, aside from the fact you don't need the resistor for an SSR because that's built into it. An SSR is an electronic SPST switch and is wired the same way. There is no input and output like a contactor.
There is simply two contacts, like a switch or a SPST relay. The LINE wire is cut (with the power off obviously) and the two ends stripped and connected to the output (AC SIDE) of the SSR. The input side is the 3- 32Vdc input and can be driven directly from any GPIO pin.
If you use this sketch and connect the SSR input to pin-13, it will turn on when the led turns on and off when the led turns off.
As far as overload protection the standard methods are surge suppressors for surges and circuit breakers or fuses for overload protection.
raschemmel:
If you use Solid State Relays, there is no difference between turning on an SSR and turning on a led, aside from the fact you don't need the resistor for an SSR because that's built into it. An SSR is an electronic SPST switch and is wired the same way. There is no input and output like a contactor.
There is simply two contacts, like a switch or a SPST relay. The LINE wire is cut (with the power off obviously) and the two ends stripped and connected to the output (AC SIDE) of the SSR. The input side is the 3- 32Vdc input and can be driven directly from any GPIO pin.
If you use this sketch and connect the SSR input to pin-13, it will turn on when the led turns on and off when the led turns off.
As far as overload protection the standard methods are surge suppressors for surges and circuit breakers or fuses for overload protection.
If you had a 600A breaker with adjustable instantaneous, depending on what you are serving, you can set it to low. The breaker would begin to open at ~3kA and be open before the 0.6 seconds (depending on the model) that it would take the fuse to react.