When we use SMPS (Switched mode power supply) for our projects we can get good results due to stabilized constant current bias from SMPS, but cost and size of smps may huge than our projects prototype.
Now we can get rid from this problem by choosing compact SMPS modules, HiLink makes compact power modules under 3W and 5W categories and costs around $3 to $5 .
5V & 12V SMPS module from Hi-Link
These are PCB mount plastic enclosed isolated switching step down power supply modules. These modules takes 100 to 240 Vac with 50-60 Hz frequency as input power supply and gives Constant DC (5V or 12V depends on module). These modules are capable to give good bias to microcontroller or embedded electronics projects. It occupy very tiny space in board, size of 5V module 33 * 19 * 15mm and size of 12V module 38 * 23 * 18 mm with weight of 20gm to 35gm.
These modules are not require step down transformers, rectifiers, regulators and filters hence the power supply design cost reduced drastically. It provides high efficiency output, high reliability, low temperature rise, high security isolation etc..,
Hi-Link compact SMPS module product Page
If you are looking for more power in compact size, then make a look at IRM 30-15 PCB mounting style AC/DC power module from Mean well.
If you use SMPS for 3W or 5W you should stop working on electronics and do something else. Use linear regulators for low watts.