Turning off an XL7015 buck converter - Page 1
Forum section: electronics / beginners

author: Menno
author_rank: Newbie
timestamp: May 05, 2023, 07:21:25 am
content: Given my limited electronics experience this has me a bit stumped. I have an XL7015 buck converter that is converting the 10S (36V) battery voltage into 12V for a led strip. The battery is also connected to a logic board (a VESC in this case) that has an on/off switch.What I'd like is when the logic board turns off, the buck converter should also turn off. I can use a 5V line from the logic board which has power when its turned on as a signal.From what I've read in the data sheet the XL7015 has an enable pin that has to be pulled high to turn off the converter.My question is, how can I do that with this setup? I'm guessing some sort of pull-up when the 5V line is low. but I can't quite wrap my head around it. I've thought about a MOSFET switch on the high voltage side to cut off the XL7015 entirely, but I've read that these tend to burn out after a while given the high battery voltage.

author: Ian.M
author_rank: Super Contributor
timestamp: May 05, 2023, 08:38:34 am
content: The datasheet says its EN can be pulled all the way up to Vin, and has a worst case input leakage current of 20uA. Therefore EN needs a pullup resistor to +Vbatt, and a N-MOSFET (gate to Logic5V) to pull it down when Logic5V is present. A 3.3 Meg resistor would only use an extra 0.1mA when pulled low. The MOSFET should be a small signal one, rated for at least 60V, with a threshold voltage of approx. 2.5V, half your 5V logic supply. If the Logic5V rail doesn't drop to 0V cleanly when it shuts off, you may need a load resistor across it and ground to draw a few mA and get it below the MOSFET's min. gate threshold voltage in a timely fashion.

author: Menno
author_rank: Newbie
timestamp: May 05, 2023, 05:57:41 pm
content: Thanks! That's really helpful.I've added a schematic based on my understanding of your explanation; does this look right?

author: Ian.M
author_rank: Super Contributor
timestamp: May 05, 2023, 10:34:02 pm
content: You've got the general idea but you've chosen an inappropriate MOSFET and wired it wrong.A 2N7002 or similar would be a better choice, and the drain must go to EN and the source to ground. You've got them swapped so the body diode conducts, which means you can never shut the buck converter. Your choice of MOSFET is poor because the FQP30N06L is a 32A device, so large and expensive and the large junction area is likely to result in a higher leakage current when off (vs the 210mA 2N7002). Also the 10K pulldown forms a potential divider with the 1K gate resistor which reduces the gate drive. If you need a pulldown, move it to the other end of the gate resistor!Lastly, you need to confirm that the logic board's power in negative side is directly connected to the board's 0V/Gnd. If not, you may need to us an optocoupler instead of a MOSFET!

author: Menno
author_rank: Newbie
timestamp: May 06, 2023, 05:22:24 pm
content: Much appreciated! I'll be sure to keep those things in mind. Based on your comments I updated the schematic.

author: Ian.M
author_rank: Super Contributor
timestamp: May 06, 2023, 08:28:28 pm
content: That's good if the logic board 0V (your V5- ?) is internally connected to power in negative. If not there's a risk that making that connection externally may cause problems, e.g. by bypassing a protection circuit on the logic board. Its easy enough to check - with the power disconnected, simply test for continuity between the terminals in question on the logic board.

author: Menno
author_rank: Newbie
timestamp: May 07, 2023, 06:24:09 am
content: Great! Yes, the ground of the V5 is indeed connected to the ground of the board (and thus the battery negative). Again thanks, this has been helpful and educational.

author: Ian.M
author_rank: Super Contributor
timestamp: May 07, 2023, 08:52:53 am
content: For completeness, the Optocoupler solution for the case if logic ground is *NOT* the same as DC -in, would be to connect the optocoupler's phototransistor side, collector to EN, emitter to BAT-, and its LED side, cathode to 0V, emitter to a resistor, and the other end of he resistor to +5V. You want the optocoupler's phototransistor fully saturated, so need LED If of approx 10 * Ic / CTR. Choose the resistor accordingly. If Ic is very low, off the datasheet's graph for CTR, drive the LED a bit harder so you are working 'on the graph'!

author: Menno
author_rank: Newbie
timestamp: May 07, 2023, 10:16:58 am
content: Looks like I'll need to do some reading to get a good grasp on thisOne thing I was wondering, how is the value for the (in this case) 3M3 resistor calculated?

author: Ian.M
author_rank: Super Contributor
timestamp: May 07, 2023, 10:36:46 am
content: Whoops, It isn't! I dropped a zero!The 3.3Meg resistor has to pull up EN enable pin against any leakage current through the MOSFET or into the EN input. The max. EN input leakage is given in the datasheet as 20uA, and a 2n7002 can leak up to 1uA at room temperature. Unfortunately, if you want to get above 1.6V (EN guaranteed shutdown threshold) with Vbat end of discharge 30V, a 3.3Meg resistor can only deliver 8.6uA, about 1/3 of what you need.It looks like 330K would be a better choice, or even 100K if its got to work at high temperatures. The tradeoff is of course higher quiescent current when the XL7015 is on, but as the chip uses typ. 2.5mA an extra few hundred uA is negligible.