Re: PIC18 transistor LED drivers
From: Spehro Pefhany (speffSNIP_at_interlogDOTyou.knowwhat)
Date: 10/20/04
- Next message: Meindert Sprang: "Re: Anyone seen ATMega8515 lose eeprom data?"
- Previous message: Richard: "Re: True Performance Comparison?"
- In reply to: Chuck: "PIC18 transistor LED drivers"
- Next in thread: Chuck: "Re: PIC18 transistor LED drivers"
- Reply: Chuck: "Re: PIC18 transistor LED drivers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 20 Oct 2004 16:14:06 -0400
On 20 Oct 2004 12:18:52 -0700, the renowned csembro@yahoo.com (Chuck)
wrote:
>Happy Halloween!
>
>Last year I built a collection of plywood pumpkins to stick in the
>yard on Halloween night. I installed superbright LED's in the eyes,
>nose, mouth, etc and was pretty pleased with the results. This year I
>want to animate the LED's.
>
>I bought a DLP-245PL which uses a PIC18LF8720 to drive it's digital
>I/O. I need a simple transistor circuit to drive each LED. There's
>about 22 of them. Typical LED voltage is 2.1V to 3.4V, current ranges
>from 20mA to 30mA.
>
>Last year I was driving the LED's from a simple 12V DC power supply.
>Their cathodes are connected together and to ground. The anodes
>connected to appropriate resistors. For the life of me, I can't
>remember the equations appropriate for switching transistors.
>
>It seems like optoisolators are a bit of overkill. Things I'm worried
>about are the base resistor and transistor selection, and the
>possibility of sending 12V into the TTL outputs of the PIC. It would
>be nice to reuse the transistors I have on hand, which are: 2n2222a,
>tip34, 2n3906.
>
>chuck
x------[Rx]----|<|---- +12 (12V)
| \\\
| LED
|
B |/C
-----[2K7]-------|
|\E 2N2222A, 2N4401 etc.
|
|
0V (5V) -----------x----------------------- 0V (12V)
Only tie the 12V supply ground to the 5V supply ground at one point.
(Do not allow the LED current to flow through the 5V ground circuit).
If you're using 30mA maximum, then a forced beta of 20 would imply a
base current of 1.5mA, so 2.7K is about right.
To calculate Rx, you need to know the LED forward voltage Vf. If
you're not sure, use 2.5 for yellow or green LEDs, 3V for white or
blue, and 2.0 for red.
Then Rx = (12V - Vf)/Iled
Eg. if the Iled is 20mA and the Vf is 3.0V, the equation gives 450
ohms, so round it up to 470R as the closest standard value. The power
disipation is I^2*R = 0.188W, so a 1/4W resistor will suffice for this
kind of application.
Alternately, replace the 2K7s and transistors with ULN2003A/ULN2803
parts to drive 7 or 8 LEDs with one chip.
Best regards,
Spehro Pefhany
-- "it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com
- Next message: Meindert Sprang: "Re: Anyone seen ATMega8515 lose eeprom data?"
- Previous message: Richard: "Re: True Performance Comparison?"
- In reply to: Chuck: "PIC18 transistor LED drivers"
- Next in thread: Chuck: "Re: PIC18 transistor LED drivers"
- Reply: Chuck: "Re: PIC18 transistor LED drivers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|