Hi Friends and Colleagues!
With one of my pupils we are designing a kind of LED light source. It is fed from 220 AC directly with basic diode rectifier - many strips of LED band are soldered sequentially.
Now we want to add some control logic to it (e.g. IR or acoustic switch). The trick is how to power this logic. I.e. how to create low-current 5V as we only have about 310 DC here.
My current idea is to use zener diode and powerful resistor: to draw 5 mA from about 300 V we need a resistor of 60 kOhm / 2 W.
The supposed schematics is below. I'm unsure whether it would be ok to use 5V zener and feed the logic from point A (i.e. without 78L05) or it is better to use 9V zener and take the voltage from point B? And do you believe it is safe design overall, provided that no one is going to touch anything when under voltage (and probably this is going to be used mainly for demo purposes anyway).
UPD: Dear Friends. Thanks a lot for that many hints and opinions. I'm sorry I was impatient and implemented the thing before waiting enough to collect all these answers. I dare to add a couple of words about...
About safety - thanks for your concerns, all this is pretty correct.
However this project is directly aimed to teach safe procedures while working with dangerous voltage. It is not that important to make production ready device (though I hope we'll be able to show it at school conference), but more important that pupils learn to apply proper safety measures.
The matter arose from the fact that several of them after soldering a few 5V schemes decide they are real gurus and started playing with power lines in their homes etc - which led to some hazardous situations. One of their "domestic experiments" included plugging 5V schematics into 220 directly - with enough sparks, smoke etc. When I learned about it, I decided we should cover the topic of working with home switches, bulbs, plugs etc, etc - and particularly about difference between 5 volts for logic, 12/24 for leds and 220 AC...