HACKED!: Adding a Current Limit Feature to a Buck/Boost Converter
Вставка
- Опубліковано 7 лют 2025
- Support me for more videos: / greatscott
Previous video: • DIY LiPo Charge/Protec...
DIY Buck/Boost Converter: • DIY Buck/Boost Convert...
Facebook: / greatscottlab
Twitter: / greatscottlab
More project information (schematic, pictures,....) on Instructables: www.instructab...
Parts list (incomplete, see Instructables for more, affiliate links):
Aliexpress:
1x Buck/Boost Converter: s.click.aliexp...
1x LF33 Voltage Regulator: s.click.aliexp...
1x 10nF Capacitor: s.click.aliexp...
1x 10µF Capacitor: s.click.aliexp...
1x 0.1Ω Current shunt: s.click.aliexp...
2x 3.3kΩ, 2x 100kΩ Resistor: s.click.aliexp...
1x MCP602 OpAmp: s.click.aliexp...
1x 10kΩ Trimmer: s.click.aliexp...
1x UF4007 Diode: s.click.aliexp...
1x Voltage/Current Meter: s.click.aliexp...
Ebay:
1x Buck/Boost Converter: rover.ebay.com/...
1x LF33 Voltage Regulator: rover.ebay.com/...
1x 10nF Capacitor: rover.ebay.com/...
1x 10µF Capacitor: rover.ebay.com/...
1x 0.1Ω Current shunt: rover.ebay.com/...
2x 3.3kΩ, 2x 100kΩ Resistor: rover.ebay.com/...
1x MCP602 OpAmp: rover.ebay.com/...
1x 10kΩ Trimmer: rover.ebay.com/...
1x UF4007 Diode: rover.ebay.com/...
1x Voltage/Current Meter: rover.ebay.com/...
Music:
2011 Lookalike by Bartlebeats
Ecstatic Wave, Jens Kiilstofte
machinimasound...
In this episode of HACKED! I will have a closer look at a common buck/boost converter and create a small, additional circuit that adds a current limit feature to it. With it, the buck/boost converter can be used just like a variable lab bench power supply.
To make full CV (constant voltage)/ CC (constant current) operation - the voltage and current feed-backs are to be combined into the FB pin. Whoever is higher will take control.
Most commonly people use a resistor divider (to FB pin) for the voltage feedback and current sense amp for the current feedback. How to combine them? The simplest is to connect the current feedback signal to FB pin via diode. The drawback? - diodes have voltage drop changing with temperature *by 2mV/deg C). The most accurate solution is to "idealize" the diode by op amp.
The current feedback signal is applied to the non inverting input of an op amp. Its output drives an NPN emitter follower, whose emitter is connected to the op amp inverting input. The circuit can only pull up, but not down i.e. does affect the voltage control in normal operation. Should the current limit be exceeded, the current feedback will take over
Software Engineer. Always have to remind myself that with circuits and hardware in general you cannot just "get started and refactor when you know what what you're doing more" 😎
And that's where simulation enters the chat.
There's sort of a mechanical/electrical equivalent to refactoring. It's cost-down. You comb over your design and figure out if there's a better/cheaper/more efficient way to achieve the same thing.
eventhough I donot understand anything, I still watch your videos and I like them.
Please keep em coming 👍👌✌
The issue I have with differential amplifiers for current sense is that they are very sensitive to errors in the resistor values. A 1% resistor error will give an output error of 1% of the _supply voltage,_ which is comparable to the thing you're trying to measure.
Alternative is to use a current sense amplifier. Silicon Labs SI8540-B-FWR is just one example.
Ich don't understand what Scott is talking about. But I love his voice. That's why I watch his videos.
Good idea is to add a bit integration to comparator circuit. Something around 10nF between output and inverting input does the trick. Much cleaner output voltage and less hissing sound from inductor.
Hope somebody has already caught electrical schenatic typo at 05:49 - differential amplifier IC1A won't work the way it shown :(
Non-inverting pin.3 should be connected to junction between R2 and R3.
Anyway - that's is great work, Great Scott!
The two main ways Scott starts his video:
-Recently...
-In ze previous video...
But not this time
XD lol
totally!
"let's find it out!"
“A while ago”
I've learned more _useful_ information about electronic circuits with the likes of GreatScott than I did in school.
The beauty of Scott not glossing over the finer details is that it inspires me to "really" study the circuit or concept intensively, by consulting MANY sources (including the Wiki, even) until I have a truly intuitive (deep) understanding of the FLOW, the LOGIC, and the MATH. .. I do not care how long it takes. .. I resent being rushed through anything that I do not yet "fully own". .. Scott seems to OWN the knowledge, which he shares, and his uncompromised, comprehensive and detailed presentation illuminates the degree of my shortcomings. .. This allows me to fully remediate my deficiencies, however frustrating.
Yes, absolutely !
When I first watched the Nixie tube video, I didn't knew what was going on, but after few hours of research, I came back to the video, and could clearly see what problems and solution he has used.
I'm always left wondering, how many people watching here are electrical engineers vs. hobbyists? :)
I'm sure there are a ton engineering students.. I happen to be studying mechanical engineering, and it's nice to be able to check these out whenever I have no idea what a circuit does.
Spurdo Sparde both lol
ECSE student here, binge watching all the good electronics channels
Electrical engineering student here. I watch these videos for fun but i might build this circuit for a project.
Hobbyists are 100x smarter.
I just started electronics a few months ago and I have learned so much from these videos. I have recently made my own power supply, no current limit feature though this video should help
I used an ATX power supply with one of these buck modules to make a crude powersupply. It worked so well that I plan to increment that and this circuit will be very handy! Thanks!
You can also switch off a buck converter by introducing a feedback voltage greater than the reference voltage. In the case of a boost, the output voltage would then roughly correspond to the input voltage.
Without really noticing, everyone here is being taught/shown basic control theory principles under their noses! Well done! Usually its scary shit!
Real blend of creativity , fundamentals and hacking
When Great Scott has a video on the exact thing I'm trying to do... AWESOME! thanks!
0:45 That NOISE!!! You can literally see the LED flickering in the footage. If you want to use a buck-boost converter for anything that requires a fairly stable voltage, I highly suggest adding a good amount of filtering!
I LOVE the way you explained this!
You're a great teacher.
Thank You!
Just to be sure if I have understood the feedback as you have explained: when you see the output voltage swinging a bit on the scope, that is the switching noise, not the error direction of the control feedback.
Another advantage of lab PSUs is a much, much cleaner voltage. Try to power a radio with a circuit like this and you'll see what I mean
True
You should be able to reduce the ripple by loading the buck/boost converter with high load but kinda makes the current limiting in this video pointless :P or use a LDO or RC in series to from the converter
I'd just add an LC filter to the output for lower noise operation.
I see, LDO, RC or LC filter.....is there more solution for cleaner voltage?
A linear PSU perhaps.
Nice video.A small error thought at 6:20,I think the diff. Ampl circui5 is not correct at the point where you have shown the ground. The non inverting input should be connected after the 3.3k and then the 100k from the non inverting to ground?
I don't understand any thing !!!
But I love watching your videos
It gives me a kind of satisfaction.😌🙏💁
I was searching for this type of project for a long time :D ..Thanks GreatScott :)
Very neat handwriting and schematics!
This is exactly what I needed to know/do! Thanks!
While using buck/boost converters to build a DIY solar charger on a LiPo power pack (w/o mfr's circuitry), I've fried my rework station's internal 15 VDC PSU, a buck/boost converter, a buck converter, a boost converter, and a solar tracker... so far.🥴
Unfortunately, I was unable to keep up with the video. So, I'll watch it about a dozen more times and head to your project info links.
Ha! just noticed a link to your DIY LiPo solar charger video. (How did you know?) See ya. 😎
This is exactly what a was trying to learn this week. add current limiting to my power supplies. thanks!
The ground at pin3 of the IC is really throwing me off. Why is the non-inverting pin grounded? I’m so confused 5:55
Edit:
Since the inverting pin is connected on the lower potential of the shunt resistor, I suppose it means it is negative, and the gain is actually -R2/R1 which means if he wants 333mA, he sets the potentiometer to 1V, and the first op-amp will stabilize to 1V output, or otherwise, the inverting pin will receive -33mV (333mA*0.1ohm) which will receive a gain of -30, which will output 0.99V.
And it stays stable because when the current gets too low, it will output less than 1V which will be compared and set the feedback to low, which makes the converter output more energy, and when it is more than 1V, the feedback will tell the converter to output less energy.
This took me so many other videos to understand 😅
I still don’t understand the purpose of R2 and R3
This video helps me. I have a junk benchtop power supply that eventually I wish to rebuild, so this gives me a place to start looking for possible starting point. Thanks!!
You can easily buy current-limiting converters from eBay... But DIY is so much better haha
Great project btw! :-)
Greeting from PAKISTAN.. Greatscott you always do a great job. You are a great teacher for me. i learnt using arduino totally from you.
Great Scott YOU ROCK!!!!!. Another great video. You are helping and motivating youngsters to learn electronic. Good work. Keep it up.
Spoken like a true politician! I take it you belong neither to the EE group nor the hobbyist group, but the bureaucrat group. Just kidding!
using a pot to set output voltage like shown at 4:11 is usually a bad idea, a bad connection in the pot will result in maximum output voltage. Have you looked at the output on scope when the current limit is in effect? I suspect using a comparator rather linearly adding to the feedback node will cause it to rapidly turn on and off rather than lower the output voltage
An engineer here.
Hi Scott, can you please look at your video once again? I believe you have an error in your schematic in 5:50 when you are showing the circuit of differential amplifier for the current measurement. The R3 100 K shall be connected from non inverting input of IC1A to GND, not in series with the input. When it is grounded it will not work and output voltage from IC1A will be only close to zero volt. You are showing the same circuit couple more times in your video so it might be good to review it for all the audience.
Keep going with your videos.
This is very clever and I have enjoyed watching your skills and experiments progress. Thanks for the dedication mate!
I'm only 10 and I love these vids.
The diagram in 1:47 has the diode reversed.
greetings from India.. great Scott luv ur all videos keep going..
Thanks mate :-)
Aniket Shinde hi aniket
one more from India.😊
Count Me In Too :P
One more Indian ;)
I've done this many times. The problem I've sometimes had was that the high side of the feedback resistor would sometimes exceed the common mode input capability of the opamp. This has often forced a careful selection of a high voltage capable opamp.
There are ready made CC, CV Buck Boost converters, with additional trim pot for current limit adjustment. They typically use low side current sense resistor (shunt), making it easier to process the current feedback signal. Typically the current feedback signal after non inverting amplification is fed to the FB pin via diode. The FB pin is controlled by the higher of of voltage and current feedback signals. Nothing wrong using high side current sensing...but the accuracy of the simplest 4 resistor diff amp even with 0.1% resistors could exceed 2% due to unwanted sensitivity to voltage due to resistor mismatch. TI and AD have an extensive range of tiny current sense amplifiers, more suitable for this role than a general op amp (comparable on size and cost).
op amp pin 2 connected wrongfully to GND instead of the mid point of R2,R3.
Also low side current sensing breaks the input ground from output one.
This implies that a short circuit towards the input GND bypasses the current sense shunt i.e. eliminates the protection. Also a current sense amp is preferable to common op amp.
In this example the 4 resistor diff amp is sensitive to resistor values match i.e. tolerances result to unwanted sensitivity to output voltage, not just current (1 % resistors may result in say 5% error)
Great video @GreatScott. Your channel is a perfect guideline for any electronics beginner. I learn a lot from each of ur videos. Thanks man :)
You're welcome
"this circuit can be used to test LEDs" is a wrong statement if you leave voltage at any level and just set the current to minimum (20 mA for your case). Because although the current is limited, but the output capacitor is still charged to the set voltage value. So when you connect an LED with let's say the voltage set at 12 V and current at 20 mA, the capacitor will supply enough surge current to destroy the LED. I have practically experienced that. So in order to test LEDs, you'll need to replace the output capacitor with a small 10 to 22 uF capacitor. But that will introduce alot of ripple in low impedance loads (high current) so you'll need to add a relay and a larger capacitor so that the relay connects the bigger capacitor to output when set current exceeds a certain limit (e.g 200 mA). But since the larger capacitor is not charged if disconnected, it will cause a huge current surge when connected at once. Which can affect the transient response of the power supply. To address that, connect a diode from output to larger capacitor so it keeps charging with the output voltage but won't discharge through load unless connected by the relay. And here we got into another trouble. What if we had set a higher voltage with larger capacitor connected and then disconnected it (set a lower current value) and then reduced output voltage and again switched the larger capacitor in? It would provide a higher voltage spike that can cause harm to sensitive electronics. To address that problem now, connect a resistor (e.g 6.8K or 10K) parallel to the larger capacitor so it keeps at the set voltage level whether its connected or disconnected.
Thank me later!
It is better to use dedicated current sense amplifier like INA193. The proposed op amp base design has two main deficiencies:first, with gain of 30 the op amp inputs get too close to the power rail. Many op amps have limited common mode range on the upper side. The second problem is the effect of tolerances between the paired resistors. This results in sensitivity to voltage, not just current. Laser trimmed resistor quad IC like LM5400 can help, but it is easier to use dedicated current sense amp.
I love your videos and how you explain it function so clearly !!
GREAT Scott a well thought out and worth while doing little project thanks.
Thanks!!! I Made it and with dome changes i Made my super Power supply!!!! Very good video.
hey, did you make a mistake with your dif. amp ? The ground on the non-inverting input puts this opamp into an inverting amp configuration, I tried to calculate it and never came close to your Vout formular at 6:23 . This formular is also wrong, because of your resistor config (R3=R5, R2=R4) it should be Vout = R5 / R3 (VLoad_ - Vout_), and not the potentials at the opamp inputs. But great video!
Thanks for this great hack bro...i searching for this type of hack...😍
If I knew half of what this guy knows, my head would explode!
After this explaination, make sure to make the successor of your DIY Buck/Boost Converter, which will feature that as well. Also, the horsepower of an electric motor, depends by how much current/voltage flows form the battery packs into
This is cool knowing how to do this, but I would probably just buy one of the many buck converters that include an adjustable current limiter in the design.
Zero challenge or understanding of the components you're using means when they don't work you just buy more
That's exactly what I did, only the board has _three_ trimpots on it, not the two that you'd expect. And it doesn't seem to want to work properly to drive a 10W LED. I'm in the process of trying to figure out why...
Yeah but you have to wait for it to arrive from China or wherever. I like to be able to build things with the stuff I have lying around. As a programmer I find there is a lot of beauty in creating complex things from a limited number of primitives. So as an electronics hobbyist endlessly buying new components doesn't satisfy me. If I were building a commercial product that would be another story.
i FINALLY understand all of the circuit, and started to build my own, but still the current calculations, i do not understand at 7:12, can anyone just give me a little hint? thanks
Current can be dependent on load resistance, or it can be dependent on voltage. In this case, it is dependent on voltage.
What if you need constant voltage and constant current? Can’t you make a current limiter dependent on a variable resistance such as a thermistor which is designed to heat up for a specific resistance, or a photoresistor designed to be exposed to a specific light intensity for a specific resistance?
I enjoyed it alot and you created what i wanted to have in my little electronic project but its not easy for me to build just like you did it but great video its always fun to watch your videos.
Hi, great video as always. Can this be used to power a super capacitor bank? Thank you.
Really I would say the video is very excellent. You are really Great Scott
Great video, thx! I wonder what could happe if a boost converter designed to boost to 12V, sees an input (from solar panels in full sun) coming @ 16V. Would it fry?
Awesome.. Thanks for your time and efforts.. love from INDIA.
mrco74 flush it.
lol
Your videos always exists me!!
Please, I have a doubt about the connection in the feedback pin of the IC. Did you connect the new feedback signal from the current limiter with the same feedback that is used for voltage measure? How does the circuit will control the output voltage if there are two signals in the same pin? Thank you!!
It might be a good idea to use a pot for the feedback resistor to calibrate the opamp for the precise current measurement.
Can I change the shunt value according to the capacity of my circuit?? For example for a circuit which can output maximum of 9A , the value of shunt should change right? 😓😓
Thank you. Your voice and speech is great. I very like.
can we create free energy using boost converter, lamp, and solar panel? 😅 just asking. i dont knw it will work or not
Wonderful! Is there any way to miniaturize this?
Great project, next one should be "make a li-ion battery charger using a buck-boost converter". Interesting thing would be, how to prevent reverse flow of current.
In theory, you should be able to make a simple circuit to hack SMPS power supplies too, to regulate the voltage and current accurately. Just make a circuit that activates the optocoupler when the output voltage or current is too high, with current control having priority. That decreases the switching circuits duty cycle, decreasing current and voltage with it.
It's actually possible that this exact circuit will be able to do that, but I (and probably you as well) want voltage regulation down to lower voltages than 3-4V.
And because buck converters work like switching power supplies, it has to work, right?
Hello GS. In this type of power supplies can i use a big electrolytic capacitor at output, like in a linear power supply, to avoid ripple? Thank you. Keep the good schematics.
Due to the quite high frequency i thin its better to use film or ceramic caps
wouldn't the sudden 3.3v to regular voltage create a very spikey and uneven power output (current fluctuating as a result) when the current limit is activated?
Hi You are shorting pin 3 to ground with the schematic you showed on video.but the schematic on instructable is ok.
Hi. This is the video that I am searching for. Is there any cheaper solution? For example which opamp I can use instead of mcp602? I cannot reach it currently. Unavailable. How I can decide the compınents?
Very useful hack. I was looking into doing something as elegant for a a linear regulated power supply. Perhaps you could could think of a similar way to Implement current limiting using an Lm317?
Brainpowered Electronics i just burned a lm317 with overvoltage , i was lucky to have a spare lm338 , this reminds me to buy some more.
Very good
If Iwant to increase the current with transistor LM7805 how conect it with 2n3055.....thanks
What kind of power supply would I use if I wanted to hook up some LED off road light bars (say 180 watts) as outdoor lights? So taking mains and converting to 12v while supplying enough power. And isn't too expensive
Are you trying to erase the schematic with that highlighter? Also, I keep feeling like you're going to twist those little terminal blocks off the board when you put the wires in.
Great stuff great Scott!, I always follow your channel. As an electronics fan I always wanted to do a kirlian camera as an experiment for myself, yes that camera that supossedly takes photos of the aura, it is possible to do that with a circuit?
Your videos are just so cool, thanks for sharing your knowledege :P
Your videos are amazing! Thanks to share knowledge and your experiences!
If I were to use a buck converter to drop 12v down to 9v, would the amperage increase? If so by what factor? I am attempting to DIY a guitar pedal power source, and I can't find any suitable inexpensive 9v power supplies
Excellent video and tipp! much appreciated!
Did you also investigate the behavior of the buck/boost converter when input voltage drops below 3.8 V? I figured out that the output rises suddenly to its maximum when input voltage drops below 3.5V. This would be fatal if powered by a liion e.g. that suddenly drops below 3.5V. Then it could happen that the output of the buck-boost rises to 30 or 40 V destroying an led that might be connected to its output (or anything else). I think i got exactly the same buck-boost converter from ebay (chinese seller) - which cost me only little more than 1 euro.
yeah this assumes intimate knowledge of circuitry and I bet I'm not the only one who was left scratching their head.question remains: what/how to connect a current limiter (in simple DIY terms) to a buck converter
So i did the diy boost convertor with attiny85 and i wanna add this current limit circuit to it. How should i make the connection between these 2? Especially the feedback connection.
is it all this 3 module just can adjust the voltage only, not current?.
how about the output current?.
is it have overcharge protection?.
is it can solar panel to connect to input to charge 6v 7ah SLA battery?.
Scott, thanks for the video, qq, on normal power supplies we can short the terminals to set current limit. I am not understanding how we can achieve this with buck being the power supply and IV meter for display. Red wire from display is negative which goes to the load and positive comes from buck. Thiese two terminals are say the two terminals for DIY power supply. Now I want to set the limit before connecting the load so ideally we would shot them but not sure if that would work. Any idea?
Answering my own question, GS might not even see this since the video is old. 😅
MY CONFUGURARIOB FOR DIY power supply is this, 2 bucks, 1 to reduce main supply voltage, second to power the display alone. Now to achieve CC limit setting and see it happen on display like normal PSU, we can still short the two terminals (negative or thick red from display and positive from main buck). My issue was the current limit was set to low on my display buck which was causing display to shut off, I guess this is due to high current draw and safety measures. I simply cranked up the current limit on my display buck and that did it. Works perfectly just like any other power supply.
Is it smart to use buck converter connected to boost converter to gain higher volatges?
Can I use this as a laser diode driver for a 3A laser such as the NUBM08 without damaging it?
Hi, you should have connected the GND on the other side of the R3 resistor in order to have a differential amplifier.
This is what I was looking for, R2 and R3 just form a combined resistance of 103.3K ohms. I don’t understand the purpose.
Man, you are pretty amazing and one heck of an instructor! It's like you make almost everything understandable. Please continue your fine work... :-)
Thanks for the feedback. I will try my best.
Very good video, I have been trying to look for a boost converter that will take a single 18650 Li Ion Cell and boost its voltage from 4.12 Volts to 30 volts. Most of the boost converter go with a min voltage of 5 volts. Is there such a boost converter or could one be made?
Thanks for posting this.It's exactly what I'm looking for.
hello, I have a question, I wanted to add current limit function to boost converter (2A version) to charge 4s batteries. so will it be possible to monitor input current of the converter to adjust output voltage? (Iout will always be under 2A, so i am not afraid of damaging the battery, i want to use converter safe operating current to maximize usage on any input voltage) I think it should work.
Hi Great, why you don't use your JBC? 😃
Will I loose integrated to converter overcurrent protection using feedback circuit ?
My big problem with all the current limit devices I've seen, whether built in or add on devices, is that they always perform the current detection on the ground side. While I understand why it is done this way, it simply isn't going to work where both the supply and the load have a common ground. I need a circuit which will measure the current on the high side or some other point in the device.
Can you make a video about converting small solar lanterns for gardens to an option for charging cellphones?
Is it possible to make the same scheme but with maximum current around 10A? (Of course using another buck converter)
Could you make a video on building a trailing edge AC dimmer? There aren’t any on eBay or Aliexpress that are controllable via a micro controller. Thanks!
Your videos are awesome
Sir is there any possibilities to control the feedback pin automatically using Arduino so that output voltage automatically control without rotate the knob manually...