how to ........sequentially control two lights with one switch

GopherT

Joined Nov 23, 2012
8,009
What is the reason for or advantage of having an of state between each on state combination?
ak
Why are you asking? Don't you realize that decisions like that come from marketing! The specifications were carefully laid out based on focus groups. The focus group could not agree on which cycle the OFF state should be in the cycle (A, B, A+B) so they agreed on OFF being between all of them.
 

Thread Starter

firosekhan

Joined Apr 13, 2016
15
AnalogKid, If you read the project requirement you will realize that one has to operate mains switch (230VAC/120VAC) multiple times to have 3 possible options(A,B,A+B). So, alternate OFF state is by default.
 

Thread Starter

firosekhan

Joined Apr 13, 2016
15
dacflyer, thanks for help but it seems suggested product is a wireless capable dual relay module. With this you can control two load with either remote or mobile app.
 

Thread Starter

firosekhan

Joined Apr 13, 2016
15
GopherT, your solution is fine except one issue. It looks that counter clock is positive edge triggered only i.e. counter will not increment when switch is pressed from ON state to OFF state. which means every time one has to make the switch ON twice to get either of 3 result. (binary 1 both ON, 3 B ON, 5 A ON)
 

Thread Starter

firosekhan

Joined Apr 13, 2016
15
GopherT, I think this issue can be resolved, if N-mos is connect with R(reset) instead of Q0. Whats your view???
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,139
AnalogKid, If you read the project requirement you will realize that one has to operate mains switch (230VAC/120VAC) multiple times to have 3 possible options(A,B,A+B). So, alternate OFF state is by default.
I was referring to the schematic in post #19 (the one immediately before mine), which has no such default restriction.

ak
 

GopherT

Joined Nov 23, 2012
8,009
GopherT, your solution is fine except one issue. It looks that counter clock is positive edge triggered only i.e. counter will not increment when switch is pressed from ON state to OFF state. which means every time one has to make the switch ON twice to get either of 3 result. (binary 1 both ON, 3 B ON, 5 A ON)
Look in your first post. You asked for

- one on, then all off
- other on, then all off
- then both on then all off
- repeat

If you wanted
- one on
- other on
- both on
- off
- repeat
(please advice)

Also, it is assumed that this circuit would run with a momentary push button switch. If you want it to work with a toggle switch, that is another story.

Your initial request...
This is one complete Cycle

1st On -> Light A ON, Light B OFF
1st Off -> Light A OFF, Light B OFF

2nd On -> Light A OFF, Light B ON
2nd Off -> Light A OFF, Light B OFF

3rd On -> Light A ON, Light B ON
3rd Off -> Light A OFF, Light B OFF
Cycle repeats...
 

Thread Starter

firosekhan

Joined Apr 13, 2016
15
GopherT, first of all sorry for my bad explanation i.e. i have not mentioned about toggle switch. But, i did mentioned about purchased DUAL LED lights that operates with normal toggle switch in home.(230VAC since i am from India). Please see below link. And the sequence should be this only.

- one on, then all off
- other on, then all off
- then both on then all off
- repeat

http://www.aliexpress.com/item/5pcs...2443091781.html?spm=2114.40010308.4.74.2TNNbp
 

AnalogKid

Joined Aug 1, 2013
12,139
Inn the "then all off" state,not only are the lights or devices off, but the controller is unpowered. To preserve its position in the rotation it must have some kind of non-volatile memory, and that gets into timing. Apologies if this was answered already. I asked this a while back and don't recall seeing an answer.

What is the longest time period anticipated for the "then all off" states? In other words, how long does the controller have to remember the previous state before the command for the next state comes along? If it's only a second or two, then a small electrolytic capacitor can keep the controller state memory (like a CMOS counter) powered up during the off states. In this circuit, the cap will run dry during an extended off period and reset the controller to the beginning of the cycle at the next power-on. If it's indefinite (an hour, overnight, etc.) and you want the controller never to auto-reset itself to position 1, you'll need a true non-volatile circuit.

ak
 

Thread Starter

firosekhan

Joined Apr 13, 2016
15
AnalogKid, you pointed out it correctly. longest time period can be few seconds or at the most a minute as the application required the controller to remember the previous state only when toggle switch is being pressed(ON/OFF). And lets say if its left in OFF state in in-between state, it may get reset.(not an issue).

Keeping this in mind, want to ask if circuit suggested by GopherT will work with toggle switch as well??? Now would like to ask if my previous comment make any sense???

{ GopherT, your solution is fine except one issue. It looks that counter clock is positive edge triggered only i.e. counter will not increment when switch is pressed from ON state to OFF state. which means every time one has to make the switch ON twice to get either of 3 result. (binary 1 both ON, 3 B ON, 5 A ON) }
 

Thread Starter

firosekhan

Joined Apr 13, 2016
15
Based on feedback from GopherT but with bit different logic i had made the simulation circuit with counter from 0 to 4. Conditions are like this,
0 all off
1 A on
2 B on
3 Both on
4 reset.
Also i cam across this website http://www.falstad.com/circuit/circuitjs.html which provide quite user friendly online circuit simulator.
But for some reason, my circuit is getting stuck at one point. Please see atached pic and file to import in simulator.

Note:- I have used 2 N-mosfet as the circuit once worked when i used 2 N-mosfet instead of 1.
 

Attachments

Top