LED sequence project

Thread Starter

Zaydonandrew

Joined Feb 15, 2017
10
I'm currently working on a project which requires a circuit that is able to turn on one LED the first time it's pressed, and then a different LED the second, and so on and so forth. But I was thinking of a tactical flashlight system, but instead of different flash sequences, different LED's.
 

wayneh

Joined Sep 9, 2010
18,104
Good for you. Do you have a question? Personally, I'd probably use a 4017 counter to advance from one LED to the next.
 

wayneh

Joined Sep 9, 2010
18,104
A counter like the 4017 receives a clock signal - like a pulse from a button switch or a timer IC such as the 555 - and advances its output from one pin to another. The 4017 can count to 10, so you can have as many as 10 LEDs lit up in sequential fashion each time you send a pulse to the 4017. Then it resets and starts over. Does that sound like what you want?
 

Thread Starter

Zaydonandrew

Joined Feb 15, 2017
10
A counter like the 4017 receives a clock signal - like a pulse from a button switch or a timer IC such as the 555 - and advances its output from one pin to another. The 4017 can count to 10, so you can have as many as 10 LEDs lit up in sequential fashion each time you send a pulse to the 4017. Then it resets and starts over. Does that sound like what you want?
Yes, it sounds perfect. Will a circuit like this be small enough to fit in your pocket?
 

wayneh

Joined Sep 9, 2010
18,104
Yes, it sounds perfect. Will a circuit like this be small enough to fit in your pocket?
Absolutely, if that's all it does. What sort of LEDs are you thinking of and what kind of power source? The LEDs might need heat sinks and, as you know, batteries can be bulky.
 

Thread Starter

Zaydonandrew

Joined Feb 15, 2017
10
Absolutely, if that's all it does. What sort of LEDs are you thinking of and what kind of power source? The LEDs might need heat sinks and, as you know, batteries can be bulky.
The LED's are just standard sized 2 V bulbs. And as far as power supply I am also seeking consultation. Your guess would be better than mine.
 

wayneh

Joined Sep 9, 2010
18,104
The LED's are just standard sized 2 V bulbs.
I don't know what that means. Most generic (not high power or otherwise unusual) LEDs require 5-20mA and a minimum of ~3V to light up.

You should be able to use a single resistor to limit the current, since only 1 LED will be on at any one time. A 4017 IC cannot source enough current to damage a 20mA LED anyway, so you might even do away with the resistor.

Are 3 AA's acceptable? Or maybe a 9V battery?

I think what AK is about to suggest is that an "off" state is just like a 4th LED, but with no LED actually present. You can then reset the timer IC without counting up al the way to 10.
 

Thread Starter

Zaydonandrew

Joined Feb 15, 2017
10
I don't know what that means. Most generic (not high power or otherwise unusual) LEDs require 5-20mA and a minimum of ~3V to light up.

You should be able to use a single resistor to limit the current, since only 1 LED will be on at any one time. A 4017 IC cannot source enough current to damage a 20mA LED anyway, so you might even do away with the resistor.

Are 3 AA's acceptable? Or maybe a 9V battery?

I think what AK is about to suggest is that an "off" state is just like a 4th LED, but with no LED actually present. You can then reset the timer IC without counting up al the way to 10.
9V might work, but 3 AA's might be a little bulky
 

Thread Starter

Zaydonandrew

Joined Feb 15, 2017
10
I don't know what that means. Most generic (not high power or otherwise unusual) LEDs require 5-20mA and a minimum of ~3V to light up.

You should be able to use a single resistor to limit the current, since only 1 LED will be on at any one time. A 4017 IC cannot source enough current to damage a 20mA LED anyway, so you might even do away with the resistor.

Are 3 AA's acceptable? Or maybe a 9V battery?

I think what AK is about to suggest is that an "off" state is just like a 4th LED, but with no LED actually present. You can then reset the timer IC without counting up al the way to 10.
Also how would you reset the timer to not count all the way to 10
 

wayneh

Joined Sep 9, 2010
18,104
Read the data sheet for the 4017. It will take a while to grasp the various concepts but it's worth it. In short you apply the counter output, for instance when it hits 3 (the first one is zero) to a reset pin instead of an LED.

You may benefit from this.
 

Thread Starter

Zaydonandrew

Joined Feb 15, 2017
10
Read the data sheet for the 4017. It will take a while to grasp the various concepts but it's worth it. In short you apply the counter output, for instance when it hits 3 (the first one is zero) to a reset pin instead of an LED.
So is set up the 0 pin to the first LED the 1 to the second LED, the third to the 2, and then the third pin to the reset pin?
 

AnalogKid

Joined Aug 1, 2013
12,132
I think what AK is about to suggest is that an "off" state is just like a 4th LED, but with no LED actually present. You can then reset the timer IC without counting up al the way to 10.
Also how would you reset the timer to not count all the way to 10
I think you'll want the "3" to be for all LEDs off, and then reset on 4 (the 5th state).
Almost. A direct connection from the "4" output will reset the counter and leave it sitting in the "0" output. This is the state with all LEDs off. Subsequent inputs advance the counter to 1, 2, 3, and then to 4 again when it resets to 0.

To make sure the counter does not power up in a random state such as 6, where it would take 4 button presses to get it into the correct cycle, connect "4" to Reset with a small signal diode such as a 1N914 or 1N4148, and connect an R-C power on reset directly to the Reset input.

Wayne's suggestion also will work. With his circuit, the device will power up with LED #1 ON. With my circuit, the device will power up with all LEDs OFF. Other than that the two circuits are the same.

ak
 
Last edited:

Thread Starter

Zaydonandrew

Joined Feb 15, 2017
10
Almost. A direct connection from the "4" output will reset the counter and leave it sitting in the "0" output. This is the state with all LEDs off. Subsequent inputs advance the counter to 1, 2, 3, and then to 4 again when it resets to 0.

To make sure the counter does not power up in a random state such as 6, where it would take 4 button presses to get it into the correct cycle, connect "4" to Reset with a small signal diode such as a 1N914 or 1N4148, and connect an R-C power on reset directly to the Reset input.

Wayne's suggestion also will work. With his circuit, the device will power up with LED #1 ON. With my circuit, the device will power up with all LEDs OFF. Other than that the two circuits are the same.

ak
Do you think that you could sketch this out for me and possibly send it to my email zaydonandrew@yahoo.con
 

djsfantasi

Joined Apr 11, 2010
9,237
Never post your email address on a public forum. The address harvesters will have it in a second and you will get more junk email. You can edit your post...

Here’s a schematic I drew up tonight. One issue, which I hadn’t seen discussed, is that your ‘button’ will generate multiple pulses with each press. What this means is that your LEDs may appear to light in a random sequence. This is called switch bouncing.

Here is the schematic.
Counter.PNG

So what can you do? Debounce the switch and I am serious. That is what it is called.

Also, as @AnalogKid mentioned, you will need a power on reset. He outlines it in his post, but missed a required resistor. I don't neccesarily agree with his implementation.

The upshot of the last two paragraphs is that you’ll need another chip. On the schematic the additional chip is shown. I was able to use ¼ of the chip for the switch debounce circuit and another ¼ for the power on reset. The remaining gates have their inputs tied to ground, so as not to cause issues.

First, don’t be alarmed. Second, post any questions and I will answer them.

I also wonder if you are a programmer. A tiny micro controller will do all that you ask, without a lot of additional circuitry. They are small; see the picture below.

Trinket.jpg
 

AnalogKid

Joined Aug 1, 2013
12,132
I didn't miss the resistor; it's right there in the "R-C" part of the sentence. If you reverse the R and C in your drawing, you can eliminate the gate, its diode, and the 10K pulldown resistor. You still need the diode coming from the "4" output.

I don't think you need an additional chip. The 4017 clock input has hysteresis, so you can hang the R, C, and switch on it directly. I'll try to whip out a schematic tomorrow.

ak
 

Thread Starter

Zaydonandrew

Joined Feb 15, 2017
10
I didn't miss the resistor; it's right there in the "R-C" part of the sentence. If you reverse the R and C in your drawing, you can eliminate the gate, its diode, and the 10K pulldown resistor. You still need the diode coming from the "4" output.

I don't think you need an additional chip. The 4017 clock input has hysteresis, so you can hang the R, C, and switch on it directly. I'll try to whip out a schematic tomorrow.

ak
Wow. I am really out of my depth, if you guys could break this down into terms a guy that barely knows AND, OR, and Inverter chips please.
 
Top