I work with a lot of ESP8266 microcontrollers, and often need to power them from 240V AC mains. This generally involves either a wall-wart or a dedicated isolated module such as the HLK-PM03.
However, it occurred to me that - in situations where isolation from the mains supply is not a requirement - I could maybe use a simple buck circuit.¹
I came up with this circuit:
The resulting 6V-or-so could then be passed through an LDO to produce a stable 3.3V supply.
Assuming I use a 250V-rated triac to chop the mains supply into pieces, is there any good reason this circuit wouldn't work and/or be unsafe?²
In addition, would I need to use an inductor and capacitor rated for 250V? Under normal circumstances, they would spend most of their time seeing low voltage.
¹ I toyed with the idea of capacitive droppers, but the current requirements of the ESP8266 are too high for that to be feasible.
² I am well aware of the importance of isolation, thank you. This is for use in situations where mains-referenced power is not a concern.