sure- you'll need to put it back to back or block it with a normal power
diode (350v forward or reverse - whatever you decide) coz the reverse
voltage will fry the LED otherwise, but work out the resistor as peak
voltage-2 / 10mA so with 220V RMS, we get (to get peak from RMS divide by
0.7071)
220/0.7071 = 311V peak
less 2V for the LED (practically you can ignore the LED voltage when driving
from HV sources) driving at 10mA... 309V/0.01A=30900ohms so any resistor
above 30K will do the trick - of course it will flicker (impersceptably?) at
the mains frequency
remember also that the other diode (you could always use two LEDs) will be
shunting the current if mounted back to back (by which I mean the two diodes
are mounted in parallel but opposite polarities) and it must be rated at
350V forward voltage. If you decide to use a diode to block (by which I mean
the two diodes are mounted in serial with the same polarities) you must
ensure it has a reverse breakdown of 350V or more otherwise it'll all go up
in smoke
) remember also that 300V @ 10mA is 3Watts of power - resistor
and power diode please take note. If you can get away with lower current
you'll be better off - consider using a hyperbright LED and drop the current
(by raising the resistor value) as much as possible. These LEDs are still
very bright at just a few mA. You could half the current (and so the power)
by doubling the resitor and still get a perfectly acceptable brightness from
the LED - perhaps even more. Play around and get it right....be very careful
rectifying mains - you'll get 320+volts of DC and across fingers it stings
*big time* - Any voltage at that level (but particularly DC) from one hand
to the other ***will kill*** even at very low currents - Don't take chances
with it!!!