Hi,
The simplest configuration should work:
Calculate R1 as:
(Vin - Vled)/Iled
=(220-Vled)/Iled
Vled is the LED forward voltage dependent on the colour of the LED: ~1.4v for red, ~2.3v for green, etc.
Iled is the LED current, dependent on the LED. For a standard LED, you can select 10-15mA.
So, if it's a red LED with Iled = 10mA
R=(220-1.4)/0.01
=21.8k
Select 22k
Hope this helps.
Tahmid.
---------- Post added at 23:00 ---------- Previous post was at 22:59 ----------
Be careful about the resistor rating. In the above example, power dissipated within resistor = (220-1.4)*0.1 = more than 2W. So select something appropriate. You could reduce Iled to reduce power dissipation.
Hope this helps.
Tahmid.
---------- Post added at 23:04 ---------- Previous post was at 23:00 ----------
At such high voltage, however, I use low Iled and use a 100k resistor. However, this works because the LED's current demand is low. Check if your LED can work with a few mA's current. If so, it helps reduce the power rating of the resistor.
Hope this helps.
Tahmid.