#183 How to select voltage regulators for small projects? (ESP8266, ESP32, Arduino)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
power is significant for our devices this is why we take a closer look at this topic linear or switching converters buck boost or buck boost LDO Sepik quiescent current and a few more passwords will be covered in this video and of course efficiency in the end you should be able to decide on the right regulator for your project I'm not sure if I can avoid some magic smoke and we will see that you cannot always trust the salespeople let's see youtubers here is the guy with the swiss accent with the new episode around sensors and micro controls most of our modern processors and sensors need a stable power supply of 3.3 volts some all the chips require 5 volts and the Raspberry Pi needs nearly 1 ampere while an ESP in deep sleep requires only a few micro amperes so we will discuss the two different principles for control of voltage linear and switching regulators we will find out why linear regulators efficiency often is bad and where this fact is not significant we also look at the thermal design and how it influences maximum current we try to understand why switching regulators have higher efficiencies and can be built smaller for high currents or high differences between input and output voltage we look at the output ripple and on other high frequency signals and where they can hurt we will test how the different regulators behave when your processor is in deep sleep finally you should be able to make the right decision for your project and you should be able to do small talk using the passwords mentioned before we get power from various sources like a 220 or 110 volts great from different batteries or from solar panels we always have the same diagram an input which is connected to the source with a particular voltage a voltage regulator and an output with a stable voltage which is connected to our device the most important two questions at the beginning of I checked our what voltage do we need at the output of the regulator and what voltage or voltage range do we expect at the input an important decision is whether we want to use a linear or switching regulator what is the difference between the two to test the different regulators I built a small test bench a power supply and instrument to measure voltage and ampere at the entry of the regulator the regulator itself a device to measure voltage and ampere at the output and a variable load simulating our microprocessor this is only a basic setup and my results will not always be completely exact but I hope they are accurate enough to make the point to avoid the question where did you get these lovely meters I built them myself using 3d printed cases and the cheap meter the link to the meter is in the description and yes I will show you how my new Prusa mk3 works in a later video including how I design such cute small boxes so stay tuned linear regulator consists of two parts a variable resistor to destroy the unnecessary bolts and the controller to adjust this resistor to achieve a constant output voltage let's assume for a moment we have 13.3 volts at the input and need 3.3 volts at the output at a current of 500 milli ampere why 13.3 volts because it does not matter too much for our example and engineers like simple numbers to use mental arithmetic the necessary resistor therefore is thirteen point three minus three point three which is 10 volts divided by 0.5 amp ere equals 20 ohms in such a stable situation we would not need a voltage regulator a simple resistor would do the job so let's try if I'm right my load is 500 milli ampere and my power supply is at around thirteen point three volts this is my 20 ohm resistor actually it is two ohm's when I switch the load on we have 3.3 volts and 500 mili amperes at the output what happens here magic smoke not good the resistor destroys itself in seconds and the smell is not healthy what happened for sure too much heat for this poor resistor this leads to an important topic of linear regulators power dissipation before his sudden death this poor little resistor was rated 4.5 watts power dissipation obviously it got more than that we can calculate the killing power as we saw before its share was too involved that is what he had to kill times 0.5 amp ere equals 5 watts which was 20 times over his rating if I want a working device I have to use bigger resistors like these together they also have 20 ohms but are rated at 4 times 5 equals 20 watts still this setup gets hot after a while if we want a working concept we need a bigger heatsink and mount the resistors on it but is this really what we want this leads us to the next topic efficiency our microprocessor the load needed 3.3 volts times point 5 ampair equals 1 point 6 5 watts and our resistor dissipated 5 watt efficiency is defined as output divided by input 3.3 times 0.5 divided by thirteen point three times 0.5 equals 0.25 or 25 percent not a lot this is more a heating element than a power supply we will later try to solve this issue and we see that because input and output currents are the same the efficiency is always the same for all currents it gets worse with higher input voltages next we assume that our device only needs point 5 ampair for a moment during startup after that it just needs point 1 ampair let's check what happens when we reduce the current consumption 2.1 amp ere the voltage at our device increases with each milliampere less current and that 100 milliampere the voltage we get is eleven point three volts instead of 3.3 volts at the output fortunately I did not use one of my favorite ESP 32 ports for this test because I cannot watch them die in front of my eyes here I'm similar to a surgeon but if I make a mistake my killed parts and in the drawer not on the cementary this was the main reason I choose to become an engineer and not a surgeon less stress you see without a controller or regulation no constant voltage can be produced for a valuable load let's exchange this simple resistor with a real voltage regulator the first we try is an old acquaintance an LM or am s 1 1 1 7 4 3.3 volts a regulator often used in node MCU boards I use the one in a SOT 2 3 2 package same scenario as before we start at thirteen point three volts and 500 milli ampere as soon as the load is on the voltage drops to nearly zero why is that the datasheet says max current 1 ampere let's look a little closer to the datasheet here it says that our SOT 2 3 2 package increases its case temperature by 90 degrees centigrade for each what it has to dissipate let's do the calculation the resistor had to dissipate 5 watts and so does the AMS 1 1 1 7 now remember linear regulators are only variable resistors with a controller 5 times 90 equals 450 degrees like that we could use our regulator as a soldering iron but the datasheet also says the maximum junction temperature is only 125 degrees this is why the internal protection immediately regulated the current down to a supportable value to protect the device this time fortunately no magic smoke we can get a similar regulator in a bigger tio 220 package which increases its temperature only 24 degrees per watt which should result in five times 24 equals 120 degrees centigrade this concept works but of course would not be called best practice because you do not want to run your regulator at this high temperature let's assume this point 5 ampair is only for a moment during boot up and during normal operation our device would only consume point 1 ampere the dissipation then would just be 1 watt according to the datasheet the regulator would only run at 1 times 24 degrees equals 24 degrees so it would not heat up at all because this is the ambient temperature in my lab really no of course not we always have to add the ambient temperature but it would still run below 50 degrees if we need more power we could mount it on a heatsink then the degrees per watt value would be reduced and so the temperature you see reading datasheet sometimes is a good thing before the magic smoke escapes or afterwards depends on your personality let's look at another widespread scenario we have 5 volt from USB as input and 3.3 volts at the output the power dissipation is only 0.85 watt at 500 milli ampere and point 17 watt at 100 milli ampere the efficiency would be 66% much better than the 25% from before so to get 3.3 volts from USB a linear regulator is probably an excellent idea small cheap and simple to use just do not forget the two capacitors at the in and output suggested in all data sheets now we reduce the input voltage to 4 volts and we see that the output voltage is less than 3.3 volts our microprocessor would start to suffer at these voltage levels this is because regulators need a voltage called dropout voltage to regulate the output our AMS 1 1 1 7 needs typically one point one volts to do the job at 4 volts he is no more able to support the 3.3 volts at the output if we replace it with a similar one and HT 7 3 3 3 we see that this one does its job also below 4 volts this regulator needs only a drop out voltage of 0.1 1 volt and therefore is called low dropout regulator or lgo I know they call the AMS 1 1 1 7 also an LD o regulator but who believes in what salespeople write how can we avoid the problem of power dissipation there is a simple concept if we switch the power off we do not dissipate any heat because no current is flowing unfortunately we also have no voltage at the output and if we switch the power entirely on we have no voltage across the switch and therefore also no power dissipation but of course we get the full 13.3 volts at the output both possibilities are not very useful for our purpose but if we switch between these 2 States on and off and put an inductor as an energy tank at the end it does the trick if we change fast enough we get a voltage between 0 and 13.3 volts and if we choose the right ratio between on and off times we can reach our 3.3 volts without any loss as we saw before under ideal circumstances of course a fascinating concept now our controller has to adjust the on/off ratio instead of the resistor value here I have such a switching regulator which was suggested by a viewer its input voltage is 12 to 24 volts and its output voltage can also be adjusted to 3.3 volts and it should support staggering 3 amperes by the way these regulators are called step-down or buck converters because their output voltage is lower than their input voltage the first impression is entirely different from the linear regulators before it is bigger and has more parts it's integrated circuit however is tiny and for sure cannot dissipate a lot of heat by the way if you see one of these small inductor coils the chance you look at a switching and not a linear regulator is relatively high we use the same scenario as before input thirteen point three volts and I'll put three point three watts at point 5 ampere no problem at all it delivers the 500 milli ampere without a sweet we even can go up to 1 ampere the voltage drops a bit but this is mainly because i do not use the 4 wire method shown when I tested the USB cables let's calculate the power dissipation the voltage drop is as before 10 volts but what about the current with linear regulators the input and the output currents were the same here the input current is much lower than the output current so we cannot use the same calculation as before we have to calculate the input power as 1.86 watt and the output power as 1.65 watt so the loss is only point to what this is the reason for the coolness of this device and the efficiency is 89 percent compared to 80 25 percent from before not bad and what about the dropout voltage specified is a minimum voltage of 12 volts hence a drop out voltage of 8 point 7 volts but this is not true mine runs down to about 4 volts but watch out the smaller the input voltage the bigger the input current because it always have to match the needed output power when we look a little closer we find another difference output ripple because there is a switch inside this regulator the output voltage is not entirely constant it has a high-frequency overlay we see irregular Peaks when we switch the oscilloscope to AC and zoom in it's frequency is around 500 kilohertz if we look at the full spectrum we see that it has lots of harmonics at one megahertz at one point five megahertz and so on this is a real AM Center like in the old days but what about higher frequencies my spectrum analyzer shows that it emits signals up to one gigahertz you see the difference if I switch the regulator on and off my FM radio on the smartphone stops receiving if it's antenna in this case the headphones come close to the regulator you close to a lower receiver this device is probably not a good idea and if you want to do audio stuff or work with precise sensors you might also get problems with noise so the linear and the switching regulators behave very differently and some switches can do something a linear regulator can not do they can increase voltage this is a neat feature and these unique switchers are called step-up or boost converters because their output voltage is higher than the input voltage let's assume you still want to power a 3.3 volt device and you only have an AAA battery with 1.2 volts with this small boost converter you can do that and it delivers enough energy for an ESP chip maybe something for you next project one thing we did not look at so far if we want to deep sleep our devices a barebone ESP module consumes only a few micro amperes during deep sleep and the battery lasts very long what about our regulators to simulate a minimum load I leave the output of the regulator opened and I measure the input current with my micro current called this minimum current is called quiescent current my AMS 1 1 1 7 has a quiescent current of 3 point 3 milli ampere which is lower than specified but a few 100 times higher than what the ESP uses during deep sleep please be not astonished if the battery of your ESP project does not work long if you use this regulator the HT 7 7 7 1 is much better in this respect I measure around 6 micro ampere which is similar to an ESP deep sleep current this regulator still reduces your battery life but only a bit the big surprise for me are the switchers the buck converter has a quiescent current of around 250 micro ampere depending on the input voltage this is much less than an AMS 1 1 1 7 I would have expected a much higher current because of all these parts and if we connect the enable pin to ground the output switch is entirely off and the quiescent current goes to 63 micro ampere and the boost converter its quiescent current is only 6 micro ampere similar to the HT seven seven seven one also here you can use it for a battery-powered project without harming the battery life too much great news for me we could continue to talk about many things like transient response which is vital to reduce Peaks or noise reduction of regulators but these are usually less important and harder to measure so we call it a day and summarize what we covered so far we wanted to power our 3.3 volt devices with different sources of power if we do not use live April for batteries we need some voltage regulation we covered the two different principles for control of voltage linear regulators and switching regulators linear regulators consist of a variable resistor and the controller to adjust the resistor according to the needs of the load to keep the output voltage constant we smoke the small resistor to understand that linear regulators have to convert the voltage difference between input and output into heat this is why their efficiency is not very high and for big differences between input and output voltages at higher currents we need big heat sinks to dissipate the heat produced input and output current is always the same for linear regulators we also saw that we have to look at the degrees centigrade per watt to calculate the maximum current reading the title where the maximum current is not sufficient switching converters use a switch instead of a resistor to regulate the output power switches do not create a lot of heat this is why these regulators have higher efficiency and can be built much smaller for higher currents or higher differences between input and output voltage but they are usually bigger than linear regulators for low power applications unfortunately they produce a ripple on the output line and emit high-frequency signals these signals can hurt radio communication precise answers or your applications better use a linear design in these situations converters which need a higher input voltage than their output voltage are called step-down or buck converters converters which are okay with a lower input voltage than their output voltage are called step-up or boost converters we also find buck boost converters sometimes also called Sepik converters their input voltage can be smaller or bigger than the output voltage they are usually bigger devices and were not covered here each regulator needs some difference between its input and output voltage to do a proper job regulate this with a low dropout voltage are called LDO if we want to deep sleep our microcontrollers we have to watch out for a low quiescent current we found significant differences in these matters but the switchers were better than I thought I hope this video was useful or at least interesting for you if true please consider supporting the channel to secure its future existence you find the links in the descriptions thank you bye you
Info
Channel: Andreas Spiess
Views: 99,769
Rating: 4.9702811 out of 5
Keywords: electronics, diy, esp8266, regulator, arduino, LM1117, eevblog, esp32, lorawan, voltage, ESP8266 datasheet, ESP32 datasheet, HT7333, voltage regulator, ams1117, buck, boost, buck converters, boost converters
Id: ffLU7PSuI5k
Channel Id: undefined
Length: 22min 33sec (1353 seconds)
Published: Sat Feb 10 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.