For a LED 'matrix kind of' project I want to use UDN2981's for sourcing, and ULN2803's for sinking.

I want to use 5mm LEDs, being able to use 100 mA (10% duty cycle). Since the ULN2803 can handle 500 mA to one pin, I intend to connect 5 rows to each pin of a ULN2803, thus always exactly one pin is active, sinking (max) 5 LEDs of (max) 100 mA (and by using 15 rows, this means 3 ULN2803's).

However, I'm a bit confused about the UDN2981 as source. See sceenshots below of the UDN2981 datasheet, the first picture shows the features, the second the max current (page 14, bottom left picture).

Assume I want to drive 100 mA LEDs.

  1. according to the features I can drive 5 LEDs, but according to the other picture I can only drive 350 mA (recommended maximum output current). Which is right?
  2. According to the diagram, I can thus only drive 3 LEDs at 100 mA at once, with 3 LEDs at 100% duty cycle I have about 310 mA, thus just over 100 mA per led. But is it really not possible to drive move than 3 leds with this source driver IC?

(Someone opted in earlier question for a MAX7219 but dimming separate LEDs is very hard if not impossible). I could us 2N7000 mosfets, but I would think the UDN2981 would be better for this job (and cleaner/easier layout/soldering if I can use the UDN.). But the idea I need 5 UDN's for driving 5 * 3 = 15 columns seems strange.

enter image description here

enter image description here

Update (Project description)

What I want is a kind of 'galaxy' ceiling, like 1 x 2 yards or so.

  • leds: around 100-150, initially thinking about 3mm leds, but found out 5mm leds are stronger, especially at a distance (to ceiling), the 5mm I ordered are 30 mA continuous, 100 mA peak (10% duty cycle). I plan to use the 100 mA way of driving.
  • microcontroller: preferably STM32F103C8T6 dev board, 72 MHz, using CubeMX and HAL. Mostly for educational reasons and to start with a 'simpler' project.
  • Multiplexing: I was thinking about driving 8-16 at the same time (columns), and using 10 rows (to make it easy to fulfill the 10% duty cycle)
  • Dimming: I want leds to go gradually fade in and out, independent of each other, possibly with different speeds, but maybe also other patterns to be visible (all on/off, left to right etc).
  • Colors: The majority of the leds should be white, but I also want to add other colors, I intend to make each color a different row (since the resistors will be placed per row, so I can use different resistor values depending on the forward voltage).
  • Power: I want an external power source, somewhere between 5 and 12 V, depending on what the LEDs need, I use a wall adapter, so current is not a problem (16 leds x 100 mA = 1.6 A + a little bit for the microcontroller, so 2A should be ok, including a possible DC down converter to 5V to power the STM32
  • Driver: I thought about UDN2981, using 2 of them for 16 columns, each driving 8, they can handle 100 mA each. Someone proposed a MAX7219, but this has complicated 'dimming' functionality (couldn't find a library for STM for it that controls dimming per led, not even for Arduino).
  • Sink: Not sure, I can chose between 2N7000 (but I think these can only be used as driver), ULN2803 (problem is that 500 mA is max, so I need for each 5 rows (5 x 100 mA = 500 mA) 2 ULNs (16 columns / 8 col/ULN), totaling 6). I also could maybe use TIP120 transistors, or IRL540N).
  • IR: Eventually I want to use an IR receiver to control the device
  • Pins: Since the STM32F103 has enough pins, I can use 16 (max) pins for the rows and 8 for the columns.
  • Shift registers: thought about using them, or even a CD4051 multiplexer, but since I have enough pins, it's not needed; besides using shift registers cost more time to send.
  • Brightness levels: I was thinking about 10 brightness levels
  • Speed: I want a frequency of 100 Hz, 10 brightness levels (going through each column), so a 1000 Hz cycle or 1 ms; using 10 columns, means 0.1 ms/column, 16 rows to set means 100 us / 16 = 6.25 us/column; so 'plenty' of time.
  • Memory: I want to keep two 2-dimensional arrays in memory for 16x8 leds, alternating the arrays when one is updated (called double buffering afaik).
  • Timer: I want to use one timer, and check what needs to be done (everything including 'PWM'ing and changing column/rows will be done 'manually' (mostly it's just one or more pins making high and low).
  • Loop: In the loop of the program I want to check IR, and build/change the patterns; when a pattern is full, the double buffer will alternate to the other buffer.

(So my main question - so far - is what is best/easiest to use as source and sink for the LEDs (so far 2xUDN2981 will be ok for 16 rows), columns not sure yet.

  • 2
    \$\begingroup\$ While 500mA is the absolute maximum output current, the datasheet says you can't expect more than 350mA. Also, you need to figure out what the duty cycle of your 2981's will be, then use the appropriate column of the graph. \$\endgroup\$ – Elliot Alderson Mar 6 '19 at 17:31
  • 1
    \$\begingroup\$ Normally, I use LED segment by LED segment current control to set the maximum brightness and PWM within that to adjust the percent brightness. I use a common switch (anode or cathode doesn't matter) that can handle all of the active segments worst case current but this is an On/Off switch and not current controlled. So one side is a switch, the other is current limited and individually controlled and the duty cycle of any particular LED can be adjusted. Can you explain why that doesn't work for you? Or maybe that's what you plan, anyway? (I'm not certain.) \$\endgroup\$ – jonk Mar 6 '19 at 19:14
  • 1
    \$\begingroup\$ @MichelKeijzers I worked on some aspects of devices like this: OSRAM 16x16 RGB module. (That's my writing on back.) We used six ICs ([upper half + lower half] times [R,G,B]) to operate it. Each color of each pixel (that's 768 individual LEDs) were completely controllable in the way I described. So 128 LEDs is almost an order of magnitude less. These are used for outdoor video display billboards and each LED had individual maximum current controls and used individual PWM settings for individual brightness control. There's a way. \$\endgroup\$ – jonk Mar 6 '19 at 20:31
  • 1
    \$\begingroup\$ @MichelKeijzers They were custom ASICs developed for/by OSRAM. I have the complete datasheets, but they were internal and even after these years I probably shouldn't release them to the public. The basic idea is that you have both high side and low side enable controls, but that one of them is a common (anode or cathode) switch that shares a set of LEDs in common, while the other one is a very-low-voltage-overhead current control and NOT a switch and responds to the individual "segment" enable (which can be PWM'd, giving individual brightness control.) And the whole thing is muxed, too. \$\endgroup\$ – jonk Mar 6 '19 at 21:40
  • 1
    \$\begingroup\$ @MichelKeijzers I can post up an example using discrete parts, if you want. Not like it would be my first time. Do you want that? If so, I will need to see an expanded question with more details about your exact circumstances. \$\endgroup\$ – jonk Mar 7 '19 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.