Small flyback SMPS design basics - Page 1
Forum section: electronics / projects

author: sgnka
author_rank: Contributor
timestamp: September 04, 2023, 09:04:34 am
content: I'm working on making a small low-cost SMPS to get a 5V DC supply from 220V AC to power the rest of my board. I don't have experience with these designs so I'm following a reference design provided by the IC manufacturer (On-bright part no. OB2500). The chip uses primary side sensing to regulate the output, thus eliminating the usual optocoupler+TL431. The reference design circuit given is attached.A few basic questions that came to mind:1. Any references where I can learn how this stuff works without getting too in-depth (i.e, a design note/article instead of a book)2. If I needed to change the output voltage to say 12V or 3.3V, would the design of the transformer change, or only changing the feedback divider would do the trick?3. The reference design lays out the transformer specifications. Which parameters of the transformer spec are usually critical? For example, it specifies EE12 with a PC40 core, would it work the same with EE13 instead?P.S. I'm well-versed with the dangers of working with AC mains and am aware that there are modules available which do the job readily, but those aren't an option here.Any help is much appreciated.Thanks!

author: Gyro
author_rank: Super Contributor
timestamp: September 04, 2023, 09:27:26 am
content: Quote from: sgnka on September 04, 2023, 09:04:34 amWithout in any way wanting to discourage you (the electronics are actually relatively trivial for a low power SMPS if working from a refernce design, as long as you are careful with primary side creepage and clearances), a safety note on the transformer construction. You may be familiar with AC mains, but SMPS transformers are very small in comparison to standard mains split bobbin ones. Maintaining safe isolation of the secondary winding is hard, number of layers of what sort of tape, winding edge margins, maintaining safe isolation between the ends of the windings, bobbin pins etc. I recommend that you use triple insulated wire for the secondary, brought out of the bobbin and separately terminated on the PCB. For a first project of this type, this will save you a world on headaches.

author: magic
author_rank: Super Contributor
timestamp: September 04, 2023, 09:46:39 am
content: Quote from: sgnka on September 04, 2023, 09:04:34 amFeedback ratio determines supply voltage to the controller.Transformer turns ratio determines secondary output voltage.

author: jkostb
author_rank: Regular Contributor
timestamp: September 04, 2023, 06:55:27 pm
content: Following comments from my side:1) Depending on applicable safety standards you need double fusing (line and neutral). If phase and neutral can be reversed and it is not fixed part of building wiring, you need double fusing. Please consult safety standards2) Please note you need to add additional safety caps otherwise your design will fail during conducted emission tests (EMC)

author: sgnka
author_rank: Contributor
timestamp: September 05, 2023, 02:31:06 pm
content: Quote from: jkostb on September 04, 2023, 06:55:27 pmThanks!1. It is part of building wiring, P/N reversal will not be an issue.2. Where in the circuit are the extra caps required?

author: Gyro
author_rank: Super Contributor
timestamp: September 05, 2023, 08:25:51 pm
content: 1. Double fusing isn't permitted in most countries, but not an issue for you anyway.2. He's referring to X and Y rated noise suppression capacitors. The X capacitor is there in to reduce differential mode noise emissions across the P/N. It is placed across the input, hence it's X (normally X2) safety rating. The diagram is a little unusual, it is normal to have (in sequence from mains input) Fuse, X cap, Common mode choke, Bridge rectifier. It is possible that C1 is intended to be the X cap (non polarised film), I can't say without component values. L1 and BJ1 would normally be combined as a common mode choke too (to reduce common noise emmisions).Assuming that you have a mains ground connection, The Y rated safety caps would be between P and mains ground and N and mains ground. It is normal to put a further Y cap between primary and secondary windings of the transformer to shunt switching noise. X caps are self healing (normally polypropylene film) capacitors which are safe for use directly across the mains without risk of dead shorts or fire. Y caps (normally Ceramic) have a breakdown test voltage so high (several kV) that they count as reinforced insulation, as failure would constitute an electrocution risk.One other thing I noticed, on the primary side, several points go to a downward triangle symbol. Note that this is doesnotground or chassis, it should be considered as a circuit common connection and not connected to either.Edit: It's also normal to have a VDR on the input (again, after the fuse) to clamp damaging mains transients.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: September 06, 2023, 02:24:37 am
content: Quote from: sgnka on September 04, 2023, 09:04:34 amHow much power do you need, and how many are you building ?First, look at what is already available, for low prices.https://www.lcsc.com/products/Power-Modules_634.html?keyword=AC-DC

author: Martinn
author_rank: Frequent Contributor
timestamp: September 06, 2023, 03:11:38 pm
content: Quote from: sgnka on September 04, 2023, 09:04:34 amNote that primary side feedback relies more on certain properties of the transformer. It would be more robust to go optocoupler+TL431.Advice depends a lot on your scope. Production design with 10 k/yr? One-off personal fun project?Either way I see two options: If you are interested in learning, understanding the transformer design is a key point. To some degree you get away with off-the-shelf transformershttps://www.we-online.com/en/components/products/WE-UOSTor have your transformer manufacturer do the design.If it is a production design: Forget attempting this as novice, unless you don't mind the learning curve and have enough time and money to burn. Buy a module or have a pro design it. It certainly is not rocket science, just very inefficient to try this as beginner.