LED Sequencer

Thread Starter

JoshS

Joined Dec 14, 2014
12
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?
 

Bernard

Joined Aug 7, 2008
5,784
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.
 

djsfantasi

Joined Apr 11, 2010
9,156
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
 

Thread Starter

JoshS

Joined Dec 14, 2014
12
@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?
 

djsfantasi

Joined Apr 11, 2010
9,156
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.
 

Thread Starter

JoshS

Joined Dec 14, 2014
12
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?
 

djsfantasi

Joined Apr 11, 2010
9,156
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:

Thread Starter

JoshS

Joined Dec 14, 2014
12
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?
 

Bernard

Joined Aug 7, 2008
5,784
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.
 

Thread Starter

JoshS

Joined Dec 14, 2014
12
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
 

djsfantasi

Joined Apr 11, 2010
9,156
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:

Thread Starter

JoshS

Joined Dec 14, 2014
12
@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! ;)
 

eetech00

Joined Jun 8, 2013
3,859
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
 

Thread Starter

JoshS

Joined Dec 14, 2014
12
@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!
 

Thread Starter

JoshS

Joined Dec 14, 2014
12
@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.
 

Bernard

Joined Aug 7, 2008
5,784
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:

Thread Starter

JoshS

Joined Dec 14, 2014
12
@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?
 
Top