How to make Wall lights to work with both wall switches and arduino's relay

septillion:
But there is no fail safe. The only fail safe way to turn the light on would be a seperate parallel switch.

here is the specification from the OP.

"Also I would like to clarify that I want lights to have the ability to be handled independently of arduino.
So if arduino has an issue, I will have the ability to open or close the lights."

I posted just such a wiring diagram. you can fry all the electronicable bits and it will work perfectly and totally without anyone knowing they are there or there is a problem.

yet, they can be made to fully automate the house and allow for human override.

dave-in-nj:
a EMP goes off and wipes out all electronical things.
your hydroelectric generator offers power for those calm days your wind mill does not.

Total nonsense. :roll_eyes:

Each of these has an electronic controller without which it is totally useless. Or did you really use an old-fashioned buzzer regulator from a 1960s car when you built it? :astonished:

It has previously been explained that if the Arduino were - hypothetically - to crash, but in the process to implement a counting loop which cycles the relay on and off, your three-way switch arrangement would still be useless. If you want to protect against that eventuality, you must install a separate and additional manual bypass switch!

The fact is, properly coded it is reliable and will perform its task perfectly, at least as reliably as the wall switches which I understand from actual experience, do fail from time to time. Which is one reason why I am installing touch plates.

Paul__B:
Total nonsense. :roll_eyes:

Each of these has an electronic controller without which it is totally useless. Or did you really use an old-fashioned buzzer regulator from a 1960s car when you built it? :astonished:

It has previously been explained that if the Arduino were - hypothetically - to crash, but in the process to implement a counting loop which cycles the relay on and off, your three-way switch arrangement would still be useless. If you want to protect against that eventuality, you must install a separate and additional manual bypass switch!

The fact is, properly coded it is reliable and will perform its task perfectly, at least as reliably as the wall switches which I understand from actual experience, do fail from time to time. Which is one reason why I am installing touch plates.

you are being silliery than I am. You offer one very unusual and unlikely circumstance for the unit to crash as the only reason not to use one method as opposed to a complete automation system that could suffer the exact same problem.
And you offer that adding more components that have failure rates far above those manual switches will make the system more reliable?
I do National maintenance on retail stores and every few years I replace one switch. I replace a lighting contactor in a store in the country about once per month. a lighting contactor if you don't know is a large relay. I ripp out and replace electronic control systems for lighting because of failures in either buttons relays , power supplies , board failures , component failures , etc. My actual experience manual switches are about a hundred times more reliable than electronic controls. the cost to replace one switch and the problems caused by a single switch failure are confined to one lighting circuit and one service call.. When a lighting control panel fails all the lights are either on 24 hours a day or the store is Dark until we can replace the panel. Two liscensed electricians, one night, security guard, permit, plus a new replacement.
on a personal level I have lost multiple home computers , multiple laptops , coffee pots , toaster ovens , and alarm clock. the electrical panel that controls my range and stove , twice in 5 years. because some electrical failure in the wiring or circuitry. I disagree 100 + 10% that you can make an electric electronic system more reliable then manual switches. further the only failure you find with one option is the only failure that that option would suffer. your proposed system has the same possibility as well as component failure EMF failure power surge issues , overheating issues and the list goes on and on.
you have been on this forum a long time. can you post a link two any thread in which that failure was mentioned?

lastly. if you do not know the concept Preppers are working with you might want to take a little time to understand that 0 technology is a goal.

one additional thing, I replace about $100,000 in electronic ballasts for metal halide lamps (IMH-100 $93/ea) and another $20,000 in fluorescent ballasts every year. granted it is over 5,000 stores and we do 1,500 service calls a month, but at $100 per metal halide ballast and $10 for a fluorescent one, and based on your comments, I would expect that these all electronic devices would last for the life of the fixture.

and changing one switch, every other year in the same 5,000 stores. well something just does not make sense in this thread.

No, it sure doesn't!

here is a store that is dark. in retail, this is a catastrophe.
and the automaton panel. notice the scorched marks.

there were 4,999 other stores that were open that day.

all we had to do was to re-wire every relay and use the circuit breakers until we could rip this panel out and replace it with new lighting contactors.

I added another photo of another store. all 100 wall metal halide fixtures. ballast warranty is 3 years.
I expect to change every one to LED within the next 3 years, after replacing every ballast at least once. [ figure $93 per ballast, and $85/hr for a licensed electrician that is 10 rows of 10 fixtures. ]

sorry if my ideas are silly, but I have only one goal. lights on at all cost.

as for the $9,300 in ballast costs alone for this store, plus shipping, plus labor, you can see why I do not put my faith in no failures of electronic equipment.

EDIT : panel picture was too large, had to add on a second attempt.

I'm in with Paul.

It is all based on the assumption it fails in a steady state. But the weakest link in the system is the code that's written. Not the switch or relay (aka lighting contactor if you insist on using random fancy marketing terms). And that will as likely fail in a dynamic state. Counter acting on a switch or just flipping states. Then having the option to also switch it manual is just complete useless because the system will still not do what you want.

If you want to be very fail save, drop the automation and use a switch. When you add automation that can interact fully (aka turn on and off the light, no matter how you connect it) then there is no fail save way unless you also add bypass switches.

So granted, a switch is probably more reliable (but it all depends on quality) but connection it in a multi-way manner is no guarantee the automation error can be fixed by flipping a switch. The fault can still be there because the system counteracts it because of a software error of the relay failed in a open circuit way.

So I think the whole multi way manner because it's fail save is just bull... Just save yourself all the extra mains wiring and control it with a relay and low voltage switches (push buttons).

And yeah, make good code. Debug it etc. Post it here and we can check for errors etc.

Just make the Arduino another three way switch. Most contactors have a normally closed and normally open slot, along with a common.

Put the two travelers on each of the normally open/normally closed contacts, then put the common on the common.

Measure the current on the common and that will tell you if the light is on/off

But that doesn't make it fail safe!!! If you have a code error you're still screwed.

It does make it fail safe. Irregardless of the position of the relay, the lights can be tuned off and on manually.

If you want it to be 100% add a switch to the psu of the Arduino. If it starts acting up, turn it off. Switches still work.

If you call that fail safe then please please, never make something where my life depends on. ::slight_smile:

Yes, if the relay in (a) a steady state AND (b) does not react on you switching then yes, you can control the light. But both can be untrue. If you write a bug to random switch the relay then yes, you can also switch relay.

a) Unless you always counter act the random relays switching by manually flipping a switch you can't have the light in the state you want.
b) If the relay always counter acts on you flipping the switch then doing so is useless.

So no, it is in NO way fail safe. Code errors can still effect the light, no problem. And making a error like that is just as easy to write as not reacting at all.

So you answer is to add a bypass switch....

Just write good code and you're fine! It's only a light in your house. But fine, i you want to spend the extra money on useless wires then fine, be my guest. But copper ain't cheap these days....

If the Arduino is not running there is no code being ran. The switch still works. Even with code of the gods, the Arduino is susceptible to failure at a signicantly higher rate that the bypass switch.

But that IS bypassing it. Not a fail safe. You could also add a switch in parallel to turn the light on. It's still bypassing aka it doesn't make the normal switches work safer.

septillion:
If you call that fail safe then please please, never make something where my life depends on. ::slight_smile:

Yes, if the relay in (a) a steady state AND (b) does not react on you switching then yes, you can control the light. But both can be untrue. If you write a bug to random switch the relay then yes, you can also switch relay.

a) Unless you always counter act the random relays switching by manually flipping a switch you can't have the light in the state you want.
b) If the relay always counter acts on you flipping the switch then doing so is useless.

So no, it is in NO way fail safe. Code errors can still effect the light, no problem. And making a error like that is just as easy to write as not reacting at all.

So you answer is to add a bypass switch....

Just write good code and you're fine! It's only a light in your house. But fine, i you want to spend the extra money on useless wires then fine, be my guest. But copper ain't cheap these days....

are you in politics ?

your computer program and your computer will suffer from the exact same possible glittttch, the one that has plagued us all from the start. (by number of posts on how to cure it) ... a failure that results in an output constantly changing state.....

but your computer and your computer program does not have any alternative way to turn the lights off and on from any location in the house.

using one relay and multiple manual switches offers one safety factor. you can unplug the controls and it fails in a steady state. then any switch will toggle to the other state.

you are in a fly by wire plane, expecting that a failure of any part of your system means a total loss of control.
in the other proposed system, you shut off the power, lose electronic control and manually regain full manual control

I would have used 'micro-controller' but since we are avoiding random fancy marketing terms, your full computer control has no backup.

As a note, do you know the difference between a lighting contactor and a relay ?
Think transistor, FET, triac, SCR, it is all the same right ? just random fancy marketing terms ?
unfortunately (or fortunately) my job is to replace poor designs and poor equipment choices with things that work in the (get ready ) "application" in which they will be used. does not make me an engineer, just a pragmatist.

is ANY electrical thing fail safe ? here is one definition : A fail-safe device is one that, in the event of a specific type of failure, responds in a way that will cause no harm, or at least a minimum of harm, to other devices

the single relay, multiple manual switch method proposed will take itself out of service and allow manual operation, the fully automatic system proposed will cease all operations, either all on, all off, or the flashing described, with the only option being the nuclear option of pulling the plug and having no way to turn the lights on.

septillion:
But that IS bypassing it. Not a fail safe. You could also add a switch in parallel to turn the light on. It's still bypassing aka it doesn't make the normal switches work safer.

Ok. I thought op wanted to be able to control lights irregardless of the Arduino managed portion of the system. This accomplishes that goal 100 percent of the time (fail safe) with the added benefit to be able to easily remove the Arduino, if for example you decided you no longer want it. (If your selling the house for examle)

Committing to low voltage switches for house wiring is a terrible idea as a practical matter. They did that in he 1950s and I'm having to take all those wires out and replace them with the right stuff.

The other problem with the low voltage relay is that t precludes dimming the lights.

Qdeathstar:
This accomplishes that goal 100 percent of the time

That's true

Qdeathstar:
(fail safe)

But that's not that same as that. It's like designing a "fail safe" elevator which you can stop from dropping when something went wrong by manually flipping a switch/pulling a lever. That's not fail safe.

Qdeathstar:
Committing to low voltage switches for house wiring is a terrible idea as a practical matter. They did that in he 1950s and I'm having to take all those wires out and replace them with the right stuff.

Can you tell me what's wrong with it except from not being standard?

Qdeathstar:
The other problem with the low voltage relay is that t precludes dimming the lights.

If you use a relay then kind of. You can still use a fixed or series dimmer. But it has nothing to do with low voltage switches.

Qdeathstar:
If your selling the house for examle

That is a good point. But with all the home automation is becomes a different world. And routing it via a relay also leaves you with some work to remove it when you sell. You can't really leave the relay...

dave-in-nj:
are you in politics ?

Nope, electrical engineering, kind of the same thing :stuck_out_tongue:

dave-in-nj:
using one relay and multiple manual switches offers one safety factor. you can unplug the controls and it fails in a steady state. then any switch will toggle to the other state.

There you have a point but you have to first bypass the system by turning the Arduino off. But my point is, you cannot call that fail safe.

But if you want to be able to bypass it like that then yes, go with the multi way switches. But I wouldn't install all the extra wiring and spend all the extra money if I had to start from scratch just for that small benefit. It's just about some lights after all.

Like I said, the main light switch in my livingroom is low voltage and the light and AV devices are controlled via triacs. Yeah, I had to fix one or two bugs when I had it installed (one was a random disco...). And yeah, I blow a Triac because I didn't designed it for a TV, radio, sub woofer, Playstation 4, Xbox One, Game Cube, Wii, Nintendo 64 and chargers on that one triac. (But at least that fails short circuit so fail safe in this case.) But after that beta time it's running smooth for 3 years 24/7, no problem.

dave-in-nj:
you are in a fly by wire plane, expecting that a failure of any part of your system means a total loss of control.
in the other proposed system, you shut off the power, lose electronic control and manually regain full manual control

With fly by wire, that's not going to happen. Shut off the power = shutting down control. Yes, you're able to bypass sub-systems (or it happens automatic aka fail safe) but in the end it all depends on the basic system. If the basic fly by wire controller fails you're indeed doomed. That's why there are multiple redundant systems which can disengage each other in case of a error. If they do it themselves it's fail safe. If the pilot has to do it it's just another bypass.

dave-in-nj:
As a note, do you know the difference between a lighting contactor and a relay ?
Think transistor, FET, triac, SCR, it is all the same right ? just random fancy marketing terms ?

Okay, you have a point. It's a group name. But a group name from marketing.

dave-in-nj:
unfortunately (or fortunately) my job is to replace poor designs and poor equipment choices with things that work in the (get ready ) "application" in which they will be used. does not make me an engineer, just a pragmatist.

And that's because
or a management decided the 2 cents cheaper option should be "good enough";
or the engineer(s) didn't got the design requirements right (probably given by the same management);
or the designer calls himself engineer but is not ;D

dave-in-nj:
is ANY electrical thing fail safe ? here is one definition : A fail-safe device is one that, in the event of a specific type of failure, responds in a way that will cause no harm, or at least a minimum of harm, to other devices

I can agree with that definition :slight_smile:

dave-in-nj:
the single relay, multiple manual switch method proposed will take itself out of service and allow manual operation,

No, it will not. It will just do unwanted (and maybe harmful) stuff until you bypass it. Making it NOT fail safe. But yes, in case of a bypass it's still easy to control the light. But is it worth all the cabling aka money? That's a question you have to answer. I would say no. At least not for domestic lighting.

dave-in-nj:
the fully automatic system proposed will cease all operations, either all on, all off, or the flashing described, with the only option being the nuclear option of pulling the plug and having no way to turn the lights on.

I wouldn't call it a nuclear option but that's true. But I never said you can't add a bypass switch to that. Isn't as convenient as all switches working but it's a hell lot less mains wiring (aka money) to do so.

But my point was, both options are not fail safe. And both options don't mean you can always turn on (or off, whatever you find "safe") the light no matter what. You have to do something (bypass the automation) in order to control it again. So it doesn't mean you know for sure the light will come on when you walk in the door and flip the switch. Yes, doing it the multi way switches way you can make it work again after you bypassed it. But it's not fail safe. And is it worth it?

Quote from: dave-in-nj on Today at 04:52 pm

the single relay, multiple manual switch method proposed will take itself out of service and allow manual operation,

No, it will not. It will just do unwanted (and maybe harmful) stuff until you bypass it. Making it NOT fail safe. But yes, in case of a bypass it's still easy to control the light. But is it worth all the cabling aka money? That's a question you have to answer. I would say no. At least not for domestic lighting.

Thanks for taking the time to break things down. think sometimes I get rushed and less than polite.

I offered that if you wire the house in 3 wire and 4 wire as needed, yes more wire, but we assume the house is open for wire.

a control panel in the basement with an array of relays
a CT on each hot (common) line
local Arduino.

nothing outside of the basement. similar to zoned heating with everything centrally located.

I do believe that this option is the closest to fail safe because it reverts to manual so easily. and once in manual, it would be transparent to the user.

The extra wire is maybe 100usd. Not much considering the total cost of the electrical remodel.

@Qdeathstar, how on earth can you make an estimation of the cost without knowing cable length and location in the world (different rules etc)? And even if it is only $100,-, if it's much considering the total costs or not, with that you're already halve way through the cost of a basic real domotica system... (alright, without bypass).

@dave-in-nj, If I could redo a part of my house I would use a central switchbox in each room (or hallway for multiple small rooms) and just a single relay (or rather a triac/mosfet/igbt to be able to dim). And a bus system of some sort for all the switches (and possible other extensions). No need for CT etc. But I would also use an existing framework to run and setup everything like Domoticz or something.

It's in a house. So the house can only be so big. We are talking about adding switches for arduinos inside rooms, somehwere in the house. SO the wire can only be so long. 500ft of 14-3 romex (commonly used for wiring for lighting inside houses) is 100 bucks.

Even if its 200 bucks its not adding on to the cost much.