ehsjr
Guest
|
Posted:
Wed Nov 23, 2005 9:35 am Post subject:
Re: Has my PIC blown? |
|
|
Silverfox wrote:
| Quote: | Ok now I have set up a delay and a loop and I am switchin a red LED on
and off via pin 17 and I am keeping a green LED turned on, on pin 18.
So both the anodes of the LED goes to the output pin of the voltage
regulator. I put a 270 ohms resistor in series and the red LED flickers
ok, and so does the green LED (but very slightly) as if its being
interfered by the red LED. So its output pin goes to resistor goes to
red LED and to the green LED. I am wondering why this causees
intereference in the green LED.
If I put in another 270ohms resistor, so one resistor from green LED to
output pin of voltage regulator and 1 resistor from red LED to output
pin of voltage regulator and this clears up the flickering.
Can anyone explain what is happinening here please?
Thank you all very much in advance
Richard
|
Hi Richard,
A schematic will help to explain this:
A
Regulator Output + +---[270R]------+
| |
| +--+--+
| | |
| [RLED] [GLED]
----- | |
| PIC |---------+ |
| | |
| |---------------+
-----
|
Gnd
A green led requires a higher voltage to turn on than
a red led. A rough approximation is 1.4 volts for a red,
and 1.7 volts for a green. When a led is turned on, it
draws current through the resistor, creating a voltage
drop. Turning on the red led will drop the voltage at
point A to about 1.4 volts, which is too low for the green
led to glow properly. Thus it will dim or turn off
completely every time the red led is turned on.
Now look (below) at the correct way to wire it:
A
Regulator Output + +------------+-----+
| | |
| [270R] [270R]
| | |
| [RLED] [GLED]
----- | |
| PIC |---------+ |
| | |
| |---------------+
-----
|
Gnd
Point A will be held at +5 volts by the regulator, regardless
of what the red led does. So when the red led is turned on, it
draws current through the 270 ohm resistor connected to it,
causing a voltage drop to about 1.4 volts at the bottom of the
resistor, but does not prevent the green led from turning on.
Ed
|
|