Momentary switch to step up lights

Thread Starter

per_w_aberg

Joined Jan 11, 2014
1
Hi

Can I put up my first question here? My aim is to have a switch operated by multiple pushes to step through a series of conditions (light a number of leds)

These are the states I like to cycle through:
None
a+b
a+b+c
a+b+c+d

I would like to keep operating voltage at 12V dc. What would be a cost and space effichent way to accomplish that?

Regards,

Per
Sweden
 

crutschow

Joined Mar 14, 2008
34,412
I suggest a CD4017 decade counter with a few OR gates.
The OR gate outputs would control the LED driver transistors.
What is the LED current?
 

hp1729

Joined Nov 23, 2015
2,304
Design 105 CD4017.PNG
Hi

Can I put up my first question here? My aim is to have a switch operated by multiple pushes to step through a series of conditions (light a number of leds)

These are the states I like to cycle through:
None
a+b
a+b+c
a+b+c+d

I would like to keep operating voltage at 12V dc. What would be a cost and space effichent way to accomplish that?

Regards,

Per
Sweden
Like a stepping switch from old pinball games? Every time you hit the switch it increments to the next output? How many steps? As suggested CD4017 looks like this.
 
Last edited:

djsfantasi

Joined Apr 11, 2010
9,160
Plus the components for a debouncing circuit. Depending on the rest of the circuit, you might be able to use diodes instead of OR gates.
 

GopherT

Joined Nov 23, 2012
8,009
A simple 4-bit binary counter works well too. I added mosfet switches - pick logic-level MOSFETS that can handle the current of your LEDs. A small indicator LED, less than 50mA - use a simple 2N7000.

Also, my circuit can be simplified by switching A and B LEDs with the same MOSFET.

EDIT: debouncing added.

image.jpg
 

hp1729

Joined Nov 23, 2015
2,304
Design 794 arrow blinker.PNG
Hi

Can I put up my first question here? My aim is to have a switch operated by multiple pushes to step through a series of conditions (light a number of leds)

These are the states I like to cycle through:
None
a+b
a+b+c
a+b+c+d

I would like to keep operating voltage at 12V dc. What would be a cost and space effichent way to accomplish that?

Regards,

Per
Sweden
Using the CD4017 we end up with something like this. It can be expanded easily to any number of LEDs.
 

Kjeldgaard

Joined Apr 7, 2016
476
I came to think of a number of D Flip Flop in series, with the first data input held high and the first not use output to reset all the D-Flip Flop.

Here is an early sketch with a NXP HEF4015B:

ShiftReg_1.jpg
With the slow rise and fall times of the de-bouncing on the switch input, I have drawn a RC networks between the two sections of D-Flip Flop in order to provide a longer holding time. This time should be significantly longer than the RC time of the contact input.
 

ci139

Joined Jul 11, 2016
1,898
I came to think of a number . . .
while the debouncing gets gradually better here -- items involved:
a low pass filter + a delayed treshold circuit:
the RS trigger that sets it's output as follows:
┌→ a low passed SW (dt1) to set RS - Q.rs _/¯ CP , RC delayed dt2(>dt1) - NAND(LoPsd(SW), NOT(Q.rs3gr)) to reset RS > Q.rs ¯\_ CP
└→ or a simplified v. of the above (as in prev. post) 100nF + schmitt trigger
 

Tonyr1084

Joined Sep 24, 2015
7,899
Seeing some good solutions. However, every solution so far - well, put it this way:

Condition 1: NO LED's lit.
Condition 2: AB
Condition 3: ABC
Condition 4: ABCD

Everything so far has AB for condition 1. The Four Bit counter Gopher suggests is my favorite so far, but it only has three conditions (#2, #3 & #4) With the fourth clock pulse the counter resets to output 0 (condition 2).

To best suit the requirements the decade counter approach is best, using diodes and transistors; diodes to isolate and transistors to handle the current needed for the LED's. Output 0 must be the "NONE" requirement (condition 1). Output 1, 2, and 3 can light the required LED's. With output 4 resetting the counter to output 0 (no LED's on).

HP1729 is on the right track but output 0 is still connected to LED A. It needs to be tied into LED B. And both LED's A & B can be driven through the single MOSFET.
 

Tonyr1084

Joined Sep 24, 2015
7,899
MY APOLOGIES TO GOPHER. His circuit DOES meet all four conditions. My error was in thinking that at least one output is always high. While that's true of the decade counter - it's NOT true of the binary counter.

Gopher's circuit will work.

Condition 1: | 0 | 0 | 0 | 0 | equals "NONE"
Condition 2: | 0 | 0 | 0 | 1 | equals "AB"
Condition 3: | 0 | 0 | 1 | 0 | equals "ABC"
Condition 4: | 0 | 0 | 1 | 1 | equals "ABCD"

With the next push of the switch (clock pulse):
Condition 5: | 0 | 1 | 0 | 0 | equals "RESET TO CONDITION 1"

Again, my apologies to Gopher.
 

AnalogKid

Joined Aug 1, 2013
11,037
Similar to post #8, I think using only 1/2 of a CD4015 is the most simple approach. An R-C network on the Reset input guarantees an all-off startup. A diode from the Q3 output to the Reset pin sends the circuit back to the all-off state.
1 - CD4015
2 - resistors
2 - capacitors
1 - small diode (1N914 or 1N4148)
3 - 2N7000 transistors to drive the LEDs

With minor circuit changes and no additional parts other than output transistors, the circuit can be extended to up to 7 output stages using the other half of the CD4015.

ak
LED-Stepper-1-c.gif
 

Attachments

Last edited:
Top