Best method/circuit for converting 240VAC to 5VDC (Low power)

powerpower supply

In short, I'd like to power Arduino-like devices (small PIC devices as well) run off of a mains socket at 240VAC – which obviously can't be done with a simple wire. I assume I'd need an output anywhere between 3 and 5 volts DC.

I don't want to use a generic plug power supply as they're usually designed for higher current outputs (I'd probably need 500mA at most – the processor and a couple of LED indicators), can cost a reasonable amount and I'd like to up my electronics knowledge/DIY skills by creating something myself (even if it is just a couple of soldering joints).

Also, when I say "best", I mean either the simplest to build or most efficient (or a combination of both).

My apologies for the generic question, I've just never done this sort of thing and I'm not sure how to word it properly.

Best Answer

The way you would need to do it is design a flyback SMPS - This is what is in every USB charger ever made... So why design it again when you can just pick one up for 5$ somewhere, the design will be long, and if not done right, it could be deadly.

Keep in mind 5V @ 500mA is not really 'low power' that was the normal USB supply for the last ~10 years. That is 2.5W...

I'll also add they are fairly efficient. A well designed USB charger with synchronous rectification should be >80% efficiency. You will be hard pressed to get this level of efficiency from your first custom design...