13
\$\begingroup\$

I am currently building some kind of game console based on a Raspberry Pi, with some features (one discussed here), right now I am using for this project a Meanwell power supply.

However, I was thinking to design soon or later a PCB instead of wiring a power board and an arduino uno, since it can be so cheap nowadays to design it with KiCAD and then print & send from China. So make a board with some microcontroller for I/O, measurements and so, and a power supply board too, in order to make all the system embedded.

Is it worth the hassle ? As far as I know a transformer, bridge rectifier and a circuit with several LM2596 or other switching power supply IC to generate 3.3V, 5V and 12V doesn't seem hard to make, but are there any downside other than risks of shock ?

Edit : This is only for my personal use, I won't mass produce it or sell !

\$\endgroup\$
10
  • 5
    \$\begingroup\$ Isn't it totally up to you? From my perspective designing a game console does not worth the hassle, but apparently not from yours. As for safety - again, depends how well you know what you are doing. \$\endgroup\$
    – Eugene Sh.
    Jan 28, 2020 at 19:30
  • 6
    \$\begingroup\$ Are tou planning to sell these devices? If so how will you certify your power supplies for your intended market? That alone should put you off building your own. \$\endgroup\$
    – Transistor
    Jan 28, 2020 at 19:39
  • 2
    \$\begingroup\$ Go for it then. You'll learn plenty. \$\endgroup\$
    – Transistor
    Jan 28, 2020 at 20:04
  • 4
    \$\begingroup\$ Use a wall wart to step down to 12V. There's plenty to learn going from there to 3 and 5V without worrying about electrocution and fire risk. \$\endgroup\$
    – user16324
    Jan 28, 2020 at 20:24
  • 4
    \$\begingroup\$ One convenient option is to make your project run from a laptop supply. There always seem to be extra laptop supplies floating around. If you make it so it accepts anywhere from 18-25V, you can use just about any laptop power supply to run your project. You will still get some power electronics experience designing all the buck converters to get down from 18V to whatever you need. \$\endgroup\$
    – user57037
    Jan 29, 2020 at 5:06

12 Answers 12

19
\$\begingroup\$

If you're building a few for personal use, I'd say it's not worth it unless part of your goal is to learn power supply design techniques and principles. Even then, it's much safer to get a wall wart to convert your line to, say, 12VAC for safety.

If you're planning to go into production with it, you should consider your volumes first. The lion's share of the development cost will be the safety and conformance certifications needed to plug it into the wall, which can run into thousands of dollars. Even so, you'll be hard pressed to match the cost performance of a commodity OTS supply with your lower volume custom design.

\$\endgroup\$
4
  • \$\begingroup\$ If it was for just having a simple system to play I guess a wall wart would be perfect and cost effective, but as you say one of the goal is also to learn power electronics and PCB (which I didn't practice since engineering school) \$\endgroup\$
    – Varech
    Jan 28, 2020 at 20:08
  • 6
    \$\begingroup\$ Then at least get an AC wall wart to lower your AC voltage to a safe level. And remember to keep your current loops tight! \$\endgroup\$ Jan 28, 2020 at 20:12
  • 4
    \$\begingroup\$ @CristobolPolychronopolis That's a good idea. Using an AC-AC wall wart. Or a AC-DC wall wart followed by his switchers. \$\endgroup\$
    – DKNguyen
    Jan 28, 2020 at 20:13
  • 3
    \$\begingroup\$ "which can run into thousands of dollars" ..Which can run into tens of, or even HUNDREDS of thousands of dollars, depending on the certifications and on whether you want to be self-certified or iso accredited (in Europe). \$\endgroup\$
    – user173292
    Jan 29, 2020 at 17:29
10
\$\begingroup\$

Even for mass-market consumer devices it's often worth it to not design a custom power supply, or even integrate an off-the-shelf power supply into the device. Going with an external power supply saves you from having to design & certify the device to avoid shock hazards, and once you do that you might as well use a commercial off-the-shelf external power supply.

For your own hobby project, whether it's worth it depends what you're trying to achieve and whether it's safe depends you take appropriate safety precautions in the design and in the testing of your device.

\$\endgroup\$
7
\$\begingroup\$

Sure you could buy a supply or but if you want to learn and time for your hobby is not a problem then take a shot at a power supply. Manufactures spec sheets have a ton of info and often reference designs. A stop-gap or workbench solution if you need more power is take an old PC supply and hot-wire the startup, remembering that some require a load before they will run.

If you do roll your own switch mode power supply, use quality caps. About 10 to 15 years ago, there was a flood of cheap caps that couldn't stand up to the the high frequency switching due to poor electrolyte formula. I saw everything from DSLR cameras to server motherboards to monitors with the tops of the caps swelling. Just repaired (on my garage bench) a premium $600 self-powered speaker that wouldn't turn on, bad cap in the startup ckt. Landfills must be full of almost functional gear so the mfg could save 25 cents on the parts list, and I'm talking about top brand vendors.

Use some line fuses in case you have a short, they prevent fires. Use load fuses in case you have a short, they save parts. It kills me when I see a burnt up regulator and the fuse after it is still good, always wonder who spec'd that? What little power you need shouldn't make any serious heat but since this is for your hobby, use generous heat sinks with a little thermal paste.

You might be surprised how easy it is to etch your own board and mount your own parts. Even if you do order out the board for etching and drilling you could still solder the parts on yourself. Then you are more prepared to make repairs if you have a temperature controlled iron that can stay 600 deg F for small work/ 700 deg F for large joints, some various small sizes/shape tips, tip cleaning sponge, flux, solder sucker, some SN63 fine solder, some metal dental-type tools, and a small vise with cushioned jaws. Cleanup the board with an acid brush and anhydrous isopropyl alcohol to remove flux residue. Good solder joints have slightly concave sides. Only amateurs believe 'The bigger the blob, the better the job.'

I don't worry about line (mains) power, I just unplug before opening. You're not going to have any big caps that require discharge rods for safety but you could put in some real high value resistors as draining loads. Those are the kind of things that are mandatory in multi-kiloVolt supplies.

I remember as a child having a model railway with a power regulator that was easily opened and the line voltage going to a bridge rectifier. Was told that was dangerous and believed my dad. A little common sense was enough, now days I'd use heat shrink to avoid an oops.

Since this is a game and there may be children or non-techies about, you probably want a case that's hard to open to get to the hot bits. At least make them bring a screwdriver. Times (and lawyers) have changed since I was a lad so I would never give a home built supply away to someone else who might not understand the risk.

\$\endgroup\$
1
  • \$\begingroup\$ Wow ! Thanks a lot for the detailled answer ! For the boards I was thinking to solder myself yes, drilling and etching is more difficult as I don't have the material, or the chemical needed is not an easy solution in my flat. I will apply your advices ! \$\endgroup\$
    – Varech
    Jan 29, 2020 at 14:56
7
\$\begingroup\$

35 or more years ago, almost every kit radio and electronic hobby project required building some sort of linear power supply. Diode bridge, or even vacuum tube half wave. Most Apple 1’s, for instance, have two big transformers. A whole bunch of us old computer hobbyists, amateur radio operators, engineers, and scientists are still alive.

One doesn’t learn nearly as much buying some potted module.

You do have to follow more safe construction and safe practice rules when dealing with AC mains voltages. Make sure you learn and follow them.

\$\endgroup\$
1
  • 3
    \$\begingroup\$ Yeah, but Heathkits were UL listed if assembled according to instructions. Use of the device according to instructions is mandatory per NEC 110.3(B), which makes sense because when UL lists an item, they only safety-test it for uses which reasonably align with the instructions. \$\endgroup\$ Jan 29, 2020 at 11:44
6
\$\begingroup\$

To design and implement an off-line power supply is indeed dangerous, since the 110/220 V at the mains and the rectified DC voltage can be lethal. Other than risk of shock, one need to take care of clearances and protections.

I would recommend to someone without experience in the subject to buy a power supply, like your Meanwell power supply. A cheap PC/notebook/cell phone power supply is another option that will give you a safe DC voltage which you can convert for your application.

\$\endgroup\$
3
  • \$\begingroup\$ As mentioned in another comment, my objective is to learn also power electronics, but I was wondering if such a task was extremely tough or had legal issues, I see a lot of hobbyist on SO designing their PCB with microcontroller but never their own Power supply \$\endgroup\$
    – Varech
    Jan 28, 2020 at 20:10
  • \$\begingroup\$ @Varech That's because projects usually have a lot to deal with and by the time you get to the end you're just tired so you go and get another power supply. For example for your project, you aren't just getting one switcher to work, you're going to try and get three to work. \$\endgroup\$
    – DKNguyen
    Jan 28, 2020 at 20:12
  • \$\begingroup\$ In your question you said your goal is to build a game console. To learn about power electronics is another project and another topic in and out of itself. It is indeed tough and one has to be extremely careful when working with mains voltage. There aren't many hobbyist doing their own PS because in power electronics the cost of making a mistake is very serious. In low voltage electronics the cost is low so you can learn by doing (mistakes). \$\endgroup\$
    – Ken Grimes
    Jan 28, 2020 at 21:05
5
\$\begingroup\$

As far as I know a transformer, bridge rectifier and a circuit with several LM2596 or other switching power supply IC to generate 3.3V, 5V and 12V doesn't seem hard to make, but are there any downside other than risks of shock ?

Linear power supplies are quite simple to make, and the risk of shock is low if you properly insulate the mains side and keep it separated from the low voltage side. On the secondary side you can add switching or linear regulators to produce the voltages you need.

The main downside is bulk and weight. Depending on how much room you have inside the device that may not be a problem. If it is then you could do what many commercial products do - put a power jack on it and plug in an external transformer. If you have room then put the bridge rectifier and filter capacitor in the device, then you can power it with either AC or DC.

On the up-side you can easily customize the power supply to suit your needs, and you might be able to repurpose a mains adapter or transformer from some old equipment to save money. Cheaper for you, and better for the environment!

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Bulk and weight AND heat. By the time you tolerance everything, you will probably end up with an uncomfortably high input voltage to your linear regulator, and thus, have to deal with a lot of heat. \$\endgroup\$
    – user57037
    Jan 29, 2020 at 5:03
  • 1
    \$\begingroup\$ @mkeith not if you design it right. Use linear regulators for small current, switching for large. Produce just just enough unregulated voltage for the job, and 'over-size' the rectifier and smoothing caps. Provide more than adequate heat-sinking. The greater bulk means parts can dissipate more power and yet still run cooler. I have designed many linear supplies that delivered high power without getting hot. Many commercial linear supplies are hideously designed. \$\endgroup\$ Jan 29, 2020 at 5:43
  • 1
    \$\begingroup\$ I trust you, Bruce. But when I looked at input AC voltage range and transformer tolerance and everything else, it seemed to me that the linear regulator would need to dissipate a lot of heat. Of course if you use a switcher after rectification, then that is much less of a problem (basically not a problem). \$\endgroup\$
    – user57037
    Jan 29, 2020 at 7:04
5
\$\begingroup\$

Here's how that works in the real world.

Option 1: Use a Wall-Wart that is already UL-listed.

You design the DC side of the product, and pack it off to UnderWriter's Laboratories to be tested, along with some of the wall-warts. UL sees the wall-warts are already UL listed, and makes no further investigation. They focus on the low voltage behavior of your equipment. It's more than a formality, but it's not crushing since you use RU listed components. It goes fairly quick, and it's not terribly expensive.

It's also fast, and only a few people are involved, which helps with trade-secret stuff/leakage to competitors/press.

Then you want to revise the product. This voids the UL listing so it has to go back for another approval cycle. UL asks "Same wall-wart?" You say "Yeah." Not terrible.

Option 2: Integrate the power supply into the entire product.

You design your entire product, soup to nuts, with its integral 120V/230V power supply. You pack it off to Underwriter's Laboratories, because you can't sell it in the US without a UL listing.* UL then tears it apart and torture tests everything in it relating to how it interacts with mains power, including all manner of provoking the 120/230V mains power to go places on your board it should not, dunking it in water, yada yada.

They really pull out the stops, with a lot of types of inspection done by a lot of people. It takes awhile, so all these people are product-secrecy risks.

And then they fail you on a bunch of items, mostly related to mains power, (you never figured for people sticking paper clips in the vents), and then you have to rework and redesign, rinse wash repeat. Finally you have your cert and you are shipping.

Then you want to revise the product. That voids the UL listing so you have the mains testing done again.


This is why power bricks/wall warts are so darn popular for manufacturers.

For tinkerers, it means if you stay on your side of the wall-wart, you don't have a particularly big safety concern.




* Unless you a) ship it direct from China, or b) ship it direct from China to a domestic drop-shipper such as Amazon prime/Fulfillment. Either way, you are sneaking it past Customs, who doesn't really have the expertise to inspect for unsafe electrical products (and it's the least of their worries), and you are also making the end-user the importer, which evades responsibility for you. This works great if you are beyond the reach of US or EU regulatory agencies.

\$\endgroup\$
3
\$\begingroup\$

To try to expand on a few answers a little...

Firstly, if you're talking about a low-voltage PSU (ie. something that takes 12V or 24V in and pushes out 12, 5, 3.3 etc - then I'd say it is worth doing yourself, although you may find breakout boards that do a lot of what you want are available pretty cheaply. These days, little buck converters seem to be everywhere and they can produce very stable, smooth outputs (and some can boost upwards as well as downwards). Whether you want to go down that road or build yourself is down to preference and cost. On the assumption that your time to assemble a board is "free", then it may make sense to make your own. It means your project can have one 12V input socket and you can use a wall-wart type supply to run it (or take 5V in and power it with a USB charger?). For what it's worth, this is my personal preference - either a 12V barrel type connector and a "wally diode" or a USB connector break-out board - both cheap, easy to buy and use.

If you're talking about a mains to low voltage PSU, then it's almost never worth it unless you're learning about PSU design. It's fun to think about transformers and rectifiers and whatnot, but there are significant risks involved. You might indeed shock yourself, or literally blow something up on the desk in front of you, or maybe you'll make a working supply, think it's great and then end up burning your house down a week later because it wasn't at all safe. Unless you're prepared to consider all those aspects before starting, then I'd advise against it.

If you're still keen to mess about with power supplies, then you can make things quite a bit safer for yourself by using an intermediate supply first. That is, buy a nice 24V AC supply, and then tinker with the 24V all you like. Your risk at that voltage is almost nothing, especially if it's an isolated supply. Once you've got some skills then consider moving up the voltage scale a bit and see how you get on there.

And just to labour the point (even though you said it's just for your own use) as other have noted, the majority of the cost of a power supply isn't the components. It's the design and the safety certifications of that design. There's a reason those things exist, and why they're as thorough as they are - you can indeed "do it cheaper", but do you want to? Perfectly safe and decent power supplies don't cost much these days, and they're available in a plethora of different shapes and sizes.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Well originally I am engineer in embedded systems / instrumentation, so most of time in my work power supply is taken care of by another person or team. I really wish to learn about it. One of the reason is that the shape is a problem in my console, like I need to adapt the box to the supply, the screws etc, with a home made designed PCB I could make it fit perfectly, and learn in the same time. I understand certification is important, kind of a premium for a product, but in my case I really will not give it away, and unplug if not in use. \$\endgroup\$
    – Varech
    Jan 29, 2020 at 15:07
  • 1
    \$\begingroup\$ It sounds like you've talked yourself into taking the risk. That's fine, but see other answers about making a linear PSU (ie. transformer + rectification + smoothing) - it's simplest and least likely to malfunction - but it's big and hot. A switching supply can indeed be tiny, but the design work required and most importantly, the risks you take are considerably bigger. Unless you need loads of current, I'll bet you could buy a ready-made PSU to fit - but if you're doing it to learn, then go for it. \$\endgroup\$ Feb 4, 2020 at 16:42
3
\$\begingroup\$

A traditional power supply based on a line-frequency transformer is reasonablly easy and safe to build, since the only things on the main side are the line side of the transformer and any protective devices. All the electronics are safely on the isolated side of the transformer.

However at typical electronics power levels, line-frequency transformers are bulky, heavy and have signigicant no-load losses. Then you need to follow them up with some form of regulators, which have further lossess, (especially if they are linear regulators)

This is why nowadays, nearly everything uses an isolated switchmode converter. However these are much hairier to design. Unlike a power supply using a line-frequency transformer, where the transformer is the only thing crossing the isolation barrier, a switch-mode converter will have the transformer itself, plus EMI suppression capacitors (which need to be a special type of capacitor for safety), plus in some cases a feeedback path (though this is sometimes provided by an extra winding in the transformer). You may also need to debug the circuitry on the mains side of the isolation barrier, which obviously requires special precautions.

Another complicating factor is the transformer itself, as far as I can tell transformers for switchmode converters are usually custom-designed to match the needs of a particular power supply and so can be difficult to source for a custom project.

On the other hand while single output power bricks are easy to find and generally well-behaved multiple output ones can be harder to find and can have regulation problems under light load or cross-load (where one output is loaded more heavily than another).

So the usual compromise when you need multiple rails is to use a commercial single rail isolated switch-mode power brick, to supply one of your rails (usually the highest voltage and/or highest power one). Then use non-isolated switchmode converters to derive the rest of the rails you need.

\$\endgroup\$
2
\$\begingroup\$

i have been working on power supply from transformer and to flyback SMPS, and some PS i create is definitely overpriced / overcost even the basic power supply with common transformer. it didn't even worth it to create "The best most stable PSU", it just not worth enough your time and cost but probbably just enough for experience, if you are not even have a eletronic degree like me, don't even try. remember the input voltage is usually over 100Vac and over 200Vac in some country, one flash you are over. The price of power supply nowadays is usually cost nothing but dust, thanks to China crazy underpay worker. You could choose between many amongs type of power supply, from basic transformer, smps flyback, pushpull with some dedicated regulator and adjustable voltage. 1st you must try is read all the books / schematics explanation from power supply design, if you still in doubts, read again and ask people who knows it better than you.

But i suggest you create one of fundamental power supply, the basic one : Transformer power supply with IC regulated. it's fun

\$\endgroup\$
2
\$\begingroup\$

I have been building my own power supplies since the mid 70s. The primary reason for doing so is that whatever power supply you buy is only just so good and I've seen hundreds of them fail. When I design, I factor in at LEAST 100% overkill. In most PS designs, the overkill is at max about 50%. That is just not acceptable to me. I have even built a couple of inverter power supplies for automotive projects. Wound my own transformers, too! One thing you can always count upon is the learning and for me that was invaluable.

\$\endgroup\$
1
\$\begingroup\$

I'm going to ignore the risk of electrocution or shock, since 110V is weaksauce anyway and you'd have to be super unlucky to actually hurt yourself with it.

That said, the major downside for me is that the cost of components to build your own power supply is much higher than just using a mass-produced wall-wart or phone charger.

Additionally, unless you've been making your own power supplies for 10 years and already know what you're doing, anything that you build yourself will be noisy, big, hot, fragile and need a lot of work and testing to get right.

If you really want to learn about AC/DC conversion, and you want to add weight, heat, size, cost and potential points of failure to your project, then sure, go wild, make your own power supply.

Personally, I would buy a $5 sealed unit from China like everyone else does, and forget about it.

\$\endgroup\$

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