# latching sequencer for LEDs

#### charlie_r

Joined Jul 12, 2007
16
I am looking for a little help in creating a variation of an LED sequencer.

What I want to do is have a set of LEDs turn on in sequence, similar to using a 4017 decade counter, but keeping each individual LEDs on until the entire sequence has finished then start over. Is this possible?

C

#### a_kent

Joined Jun 12, 2007
30
If I were doing a project like this, I would use a small processor. Then you could tweak what it does, such as if the input was overwhelmed, flash a code, go backwards if you want, etc....

The PIC, for instance, can source or sink 25ma, generally more than enough for driving LED's directly.

#### charlie_r

Joined Jul 12, 2007
16
Thanks for your suggestion. I do have one problem with that though, I don't know how to program an ATtiny or PIC, and have very limited electronics design experience. But you have given me an idea of what to look for, maybe someone out there has already written the coding for this type of app.

As for current needs, I do know how to use a Darlington pair type setup for driving higher currents.

I'll try to clean up my diagrams and post them here along with a description of what I am trying to accomplish.

C

#### charlie_r

Joined Jul 12, 2007
16
Ok, an explanation for what I am trying to accomplish:

I ride my bicycle on a daily basis through sometimes heavy traffic. I needed something to get the attention of the cars and trucks I have to share the road with, for my own safety.

I have modified a circuit I found online at this site to make an alternating flasher similar to what some emergency vehicles have.

Here is the schematic I came up with, it seems to work fine.

I am also trying to come up with a turn signal setup similar to what was used on a few cars in the mid to late '70s, like this.

From a_kent's post, I think he's right. A microcontroller may be the only way to do this. However, I know almost nothing about these things, so would appreciate some help in the design and programing of the proper circuitry.

Thank you,

C

#### Pootworm

Joined May 18, 2007
29
You could pull it off with a 555 and a fist-full of BJTs, but it'd be very, very easy to do with a micro.

If you don't expect to be doing a whole lot with micros after this, you might just see if someone will send you a pre-programmed one for a few bucks, rather than go through getting yourself an AVR programmer and then doing the actual flash programming yourself.

#### charlie_r

Joined Jul 12, 2007
16
I've been all morning searching the term "sequential turn signals" and such. Found plenty out there from commercial interests, for automotive use, but almost nothing on DIY except how to install commercial units into your car.

I knew that people had already done this type of thing, but i don't want to pay $75-$300 for something I should be able to build with a little guidance, and a huge amount less $$. I'll look further into trying to learn how to use uC for this, as it seems the most logical and cheapest way to go. Thanks for your input! C #### recca02 Joined Apr 2, 2007 1,211 some of the links u powted didnt work on my pc , and from what i gather from ur post abt an arrangement similar to decade counter and keeping the led on how abt using a shift register? #### Pootworm Joined May 18, 2007 29 Back to your decade counter idea... You could use a decade counter with some flip flops to keep the already-counted lights active. Maybe like a quad flip-flop w/ clear (http://www.fairchildsemi.com/ds/MM/MM74HC175.pdf), and have one of the outputs on the decade counter reset the flip flops and reset the decade counter. Or some other reset mechanism, maybe an AND gate connected to the outputs of the flipflops that would reset everything. #### mrmeval Joined Jun 30, 2006 833 http://www.arduino.cc Open hardware design and open source Integrated Development Environment. It does have a bug with one of the resistors which only causes a problem if you're running it stand alone but they're reasonably cheap and that's easy to fix. You'd want the Arduino, power supply, assembled protoshield board and the have a bread board handy. The proto shield is not absolutely needed but it's nice to have. You could also look at the arduino mini and having the serial setup on the protoboard rather than the USB the Arduino has. That's a bit cheaper but you have to provide more in the way of support hardware when prototyping. I can sequence the LEDs in so many ways. The atmega168 has a large number of digital IO and also analog IO. If you need more IO just add a serial to parallel chip. For LEDs I'm looking at a HEF4794B which works similar to the logic chip of the same base number but has a 20ma per pin LED driver output. It has 8 outputs. Thread Starter #### charlie_r Joined Jul 12, 2007 16 Thanks for all your input! Can anyone pick this apart? I understand that the last transistor will be carrying quite a load, but i don't think it will be too much for it. Thread Starter #### charlie_r Joined Jul 12, 2007 16 Here's another go at trying to figure this out. If I'm reading the logic gate thing right, if I use a nand gate between the 4017 and the switching transistors, I still would need to invert that signal. If I could have someone look this over and tell me what I'm doing wrong or right..... #### Ron H Joined Apr 14, 2005 7,012 On1aag has already shown you the best way to do it, short of using a microcontroller. You can add as many shift registers in the middle of the string as you need. You might have to add a transistor driver for each LED, because CD4000 series doesn't have much output drive capability. Thread Starter #### charlie_r Joined Jul 12, 2007 16 Ok, i get the point. it would be much simpler to use the PIC. Now, with VERY limited knowledge of those, and not wanting to have to lay out$$$$for a programmer and learn how to use it for a one off project, who among you is willing to program a pair of PICs for me to accomplish this task? #### SgtWookie Joined Jul 17, 2007 22,201 If you don't wish to go with any additional functionality, you could just use a parallel-out serial shift register w/clear like Recca02 suggested. Tie the shift in pin to Vcc, so that with every clock, another LED becomes lit. Wire the highest output pin to the clear pin, or cascade another similar shift register, eventually tying the highest output to the clear pin. Depending upon the shift register you select, you may need to use an inverter,like an inverting buffer gate or a NOR gate with both inputs wired together. Then wire the outputs to your driver transistors. This avoids the problem of having the one transistor carrying a hefty load, and eliminates the need for the diodes altogether. You could use a CMOS 4015 or a TTL 74x164, or equivalent in another family. #### a_kent Joined Jun 12, 2007 30 #### blueroomelectronics Joined Jul 22, 2007 1,758 Ok, i get the point. it would be much simpler to use the PIC. Now, with VERY limited knowledge of those, and not wanting to have to lay out$$ for a programmer and learn how to use it for a one off project, who among you is willing to program a pair of PICs for me to accomplish this task?
You can build a basic PIC programmer with a handful of resistors.
http://www.stolz.de.be/

#### charlie_r

Joined Jul 12, 2007
16
thanks for the ideas. guys!

#### spar59

Joined Aug 4, 2007
57
If you are still struggling with this then please let me know how many LEDs you want to sequence and how long you want each scan to take.

I understand that you want to start off with all off then gradually adding another until all are lit and then back to all off.

Do you need these to go left to right and right to left depending on intended direction of turn (i.e. a true turn indicator like the example you referred to rather than just an attention getter), in which case would you want 2 seperate units or one centrally mounted bank of leds where the lighting commences from left to right or right to left depending on which way you want to turn - less LED's to buy. A PIC can give 25mA per output (per LED) but if you need more I believe you said that you had already used darlington drivers before and these could fit between the PIC and LEDs.

Let me know and I will start some PIC coding for you, I need to know how many LEDs so I can choose the appropriate PIC.

I can either send you the code for you to program your own PIC (I will test the code on a test rig before sending it) or could program one for you.

The type of PIC I am initially considering can manage up to 14 LEDs plus direction input signal - I would consider using one input to set direction if you want the single centrally mounted option i.e. if the circuit is energised with the input level low it will indicate one way and if the circuit is energised with the input level high it will indicate the other way (minimises wiring), alternatively I can program 2 inputs - one for turn left, one for turn right.

Obviously if you want 2 separate units direction is irrelevant but there would still be a limit of 14 LEDs maximum per unit.

Sorry for length of post but am trying to cover all aspects in one go.

Steve

#### charlie_r

Joined Jul 12, 2007
16
@sparc59

Steve, thank you for your offer.

I will be starting to gather the items needed to build my own programmer, and delve into the world of uC's.

In talking with one of my sons, he expressed the need for a few PICs as well. So we will be taking on this project.

I have also come up with a few ideas for other projects as well so will need to learn to program them myself.

Again, I thank you for your kind offer!

charlie