Maker Pro
Maker Pro

Driving a large number of LEDs with ULN2803A

A

Anthony Fremont

Phil said:
"Anthony Fremont "


** EXACTLY what I claimed !!!

With logic like that, I'd love to see some code that you've written. I can
only surmise that it would remind me of some post-impressionist van Gogh.

At any rate, I must congratulate you on the quick response. Only 7 minutes,
I doubt the local fire department could do better. Thanks for being so
attentive. HAND. :)
 
P

Peter S. May

Eeyore said:
No, that's ideal. Run the LEDs in parallel strings with 2 diodes in each string.

Graham

It occurred to me last night as I was leaving work that this is in fact
the right answer. Running five two-LED series at 12V would allow me to
run 10 LEDs at a draw of 100mA, which is well within the limitations of
the device even when all the outputs are on (the way I figure it it
comes in under 0.9W dissipated by the device itself). And 2Vled + Vce
is far enough from 12V that I can figure out a reasonable value for the
resistor. (240 ohms seems like a decent selection for my parameters.)

So, I think this is my route!

Thanks
PSM
 
L

linnix

It occurred to me last night as I was leaving work that this is in fact
the right answer. Running five two-LED series at 12V would allow me to
run 10 LEDs at a draw of 100mA, which is well within the limitations of
the device even when all the outputs are on (the way I figure it it
comes in under 0.9W dissipated by the device itself). And 2Vled + Vce
is far enough from 12V that I can figure out a reasonable value for the
resistor. (240 ohms seems like a decent selection for my parameters.)

So, you would be burning half of the power on the resistor. We just
went through on another thread that a two transistors booster can
switch 12V to 35V at 20mA. You can hook up 10 LEDs in series on the
booster output without resistor. The booster circuit is self
limiting, it will stop oscillating when the output current gets too
high.

Part lists: BD139 Q1, 2N2222A Q2, 470uH L1, 10uF C1, 0.5uF C2, 0.2uF
C3, 56uF C4, 150 R1, 300 R2, 2700 R3, 1N4002 D1.
 
P

Peter S. May

linnix said:
So, you would be burning half of the power on the resistor. We just
went through on another thread that a two transistors booster can
switch 12V to 35V at 20mA. You can hook up 10 LEDs in series on the
booster output without resistor. The booster circuit is self
limiting, it will stop oscillating when the output current gets too
high.

Part lists: BD139 Q1, 2N2222A Q2, 470uH L1, 10uF C1, 0.5uF C2, 0.2uF
C3, 56uF C4, 150 R1, 300 R2, 2700 R3, 1N4002 D1.

I'll probably go with the simpler approach for the first revision just
because it's something I already more or less fully understand. But
your notion is something I'd consider to be worth understanding,
especially when my hobby project starts getting more serious.

Can you refer me to (a) a schematic for what you're describing and (b) a
general explanation of how it's working? I know nothing about inductors
and very little about capacitors or analog circuits in general; I'm
still early in the transition from the theory of digital logic to the
practice of actually constructing something that works. (As I've been
stating repeatedly, I'm fortunate that this is only a pastime and not my
employment!)

Thanks for the help
PSM
 
L

linnix

I'll probably go with the simpler approach for the first revision just
because it's something I already more or less fully understand. But
your notion is something I'd consider to be worth understanding,
especially when my hobby project starts getting more serious.

Can you refer me to (a) a schematic for what you're describing and (b) a
general explanation of how it's working? I know nothing about inductors
and very little about capacitors or analog circuits in general; I'm
still early in the transition from the theory of digital logic to the
practice of actually constructing something that works. (As I've been
stating repeatedly, I'm fortunate that this is only a pastime and not my
employment!)

Thanks for the help
PSM

Q1 and Q2 oscillate ON and OFF. The OFF cycle of Q1 kicks up the L1
and charge C1 via D1. Watch out for the -60V kicks.

See: http://linnix.com/booster.gif

I lost the other parameters. I am trying to get maximum current out
of it.
Here is the netlist for a 680 load 24V @35mA
You should be able to construct the schematic from it.

vcc VCC 0 12
l1 VCC FEEDBACK 470u
q1 FEEDBACK BASE2 0 bd139
q2 OSC BASE1 0 2n2222A
d1 FEEDBACK OUTPUT D1N4002 ic=0v
c1 VCC 0 10u ic=0v
c2 FEEDBACK BASE1 470n ic=0v
c3 OSC BASE2 270n ic=0v
c4 OUTPUT 0 47u ic=0v
r1 VCC BASE2 270
r2 VCC OSC 150
r3 VCC BASE1 2700
r9 OUTPUT 0 680
 
P

Peter S. May

linnix said:
Q1 and Q2 oscillate ON and OFF. The OFF cycle of Q1 kicks up the L1
and charge C1 via D1. Watch out for the -60V kicks.

See: http://linnix.com/booster.gif

I lost the other parameters. I am trying to get maximum current out
of it.
Here is the netlist for a 680 load 24V @35mA
You should be able to construct the schematic from it.

vcc VCC 0 12
l1 VCC FEEDBACK 470u
q1 FEEDBACK BASE2 0 bd139
q2 OSC BASE1 0 2n2222A
d1 FEEDBACK OUTPUT D1N4002 ic=0v
c1 VCC 0 10u ic=0v
c2 FEEDBACK BASE1 470n ic=0v
c3 OSC BASE2 270n ic=0v
c4 OUTPUT 0 47u ic=0v
r1 VCC BASE2 270
r2 VCC OSC 150
r3 VCC BASE1 2700
r9 OUTPUT 0 680

I only vaguely get it. Maybe I need a textbook. "Watch[ing] out for
the -60V kicks" is something that will come once I understand the
thing...it seems like a circuit I shouldn't just be implementing blindly.

I almost understand the netlist format intuitively. Are the transistor
contacts listed in C-B-E order? Diodes in A-K order? Is there a
program I can feed this mishmash into to produce a visual? Dare I
dream, one that works with Ubuntu?

Thanks
PSM
 
L

linnix

linnix said:
Q1 and Q2 oscillate ON and OFF. The OFF cycle of Q1 kicks up the L1
and charge C1 via D1. Watch out for the -60V kicks.

I lost the other parameters. I am trying to get maximum current out
of it.
Here is the netlist for a 680 load 24V @35mA
You should be able to construct the schematic from it.
vcc VCC 0 12
l1 VCC FEEDBACK 470u
q1 FEEDBACK BASE2 0 bd139
q2 OSC BASE1 0 2n2222A
d1 FEEDBACK OUTPUT D1N4002 ic=0v
c1 VCC 0 10u ic=0v
c2 FEEDBACK BASE1 470n ic=0v
c3 OSC BASE2 270n ic=0v
c4 OUTPUT 0 47u ic=0v
r1 VCC BASE2 270
r2 VCC OSC 150
r3 VCC BASE1 2700
r9 OUTPUT 0 680

I only vaguely get it. Maybe I need a textbook. "Watch[ing] out for
the -60V kicks" is something that will come once I understand the
thing...it seems like a circuit I shouldn't just be implementing blindly.

I almost understand the netlist format intuitively. Are the transistor
contacts listed in C-B-E order? Diodes in A-K order?

Yes, this is standard spice3 netlist.
Is there a program I can feed this mishmash into to produce a visual?

Yes, I am working on it.
Dare I dream, one that works with Ubuntu?

Spice3 works on my linux box.
 
J

Jasen Betts

linnix said:
Q1 and Q2 oscillate ON and OFF. The OFF cycle of Q1 kicks up the L1
and charge C1 via D1. Watch out for the -60V kicks.

See: http://linnix.com/booster.gif

I lost the other parameters. I am trying to get maximum current out
of it.
Here is the netlist for a 680 load 24V @35mA
You should be able to construct the schematic from it.

vcc VCC 0 12
l1 VCC FEEDBACK 470u
q1 FEEDBACK BASE2 0 bd139
q2 OSC BASE1 0 2n2222A
d1 FEEDBACK OUTPUT D1N4002 ic=0v
c1 VCC 0 10u ic=0v
c2 FEEDBACK BASE1 470n ic=0v
c3 OSC BASE2 270n ic=0v
c4 OUTPUT 0 47u ic=0v
r1 VCC BASE2 270
r2 VCC OSC 150
r3 VCC BASE1 2700
r9 OUTPUT 0 680

I only vaguely get it. Maybe I need a textbook. "Watch[ing] out for
the -60V kicks" is something that will come once I understand the
thing...it seems like a circuit I shouldn't just be implementing blindly.

I almost understand the netlist format intuitively. Are the transistor
contacts listed in C-B-E order? Diodes in A-K order? Is there a
program I can feed this mishmash into to produce a visual? Dare I
dream, one that works with Ubuntu?

Berkely Spice should run it... but If you want a GUI "Oregano" or
"LTspice" (switcher cad III, free download from linear technology)
running under wine - No bd139 model, but the simulation runs with
a 2n2222 in both places.

this is an LTSPICE model
---- cut here, save as switcher.asc ------
Version 4
SHEET 1 1252 680
WIRE 16 32 -48 32
WIRE 48 32 16 32
WIRE 160 32 48 32
WIRE 240 32 160 32
WIRE 352 32 240 32
WIRE 448 32 352 32
WIRE 448 48 448 32
WIRE 160 144 160 112
WIRE 256 144 160 144
WIRE 352 144 352 112
WIRE 352 144 320 144
WIRE 448 160 448 128
WIRE 160 176 160 144
WIRE -48 208 -48 32
WIRE 48 224 48 32
WIRE 240 224 240 112
WIRE 240 224 224 224
WIRE 272 224 240 224
WIRE 448 224 448 160
WIRE 448 224 336 224
WIRE 464 224 448 224
WIRE 560 224 528 224
WIRE 576 224 560 224
WIRE 640 224 576 224
WIRE 768 224 720 224
WIRE 448 240 448 224
WIRE 560 256 560 224
WIRE 768 256 768 224
WIRE 352 288 352 144
WIRE 368 288 352 288
WIRE 384 288 368 288
WIRE -48 368 -48 288
WIRE 32 368 -48 368
WIRE 48 368 48 288
WIRE 48 368 32 368
WIRE 160 368 160 272
WIRE 160 368 48 368
WIRE 448 368 448 336
WIRE 448 368 160 368
WIRE 560 368 560 320
WIRE 560 368 448 368
WIRE 768 368 768 336
WIRE 768 368 560 368
WIRE 32 384 32 368
FLAG 16 32 vcc
FLAG 32 384 0
FLAG 240 224 base1
FLAG 160 144 osc
FLAG 576 224 output
FLAG 448 160 feedback
FLAG 368 288 base2
SYMBOL ind 432 32 R0
SYMATTR InstName L1
SYMATTR Value 470µ
SYMBOL npn 384 240 R0
WINDOW 0 56 46 Left 0
SYMATTR InstName Q1
SYMATTR Value 2N2222
SYMBOL npn 224 176 M0
WINDOW 0 56 46 Left 0
SYMATTR InstName Q2
SYMATTR Value 2N2222
SYMBOL diode 464 240 R270
WINDOW 0 19 58 VTop 0
WINDOW 3 0 32 VBottom 0
SYMATTR InstName D1
SYMATTR Value MURS120
SYMBOL cap 32 224 R0
SYMATTR InstName C1
SYMATTR Value 10µ
SYMBOL cap 336 208 R90
WINDOW 0 0 32 VBottom 0
WINDOW 3 32 32 VTop 0
SYMATTR InstName C2
SYMATTR Value 470n
SYMBOL cap 544 256 R0
SYMATTR InstName C3
SYMATTR Value 47µ
SYMBOL res 336 16 R0
SYMATTR InstName R1
SYMATTR Value 270
SYMBOL cap 320 128 R90
WINDOW 0 0 32 VBottom 0
WINDOW 3 32 32 VTop 0
SYMATTR InstName C4
SYMATTR Value 270n
SYMBOL res 144 16 R0
SYMATTR InstName R2
SYMATTR Value 150
SYMBOL res 224 16 R0
SYMATTR InstName R3
SYMATTR Value 2700
SYMBOL res 624 240 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R9
SYMATTR Value 60
SYMBOL voltage -48 192 R0
WINDOW 123 0 0 Left 0
WINDOW 39 24 132 Left 0
SYMATTR InstName V1
SYMATTR Value 12
SYMATTR SpiceLine Rser=0.1
SYMBOL voltage 768 240 R0
WINDOW 123 0 0 Left 0
WINDOW 39 24 132 Left 0
SYMATTR InstName V2
SYMATTR Value 20
SYMATTR SpiceLine Rser=0
TEXT -42 506 Left 0 !.tran 0 .02 0 startup
TEXT 600 56 Left 0 ;LED Supply Switcher \nBy "linnix"\nsci.electronics.design july 2007
---- cut here ---

Bye.
Jasen
 
Top