Controlling 6 light bulbs with one switch

AnalogKid

Joined Aug 1, 2013
12,143
Here is an updated schematic for higher-power bulbs. It is functionally the same schematic as #36, but U2 has been replaced with equivalent components rated for higher current.

NOTE: ll seven transistor part numbers are WAY overkill for this circuit. They are the correct transistor types that I have in my design libraries.

Where are you located? Others here can recommend better part numbers available in your area.

ak


Stepper-Six-Lights-2.c.gif
 

MrAl

Joined Jun 17, 2014
13,709
Concept schematic. Two chips (not six), and one of them is nothing but transistor drivers.

As others have said, the CD4017 steps through a six-output sequence one output at a time. Q1 enables power to any lamp only when the switch is pressed.

R2-C2 debounce the signal into the Clock input. R2 also keeps the clock input held low when the button is not pressed.

For higher current lamps, replace U2 with 6 small power MOSFETs and six transient suppression diodes. Also, replace Q1 with a PNP power transistor.

At room temperature, the static current of the circuit when the button is not pressed is approx. 10 uA.

Note: 4017 chips from some manufacturers always power up in the 0 state (pin 3 low). However, this is not a defined characteristic of the part. If you want a guaranteed startup condition, a power-on-reset (POR) circuit can be added at pin 15.

ak


View attachment 301354
Hello there,

Are the bulbs still to be rated at 1 amp or did something about the specifications change?
I ask because a 2N4403 can not handle 1 amp, and not sure if it will drop too much voltage to drive the bulbs properly.
 

MrAl

Joined Jun 17, 2014
13,709
Here is an updated schematic for higher-power bulbs. It is functionally the same schematic as #36, but U2 has been replaced with equivalent components rated for higher current.

NOTE: ll seven transistor part numbers are WAY overkill for this circuit. They are the correct transistor types that I have in my design libraries.

Where are you located? Others here can recommend better part numbers available in your area.

ak


View attachment 301389

Hello again,

Oh ok i see you updated the transistor. Gee this looks a lot like my circuit now :)
 

ThePanMan

Joined Mar 13, 2020
921
The 4017 has a Clock input and a clock Enable input. When the enable input is low, the clock input advances the output on the positive-going edge. BTW, this is a Schmitt trigger input. AND, clearly documented but rarely discussed, when the Clock input is held high, the Enable input advances the output on the negative-going edge. Note that the enable input is not a Schmitt trigger.
I knew it was something like that. Been a long time since I messed with the 4017 chip. Last time I did I ran into edge triggering issues as well. That's why I remember even that much about it. Thanks.
I should note that the microcontroller solution, number 2 in @MrChips post #2, has not been explored further. It would result in simpler hardware and the behavior could be changed if necessary just by reprogramming.
Simpler hardware but will require programming hardware - and knowledge of how to program.

Don't look at me - I haven't a clue when it comes to programming except for the very most basics and that was back in the 80's. I bet a lot has changed since then.
 

MrAl

Joined Jun 17, 2014
13,709
Here is an updated version of the circuit I had posted.

Note +Vcc has been separated from +BATT.
Because incandescent bulbs exhibit a significant surge current, that is capable of disrupting the count state as well as the debounce latch state when the battery voltage line gets pulled lower during the surge. Incandescent bulbs are notorious for having low cold resistance which can cause a current surge for several tens of milliseconds or longer. A small battery will not be able to handle that, and when the voltage gets pulled low the logic states could get lost leaving the state of the counter in a random count condition. By filtering the battery source voltage, we keep the states alive even during a surge.
I assumed 100uf would be enough.

It would also be easy to add a backup battery circuit (one more diode and a backup battery) that could hold the states if the main battery goes down for any reason.
 

Attachments

MisterBill2

Joined Jan 23, 2018
27,584
"BOB" got it right in post #3!! The NPN transistors will need to be able to carry the current to light the bulbs. OR use FET transistors that will saturate with 9 volts.
BUT using LEDs you can make it work with only one IC (4017), six transistors (MPSA13) and one current limiting resistor. Each press of the button will advance the counter and switch on one LED releasing the switch turns that off. The next button press advances one position and powers the next LED.
After press #6 there may be an extra press needed to skip an off state after the #6 LED.
 

AnalogKid

Joined Aug 1, 2013
12,143
In the #36 and #41 schematics there is no off state. On the 7th button press the counter jumps from the unused "6" output to the "0" output in less than 1 microsecond. If the TS wants an off state before the pattern restarts, that is a simple change of one connection.

ak
 

MrAl

Joined Jun 17, 2014
13,709
In the #36 and #41 schematics there is no off state. On the 7th button press the counter jumps from the unused "6" output to the "0" output in less than 1 microsecond. If the TS wants an off state before the pattern restarts, that is a simple change of one connection.

ak
Hi,

I don't think you need an off state, there are already 6 of them.
Think of what that would mean. You press the button, #1 lights then you let go and #1 goes out, you press again #2 lights, you let go and #2 goes out, etc., up to when you press and #6 bulb lights up, then when you release it #6 goes out, then when you press the button again nothing happens.
 

MrAl

Joined Jun 17, 2014
13,709
"BOB" got it right in post #3!! The NPN transistors will need to be able to carry the current to light the bulbs. OR use FET transistors that will saturate with 9 volts.
BUT using LEDs you can make it work with only one IC (4017), six transistors (MPSA13) and one current limiting resistor. Each press of the button will advance the counter and switch on one LED releasing the switch turns that off. The next button press advances one position and powers the next LED.
After press #6 there may be an extra press needed to skip an off state after the #6 LED.
Here's what it looks like so far.
1. press, bulb 2 turns on, release 2 goes out.
2. press, bulb 3 turns on, release 3 goes out.
3. press, bulb 4 turns on, release 4 goes out.
4. press, bulb 5 turns on, release 5 goes out.
5. press, bulb 6 turns on, release 6 goes out.
6. press, bulb 1 turns on, release 1 goes out.
then the pattern repeats.
However, this does show one interesting thing. If we do not include a POR (power on reset) circuit (usually a simple thing to implement) then can we be sure what state it will start up in each time, and does it matter what state it starts up in. In the above, it starts out by addressing bulb 1, but bulb 1 does not turn on until after the 6th press. After the first press, bulb 2 turns on, so if we want bulb 1 to be the first to turn all the time we have to first change the connections a little, making bulb 6 enabled via the [0] output, and bulb 1 enabled via the [1] output, etc., etc. So we have to shift them all up one notch. If the counter does not start at [0] by itself, then we would have to include that POR circuit also. That's only if the starting count matters.
 

Ya’akov

Joined Jan 27, 2019
10,241
I'd love to know what this thing is supposed to do. The application for dimly lit incandescent lamps is not obvious. What else isn't being said that could radically change the specs?

A description of the problem being solved would be... enlightening.
 

MrAl

Joined Jun 17, 2014
13,709
I'd love to know what this thing is supposed to do. The application for dimly lit incandescent lamps is not obvious. What else isn't being said that could radically change the specs?

A description of the problem being solved would be... enlightening.
Hi,

Yes, unfortunately we don't get all the information sometimes so it makes it harder to know what exactly is wanted.
My question now is does the counter have to start in any particular state, like at 0, at 1, at 2, etc., etc.
 

MisterBill2

Joined Jan 23, 2018
27,584
Which bulb lights first depends on whether you use the leading edge or trailing edge to trigger.
Advancing the counter on the release of the button may involve additional components. Of course, using a button with both normally open and normally closed contacts would allow a lot of additional options.
Here again we have a TS requesting a narrow solution instead of a function. Often this leads to a long string of guesses that do not exactly meet the actual requirements.
 

MrAl

Joined Jun 17, 2014
13,709
Which bulb lights first depends on whether you use the leading edge or trailing edge to trigger.
Hi,

As long as the bulb lights when you press the button it should be ok. I don't think it matters if you use leading or trailing edge it just may require a slightly different connection to the 6 outputs of the counter.
What we don't know yet is if it has to start up in some predefined condition, such as the first bulb is to light first. That would dictate more about the connections and the edge. Most likely the first bulb is to light with the first press, or else it is to be random. The best edge though, in my opinion, is the leading edge because that way we get the benefit of the Schmitt Trigger input which could allow a simplification of the pushbutton debouncing. For something like this though if a SPDT pushbutton switch is available, I would do it that way instead of an RC network. I used a SPDT switch long ago for single stepping through instructions in a Z80 microprocessor back when they were just becoming popular and that method never fails. At the time I had just one such SPDT switch too.
 

MrAl

Joined Jun 17, 2014
13,709
Trailing edge would preclude the bulb being lit while pressing the button. OR perhaps that may be the way to get bulb 1 to light first. Not sure.
Hi,

Well this is interesting because if you do use the trailing edge, you can do that two different ways too. You can have the trailing edge occur when the button is released or when it is pressed.
If you have it occur when it is released, then the NEXT bulb is ready to be lit up on the next button press.
If you have it occur when it is pushed, then you have it advance one clock and light that very bulb.
So either of those methods work I think.
I would use the Schmitt Trigger input though to advance the counter as that also helps to unsure just one clock for each button press or each button release.

We just have to be a little more careful how we wire up the bulb drivers when we have to start in one particular state. The usual state to start in is zero, and the chip may do that automatically but I did not check. If not and we include a simple POR circuit it will always start at zero.

This happened to be a sort of fun little circuit.
As others have mentioned, we have to wait for more information before it can be finished entirely.
 

ThePanMan

Joined Mar 13, 2020
921
I suppose. My thinking is that if you clock on the falling edge (was thinking of a positive pulse) the light wouldn't light until you actually clocked the 17. But then it wouldn't light because the button isn't pressed. But you point out that it can still be on the negative going edge, which would mean the clock would be held high by a pull-up resistor and only go low when the button pulls the clock low.

But now I'm thinking you have to use the button to pull all the lamps low at the same time.
I'm so confused.
 

AnalogKid

Joined Aug 1, 2013
12,143
I haven't been following this. When you say you want to clock the 4017 on the falling edge, are you talking about clocking it when the switch is released? If so, the TS was pretty clear about not wanting that.

OR - are you talking about clocking the 4017 on the switch release, then enabling lamp power on the next switch press - ? That would work, but I'm not sure it has any advantage over any of the schematics presented so far. Still, if this were a class exercise, that would be a good bonus credit problem.

ak
 

MisterBill2

Joined Jan 23, 2018
27,584
Assuring that it is the first bulb lights on the first press canbe done with a simple RC POR function. But that requires switching power on prior to the start. Maybe that is OK, maybe not.
 
Top