Connect with us

Led sequencer/scanner

Discussion in 'LEDs and Optoelectronics' started by zenith, Nov 11, 2012.

Scroll to continue with content
  1. zenith

    zenith

    29
    1
    Nov 3, 2012
    Hi,
    I'm looking to build a led scanner/sequencer without using microcontrollers (yet),
    the basic effect I would like is a row of 18 leds which switch on 1 and 18, 2 and 17, 3 and 16, finishing
    with 9 and10. (scanning from ends to middle)

    The circuit below, to me, seems to just run 1 to 18 in sequence,

    So firstly, could it be altered to run how I want it, without too much trouble, or do I need a completly different circuit.

    Secondly, would the 4017 be able to run a second row of leds, so 2 leds per outlet, a total of 36, the leds will be 3mm red,
    20-30ma and 2.1 -2.4 fv, my power supply will be a 12v/12ah/5hr SLA battery (iirc, its 13.4 or 13.6v fully charged).

    Thirdly, can a varible resistor be used to control the speed?

    And lastly, once the sequence finishes at 9 and 10, could it be reversed, before starting the same sequence again?
     

    Attached Files:

  2. KJ6EAD

    KJ6EAD

    1,114
    159
    Aug 13, 2011
    It depends on what you consider too much. If you only wanted to sequence in one direction, from ends to center, you would only need one 4017.

    No, the 4017 can only drive ~15mA so you would need a driver transistor on each output group (2 or 4 LEDs). I might use a transistor array such as a ULN2804A to save space. That would cover 8 of your 9 output groups and a single transistor could handle the last one. Since you're using a battery, consider using an LM317 as a current sink to provide a stable LED current as the battery voltage drops. You won't have enough voltage headroom for the current sink with 4 LEDs per channel so you'd have to double the drivers to 18 channels if you went that route.

    Of course. Just look up 555 astable circuits. You should limit your fastest clock speed to 30Hz or less to prevent a dimming effect (LED on time < 30ms).

    Technically, no, but it can be made to appear so by ORing outputs of the 4017s such that step 10 in the sequence lights LED 8 and 11, etc. Look at the various "Knight Rider" circuits to see how this works.
     
    Last edited: Nov 11, 2012
  3. zenith

    zenith

    29
    1
    Nov 3, 2012
    Thanks for your reply KJ6EAD.

    Lets see if I have any idea what you mean. Forgive me if I don't :)


    If I used the circuit below, (single 4017) I could add another LED to the ones shown, using just the one transistor shown and I could add another transistor to each output of the 4017, which would give me 20 pairs of leds, so 4 x LEDs and 2 x transistors per output.

    The LM317 needs 2 resistors (R1 = 370, R2 = 3300) to give 12.4v or (R1 = 390, R2 = 3300) to give 11.83v even if the voltage input drops below that, until it can no longer function. Would it be better to alter the circuit to run on 12v, if so how?, or to use the LM317 to drop it to 5.97V (R1 = 180, R2 = 680) and would it require a heatsink ?

    To be honest, this is my first project, except for using diodes to steer current around, and I'm quite happy for now just to have them run each end to middle.
     

    Attached Files:

  4. KJ6EAD

    KJ6EAD

    1,114
    159
    Aug 13, 2011
    First, you need a base resistor (~2.2k) for each of the transistors.

    There's no problem with a 12V battery supply. I mentioned the use of an LM317 as a current sink, not as a voltage regulator. If you don't use it, you have enough voltage to drive 4 LEDs in series with each transistor but you'll get a decrease in brightness from the LEDs as the battery voltage drains from 12V to 10.5V.
     
    Last edited: Nov 12, 2012
  5. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    I agree with KJ6EAD, you will need some kind of buffering, such as a ULN2003 or ULN2804 with extra transistors pr MOSFETs to make up the number you need. You don't need extra drivers to drive two displays though; just connect each pair of LEDs in series, connect the cathode of both strings to the driver output, and common the anodes of each display and connect them to V+ through a current limiting resistor. With only two LEDs in each series string, there will be a lot of voltage dropped by the current limiting resistors, so the brightness change due to battery voltage drop may not be noticeable, but if you want to use active current limiting, you just need one limiter for each display.

    Then you need to generate the pattern. I'm not clear whether you want the LEDs to remain illuminated when the next pair illuminate, or whether you just want one pair on at a time. In the first case, you really need a bidirectional shift register such as the CD4034, 74HC670 or 74HC194. Also, you'll need individual current limiting for each string, otherwise the LEDs will get dimmer as more of them light up.

    In the latter case you could use a bidirectional shift register, or you could use an up-down counter (CD4029, CD4510/4516, 74HC190/191/192/193) feeding a decoder (CD4028, CD4514/4515, 74HC42, 74HC137/138, 74HC154). I would start by having a look at the data sheets for the CD4029, CD4028 and CD4034.

    Needless to say, a microcontroller could do all this very easily, and could drive a serially interfaced driver IC like the Texas Instruments TPIC devices or a dedicated LED driver, for a very compact circuit.
     
    Last edited: Nov 12, 2012
  6. zenith

    zenith

    29
    1
    Nov 3, 2012
    Thanks for your input KrisBlueNZ.
    My apologies for not being clearer, I should perhaps give some background on this project.

    A couple of months ago I agreed to take part in a competition, we have to build a trailer, for a bicycle, everything has to be made from recycled parts and not paid for, we have a budget of only £5.00, my trailer used to be a market stall, and we have to prove where we sourced every part.

    We can't use ready made lighting at all, we can however build our own circuits, but they can't use programable chips.

    At the rear of my trailer is a 20" bar, which I want to use to fix this array to. The effect I want is on then off, in sequence, from each end to the middle, at first it was going to be a single row of leds , which would light, then go off as the next led lit up, but after looking into it more, I'm going to go for 2 rows of 20 leds one on top of the other, so I have a double row of LEDs, only 2 LEDs on each display would be lit at any time. ( left display and right display)

    Having them reverse once reaching the middle would be nice, but not necessary.
    Once this project is finished and has been judged, I will be going for more effects as I have been using this trailer for a while now and its been quite useful.

    my knowledge of elecronics is very limited, I can follow a simple circuit diagram, like the ones I posted earlier and be confident I could build it, I'm learning more as people suggest things, I check every component with google and am getting a good idea of what they do.

    Hopefully I have made it a bit clearer and if you happen to know of a cicuit diagram that would do what I need, then please link me to it.:)
     
  7. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    That sounds really cool!

    Can you get any old circuit boards that might have a 4017 or a 555 or a ULN2003/2803? If you can't find the latter, you can use discrete transistors. You can also make the oscillator from discrete transistors. The sequencing logic can also be made with discretes in theory, but it's not practical, so you'll probably need a 4017.
     
  8. zenith

    zenith

    29
    1
    Nov 3, 2012
    I do already have 555 timers and 4017s several of each, which is why I was thinking that the second diagram I posted might have been the way to start, I also have lots of resistors, diodes, transistors and quite few things I haven't identified yet.

    As for the ULN2003/2803, if I don't have any, they seem to be cheap enough to buy a couple.

    It was being given these componants that got me looking at LED circuits, I was just going to set up a 12v car light system at first, but I kept looking at the box and wondering if i would be able to build something from them. So that led me to the internet and I'm hunting for info on things every chance I get now. :)
     
  9. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    True the ULN2003 and 2803 are cheap, but don't you want to keep every possible cent of your budget? And what about stripboard to construct the circuit on? You'll need money for that, won't you? If I was in your position I would use discrete bipolar transistors or MOSFETs as drivers.

    If you're using bipolar transistors, you need the following characteristics: Polarity = NPN, Vce (maximum collector-emitter voltage) 20 or more, Ic (maximum collector current) 100 mA or more (depending on the total LED current per output), package preferably TO-92 but any through-hole technology (THT) package (wire terminations) would be OK. I would connect them as emitter followers to avoid having to have base resistors. That is, base to CMOS output, collector to positive supply and LEDs (with limiting resistors) between emitter and 0V.

    If you're using MOSFETs, you'll need the following characteristics: Polarity = N-channel, Vds (maximum drain-source voltage) as per Vce above, Id (maximum drain current) as per Ic above, package as above. Connect them as common-source amplifiers (gate fed from CMOS output, source grounded, LEDs with limiting resistors between positive supply and drain).

    If you have some old circuit boards with lots of three-legged devices, post a list of their markings here and I (or someone else) can tell you which ones to consider. Any transistor marked Cnnnn or Dnnnn (short for 2SCnnnn and 2SDnnnn) (where the "n"s are any digit) in a suitable package will probably be suitable.
     
  10. zenith

    zenith

    29
    1
    Nov 3, 2012
    You know I never thought of the board :eek:

    The only transistors I have sorted so far are sn9304, they are TO-92 and have Collector-Emitter Voltage (IE = 0) 40 V and Collector Current 200 mA (taken from the datasheet)
    and some 2sc460 Collector-Emitter Voltage 30v and Collector Current 100mA also T0-92 type, would either of these be any use?

    There will be 2 leds per output.

    I have quite a few three legged devices to sort out yet, but I left them at work, so I won't be able to look at them until thursday.
     
  11. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Yes, both of those transistor types will be suitable. Is the "sn9304" a 2N3904? That's a common type.

    You're going to have four LEDs on at a time, right? And they'll be connected in strings, with each string consisting of two LEDs and a current-limiting resistor in series? So each transistor will drive two strings in parallel?

    Are you sure that 20~30 mA will give you enough brightness?

    Assuming each LED runs at 30 mA, with each output driving two strings in parallel, each transistor needs to pass 60 mA, so your 100 mA part will be fine.
     
  12. zenith

    zenith

    29
    1
    Nov 3, 2012
    1) Yes it is a 2 not an s, should really wear my glasses.

    2) 40 LEDs in total, 4 lit at any time.

    3) Brightness isn't really an issue with this project, I don't want it to overpower the main lights, it's more to catch the eye. The LEDs I will be using I did set 5 up in a small array in parallel and put them at the bottom of my garden, they seemed to be bright enough, used a 620ohm resistor I think.
    When the competition is done, I'm going to replace this with a microcontroller set up. then brightness will be more important to me.


    So if I have this right, the 555 feeds the 4017, each output of the 4017 will have 2 transistors connected, each transistor will have 2 LEDs connected in series, which then connect to the resistor?

    Thanks for your time and patience with this.

    Bry
     
  13. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Here's a schematic of what I think you want.
    [​IMG]

    I've shown the LEDs laid out the way I think you want them. There are two rows of 20 LEDs each, and both show the same display.

    The LEDs are connected into strings. Each string has two LEDs (one in the top display and one in the bottom display) connected in series, with a current-limiting resistor. Each output from the 4017 controls one transistor, which drives two strings connected in parallel.

    Here's how to calculate the current-limiting resistors.

    The voltage across each string will be roughly the battery voltage minus 1V (most of this is dropped in the driver transistor). Let's assume this voltage will be 12.6V. There are two LEDs in series in each string, so their forward voltages add. Assuming 2.3V per LED, that's 4.6V. The remaining voltage is dropped across the resistor. This will be 8V. Ohm's law says R = V / I where V is voltage across, and I is current through. If you want to run the LEDs at 30 mA, then I is 0.03 (I is always in amps). So R = 8 / 0.03 which is 267 ohms. The closest preferred value is 270 ohms.

    The components at the top right, in the dotted box, are to protect the 555 and the 4017 from voltage spikes that may be present on the 12V supply. If your 12V battery is only used for this display, there won't be any spikes, but if you're using it for other things as well, there may be. The varistor (R2) and the zener diode (D1) probably won't be found on scrap boards though, so you'll probably have to omit them. This leaves the 555 and the 4017 vulnerable to damage. If possible, include the 10 ohm series resistor and D1. D1 is a 15V zener diode, rated at 1 watt or more.
     

    Attached Files:

  14. KJ6EAD

    KJ6EAD

    1,114
    159
    Aug 13, 2011
    That's what I was thinking too but you can eliminate 18 of the LED current limiting/splitting resistors by creating dual resistor limited ground rails using just 2 resistors. This is possible since only one 4017 output channel is on at a time.
     
  15. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    D'oh! I knew that! I must have a screw coming loose. Thanks for pointing that out.

    [​IMG]

    The resistor value calculations are the same as before.
     

    Attached Files:

  16. zenith

    zenith

    29
    1
    Nov 3, 2012
    Kris you are a star, even if you do have a slightly loose screw :p

    I was getting my head around the circuit slowly, but now I've seen the diagram, I know what to do.

    And I must be learning, since I was going to question those resistors, one being if they were meant to be on the 12v side and the other if I needed so many. :)

    This circuit does run off its own 12v battery, the main lights have their own supply and the LED layout is perfect.

    Thank you for your, and KJ6EADs help with this, I'll let you know how I get on after this weekend.

    I do have a couple of questions though, just for my own curiosity and not this project.

    1) In an earlier post, you said that I could run a second transistor to each output, doubling the amount of LEDs. Is that as simple as it sounds?

    2).... I've totally forgotten the other question, I blame it on old age :D

    Bry
     
  17. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Cool! You won't need the protection components then.

    If you want to increase the number of LEDs, you don't need more transistors. Just parallel up more strings. Or you can increase the number of LEDs in each string, but you'll need to change the current-limiting resistors. As a rule of thumb, the voltage across the resistor should be at least 20% of the total voltage, otherwise small variations in supply voltage and LED voltage will make a significant difference to the LED current. That's because the voltage across the current-limiting resistor is what determines the current.
    Strings that can be commoned to a single resistor at the bottom end of the chain are strings where only one of the strings will be ON at a time.
    Good luck remembering the other question :)
     
  18. zenith

    zenith

    29
    1
    Nov 3, 2012
    Sorry for the delay in getting back to this thread, I had a 'vacation' at our local hospital and I have a feeling they wouldn't have liked me taking my soldering equipment in :p

    On the up side, I remembered question 2 :D which is: C1 the capacitor on the upper right, just left of the surge protection, I noticed it has no value, does this mean any will do? also the symbol is different than C2, I did google it, but ended up more confused than I normally am, so I'm here asking again.
     
  19. KJ6EAD

    KJ6EAD

    1,114
    159
    Aug 13, 2011
    C1 is shown as an electrolytic capacitor and it's value is to be determined by you when you decide what frequency to run your 555 at. It and R1 are the timing components for the 555. In practice, I usually try to keep the capacitor value low enough that I can use a ceramic (non-electrolytic) capacitor to avoid the electrolyte aging issue (3.3μF or less) then adjust the timing resistor to suit. Look at the 555 datasheet for more on timing.

    C2 is a non-electrolytic (usually ceramic) capacitor placed on the supply pins of the 4017 to protect it from high frequency noise being conducted in on the supply line. 0.1μF = 100nF.

    http://www.kpsec.freeuk.com/symbol.htm
     
    Last edited: Dec 2, 2012
  20. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    R1 and C1 determine the frequency of the 555 oscillator, which is for you to choose.

    The formula is roughly

    f = 0.7 / (R C)

    where f is the frequency in Hertz, i.e. number of pulses per second;
    R is R1 in ohms;
    C is C1 in farads (not microfarads!)

    Generally, you choose C1 (a typical value in this application would be 10 uF), then calculate R1 based on the frequency you want. Assuming you want f = 2 Hz, the calculations are:

    f = 0.7 / (R C) --> (R C) = 0.7 / f --> R = 0.7 / (f C)
    = 0.7 / (2 * 10e-6)
    = 35 kilohms.

    So you could use a 50 kilohm potentiometer or trimpot and adjust it for the step rate you need.

    The symbol is the European polarised capacitor symbol. It indicates that the capacitor is polarised; in this case, use a standard aluminium electrolytic capacitor. The American version of the symbol looks like a non-polarised capacitor, that is one straight line and one curved, like this: -----| (------, with a "+" sign next to the straight line. I prefer the European symbol, which has a hollow plate for the positive terminal and a solid plate for the negative terminal.

    Edit: KJ6EAD's suggestion of using a ceramic capacitor is a good one. Ceramic capacitors over 1 uF can be large and expensive though, but in this low-voltage application you may find something suitable. Aluminium electrolytics are inaccurate and less reliable than ceramics.
     
    Last edited: Dec 2, 2012
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-