Man-wai Chang said:
Let me review your replies first.
The resistance and power rating are independently controlled factors.
Resistors come in families, like 10 ohms to 22 megohms at 1/8th watt,
10 ohms to 22 megohms at 1/4 watt, 10 ohms to 22 megohms at 1/2 watt
and so on. Once you get to a certain wattage level, the wattage
rating is harder to predict.
In a DC situation, where the resistor has some voltage across it,
a current flows. We use Ohms law, amongst others.
V = R * I
If you have a 3 volt drop across the resistor, and the resistor is 68 ohms,
then to work out the current:
3V / 68 ohms = I = 0.044 amps or 44 milliamps
The power dissipated by the resistor, given the conditions above,
is as you stated P = VI. To make the latter two forms, you do substitution
of Ohm's law.
P = V * I
= V**2 / R
= (I * R) * I = I**2 * R
You select one of the previous three equation forms, according
to the numbers you have available to work with. For example,
I might select
= (3 volts * 3 volts ) / 68 ohms = 0.132 watts
That amount of watts, is slightly more than 1/8th watt, so you'd need a
higher wattage resistor. Perhaps a 1/4 watt resistor would be a
good choice. The 1/4 watt resistor will dissipate that heat, without
being damaged. A higher wattage resistor will also do the job,
such as a 1/2 watt resistor. As long as the resistor selected,
can handle 0.132 watts minimum, it's good enough.
If you use a resistor in a confined space, where it can't receive
any cooling air, then it might need to be "derated". The following
curve, demonstrates when to derate. At the boiling point of water (100C),
I can use about 60% of the normal power rating of the resistor. Notice
that this particular curve, says the resistor can't really be used
at over 150C ambient.
http://www.interfacebus.com/Resistor-Derating-Graph.jpg
So, say I go to the store, with a piece of paper in my hand
saying "I need 68 ohms at greater than 0.132 watts". I can
buy a 1/4 watt resistor, or a 1/2 watt resistor or a 25 watt
resistor. Any of those will handle the level of power being
dissipated. The smaller resistors will be cheaper and
take up less space, for this kind of application.
+ -
+5V ----- resistor ---- LED ------ Ground
HTH,
Paul