1 input 4 output circuit for light control

AnalogKid

Joined Aug 1, 2013
11,045
I'm between computers, so here is a text circuit based on the schematics in posts 5, 8, and 11. #11 is close, but I don't understand what the flipflop is doing. There are 10 defined states and 10 outputs, so there is no need for a feedback reset connection.

Debounced pushbutton
CD4017, CD4071 (quad OR gate), 4 x 2N7000
4017 outputs Q0, Q2, Q4, and Q6 go to 1 input of each OR gate
4017 output Q8 goes to the other input of all OR gates
Each OR gate drives a 2N7000; Each 2N7000 drives a relay
R-C power on reset to the 4017 Reset input

ak
 
Last edited:

ScottWang

Joined Aug 23, 2012
7,400
I'm between computers, so here is a text circuit based on the schematics in posts 5, 8, and 11. #11 is close, but I don't understand what the flipflop is doing. There are 10 defined states and 10 outputs, so there is no need for a feedback reset connection.
I was over thinking and concerned that it needs a reset signal and also forgot the CD4017 preparing to do the automatic recycling when the d-ff shifted to Q9.

Switch_NE555_CD4017_Bjt_Relay-03_AlbertHall.png
 

AnalogKid

Joined Aug 1, 2013
11,045
Using the CD4071 and 2N7000's reduces the component count by 11 and the soldered pins by 10. Add one decoupling cap for the chip.

OR - replace the diodes/OR gates, the relay driver transistors, and the relay coil suppression diodes with one (1) ULN2804. Everything to the right of C2 all in one chip. 18 soldered pins instead of 46.

Q0, 2, 4, and 6 each drive one 2804 section, and each section drives a relay. Q8 drives four 2804 section inputs as a group. Each of those four outputs is in parallel with one of the individual outputs from Q0, 2, 4, 6. That is the OR function that turns on all lights in step 9.

ak
 
Last edited:

AlbertHall

Joined Jun 4, 2014
12,346
I'm between computers, so here is a text circuit based on the schematics in posts 5, 8, and 11. #11 is close, but I don't understand what the flipflop is doing. There are 10 defined states and 10 outputs, so there is no need for a feedback reset connection.

Debounced pushbutton
CD4017, CD4071 (quad OR gate), 4 x 2N7000
4017 outputs Q0, Q2, Q4, and Q6 go to 1 input of each OR gate
4017 output Q8 goes to the other input of all OR gates
Each OR gate drives a 2N7000; Each 2N7000 drives a relay
R-C power on reset to the 4017 Reset input

The circuit powers up in the Q0 state with all lamps off.

ak
But you have Q0 turning on a relay.
Also it doesn't meet the requirement that pressing the button lights the next in sequence and then releasing the button turns outputs off.
 

AnalogKid

Joined Aug 1, 2013
11,045
I am off my game today. But that does explain why I didn't think the first few schematic were correct. My bad. However, this means that the input button must be pressed continuously for any lamp to be lit. Seems strange, but whatever.

I can get most of the way there with a 4017, 4081 quad AND, and 2803 octal driver. The only messy is part turning off all outputs when the button is released while Q4 is high. The next button press turns on Q5, which is tied to the reset input and flips the 4017 around to the starting state. Almost there.

One option is to go with triple-input gates, but that seems messy.

ak
 

AlbertHall

Joined Jun 4, 2014
12,346
I am off my game today. But that does explain why I didn't think the first few schematic were correct. My bad. However, this means that the input button must be pressed continuously for any lamp to be lit. Seems strange, but whatever.

I can get most of the way there with a 4017, 4081 quad AND, and 2803 octal driver. The only messy is part turning off all outputs when the button is released while Q4 is high. The next button press turns on Q5, which is tied to the reset input and flips the 4017 around to the starting state. Almost there.

One option is to go with triple-input gates, but that seems messy.

ak
It is not an easy thing to design - but fun :)
I wouldn't design it this way. I would be going the uC route. That way when the customer changes the spec you just reprogram the uC. You don't have to throw the board away and start again.
 

ebeowulf17

Joined Aug 12, 2014
3,307
However, this means that the input button must be pressed continuously for any lamp to be lit. Seems strange, but whatever.
It's not at all strange if the input is a maintained switch (I'm guessing this is what was meant by "on/off",) as opposed to a momentary switch. Then it makes perfect sense to have "off" always equal off, but to have each subsequent "on" cycle through the available output options.
 

AnalogKid

Joined Aug 1, 2013
11,045
A DPST or DPDT switch makes things much easier.

EDIT: Now that I think about it, a SPST switch will work. If you reverse the positions of S1 and R1 in post #24 so that one pole of S1 is tied directly to the rail, then the output of S1 can clock the 4017 *and* power the relay coils. This eliminates the gating needed to turn off the lamps when the switch is off. We're back to one 4017 and one 2804.

ak
 
Last edited:

ScottWang

Joined Aug 23, 2012
7,400
A DPST or DPDT switch makes things much easier.

EDIT: Now that I think about it, a SPST switch will work. If you reverse the positions of S1 and R1 in post #24 so that one pole of S1 is tied directly to the rail, then the output of S1 can clock the 4017 *and* power the relay coils. This eliminates the gating needed to turn off the lamps when the switch is off. We're back to one 4017 and one 2804.

ak
I just thought that I could be wrong for the output of CD4017, because there was a product already assembled in the wall of my room and I think what the TS want is something like this and this(there is wiring diagram inside more clearly) , and the first status could be wrong, it should be I=0(off), the effects like this video below.
.

And it used the wall toggle switch like this or other switches has the same function, but this kind of function will be included the transformerless power supply for the logic ic, so I think probably this thread will be closed soon, I will bring this issue in Mods Team to discuss.

I was designed a case like this one before, but it didn't completed, and the output was used TRIAC to replace relay.
 
Top