# NPN transistor won't switch off in boost circuit

I'm designing a boost circuit to generate ~150V from a 1-4 cell lithium battery. It doesn't need to supply a lot of current; I just need high voltage. Using a 4 cell battery with full charge (16.8V), I could get ~130V in LTSpice simulation and with a 1 cell battery it could barely output 30V. After putting the circuit together on a breadboard and using both 3.3V supply and a 4 cell battery, I was surprised to see that it could output around 90-100V regardless of the input voltage.

simulate this circuit – Schematic created using CircuitLab

Once the output voltage reaches the desired level, LM339's open-collector output pulls Q1's base low and prevents it from switching. Q2 isn't strictly necessary but in the final product there will be more than one high voltage output and Q2 will switch all of their transistors.

I've found the optimal pulse width of the PWM (in compliance with L1's max current) to be 4.4us (44%) in simulation with a 16.8V supply and 5us (50%) on the breadboard for a maximum output voltage with a 3.3V supply.

### The Problem:

If I turn up the pot (and thus the comparator's +input voltage) too quickly, or power on the circuit with the pot already on max (effectively removing the comparator), the output voltage drops to about half the max voltage (~50V). After checking the voltage at the base of Q1, it seems like it just stays at 0.7V and Q1 doesn't turn off.

Here is the circuit operating normally at 98V and 45V. CH2 = B(Q1).

CH2 = CLK

And here's "the bugged state" outputting ~50V (and slowly dropping since Q1 isn't switching L1 anymore), CH2 = B(Q1):

CH2 = CLK

Note that my oscilloscope can't capture more than 5V (50V with x10 probe).

Interestingly, it also seems to skip some pulses in this state. I've tried using a diode or a separate transistor to try to pull Q1's base to ground but it didn't work and also reduced the maximum output voltage.

• Your scope can't capture more than 50 V, even in 1 MΩ termination mode? Might be time to look into getting a new scope.... Sep 19, 2023 at 18:48
• The spice schematic isn't super helpful, especially with the floating node on the BJT and the PWM source, to really debug this there would have to be the design schematic. Sep 19, 2023 at 18:51
• Welcome to the stack. As note in other comments, an accurate design schematic, plus a photo or two of the actual board would likely increase the chance of getting a good answer. Sep 19, 2023 at 21:22
• @colintd The breadboard is too messy to be understood from a picture but I've updated the schematic.
– SMMB
Sep 20, 2023 at 3:57
• Please show the output voltage of the sig-gen at the same time as these waveforms under the same conditions. If you only have a 2 channel scope, then please show CH1 as is, then sig-gen on CH2. Sep 20, 2023 at 4:29