Momentary switch to step up lights

Discussion in 'General Electronics Chat' started by per_w_aberg, Jul 30, 2016.

  1. per_w_aberg

    Thread Starter New Member

    Jan 11, 2014
    1
    0
    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
     
  2. crutschow

    Expert

    Mar 14, 2008
    12,984
    3,223
    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?
     
  3. hp1729

    Well-Known Member

    Nov 23, 2015
    1,938
    218
    Design 105 CD4017.PNG
    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: Jul 31, 2016
  4. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,793
    829
    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.
     
  5. GopherT

    AAC Fanatic!

    Nov 23, 2012
    5,986
    3,729
    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
     
    Tonyr1084 likes this.
  6. hp1729

    Well-Known Member

    Nov 23, 2015
    1,938
    218
    That's good.
     
    GopherT likes this.
  7. hp1729

    Well-Known Member

    Nov 23, 2015
    1,938
    218
    Design 794 arrow blinker.PNG
    Using the CD4017 we end up with something like this. It can be expanded easily to any number of LEDs.
     
  8. Kjeldgaard

    Member

    Apr 7, 2016
    71
    16
    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.
     
  9. ci139

    Member

    Jul 11, 2016
    341
    38
    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
     
  10. Tonyr1084

    Active Member

    Sep 24, 2015
    531
    86
    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.
     
  11. Tonyr1084

    Active Member

    Sep 24, 2015
    531
    86
    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.
     
  12. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    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
     
    Last edited: Aug 1, 2016
  13. ci139

    Member

    Jul 11, 2016
    341
    38
    (google can't find) but a miniature rotary - cycled 4-position push-button (like a click on click off pen) - would define your app.
     
  14. GopherT

    AAC Fanatic!

    Nov 23, 2012
    5,986
    3,729
    Way to turn it from an electronics project into an electricians project.
     
  15. ci139

    Member

    Jul 11, 2016
    341
    38
Loading...