3 way switching 230v

hi all, i am new but i am learning and very interested in automation and i have some question.

i would like to control my lighting using both arduino and wall switch (wall switch to bypass arduino, just incase arduino it break down so that i could still switch on my lights)

what i need to do is to power on/off the light with arduino or wall switch.

example: arduino to power on the light and power off using switch and also switch to power on the light and power off using arduino

i know it call a 3 way switching, but what do i need to be able to do this ? 3 way switch x 1, arduino x 1, 230v relay x 1?

and how is the wiring circuit like?

Yes, you need a relay. You need a single-pole double-throw (SPDT) relay. DPDT relays are more common, and you can simply leave 3 terminals unconnected.

[u]This page[/u] shows you how to wire a 3-way switch.

There’s one possible issue… You may need some “feedback” so the Arduino “knows” if the light is on or off.

http://www.youtube.com/watch?v=8dynrQvF_bE

how he does it ? any idea?

nvm bout the video, it doesn't feed back to change the switching on the web

but is there any possible way for it to feed back to change the status on the web button ?

any help here ?

1 it isn't 3 way switching it is called 2 way switching (there are only 2 ways for the electricity to go) 2 Part P of the building regulations (UK) state that only work certified by competent (i.e qualified electricians) meets the building regulations. 3 Without being conversant to BS7671 (The electrical installation regulations) (which is harmonised to the European regulations) You are risking Fire and or possibly death by indirect contact via improper fusing arrangements/ altering the earth fault loop impedance path.

What you want to do is possible you would need 2 * 2 way 230V switches, 1 * 2 way 230 volt relay (everything rated to the load of your circuit also taking into account the power factor) You do not need to know the state of the relay you could add a 5 V light sensor to the to change a variable 'lightOn' to either 1 or 0

[u]230 Volts can kill and adapting mains voltage circuits with electronics is not for the untrained[/u]

The best idea is make a 5 volt version and then consult an qualified electrician.

*Edit also back switching (mentioned on the site you linked) is unsafe, as switching the neutral leaves main voltage in an unilluminated lamp, further also he makes no note of the conversion method for 2 way switching.

I wouldn't trust that guy to wire a plug.

Nico BS7671 (2008) 17th edition qualified electrician

You need a single-pole double-throw (SPDT) relay. DPDT relays are more common, and you can simply leave 3 terminals unconnected.

DISCLAIMER: Mentioning stuff from my own shop...

SPDT relays are very common in versions intended to be controlled by Arduino. Example: HERE:

Take a look at "Arduino Power" on the ArduinoInfo.Info WIKI HERE: and the section on relays.

Strange Nomenclature: The typical home light setup with two switches at the top and bottom of stairs are called "3-way switches" (In USA anyway). When a 3rd or more switches are added into the circuit the physical added switches are called "4-way switches" and are really DPDT (Double Pole Double Throw".). A good discussion / diagram is HERE:

My Dad explained this to me when I was about 12 years old for the Electricity Merit Badge (62 years ago!). I probably wouldn't have remembered if if I hadn't needed to explain it to MY kids..

...and there is a way cool animation of this HERE:

terryking228: Strange Nomenclature: The typical home light setup with two switches at the top and bottom of stairs are called "3-way switches" (In USA anyway). When a 3rd or more switches are added into the circuit the physical added switches are called "4-way switches" and are really DPDT (Double Pole Double Throw".). A good discussion / diagram is HERE:

In the UK we call it 1 way switching, 2 way switching, and intermediate switching (for more that 2 switches)

Although I do not think working with anything above 50 VAC is for a beginner.

XQuilet: is there any possible way for it to feed back to change the status on the web button ?

You have the Arduino control a single pole double throw relay. The Arduino obviously knows the state of the relay since it is controlling it.

Connect the lighting circuit using the standard wiring scheme for dual switch lighting but with the Arduin-controlled relay in place of one of the manual switches. So far the Arduino knows the position of the relay it is controlling, but not the position of the manual switch. To get the position of the manual switch you could connect a 5V transformer in parallel with the lamp so that it generated a 5V supply when the lamp is on, and use a digital I/O pin to read the state of that.

locodog:
What you want to do is possible you would need 2 * 2 way 230V switches, 1 * 2 way 230 volt relay (everything rated to the load of your circuit also taking into account the power factor)

Unless he wants a 3 way arrangement (with a centre crossover) he only needs one 230V 2 way switch and a single pole double throw relay to take the place of the second switch.
Everything else you wrote, I heartily agree with.

Henry_Best:

locodog: What you want to do is possible you would need 2 * 2 way 230V switches, 1 * 2 way 230 volt relay (everything rated to the load of your circuit also taking into account the power factor)

Unless he wants a 3 way arrangement (with a centre crossover) he only needs [u]one[/u] 230V 2 way switch and a single pole double throw relay to take the place of the second switch. Everything else you wrote, I heartily agree with.

I included the second switch to bypass the relay in the event of a component failure, I don't want to describe exactly how, as we both agree 230 V can be hazardous.

yes i agree 230 V can be very hazardous. but i am living in singapore and the standard voltage from the DB box is by standard 230v and it a 13amp rated

reguarding why i need a signal feed back is because i want it to show on/off status on the annikken andee interface on android

if i am going to use a light sensor to sense the light i will have to do another coding to it, so what i am thinking of is no coding but just return feedback to the i/o

i am not having a arduino right now all i know is knowledge of what i have read so far in this 2 days i have been looking into possibility of what i can do on the arduino before i get my hands on it by next wed.

@PeterH The Arduino obviously knows the state of the relay since it is controlling it., (meaning that even if arduino controlling the SPDT relay is in light on and i switch of the light using manual switch, arduino will know that the light is of and return a off status?)

so can i assume that all i need is a 2way wall switch and a 230v SPDT relay to do this ?

truly thanks for all the reply from you guys and you really teach me alot ^-^

XQuilet: (meaning that even if arduino controlling the SPDT relay is in light on and i switch of the light using manual switch, arduino will know that the light is of and return a off status?)

No, not meaning that.

Your circuit has two switches. One is the relay. Since the Arduino controls the relay, it knows which position it is in. It doesn't directly know what position the manual switch is in. To know that, I suggested using a 5V transformer to convert the dangerous 230V AC to a safe 5V DC which your Arduino can detect. This lets your Arduino know whether the lamp is actually on or not.

Have you considered adding bulb failure detection, soft starting etc yet?

@PeterH, suggested using a 5V transformer to convert the dangerous 230V AC to a safe 5V DC which your Arduino can detect. This lets your Arduino know whether the lamp is actually on or not.

How do I do that n how Do I connect to arduino with the 5 vote to let arduino know the status I am noob in this could u teach me? Is it a additional Link connection from a 230v step down to 5v or convert it to 5v to connect the bulb too? As u know we use 230v here

sorry for my nnoobness, I know basic electricity n electronic As i work in Somfy singapore for few years n my knowledge is from there. But if talking about full knowledge of electricity n electronic I don't really know much.

Hope u could teach n elighten me more on these, I would very much appreciate it, n thanks a lot ^-^

Bulb failure not a concern yet, but it a good suggestion!

Don't use a transformer to detect if the light is on, use a 5V light sensor, they are cheaper, safer and easier.

Read this, all of it Electrical regulations Singapore

Really now, if you can't follow the diagrams you have posted, you have no idea how to wire a transformer, You have absolutely no idea how your project will alter the fuse operation thus protection from indirect contact could be compromised also there could be a risk from fire.

STOP seriously, Electricians earn their money not from wiring stuff together, (because anyone can do that after a few hours instruction) they earn their money by knowing what they are doing is safe, please find another project that doesn't involve mains voltage

locodog: Don't use a transformer to detect if the light is on, use a 5V light sensor, they are cheaper, safer and easier.

Read this, all of it Electrical regulations Singapore

Really now, if you can't follow the diagrams you have posted, you have no idea how to wire a transformer, You have absolutely no idea how your project will alter the fuse operation thus protection from indirect contact could be compromised also there could be a risk from fire.

STOP seriously, Electricians earn their money not from wiring stuff together, (because anyone can do that after a few hours instruction) they earn their money by knowing what they are doing is safe, please find another project that doesn't involve mains voltage

"A little knowledge is a dangerous thing" and he has shown how little he knows.

Sounds as if the correct answer will be a servo actuating a plate fitted in a slide over the light switch with a narrow slot around the switch lever. A reed switch or opto-interrupter can sense the position of the plate.

This arrangement has the specific advantage that there is no complication regarding whether the switch is on or off - there remains only one switch, the switch is moved either by hand or the servo and its position is known both by direct visual observation and by the sensor.