The Pros and Cons of Microcontrollers for Boost Converters

It never fails — we post a somewhat simple project using a microcontroller and someone points out that it could have been accomplished better with a 555 timer or discrete transistors or even a couple of vacuum tubes. We welcome the critiques, of course; after all, thoughtful feedback is the point of the comment section. Sometimes the anti-Arduino crowd has a point, but as [Great Scott!] demonstrates with this microcontroller-less boost converter, other times it just makes sense to code your way out of a problem.

Built mainly as a comeback to naysayers on his original boost-converter circuit, which relied on an ATtiny85, [Great Scott!] had to go to considerable lengths to recreate what he did with ease using a microcontroller. He started with a quick demo using a MOSFET driver and a PWM signal from a function generator, which does the job of boosting the voltage, but lacks the feedback needed to control for varying loads.

Ironically relying on a block diagram for a commercial boost controller chip, which is probably the “right” tool for the job he put together the final circuit from a largish handful of components. Two op amps form the oscillator, another is used as a differential amp to monitor the output voltage, and the last one is a used as a comparator to create the PWM signal to control the MOSFET. It works, to be sure, but at the cost of a lot of effort, expense, and perf board real estate. What’s worse, there’s no simple path to adding functionality, like there would be for a microcontroller-based design.

Of course there are circuits where microcontrollers make no sense, but [Great Scott!] makes a good case for boost converters not being one of them if you insist on DIYing. If you’re behind on the basics of DC-DC converters, fear not — we’ve covered that before.

37 thoughts on “The Pros and Cons of Microcontrollers for Boost Converters

  1. That said, if your Boost Converter is built around a Raspberry Pi and an ADC chip you are definitely doing it wrong.

    Yes… you know who you are. I’m calling you out on that!

  2. The first time I ran across a switching regulator, in a Hewlett Packard printer from the late 1970’s, it used a 555 timer. Now that I work in switching regulator design, wowie are there a lot of advantages to using a dedicated boost controller, specifically amplifier bandwidth and precision bandgaps. I’ve built them out of uC’s, as well, because moving problems into software is usually helpful. But building boosts out of discrete components is the kind of noble task like walking from one city to another: you’re not doing it because you’re in a hurry or you want good results, you’re doing it to say you’ve done it.

  3. Isn’t the default solution is using a pwm controller?
    I did this long time ago using tl494 but later i realised that using mcu for this purpose is way more cooler than you think

  4. pro it would be easy to reprogram.

    con if the cpu crashes depending on if there is any protection it could latch up and stay on and destroy the fet, coil and other parts that may be sensitive to having solid dc applied to them

    1. Another con is that you have to program it in the first place, and that you have to design the circuit such that nothing breaks if you power it on without the program.

    2. True, but that’s what a fuse is for. Always helps to try to consider all the possible failure modes of the system and make something that breaks gracefully. Personally I’d rather use a less reliable machine that fails gently over a more reliable machine that fails spectacularly.

  5. A microcontroller makes sense if you already need one for other tasks. Otherwise, I would just get a dedicated boost controller IC, which will typically have much better regulation and higher power output.

  6. This is exactly the task where a uC makes *zero* sense to use, apart from educational purposes (which, coincidentally Scott’s videos were about and which, coincidentally, seems to be completely lost to the Hackaday writer …). Any normal application would use a dedicated DC-DC converter chip. The efficiency will be better, the part count lower and it will take 10x less board space.

    1. Well there can be some more special applications where a µC-based controlling of a Buck/Boost converter can actually be useful:
      1. Include battery charging logic (used e.g. in the Imax B6 charger)
      2. MPP tracking for solar cells or wind generators
      3. Intelligent lab power supply with user interface/digital control interface
      4. Input overload protection by monitoring input voltage drop (e.g. when powering something off an old laptop power supply or similar)

      1. A more reliable design would still separate the power converter if component count isn’t absolutely essential.

        And, the design becomes more flexible because you can choose the micro independently of the need for having comparators or PWM outputs, and timing considerations for the other tasks you’re trying to accomplish. Maybe you want to use the analog input for reading a potentiometer instead.

    2. As Jakob says there times when a µC can add value to specific applications. Every IC is an ASIC, it’s really a question of just how specific that application needs to be.

    3. I don’t think “buy a premade component to do it” works as a criticism of “of these two possible ways of doing a task yourself, one is better”. Yes, if DC-DC boost is your end goal you can buy a jellybean part, I see this whole discussion as more about the general process of “I have X task to accomplish, using Y discrete components or Z clever computery thing, which approach do I take?”

  7. People often tend to forget that not everyone has a stack of obscure components to choose from. As an occasional electronics tinkerer, I’d much rather order ten attinys and have multiple useful applications for them than to order a bunch of discrete components whose characteristics are tuned to a handful of applications .Sure, the attiny is a jack of all, master of none, but if I were to have only a few components on hand, I’d rather them have as many potential applications as possible. If a prototype goes further than it’s abilities, then it’s worth taking the trouble to move to a more tailor made solution, with all the time and troubleshooting that brings.

  8. If you already have a uC in your design, and you need a boost converter, and you want to shave cost, and you’re happy with crude performance, then implement the boost converter with the uC.

    Otherwise, buy a boost converter chip. That’s how civilized people do it.

    1. this has nothing to do with being polite.

      uncivilized people dont design circuits, they wage war. civilized people design circuits of all kinds without fear of being killed for using one that no-one else uses.

  9. PSoC5 MCU already has boost converter component built-in, so one can use e.g. 1.5V battery to power the MCU at e.g. 3.3V. Problem is rf noise created within the chip, affecting ADCs, DACs and all alalog parts. It is better to have power supply externally.

  10. For one of my projects I designed both boost and buck-boost converter driven by uC to provide power for an op-amp. First design used charge pumps, but they didn’t work out too well, not efficient enough – it got -0,3V on negative rail and 5,5V on positive one with 5V supply. My new design should fix this problem. Boost converter uses PFM for voltage limitation. Both are driven by internal oscillator via. CLKOUT pin with 50% duty cycle at 4MHz. I had to add three transistors, two inductors, two diodes and few resistors to the project. In few weeks I should test the prototype and make video about it…

    1. When I was in 3rd grade, I figured out that I could use a motor to turn another one operating as a generator, yielding a higher voltage out if done right. Use a stepper out of a 5.25″ floppy drive as the generator and it will generate enough voltage to give a small shock.

  11. I like uC for this application in my own projects. I made a led flash light made from 12V led panel from a mains spot light. A PIC16F18313 creates the pwm at about 70Khz, handles the on/off button that also allows switching between different modes. I’ve planned battery monitoring but haven’t got around to implement it in firmware yet, but with the build in voltage ref and ADC, it’s easily done. I’ve started with a breadboard version, then a larger PCB through hole and smd version and finally a small all smd component pcb, which made it very tiny. The advantage was that all components were smd occupying only one side of the pcb.

    But I also use dedicated buck/boost converters. From the smdshop.nl I bought some converters that would take one or two AAA size bateries and convert it to 3.3V or 5V. I made 5 pcb’s at once, all smd components to be used in projects. The website also sells matching inductors, which can sometimes be hard to find. Efficiency is around 90-95%.

  12. I realize I’m too late.
    No commenter appears to know that many 8-bit microcontrollers have peripherals for this purpose built in.

    Once configured, they’re not using code. So even if your code locks up, the part operates just fine.

    I have many designs in production using this concept. One part + passives in less space, less cost and more flexible than a 555 circuit or even a dedicated SMPS IC. Doing it with code is too risky for a production-level device. Doing it with something as antiquated as a 555 is only really good for learning. A dedicated SMPS IC is great, but doesn’t quite have the flexibility and is another part to add.

    1. I post even later just to add a further complaint about people’s reaction: what a horrible converter layout. Why on earth would you put the transistor so far from the decoupling capacitor that sits behind and so far from the gate driver? This tells you a lot about how much this guy knows about power electronic converters. Through-hole to220 components are bad enough on their own in terms of parasitic inductance to need help from a horrible layout to end up switching worse. I wonder how quick the mosfet will die compared to how quick it would die on a decent design.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.