230V AC to 5V,1A Dc converter

Use a capacitive/resistive dropper to power an optocoupler, not just a resistor, then you don't have
to dissipate lots of heat.

A 68nF X-class cap in series with 10k 0.5W (fusible resistor) will bring 240V down to 5mA or so with
only 0.25W dissipation. If the cap fails short the resistor will fuse before the opto-coupler is damaged
(it will take 6W or so and pass 25mA). You must ensure the opto coupler is AC or has a backwards diode across it.

Reducing the heat loss is usually important as mains circuitry is enclosed for safety and little cooling
is available. Using the right rated components (like X-class caps) is very important in preventing
risk of fire.

A single resistor across the mains is a bad idea as if it fails an arc could envelop it and cause huge
fault currents - having several components in series limits the chance of heavy arc unless something
like lightning is involved :slight_smile: In evaluating safety assume every semiconductor will fail, rely on passive components if you can.

The datasheet for a fusible resistor should explain the circumstances under which it fails (open) without
causing a fire. Typically 10x -- 30x overload or so. For instance http://www.farnell.com/datasheets/2045763.pdf