So I'm playing around with an idea, but I'd like a good, compact way to power it.

In the past I've used old wall warts to provide the power. Just find one with the power output I need, solder the AC power to the plug with some heat shrink tubing to insulate it, and then take the power output and put it where I need.

The problem with that is that they are bulky and hard to fit into a project box, and I'm hoping to have something a bit more professional.

So I started to do a little research and found this: AC/DC Converter, and it looks like it would do what I want in a very small package.

To reiterate, I want to be able to run a couple AC leads in, get DC power out to power circuits and stuff.

Some details. I'm looking for a pretty compact solution that provides ~5vdc, ~.2A

The smallest wallwart style adapter I know about is the iphone adapter, and it's a little big. Something small that could be used to power a ESP8266 or Arduino ATMega without having to have a giant enclosure.

I was hoping to find something with a form factor similar to the one in the link, but part of my question is if that's even a possibility.


Found this.


This is very similar to what I want to do, and they use a HLK-PM01 to turn AC power into 5V DC power, and a LD1117V33 change the 5V to 3.3V.

Besides the size, another problem I have with wallwarts is that they aren't consistent. Out of the dozen wallwarts I have laying around, I don't think I have 2 that are exactly the same.
Having a solution where I can order a handful of components and get consistent results is kind of a big deal.

  • 1
    \$\begingroup\$ Please note that you need a whole bunch of extra components, particularly a switching transformer and line filter, which will be considerably larger than the module itself. Plus, your 400 volt capacitors will not be tiny, either. Please look at the application circuit more closely. \$\endgroup\$ – WhatRoughBeast Feb 24 '17 at 22:08
  • \$\begingroup\$ How can I narrow this question? The main question is "will this component work, and if not, what other options do I have?" \$\endgroup\$ – AndyD273 Feb 27 '17 at 15:53
  • \$\begingroup\$ @NickAlexeev I've made a handful of edits to narrow the question and make it more specific. Is this narrow enough to get it taken off hold, or do I need to make further changes? \$\endgroup\$ – AndyD273 Feb 28 '17 at 15:36

You'll find hundreds of internal, print-mount, closed frame, open frame, ... power supplies on distributors like digikey.

So, as usual, a single property, in this case supply size, is seldom the only thing you look at when choosing a device.

The one you found is not a complete supply. Please at least open the datasheet from the website and look at the schematic... it's really just the controller for a power supply. All the bulky stuff is missing, and you'd have to add it yourself! Which is especially undesirable since that includes a custom flyback transformer.

So, the power supply category is right, but you're not looking into the right device.

Notice that for proper operation, most of the AC/DC converters for board mounting will still need proper fusing, filtering, and output decoupling.

You're typically off much cheaper and safer doing exactly what you did: Use a complete, enclosed, consumer power supply.

  • 4
    \$\begingroup\$ Good answer; I think it's worth emphasizing that what the OP probably wants is called a chassis-mount power supply. Unlike a board-mount supply, it will have the necessary input and output protection and filtering built-in, but unlike a wall-wart it will have terminals for easy and neat removable connection to cables, and probably some mounting tabs to secure it to the project enclosure. \$\endgroup\$ – pericynthion Feb 24 '17 at 22:02
  • \$\begingroup\$ @pericynthion Yeah, that sounds like what I'm looking for. Wallwarts are so bulky, and are potentially very inefficient with no way to know how efficient they are. The one project I'm thinking about needs to be pretty compact. The smallest wallwart I can find is an old iphone power brick, and it's a little big for my needs. \$\endgroup\$ – AndyD273 Feb 27 '17 at 15:45
  • 1
    \$\begingroup\$ @AndyD273 modern "wallwarts" are typically very efficient and very compact, if one is not efficient then it'll get hot. Oh and iPhone-chargers are among the smallest I've seen. Where is this invention if yours going to be placed anyway? \$\endgroup\$ – user1890202 Feb 28 '17 at 14:21
  • \$\begingroup\$ agree with that. Original Apply wallwarts are really really hard to beat in terms of compactness. \$\endgroup\$ – Marcus Müller Feb 28 '17 at 14:42
  • \$\begingroup\$ @user1890202 I'm wanting it in an electrical junction box, since one of the uses is to control a relay. I've done it with a wallwart once, and even with the smallest wart I had it was pretty tight to get the wart, 8A relay, wiring, and plug into a 2 gang box. I'd really like the ability to fit it in a 1 gang box, and that's not going to happen even with an iphone charger. Now that I think about it, another project will use a 30A relay, which is pretty big. I wont fit that into a 2 gang box with a wart and plug, meaning I'd have to go to 2 boxes, or make a compact PS like I linked \$\endgroup\$ – AndyD273 Feb 28 '17 at 14:42

Embedding a Walwart inside your project box seems like a retrograde step. More sensible (and already suggested) is to use power supply products designed to go into project enclosures. If you want to go in this direction you take on a whole lot of responsibility if you intend to sell product. If you can, I'd steer away from this since it involves getting valid certification for products you build to sell.

If all your doing is solving your own DIY needs then for low power projects you cannot do better than the all in one Walwart. It's the plug and power supply all together, and the DC power cable is isolated and protected by the power supply's internal overcurrent/voltage system (however simple it might be). Even "blob-in-the-middle" power supplies such as the laptop/tablet supplies are a very reasonable solution for larger projects (though they typically have a less flexible mains AC cable to contend with).

If you want to power your project direct to the wall AC connection, the minimum cable you might use is figure-8 and this is much less flexible than the typical Walwart DC output cable. And while you might fit a fuse inside your project, the AC cable itself is protected only by the AC line circuit breakers, which may be 10-20 Amps. Damaging this cable (pet's chewing, trapped by furniture etc) has the potential to be much more dangerous than damage to the DC output cable of a Walwart.

  • \$\begingroup\$ I completely agree, however the "asker" forgot to mention that he (or she?) wants whatever he is designing to be mounted inside an electrical junction box instead of a lightswitch or similar. \$\endgroup\$ – user1890202 Feb 28 '17 at 15:42
  • \$\begingroup\$ There are plenty of USB wall outlet chargers available is he wants to. for example: ebay.com/itm/… \$\endgroup\$ – Jack Creasey Feb 28 '17 at 16:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.