Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Up/Down LED Sequencer

Status
Not open for further replies.

erock1970

New Member
Hi all,

I've been working on a project and am trying to use a 4017 counter.

I have a 10 light LED bargraph, I want to make the LED's light one after the other until all the LED's are lit, and then have the circuit cycle back down until all the LED's are off again.

I've seen a few other circuits on this board but none that worked this way.

If any of you could point me in the right direction I would greatly appreciate it.

Thanks,

Erock1970
 
A 4017 counter only would light up one LED at at time, as you are probably aware. It would require significant additional logic to do what you want.

A simpler (analog) way is a **broken link removed** operating in the bar mode. If you put a triangular ramp voltage at the input, the LEDs will light up in sequence, and then go out in sequence.

How do you want to control the sequence?

For a continuous sequence you could use function generator chip such as the MAX038, ILC8038, or XR2206 to generate the sawtooth.
 
If you are satisfied with five LEDs a 4017 could do the job and have the LEDs lit forth and back. Requires a timer circuit to clock the counter.

Boncuk
 
I'll have to order some cd4011's tomorrow. I only have a few cd4013's in my parts bin. I'll look at the data sheets and see if I can improvise. Thanks for the schematic Collin55.

I built a circuit using a LM3914. The only problem I ran into was using a 555 as a triangle wave generator. The top and bottom LED's would stay lit for a disproportionate time, and it was hard to adjust the span and time constant. If I turned one pot it would affect the range on the other.

That's why I tried building the circuit using the 4017. I wanted to make something that would use a pulse instead of depending on a changing voltage. I was hoping to make the flow seem more constant.

I'll also look into the function generator chips Crutschow, might be a good alternative to a 555, especially since I'm trying to run it at a very low frequency.

Boncuk, 5 LED's would be fine. I've been searching high and low for a circuit I could use to do this, but all I could find was a Knight Rider circuit. Do you have a schematic?

Thanks,

Erock1970
 
One digital approach would be to use a bidirectional shift register such as the 4-bit CD40194. You can connect as many in series as you need. You would connect the LEDs to the shift-register parallel outputs (through drivers). Then you connect the "shift right" direction to logic high ("1"). This will sequentially illuminate each LED on each clock pulse. When you get to the last LED you reverse the shift direction, with the "shift left" connected to "0". This will sequentially turn off each LED.

You will need some logic to generate the up/down control signal for the shift-register. The could consist of a flip-flop that controls the direction with its state changing at the beginning count and the end count.
 
Hi Erock1970,

from my understanding an UP/DOWN flashing circuit is nothing else but a Knight rider circuit.

Here is a schematic driving 5 LEDs forth and back via small transistors.

The current limiting resistors are calculated for 20mA LED forward current and Uf=2.2V.

The timer circuit produces variable frequencies from 1 to 20Hz.

If you are interested in a PCB layout please PM me. (It's already done.)

The board is split into two, one for the control circuit and one for the LEDs. They can be connected with ribbon cable connectors (10 pins).

Boncuk
 

Attachments

  • UP-DOWN-SEQUENCER-SCH-P1.pdf
    37.8 KB · Views: 1,004
  • UP-DOWN-SEQUENCER-SCH-P2.pdf
    18.8 KB · Views: 814
You don't need the 6 gating diodes in the circuit presented above. Just 2k2 resistors in place of the 5k6.
 
You don't need the 6 gating diodes in the circuit presented above. Just 2k2 resistors in place of the 5k6.

Have you tried if this works properly?

I hate putting positive potential on the low output pin of a CMOS-IC.

Those six diodes take care of correct polarity, and one of them costs 1 Cent (per 100 to order).

Boncuk
 
Last edited:
You don't need the 6 gating diodes in the circuit presented above. Just 2k2 resistors in place of the 5k6.

I think the diodes are acting like an or gate, but they need pull downs to work right.
 
The 4017 will sink or source about 7 - 10mA. It's just 6 less parts if you don't use the gating diodes.
Talking Electronics LED dice project uses resistors to gate the 7 LEDs for the face of a DICE, so the concept works.

The diode gate in the above circuit has left the base floating but this is not a major problem.
Mikebits is correct in suggesting the "OR-gate" needs a resistor to 0v to fully complete the "OR" action.
The circuit is relying on the 0.7v drop between base and emitter of the transistor to provide the "LOW."
 
Last edited:
The 4017 will sink or source about 7 - 10mA. It's just 6 less parts if you don't use the gating diodes.
Talking Electronics LED dice project uses resistors to gate the 7 LEDs for the face of a DICE, so the concept works.

The diode gate in the above circuit has left the base floating but this is not a major problem.
Mikebits is correct in suggesting the "OR-gate" needs a resistor to 0v to fully complete the "OR" action.
The circuit is relying on the 0.7v drop between base and emitter of the transistor to provide the "LOW."

I don't see a big difference between using a pull down resistor and omitting it. At VDD=12V and a pull down resistor of 10KΩ the base voltage is 3.97274e-08 with a low counter output. Without pull down resistor it is 5.20027e-06 which are both far below any voltage to allow collector current flow. LEDs 1 and 5 which are switched without diodes have a low level base voltage of 2.7623e-08.

These low levels will also work perfectly when connecting to a digital circuit.

Once again, I hate forcing a low digital output high. I call such a thing a timed self-destruct circuit.

Boncuk
 
I don't see a big difference between using a pull down resistor and omitting it. At VDD=12V and a pull down resistor of 10KΩ the base voltage is 3.97274e-08 with a low counter output. Without pull down resistor it is 5.20027e-06 which are both far below any voltage to allow collector current flow. LEDs 1 and 5 which are switched without diodes have a low level base voltage of 2.7623e-08.

These low levels will also work perfectly when connecting to a digital circuit.

Once again, I hate forcing a low digital output high. I call such a thing a timed self-destruct circuit.

Boncuk

Now easy there Bon:) When the transistors are biased in the off state they may appear high impedance. This in turn leaves the diode cathodes in an unknown state. The Diode OR needs a logic 0 on the cathode side to function properly and the pulldown ensures this.

I do not dispute that you should not drive outputs, and I understand your reason for the diodes. All I am thinking is that pulldowns on the cathodes are a good precaution. Now take a deep breath...:D:)
 
I only said the resistor was necessary if you want to complete an "OR" gate.

The current taken by the 2k2 resistors is very small compared to the capability of the outputs of the chip and will not cause any damage.
We are not talking about the effective "LOW" of the diode gate but rather the fact that the bases are left floating when the outputs of the chip are low and this can cause problems with noise getting into the buffer transistors, especially if the collector-load values are very high-resistance.
 
Last edited:
Hi Mike and Colin,

I hope this satisfies you now. :)
 

Attachments

  • UP-DOWN-SEQUENCER-SCH-P1.pdf
    39.9 KB · Views: 689
My understanding is that the knight rider circuit only lights one LED at a time. Erock1970 wanted the diodes to light up sequentially until all are lit. That's why I suggested using a shift register, which can perform that function.
 
My understanding is that the knight rider circuit only lights one LED at a time. Erock1970 wanted the diodes to light up sequentially until all are lit. That's why I suggested using a shift register, which can perform that function.

Thank you Carl,

I missed that point. :(

Hans
 
The following circuit lights up the LEDs incrementally until all LEDs are illuminated:

**broken link removed**
 
Sorry, I didn't complete his requirement.

He also wants the lights to turn off in reverse sequence.
 
Use a microcontroller. Just one component! With a microcontroller I can make the LEDs dash across the display, accelerate backwards, flash 3 times or fade off the screen. It's the only way to do things. And the micro costs only a few dollars.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top