How does a modern Power Supply work?! (230V AC to 5/12V DC) DIY Flyback Converter!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Würth Elektronik has done it once again. They just sent me a bunch of components and all I received along with it was a piece of paper onto which was written: “Do your best! Hint: Flyback” Well, in this case the components seem to be some kind of transformer. But not those kinds of transformers which are big and heavy and get directly powered with mains voltage in order to convert it down. No! Those transformers are small and some of them very light; and diligent viewers have seen them in a previous video of mine in which I talked about transformers for 11 minutes. You can often find them in commercial switched mode power supplies that convert our mains 230V AC voltage into for example 12V DC. A lot of those transformers use a so called Flyback topology in order to perform such a voltage conversion. And OK I get it, that was the hint from Würth Elektronik and that means in this video I will be showing you how such a Flyback circuit of a Switched Mode Power supply functions and how we can use it for ourselves for low voltage applications. Let’s get started! This video is sponsored by the Würth Elektronik eiSos group. First off, we should have a closer look at the Flyback transformers and with closer look I mean we should take one apart. Like always with transformers we have a primary coil and a secondary coil which sometimes come with an identical amount of windings to one another and sometimes not. But this winding relation to one another can always be found in the datasheet. Now a big difference of such a Flyback transformer in comparison to a mains transformer is for one that its used material is a kind of ferrite, while normal mains transformers use laminated electrical sheets. The other difference is that the core comes with a small air gap which is absolutely mandatory for a Flyback converter, but more about that in a minute. Because before that; let’s talk about the ferrite material which is used in order to keep the eddy currents low. Those need special attention this time in comparison to a mains transformer, because the Flyback transformer gets used with a much higher frequency and thus it would be able to create way bigger eddy current losses. As an example; this commercial switched mode power supply uses a frequency of around 68kHz. The frequency is of course on purpose so high in order to keep the size of the transformer small, while still being able to convert quite a bit of power. For example this mains transformer here can output around 21.6W while this switched mode power supply with a similar size can output almost three times as much while being lighter and featuring a higher efficiency. So in a nutshell, such Flyback transformers are essential for modern and efficient switched mode power supplies. So how can we use them with a Flyback converter circuit? Well, here you can see a simplified schematic which only consists of a voltage source, the transformer, a MOSFET switch, a diode, a capacitor and a load. There exist 2 switching states and those are either MOSFET switch closed or MOSFET switch open. So let’s begin with switch closed at which point the voltage source pushes a linear increasing current through the primary side. The current does in this case only rise slowly due to the inductance of the transformer and its air gap in which now energy gets stored. And that is also why the air gap is so important, since it can store lots of energy, while preventing the transformer from reaching its magnetic saturation too early. But since current is now flowing through the primary side of the transformer, there should be a voltage and current flow on the secondary side, right? Well, actually no; because of the winding direction of the primary side to the secondary side, identifiable by the two points at the transformer symbol, there exists a voltage on the secondary side which would let a current flow reverse-biased to the diode. And that is of course not possible. But it is noteworthy that during this phase, the load still gets supplied with energy through the capacitor which in the now following second switch state will get charged up. In this phase the MOSFET switch opens. Thus the primary side current falls abruptly and the whole stored energy gets transferred to the secondary side, in which a now a linear decreasing current runs in flow direction to the diode. And of course we can create a higher or lower voltage at the output of the circuit depending on the winding relation of the transformer. At the end it is noteworthy that such a circuit often gets used with mains voltage since its input and output side is galvanically isolated from one another which is an important safety feature against electrical shocks. But before we get lost in the theory, about which we could talk for hours with subjects like the difference between the DCM and CCM mode, we should probably move on to creating a practical Flyback circuit. I chose this transformer type for my first test which comes with 6 identical windings. You can see the used components here and those are pretty much the same as I described them in the theory. But there is one exception which is this additional diode in combination with a resistor and capacitor. This combination absorbs the energy not transferred to the secondary side and thus protects the MOSFET from over voltages as soon as it opens. Such non transferred energy by the way does exist since no transformer is perfect and thus features a leakage inductance which we should obviously keep as small as possible. But the transformers from Würth Elektronik do a pretty job at achieving that. But nevertheless, after building up the circuit and using my function generator to switch the MOSFET on and off with a frequency of 68kHz, it was time to capture some voltage and current waveforms after powering everything with 12V. And as you can see on the oscilloscope, the waveforms pretty much correspond with the theory and now we can create an adjustable voltage on the output depending on how we set the Duty cycle for the MOSFET because that determines how much energy we transfer to the secondary side. But as a simple example I went with an output voltage of 5V. This value obviously goes down as soon as we draw more current on the output since we also got higher voltage drops across the resistive elements and diode in this open loop operation. To compensate for that and transfer more energy we would have to increase the duty cycle of our square wave control signal. And that basically means we have to constantly monitor the output voltage and according to that either increase or decrease the duty cycle in order to maintain a constant output voltage. Simply put; we need a feedback system. Of course we could create such a system by ourselves with for example an Arduino microcontroller. But when it comes to mains voltage then it definitely makes more sense to use an established controller IC. This can be for example this NCP1010, which was actually a recommendation from the Würth Elektronik website. With the help of its datasheet, which comes with tons of information, and in combination with a flyback transformer I received; I was able to create a half way decent switched mode power supply that can converter 230V AC into 5V DC on its output. But as a warning I have to tell you that working with mains voltage can lead to major injuries if not handled correctly and since my power supply design does not care about safety at all which can be seen by the trace distances, a missing inrush current limitation and also no kind of EMC filter, it only acts as a demonstration and should not be rebuild. With that being said here is the schematic. The fundamental components are pretty much the same in comparison to the previous flyback converter schematic but of course we do need a full bridge rectifier this time in order to convert our 230V AC into 325V DC. And the other big difference is the feedback system which consists of an Optocoupler and a TL431 programmable reference voltage. Simply put, this TL431 quickly reacts to small output voltage changes and thus alters the operating bias point of the optocoupler in order to fine adjust the duty cycle. But since there is so much to talk about this adjustable voltage reference, there will be an extra video about it. And with that being said, the general functional principle of a modern switched mode power supply should be pretty clear and thus I hope you learned a bit about flyback converters and transformers. If so don't forget to like, share, subscribe and hit the notification bell. Stay creative and I will see you next time.
Info
Channel: GreatScott!
Views: 283,563
Rating: undefined out of 5
Keywords: power, supply, smps, switched, mode, 230V, mains, main, voltage, 5V, 12V, dc, direct, alternating, current, diy, do, it, yourself, make, project, guide, flyback, transformer, circuit, topology, explain, design, explanation, perfboard, prototype, efficient, efficiency, frequency, measure, commercial, compare, mosfet, inductance, coil, diode, duty, cycle, pwm, pulse, width, modulation, primary, secondary, side, air, gap, energy, store, save, isolation, isolated, galvanic, calculate, ferrite, eddy, greatscott, greatscott!, würth, elektronik, ncp1010
Id: ycT-PItAzNk
Channel Id: undefined
Length: 10min 28sec (628 seconds)
Published: Sun Aug 29 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.