Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

3-way switching

Status
Not open for further replies.

greghl

New Member
I need to create a 3-way switching technique without the use of travelers. two sources controlled by switches. when either switch changes state, i need a LED to turn on. I have been brainstorming ways to do it with gates but am fairly new at electronics and cant get my head around this. I am more familiar working on120v where if there is a voltage present, the device is on. maybe through the use of a microcontroller is what i need. Can anyone help shed some light.
 
Last edited:
If I understand you correctly an Exclusive OR (XOR) gate should work for that function such as the CD4070.
 
I need to create a 3-way switching technique without the use of travelers. two sources controlled by switches. when either switch changes state, i need a LED to turn on. I have been brainstorming ways to do it with gates but am fairly new at electronics and cant get my head around this. Im use to 120v where if there is a voltage its on. maybe through the use of a microcontroller is what i need. Can anyone help shed some light.

hi,
Your description is vague.:D

You say you want the LED to come ON when either switch changes state.? So after the first switch changes state the LED will never go OFF.??

E.
 
I suggest 3 change over switches in series with the LED (and resistor) and then any switch will turn the LED on/off.

**broken link removed**

However, I'm just guessing as your description is vague.

Mike.
 
I want to control a relay that will switch a 120v light. I want to have two sources controling the state of the relay. the state of the relay does not matter the state of the switches, it just matters when the switches change state i want the relay to open or close.


eg. switch 1 =1 switch2=1 light is off
switch 2 changes state to 0 light in on
switch 1 changes state to 0 light is off
switch 1 changes state to 1 light is on
switch 1 changes state to 0 light is off
switch 2 changes state to 1 light is on
switch 1 changes stato to 1 light is off


As you can see the value of the switchs is not important to the function of the light. its just the fact that they have changed . similar to a 3-way switching scenario in you house. It doesnt matter if the switch is up or down. it just matters that a different traveller in energized. Is there a way to do this using gates or a microcontroller.
 
hmm, it sounds like op doesnt want anything logical, just a flip-flop to toggle when something has happened,

but i wouldnt know how to wire the clock to fire though on both +and- edges,
maybe a +&-edge clock flip flop on each switch, somehow feeding another flip flop that controls the led?

on pic code would look like this:

read portb
num = portb
while 1{
read portb
if portb != num then { toggle(led); num = portb }
}
 
Last edited:
@ doggy___ you are correct in what i want. so i would probably need a microcontroller to do what i want?
@ canadaelk Do you have a stairwell in your house? notice the light switches that control the stair lights. It doesnt matter if one switch is up or down. its changing the switch which turns the light on or off. both switches could be down " off by convention" but the light will be on. This is done through the use of traveler wires .

I cant use anything logical( i think) because i would not be able to turn the light off.
 
Something like this?
View attachment 66858
Either switch going either way will generate a pulse to toggle the D-latch and hence the relay.

A more elaborate circuit could be used for driving a latching relay. That would have the advantage of consuming negligible relay coil current except at the instant of switching.
 
Last edited:
Crutschow mentioned XOR gating, and here is a diagram of it showing various states of the switches and the resulting relay state. For only two switches, only one XOR gate is needed and the output of the one gate provides the signal to switch the relay. Or, the circuit can be used as shown and one of the inputs is wired continuously to the high state or the low state (the same as leaving one switch always on, or always off).
 

Attachments

  • 3-way.pdf
    11.5 KB · Views: 213
Last edited:
Here's an improvement on my post #10 suggestion, with one latch of the dual-latch CD4013B being used for debouncing the switch contacts.
 
The XOR gate would seem to be the simplest way to implement what the OP wants for two inputs. It only requires one gate and doesn't require a debounce circuit. Why go to anything more complex? :confused:
 
The XOR gate would seem to be the simplest way to implement what the OP wants for two inputs
Agreed. But the thread title relates to 3-way switching, then the OP changed the spec to 2-way; the pulsed latch arrangement can be readily extended to any number of ways (I daresay the XOR approach can be too :)).
 
I agree with crutschow above; what you need is an XOR function. As far as I can see from your post #6, all you need is a standard 2 way switching circuit (as done for house lights).

I have labelled the switches A & B.

I have attached the basic circuit. The Karnaugh map shows the XOR function.
 
Agreed. But the thread title relates to 3-way switching, then the OP changed the spec to 2-way; the pulsed latch arrangement can be readily extended to any number of ways (I daresay the XOR approach can be too :)).
Circuits with two switches are called (for reasons not clear to me) 3-way. The OP mentioned two switches (sources) in his original post.
 
Circuits with two switches are called (for reasons not clear to me) 3-way
That's news to me. Maybe there's a US/UK divide on terminology :). Like you though I don't see the logic in it.
 
Last edited:
I need to create a 3-way switching technique without the use of travelers.
I am guessing this means the OP does not what the extra wiring thats needed in a typical 2 or 3 way setup.
Is there restriction on the wiring of the switch's or the relay and light?
 
Last edited:
@ doggy___ you are correct in what i want. so i would probably need a microcontroller to do what i want?
@ canadaelk Do you have a stairwell in your house? notice the light switches that control the stair lights. It doesnt matter if one switch is up or down. its changing the switch which turns the light on or off. both switches could be down " off by convention" but the light will be on. This is done through the use of traveler wires .

I cant use anything logical( i think) because i would not be able to turn the light off.

i think microcontroller is easiest if it is an option, then all you need is voltage divider resistors, and rectifier circuit on each 120v line (if its not dc already)
otherwise like i mentioned earlier, you are looking for a flip flop to toggle the led,

since you DO NOT WANT TO CONTROL THE SWITCH, and just detect a change,
\
there maybe a way to make a flipflop toggle the led ... plus then you would need more ff's to store the old state and new states, , then some AND logic to compare the difference between states, and triggers re-store the new state and do the toggle, but again that circuit could get a bit complicated ...
 
i think microcontroller is easiest if it is an option, then all you need is voltage divider resistors, and rectifier circuit on each 120v line (if its not dc already)
otherwise like i mentioned earlier, you are looking for a flip flop to toggle the led,

since you DO NOT WANT TO CONTROL THE SWITCH, and just detect a change,
\
there maybe a way to make a flipflop toggle the led ... plus then you would need more ff's to store the old state and new states, , then some AND logic to compare the difference between states, and triggers re-store the new state and do the toggle, but again that circuit could get a bit complicated ...
Why are you ignoring the simple XOR solution? :confused:
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top