Transistors and LEDs
Professorwiz
Posts: 153
Hello all,
I'm pretty new to electronics and the basic stamp.· I'm taking a college course on the subject, the only prereq on the class was beginning algebra and basic programming.· I wish they would have had DC electronics included in the prereq he doesn't go into much detail on the electronic portion of it.
I am hitting a brain stumbling block.· I'm looking at this schematic and I understand the transistor is acting like a valve opening the current for the Led so that the VDD goes though the led and the transistor to the ground, but I thought you always used a resistor tied to an LED going to the VDD.· In the 2nd page (P267), it shows the p8 going though a parallel configuration of resistors turning the transistor on and off.· Wouldn't the full 5V of the Vdd go though the LED?!?
Any help would be appriciated, I just can't seem to really get why this would happen, other than the 2 resistors are still limiting the flow enough, but that doesn't seem right to me.
Russ·
I'm pretty new to electronics and the basic stamp.· I'm taking a college course on the subject, the only prereq on the class was beginning algebra and basic programming.· I wish they would have had DC electronics included in the prereq he doesn't go into much detail on the electronic portion of it.
I am hitting a brain stumbling block.· I'm looking at this schematic and I understand the transistor is acting like a valve opening the current for the Led so that the VDD goes though the led and the transistor to the ground, but I thought you always used a resistor tied to an LED going to the VDD.· In the 2nd page (P267), it shows the p8 going though a parallel configuration of resistors turning the transistor on and off.· Wouldn't the full 5V of the Vdd go though the LED?!?
Any help would be appriciated, I just can't seem to really get why this would happen, other than the 2 resistors are still limiting the flow enough, but that doesn't seem right to me.
Russ·
Comments
Kind of you to list the page number, but what book are you referring to?
Typically a resistor is placed in series with an LED to limit current. There are cases where this resistor is provided internally or isn't needed--for example: if some other component provides resistance ...or perhaps the diagram is in error.
Try the circuit WITH a resistor, if the LED is dim, remove it.
V = IR. Voltage == Current * Resistance. This means, if you put a voltage across a resistance, then V/R amps of current will flow.
Now, a transistor and an LED are current activated devices. So yes, if you do nothing to limit the current through an LED (to no more than 20 mA, and usually 10 mA will work well) then the LED will act like a flash-bulb and burn out.
The way an LED works, once you have about 5 mA across it, it has a fixed 1.4 volt drop no matter what voltage you put across it. So, if all you wanted to do was light up an LED, a 220 ohm resistor needs to be in there.
And the current for a 220 Ohm resistor in series with an LED, with 5 volts across the whole thing, is:
Vled == 1.4 volts. Voltage across resistor == 5V - 1.4V == 3.6 Volts. Current through resistor == 3.6/220 == .016 Amps, or 16 milli-Amps (mA).
Now, the current through a 'branch' of a circuit is the same for all devices in that branch. So the LED will also 'see' 16 mA, and light up.
Now, if you put a transistor in that circuit, a 'saturated' transistor has about 0.1 volts between collector and emitter (typical, depends on the transistor). So you can take that 0.1 volts away from the voltage that must be 'dropped' by the resistor (if you really want to -- 0.1 volts is pretty negligible compared to that 3.6 volts above).
This is why when the potentiometer is turned the LED will lighted and darken - it is operating in the active region amplifying the base current instead of being fully on or off.
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
Thus the Transistor is acting as your current limiting device in this example -- which lets you control the brightness of the LED. But the principle is the same -- you always need some way to limit the current through an LED, either a fixed resistor, or a properly biased transistor.
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
The transistor has a Beta, or amplification factor of 100.
100 x 0.1mA = 10mA = current of the collector.
LED maximum current is around 30mA, so safely within operational parameters.
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
The 20 mA specification is how much the BS2 can source "without damage". It CAN source more than that (for a short time), but will blow out the output transistor if you try to do so. People have done this.
With electronics, the Voltage is the "pusher" or "puller". The "resistance" is a property of the circuit. The amount of current that will flow is a RESULT of the voltage and resistance. So when somebody says an LED can take 20 mA without damage, what they mean is, you'd better engineer your circuit so the RESULTING current through the LED is less than 20 mA.
To use the water analogy, the Voltage is the height of the water in a pipe. The resistance is the diameter of the pipe. The amount of water flowing is the Current. And basically, if you have no resistance (a large diameter pipe), huge amounts of current can flow, which results in heat, which results in damage. Thus the need for SOME "current limiting" device in the circuit somewhere.
Most current specifications for devices are how much current it can take without damage. Most current specifications for Batteries (or other voltage supply devices) are how much current it can supply at a particular voltage. It's still up to your circuit to limit how much current it allows through itself.
"If that's true, and the basic stamp can only source 20 ma, then why do we need to use a resistor when going from the basic stamp pin outs, or is it just good practice?"
There is also a voltage difference to consider, the Stamp outputs roughly 5V while most LED's want something in the neighborhood of 1.3V to 1.9V
The "LED resistor formula" is really just Ohms law in disguise.... what you basically want to do is take the difference in voltage between your source, and your LED.
In the example of driving a LED from a Stamp I/O pin, this would be 5V - 1.4V or 3.6V would be the difference ...Next determine what current the LED requires.
...In this example say 15mA. Using Ohms law ... 3.6V / 15mA = 240 Ohms ...Since the current will be consistent through each series device (i.e. the LED and resistor),
basically what we have done is to calculate the resistor value based on the voltage drop you want to see across the resistor. In this case 3.6V If you measure the voltage
across the LED, you should see about 1.4V. Coincidently the voltage across the LED + the voltage across the resistor should equal your supply voltage.
R_LED = (Vsupply - V_LED) / I_LED
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.