32 led sequential circuit help

Thread Starter

Final Bendy

Joined Jan 28, 2022
5
Hi, I've not too much experience with electronics (it's a while since I did any study at Uni). I'm looking to make a simple LED circuit to run on 12v max. The circuit will light 32 LEDs one at a time until all are lit, then when switch is opened the LEDs go off one at a time until all are off. I've looked at 555/4017 chip circuits but can't figure out how to change a standard sequencing circuit to meet me need. Any help would be much appreciated, thanks.
 

ElectricSpidey

Joined Dec 2, 2017
2,757
4017s won't do what you want, but cascaded 3914s might...depending on the "off" sequence.

Bi-directional shift registers will do the job with either ending sequence, in fact I would say they would work even better than 3914s in either case.
 
Last edited:

dl324

Joined Mar 30, 2015
16,839
I've looked at 555/4017 chip circuits but can't figure out how to change a standard sequencing circuit to meet me need.
Your description isn't very clear, but a CD4017 won't do what you want. If you don't want to use a microcontroller, you're going to need some shift registers. With shift registers, you can shift in 32 1's to turn all of the LEDs on, then start shifting in 0's to turn them off.

If you wanted them to turn off in the opposite order that they were turned on, you'd need a bidirectional shift register.

EDIT:
Welcome to AAC!
 
Last edited:

Tonyr1084

Joined Sep 24, 2015
7,852
hi FB,
Welcome to AAC,
You cascade 4017 like this circuit.
E
View attachment 258971
That circuit will either light one LED at a time or light all of them except for one LED at a time. And there's a way to use two 4017's and cascade 100 LED's - ONE AT A TIME. Give me some time and I'll see if I can find my drawing that shows this very thing. However, the TS is looking to light one LED, then a second, a third, fourth - - - 32nd. Then start extinguishing them one at a time. Another way to describe it he wants #1 on then with #1 on, light #2. Then add #3 - - - so on and so on. Then when all LED's are lit extinguish #1, then #2, then #3 - - - until #32 goes off. Then repeat. I assume repeat.

The right way is to use a series of shift registers. There's plenty of YouTube video's on shift registers and cascading SR's.

[edit] didn't take long to find it.
1643392301707.png
 

eetech00

Joined Jun 8, 2013
3,856
That circuit will either light one LED at a time or light all of them except for one LED at a time. And there's a way to use two 4017's and cascade 100 LED's - ONE AT A TIME. Give me some time and I'll see if I can find my drawing that shows this very thing. However, the TS is looking to light one LED, then a second, a third, fourth - - - 32nd. Then start extinguishing them one at a time. Another way to describe it he wants #1 on then with #1 on, light #2. Then add #3 - - - so on and so on. Then when all LED's are lit extinguish #1, then #2, then #3 - - - until #32 goes off. Then repeat. I assume repeat.

The right way is to use a series of shift registers. There's plenty of YouTube video's on shift registers and cascading SR's.

[edit] didn't take long to find it.
It is clear how the TS wants the LEDs to turn on.
The TS has not stated the sequence that the LEDs should turn off. Only that each LED turn off "one at a time".
 

Tonyr1084

Joined Sep 24, 2015
7,852
However, the TS is looking to light one LED, then a second, a third, fourth - - - 32nd. Then start extinguishing them one at a time. Another way to describe it he wants #1 on then with #1 on, light #2. Then add #3 - - - so on and so on. Then when all LED's are lit extinguish #1, then #2, then #3 - - - until #32 goes off. Then repeat. I assume repeat.
It is clear how the TS wants the LEDs to turn on.
Yes - I did say that. My circuit was in response to ericgibbs suggested approach. I felt compelled to show that you don't need to cascade a bunch of 4017's but to just use two of them. In fact, using my approach and a third 4017 you could chase 1,000 LED's before repeating.

I realize it doesn't approach the TS full question but I wanted to add it as a possible alternative. In my video I only chase 30 LED's when each transistor is powered from the second 4017.

I also said:
The right way is to use a series of shift registers.
 

Ian0

Joined Aug 7, 2020
9,667
four off 74HC299.
S0/S1 connected to the switch to set the direction.
DSL connected to VDD and DSR connected to Vss at the ends of the chain.
 

Thread Starter

Final Bendy

Joined Jan 28, 2022
5
That circuit will either light one LED at a time or light all of them except for one LED at a time. And there's a way to use two 4017's and cascade 100 LED's - ONE AT A TIME. Give me some time and I'll see if I can find my drawing that shows this very thing. However, the TS is looking to light one LED, then a second, a third, fourth - - - 32nd. Then start extinguishing them one at a time. Another way to describe it he wants #1 on then with #1 on, light #2. Then add #3 - - - so on and so on. Then when all LED's are lit extinguish #1, then #2, then #3 - - - until #32 goes off. Then repeat. I assume repeat.

The right way is to use a series of shift registers. There's plenty of YouTube video's on shift registers and cascading SR's.

[edit] didn't take long to find it.
View attachment 258972
Yes you're nearly correct in my required sequence, sorry I'm didn't explain correctly. When the circuit is switched on then the LEDs light 1 at a time (1 through 32) until all LEDs are on. Then when switch is turned off the LEDs extinguish 1 at a time ( 32 to 1) so that they are all off, actually if it's easier it could be 1 to 32. Thanks
 

Thread Starter

Final Bendy

Joined Jan 28, 2022
5
Wow I must say you guys are super helpful, I didn't expect as many replies and for them to be so quick. I think I can use the cascade shift register circuit as shown in the YT video Tonyr1084 relied with. Thanks everyone for your help. Im sure I'll be back again soon when I get stuck. Ben
 

Tonyr1084

Joined Sep 24, 2015
7,852
Perhaps a bar graph with 32 LED's will do. When powered on a large capacitor begins to charge. As the voltage rises one LED after another lights up until all 32 are lit. Then, when you shut it off, the cap discharges, extinguishing one light after the other in the exact manor you specified. Only doing that with 32 LED's in a bar graph arrangement will either mean a whole lot of comparators OR as one starts to light - and as it reaches full brightness the next LED has already begun to lighten up and approach full brightness. Sorry, I don't have a circuit I can point you to bar graphs. But I'm sure you can find something on the net.
 

Tonyr1084

Joined Sep 24, 2015
7,852
Here's a 10 LED bar graph video. I'd guess you can probably modify it to go up to 30 LED's. Is there a reason why you want 32 LED's?
 

AnalogKid

Joined Aug 1, 2013
10,986
Yes 1-32 then 32-1
Just so you know, that is a bit more difficult than 1-32 on, then 1-32 off. Regarding a typical digital solution:

For 1-32 on then 32-1 off, you need bi-directional shift registers and some steering logic.

For 1-32 on then 1-32 off, you need unidirectional shift registers with much more simple control logic.

ak
 
Last edited:

eetech00

Joined Jun 8, 2013
3,856
Yes 1-32 then 32-1
You could use 4 LM3914's and an opamp, or 555, triangle generator for the input signal.
If you can get away with 30 LED's, than could use 3 LM3914's with triangle input.
The triangle input would automatically sequence the LED's on/off.

The each LM3914 output can drive an LED up to 25-30mA.
 
Top