Using Ohms law. Since we know the current, source voltage, and LED forward voltage drop, we must calculate for the series Resistor. R = (V Source - V Forward) / I.
(6V - 2V) / 0.02A = 4V / 0.02A = 200Ω
220Ω is the next resistor up.
Now since we have the resistance, we can calculate Wattage of the Resistor. P = V (of Resistor) * I
4v * 0.02A = 0.08W or less than 1/8th (0.125) Watts. A 1/8W Resistor would work.
A better solution is two leds in series, sharing the current.
(6 - 2 - 2) / 0.02 = 100Ω
2v * 0.02A = 0.04W. A 100Ω 1/8W would work.
What you have suffered from is what I term (I don't know if it's the real name for it) a cascade failure. From your description your circuit is like this:
simulate this circuit – Schematic created using CircuitLab
You have sized your resistor assuming a total of 40mA through a pair of 20mA LEDs. You have also assumed a forward voltage of precisely 3.4V.
If both your LEDs were absolutely exactly 3.4V forward voltage, then you would have a chance of that working, since the current would split evenly between them. However, that will most probably not be the case. Imagine what would happen in that circuit if one LED had just a 0.1V difference in the forward voltage drop? How much current would flow through each one?
Well, most of your 40mA would go through the one with the lower forward voltage. That would get far more than the 20mA limit it's designed for, and the other one would get next to nothing. Yes, they may both light up, but one would be much brighter, at least for a moment, before it burned out.
Now, LEDs normally initially burn out in a dead short. But that short soon overheats and fuses, so becomes an open circuit. So it's like not having that LED there at all. So now all your 40mA is getting pumped through the second LED. That's way too much for it to handle, so it then blows as well.
A cascade: one blowing causes the next to blow. If you had lots of LEDs in parallel like this and could slow down time (maybe with a very high speed camera) you'd see a distinct sequence of them blowing one by one in the order of their forward voltages (at least for the first few - as the currents got too high they'd just all go at once).
So what do you do? Simple - you treat each individual LED as a separate entity - calculate a resistor for each by itself. For this it'd simply be double the resistance, but twice over:
simulate this circuit
So now each branch of the circuit gets its own share of the current, and each branch decides for itself what current it needs - ~20mA each in this case. If one LED should blow the other branch is still, as an individual circuit, getting just the 20mA it needs.
To better illustrate what happens, I have drawn a pretty graph of LED current (note - this isn't a real LED diode graph, just some numbers I made up for illustrative purposes. A real LED graph would have much sharper curves, but it serves to demonstrate my point):
When you have a single resistor limiting to 40mA you're limiting the yellow line (I(tot)). At the point that's at 40mA, ~3.3V, the two LED currents I1 and I2 are very imbalanced - you can see one gets ~18mA, and the other ~24mA. The one with 24mA then blows. Now there's no blue and red lines, only the yellow line. I1 becomes 0, and I2 becomes I(tot).
Best Answer
No, the impedance of the capacitor is purely reactive. It dissipates no real power.
EDIT: as drawn the circuit does not work. You want this:
simulate this circuit – Schematic created using CircuitLab
The value of C1 must be chosen to limit the current to the correct value. 470nF gives a current of 21mA, which flows alternately through D1 and D2.
R2 serves to 'bleed off' the high voltage on C1 when the device is disconnected, to prevent the user from being shocked. R1 limits the current to C1, preventing a spark when the device is plugged in, and also protects C1 against brief voltage surges.