LED Sequencer

Discussion in 'The Projects Forum' started by JoshS, Dec 14, 2014.

  1. JoshS

    Thread Starter New Member

    Dec 14, 2014
    12
    0
    So I'm starting a new project, trying to light up 3 LEDs with one push button kind of like a sequencer. However, I don't want the previous LEDs to shut off, but instead, just have the next one turn on with the push of a button. I was thinking this would be better done with a microprocessor instead of a controller, but I'm still new to this side of the tech world. Any suggestions as to what I should do?
     
  2. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,170
    394
    Is it " one button" or " a button"? Sounds like a short bar graph. Anything special about the LED's? Could be simple, SW debouncer ( 555), parallel out shift register, LED driver. or a 4017 or 4022, OR gate's , LED driver. OR more information.
     
  3. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,786
    825
    Well, it can be done with a microcontroller, even fairly easily if you are familiar with them and aren't afraid of coding. But what do you mean by "a controller"?

    It can be done with discreet components as well. A 4017 is a decade counter, and can sequence the LEDs, just not as you describe. But to get previous LEDs to remain lit, each subsequent position lights its predecessors through an OR gate. And it doesn't have to be a separate chip. You can create the OR gates with diodes. A picture might help. This is a quick example with only three LEDs. O1, O2 and O3 are outputs from the decade counter.

    seq_II.png
     
    Bernard, Art and JoshS like this.
  4. JoshS

    Thread Starter New Member

    Dec 14, 2014
    12
    0
    @djsfantasi I meant a microcontroller, just lazy me left out the micro-. I'm not too familiar with OR gates, but your picture helps a lot! This small "project" I wish to multiply by 14, hopefully powering them all by one source. Any suggestions on how I would come of that?
     
  5. JoshS

    Thread Starter New Member

    Dec 14, 2014
    12
    0
    @djsfantasi I found a decade counter that I believe would work for my project. Can you check out my schematics and see if you can find any flaws? I also attached the datasheet for the decade counter I'm using. Please bear with me, still learning a lot!
     
  6. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,786
    825
    I see two problems with your picture.

    First, what is the other end of the LED connected to?

    Second, I am not sure what he second resistor at each LED is for and why you've apparently bypassed the LED with a wire/connection.
     
  7. JoshS

    Thread Starter New Member

    Dec 14, 2014
    12
    0
    I guess that's where I got a little confused. There is only meant to be one resistor, connected to one of the LED, while the other end merges with the rest to complete the circuit back to the power source. Is that wrong?
     
  8. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,786
    825
    I've modified your drawing. It still has some problems, but for now - look at the LEDs. Is this what you meant by intending that there is only one resistor?

    I have a couple of other questions. What is the pushbutton for? Is that supposed to be a battery symbol? If so, see my comment.

    Also, my original sketch used an NPN transistor to drive the LED; it may not be necessary.

    Just be aware that the diode OR gate will introduce a voltage drop that has to be accounted for when calculating the current limiting resistor for the LED (that's what they're called in this application).

    We can later get into what you are going to use as a clock to drive the counter. Perhaps you can explain that to me. Right now, I'm confused. 2014-12-15 21.17.35.jpg
     
    Last edited: Dec 16, 2014
  9. JoshS

    Thread Starter New Member

    Dec 14, 2014
    12
    0
    1. Yeah, that was intended to be a battery. Good to know the difference now!
    2. The push button is intended to drive the counter, sequencing from LED 1; LED 1&2; LED 1,2,&3, then 0. I guess that's where this thread started, trying to figure out how to manually drive the counter instead of using a 555.

    Would an NPN transistor be better than the diodes I used to help amplify the voltage to account for the drop?
     
  10. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,170
    394
    The ckt. still needs some tweeking, but for me it is late. A pushbutton SW needs debouncing or you might get several counts with one push. a 555 can give debounce or as free running clock. Tomorrow will post 14 LED bar graph.
     
  11. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,170
    394
    Time for milk & cookies but one quick question: Future proj. 14 LED's or 42??
     
  12. JoshS

    Thread Starter New Member

    Dec 14, 2014
    12
    0
    14 of these exact circuits, 3 LED's each, making 42 LED's in total.
     
  13. JoshS

    Thread Starter New Member

    Dec 14, 2014
    12
    0
    This is roughly what the scoreboard will look like. The reason I thought different circuits is because I need each button to represent an individual score for the individual side of the scoreboard. Each time an specific button is pressed, it will sequentially light up the buttons, while leaving the last one lit. I thought it might just be done best by creating 14 individual circuits (boxed in red), but that's why I came here, for the expert advice!
    Cricket Scoreboard-page-001.jpg
     
  14. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,786
    825
    Here is a schematic of a counter, operated by a pushbutton, that will count up to three and then reset on the fourth button press.


    3ctr.png
    Note the circuitry on the bottom left (I show an SPST switch because LTSpice doesn't have a pushbutton model.) The RC circuit and the logic inverters debounce the switch, allowing only one pulse for one pushbutton press. Without this or similar circuitry, a pushbutton press results in many spikes dues to the mechanical nature of the switch.

    The counter uses OR gates to turn on an LED, if one up the chain is on. (It replaces the diodes in my earlier designs). The third OR gate, with it's inputs tied together is superfluous, but is there for balance.

    The fourth output of the counter feeds back to the reset input of the counter, hence stopping at three!

    If building multiple of these, I'd build at least two per PCB, to take advantage of unused gates (there are 4 inverters and 1 OR gate unused.) Any unused gates should have their inputs tied to Gnd.

    EDIT: There was a mistake in the original schematic, which I corrected. I had the LEDs connected to Vcc when they should have been connected to Gnd. I appeal my indiscretion because 1) I posted late or 2) I am used to driving them through an NPN transistor, where they would have been connected as originally drawn. :confused:
     
    Last edited: Dec 17, 2014
    absf and JoshS like this.
  15. JoshS

    Thread Starter New Member

    Dec 14, 2014
    12
    0
    @djsfantasi Thanks a lot for the help! I'm finishing up on finals week, so I'll take a closer look at that tomorrow, try to process it, and ask you if I have any questions. Stay tuned, I'll probably have a few! ;)
     
  16. eetech00

    Active Member

    Jun 8, 2013
    644
    110
    Hi joshs:)

    Just a little comment about drawing schematics.

    General practice is to draw the schematic with inputs and outputs left to right so signal flow from input to output is from left to right. Supply voltage sources should be drawn from top to bottom, so positive supply source at top and ground (or negative, and or negative supply sources) at bottom. Notes should be placed at bottom left corner and schematic title at bottom right corner. These are not hard fast rules but is good general electronic drafting guidelines.

    eT
     
  17. JoshS

    Thread Starter New Member

    Dec 14, 2014
    12
    0
    @djsfantasi A little bit of confusion caused on my part because of an inaccurate description, but initially, i want all the lights to be off, then turn on LED 1; LED 1&2; LED1,2,&3. This seems like a simple fix on the schematic you gave me, just moving the OR gate up one functional unit on the counter, if I'm not mistaken. And if I did this, I would not be able to use the other gates, correct? Because I would essentially need to use 5 gates on the counter itself. I'm still not too familiar with how the OR gate works, but I can take a look at that and try to figure it out, because I don't even know how to word my question yet. :D


    @eetech00 Thanks for the advice! In case you hadn't caught it, I'm still fairly new to this, so I'm grateful for all the advice I can get!
     
  18. JoshS

    Thread Starter New Member

    Dec 14, 2014
    12
    0
    @djsfantasi I guess my main question with the OR gate, or I guess that specific OR gate, is what is the arrangement for the pins? It's still a little fuzzy for me.
     
  19. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,170
    394
    JS, you are correct ; "0" stage will be high at reset so need to shift outputs up one place. Each 3 LED section needs 3 OR's, or 3/4 ths of IC package. the 4 th OR can be used with next group. Note that 4071 can logically supply .8 mA at VCC of 5V,
    but as a true logic level is not required, output can be loaded a bit more with lower V out., 74AC32 can deliver 20 mA. Still need to know what LED's that you are using & at what current.
    Seems that I misunderstood your application & even forgot to shift output down one place,; just blame it on another senior moment.
    How long does a group stay lit? Maybe untill the next PB is pressed?
     
    Last edited: Dec 17, 2014
  20. JoshS

    Thread Starter New Member

    Dec 14, 2014
    12
    0
    @Bernard One side of the board, I wanted to use red LED's, 2.2V max forward. On the other side, green LED's, 2.6V max forward. (Or possibly a combination of both; each line consisting of 2 reds and the 3rd one green). They're both 30mA continuous. The objective of the game is to get three of each number, so essentially, a line of LED's will stay lit until the game is over. I thought about including a spring loaded switch near the power source as a reset button for when the game is over, but will the counter just turn back on to where it previously left of? Is there any easier way to do this? Or will I have to wire all the resets together and attach that to another push button?
     
Loading...