0
\$\begingroup\$

I made this post a day before about controlling a DC-DC buck converter’s output voltage with an ESP32 DAC output.

Is it possible to control a Dc Dc buck converter output voltage by the DAC of an Esp32?

But in fact what I need is to control the output voltage of the DC-DC buck converter between a max voltage (for me 30 V) and a fixed lower one (18 V), from an MCU. In my case an ESP32. I don’t need to swing between the voltages, just need to choose between then when needed it.

I read about it in this post below:

Changing output voltage of a buck converter by electronically swapping the feedback resistors

I need some help on how to implement it on the feedback pin of the DC-DC controller. In my case, the XL4005.

Thanks

\$\endgroup\$
2
  • \$\begingroup\$ You can simply copy the circuit from the question you linked. The XL4005 has the same control scheme. What exactly are you unsure about? The resistor values? Or how to connect the MOSFET? \$\endgroup\$ Commented Oct 30, 2022 at 14:29
  • \$\begingroup\$ @JonathanS. well... both.. Can I get the answer diagram and remove one mosfet and one resistor and calculate it for two voltages only? R1 is the trimpot, right? Do I have to consider it 10K or the resistance value to get in my case 30V max? \$\endgroup\$
    – Rodrigo
    Commented Oct 30, 2022 at 14:54

2 Answers 2

4
\$\begingroup\$

You can use the diagram in the answer you linked almost directly. You only need one MOSFET to switch between two voltages, like so:

schematic

simulate this circuit – Schematic created using CircuitLab

First calculate Ra and Rb2 for 18V operation. Then calculate Rb1 so that Rb1 in parallel with Rb2 has the correct value for 30V operation.

\$\endgroup\$
2
  • \$\begingroup\$ Great! What if I need an inverted setup... the 30V voltage as default, and when the mosfet is active it gets the 18V one? Like an 18V_EN? How do the resistors are set? \$\endgroup\$
    – Rodrigo
    Commented Oct 30, 2022 at 15:21
  • \$\begingroup\$ You could simply place an inverter in front of the MOSFET gate. I.e. a 74HCT04. They're available as tiny single-gate variants too. \$\endgroup\$ Commented Oct 30, 2022 at 15:49
2
\$\begingroup\$

Modify the answer I gave in your previous question to replace the DAC and buffer op-amp with a GPIO pin to the FET gate. Done.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks! I chose the right answer the one by Jonathan S. because he wrote first, but both answers were correct! I already implemented and tested some values and it worked great! Thanks for your help!!! \$\endgroup\$
    – Rodrigo
    Commented Nov 4, 2022 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.