Shop OBEX P1 Docs P2 Docs Learn Events
74hc595 — Parallax Forums

74hc595

jcfergusonjcferguson Posts: 86
edited 2007-03-23 20:40 in BASIC Stamp
Hi there,

If I am using a shift register to drive multiple leds as in stampworks experiment 23 - do I NEED something like a uln2803 or can the shift register drive the leds all by itself? I can't find this kind of information on the data sheet and am not sure about how much current the chip can handle at once...



I found this posted by Mike Green:

Another caveat: The 74HC595 is limited to a total supply current of 70ma. If you're driving LEDs and they're all on, they can't draw more than about 8ma each. Any one output pin can supply over 20ma, but only 3 of those can be on at a time. There are specialized LED drivers that can handle higher total currents.

so I guess I need a uln2803 if I want to put 15 Ma through each led? Why does experiment 23 work without them? I found another similar circuit on the web with no uln2803, what gives?




Thanks,

Carlos Ferguson

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-23 18:54
    The StampWorks experiment works since the 470 ohm resistors limit the LED current to about 6ma each which is well within the capabilities of the 74HC595. The LEDs drop about 1.7V. The high output voltage of the 74HC595 is about 4.7V leaving about 3V for the resistor. Ohms law says I = E/R = 3V / 470 ohm = slightly more than 6ma. 8 outputs x 6ma = 48ma. The maximum total current for the 74HC595 is 70ma. You've got a bit to spare.

    The ULN2803 will let you drive higher current and higher voltage loads. You could also use discrete transistors of different kinds.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2007-03-23 18:55
    Carlos--

    Mike was probably referring to the "typical" LED, not the LEDs on the Professional Development Board that you are (doubtless?) using. I looked at the documentation of the Professional Development Board and could find no reference to their maximum current draw, so I figured it out all by myself.

    The technical term that describes their current draw is "tee-nintsy." Others refer to this as "itty bitty." And, some even say "really, really low", but I do not prefer that phrase.

    Ask Parallax. They may be the ONLY people that know . . .·or it may be common knowledge.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • NewzedNewzed Posts: 2,503
    edited 2007-03-23 18:55
    Carlos,Mike is correct.· If you are going to hve more than three LEDs on at one time you should use the 2803.· The TPIC6595 is a good substitute.· It has both a shift register and and an 8-channel output driver.· It can handle up to 250 ma per channel.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-03-23 19:01
    Carlos,

    There are a couple of different manufacturers of the 74HC595…It’s possible (however unlikely) that other version can handle more current. I have successfully lit up 8 10mm LEDs on a 595 without it getting warm. The trick is to stay within the devices rated Power Dissipation. Never exceed that and try to stay out of the “Absolute Maximum Ratings” ranges. If you need more current per LED you may have to use the ULN2803 or there was another chip posted here some time ago that was basically a shift register with Darlington outputs. Take care.

    [noparse][[/noparse]Edit] - Sid posted the chip I was referring to...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • PARPAR Posts: 285
    edited 2007-03-23 19:07
    jcferguson said...
    Hi there,

    If I am using a shift register to drive multiple leds as in stampworks experiment 23· ...·Why does experiment 23 work without them? I found another similar circuit on the web with no uln2803, what gives?

    Expt 23 doesn't drive (on) multiple LEDs at a time.

    Notice that the "pattern" is turning on only one LED at a time, as it shifts a "1"-bit across the 8 bit positions (the shift operator drops a pattern bit off one end and appends a "0"-bit to the other end).

    [noparse][[/noparse]Code excerpts from Expt 23]:
    pattern = %00000001
    DO ...
    pattern = pattern << 1 ' shift pattern left
    LOOP UNTIL (pattern = %10000000)


    PAR


    Post Edited (PAR) : 3/23/2007 8:46:52 PM GMT
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2007-03-23 19:17
    Carlos--

    Gee. I just hate it when I am wrong. Unfortunately, this happens a lot!

    Have fun! (You are a couple chapters ahead of me!)

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • jcfergusonjcferguson Posts: 86
    edited 2007-03-23 20:16
    Thanks all, understood -

    I have been driving 8 leds at about 15 - 20 ma each flashed randomly with a 74hc595 - so sometimes it is drawing over 200 ma with no heat or problems, but I am making a little art-piece and don't want something to burn out later... I'll just put a uln2803 in there, I was just thinking I could save myself some wiring!

    Carlos
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-23 20:40
    You could also modify your code to limit the number of LEDs to 4. Keep track of what the last 4 LEDs turned on were and turn off the oldest if there would be more than 4. People would likely not notice since the odds of 5 or more being on at the same time is fairly low (3 or fewer off).
Sign In or Register to comment.