0

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

winny
  • 13,064
  • 6
  • 46
  • 63
Rodrigo
  • 467
  • 2
  • 8
  • 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? – Jonathan S. Oct 30 '22 at 14:29
  • @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? – Rodrigo Oct 30 '22 at 14:54

2 Answers2

4

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.

Jonathan S.
  • 14,865
  • 28
  • 50
  • 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? – Rodrigo Oct 30 '22 at 15:21
  • 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. – Jonathan S. Oct 30 '22 at 15:49
2

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.

hacktastical
  • 49,832
  • 2
  • 47
  • 138
  • 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!!! – Rodrigo Nov 04 '22 at 11:20