That would be dangerous, especially if the neutral is earthed in your country. You could split the capacitor and put half in each conductor. However, this is not a good way to get 5V. It's much better to use a transformer.
On second thoughts this is not a good idea as the capacitors would have to be 1uF each and this would increase the current to ground to a lethal level.
swapping L&N will not make much difference ... the problem is that Zdiode will overheat .. it is not very "energy efficient" way to get 5V from 300V
use the transformer to transform 220V AC to 6V AC then you can Zdiode it to 5V but even better to use some 7805 or similar positive voltage regulator. If you need high A you can combine 7805 with 2n3055 or similar power transistor ..
What are you planning to power with this circuit? Whatever it is must be totally isolated from the user and the rest of the world for it to be safe. This means parts that are not rated for mains voltage can NOT come in contact with the user. ie: you couldn't use a small tact switch for input from the user because it isn't rated for mains operation. You'd have to use a switch rated for 240Vac even though you would be switching 5V.
I now remember the original circuit that I think this is based on. The capacitor is in the live conductor and the resistor goes from live to neutral. The voltage across the resistor is half wave rectified and goes via a resistor to the zener. This arrangement produces a supply that never strays more than 5V from the neutral connection. In countries where the neutral is earthed this is relatively safe.
The full wave modification above is very dangerous as it isolates the circuit from the neutral.
That is much safer but only if the live and neutral can't be swapped. You can see from the circuit that Vss will effectively be grounded and Vdd will be at 5V relative to ground.
That is much safer but only if the live and neutral can't be swapped. You can see from the circuit that Vss will effectively be grounded and Vdd will be at 5V relative to ground.
Get a transformer or treat all your circuit as though it is at 250V. Your circuit will still work with them swapped, it's just that it will electrocute you if you touch it.
Edit, DON'T connect your ICD2/Pickit2/anything else to it. Just connecting a scope will produce lots of smoke.
The risk is still there, as one of your conditions is reversibility of 2pin 230V input. However, if you want more accurate PSU you may look at the attachment to a post of mine, at,