Transistor NOT gate slow output rise time - Page 1
Forum section: electronics / beginners

author: TechJunkie97
author_rank: Contributor
timestamp: February 10, 2019, 04:06:00 am
content: Hi, I wanted to invert a PWM signal (i.e. the HIGH duty cycle becomes the LOW duty cycle and vice-versa) so I decided to try a NOT gate using 2N3904 transistor on a breadboard. I found that the output takes ~4.5 us to become high (when the input becomes low). This time lag is significant for a 15-20 kHz switching frequency PWM signal. However, there is no lag (<100 ns) when output becomes low (When the input goes high).Moreover, this output rise time improves to 2.3 us when I use 1k collector resistor instead of 10k and worsens when I use resistor value greater than 10k.My theory:It seems that there is some capacitance getting into the circuit. When I use lower the value of the collector resistor the RC constant decreases and I have smaller output rise time and vice versa.what do you think is happening here?Thanks

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 10, 2019, 04:19:57 am
content: Place a 4.7k from base to GND, and reduce the collector load resistor to 1k. Or double up the circuit, complementing polarity (resistor from input to base, base to VCC; use PNP, emitter to VCC, collector to output) and drop the collector resistor entirely, thus making the BJT equivalent of a CMOS inverter.Further speed can be had by placing 100pF in parallel with each 10k from input to base. Beyond that, I'd really strongly suggest something 74HC or LVC flavored instead.There is quite indeed capacitance in the circuit, and not just those on the datasheet (Ccb, Cbe) and their expected effects (i.e., Miller effect with Ccb), but also the equivalent capacitance of the charge stored in the B-E junction.Diode recovery (stored charge) acts like a very small battery. I'm... not sure if that's actually a useful statement of it, but it so happens that a battery has these properties. Self-discharge is the charge leaking away over time, under no load. The terminal voltage has an exponential dependence on concentration of the reactants (in this case, stored charges (conduction electrons and holes) in the semiconductor; in batteries, the chemicals used), times a nominal standard voltage drop (which is the reduction potential of the battery's chemistry, or, related to the bandgap of the semiconductor).As it happens, the self-discharge of the diode junction is also proportional to its state of charge (beyond a baseline level). In a BJT, this is the base current supplied by the input circuit. Yes indeedy, the base current is something of an accident -- for the most part, we have to consider its effect on the circuit, and provide for it, but we never use base current as a primary design parameter. (A consequence of this is the ratio between collector and base currents -- hFE -- which is generally consistent say over a range of currents, but this really just happens as coincidence and should not be relied on.)Because batteries are nonlinear, we can't simply express them as capacitors. Two practical ways to express it are: the incremental capacitance, C = dQ / dV (where d is a small change around some operating condition of charge Q and voltage V; and the average capacitance, C = Q / V (for some instantaneous pair of Q and V). Because this varies widely with condition, we might measure an effective capacitance for a particular case (like a saturated switch with 10k resistors around it), and use those figures in our calculations of switching speed, or current requirements or so on. We can guess that this parameter will change gradually as we vary conditions, but beyond say a factor of 2x in any direction, we should probably measure again, and repeat whatever calculations we've based on it.The "reduction potential" for silicon, by the way, is around 0.7V (it depends on initial current and doping), and the recombination time (self discharge) is on the order of 10-20us. These are small batteries -- in the range of pico ampere hours!And yeah, in case it's not clear, the B-E junction is for all intents and purposes, just another diode junction.So, it has reverse recovery and nonlinear capacitance and all that. MOSFET body diodes too, or JFET gates (though you don't usually forward-bias those; but if you did, you'd see recovery when turning it off, just the same).Tim

author: TechJunkie97
author_rank: Contributor
timestamp: February 10, 2019, 05:40:48 am
content: Thanks T3sl4co1l for your detailed and helpful reply. I had no idea about this phenomenon. I tried your suggestions and got much better results (<1 us output rise time) and I am very happy with this.Actually, that PWM signal controls the speed of a fan and is also used elsewhere in the circuit. Turns out the fan speed is controlled by the negative duty cycle ( but I assumed the other so that fan speed was exactly opposite of the desired). It was better to invert this signal for the fan instead of making changes to essentially all the circuit. I wanted to use BJT instead of 74HC logic as there is not enough space of the already soldered vero board to put a 14-pin DIP IC.At least my stupid mistake helped me learn something good

author: TechJunkie97
author_rank: Contributor
timestamp: February 10, 2019, 06:11:10 am
content: T3sl4co1l, just one question. How does putting a 4.7k resistor from base to GND, for example, help us in this circuit? Does it provide a path for the B-E junction to discharge charge faster instead of self-discharge? and how does it affect reverse recovery?Thanks again for your help!

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 10, 2019, 08:38:51 am
content: Yes, precisely. That was the one thing I didn't wrap up: you need to discharge the battery, and that's what the resistor does.Tim

author: Zero999
author_rank: Super Contributor
timestamp: February 10, 2019, 09:39:11 am
content: Quote from: jaskiratubhi on February 10, 2019, 05:40:48 amLots of the 74HC parts are available in single gate packages, to save space, such as the 74HC1G14 and 74HC1G04. The only problem here is they're in SMT packages, which is a pain to use with strip board.https://assets.nexperia.com/documents/data-sheet/74HC_HCT1G14.pdfhttps://assets.nexperia.com/documents/data-sheet/74HC_HCT1G04.pdfAnother thing you could try is replacing the BJT with a small MOSFET such as the 2N7000. MOSFETs don't suffer from the storage time issue, like BJTs do. Once the gate's capacitance is discharged, the MOSFET rapidly turns off. The gate just looks like a capacitor, so doesn't need a current limiting resistor, but a low value gate resistor is still a good idea to prevent resonance and limit current surges drawn from the driver: 100R will do in this case.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 10, 2019, 08:04:01 pm
content: Yeah, I stopped myself short of promoting mini-gates, as a lot of builders just don't want to deal with figuring out tiny components and want to stick with THT. Mixed technology prototyping is a valuable skill though. (I don't even use perfboard anymore; I SMT everything on cut-out pads in copper clad, or solder chits of PCB on top, making standing islands. It's a solid ground plane approach, so signal quality is never a worry.)BTW, 2N7000 is a pretty big MOSFET, rated 1A (more than a 2N4401) and the gate is about 200pF equivalent. (Again, the capacitance is nonlinear, but in this case it's a simpler matter: the capacitance depends on Vds, and Miller effect must be included. The total is documented on the datasheet's gate charge graph.)Tim

author: ogden
author_rank: Super Contributor
timestamp: February 10, 2019, 08:12:04 pm
content: Schottky diode may improve BJT switching time as well:https://en.wikipedia.org/wiki/Schottky_transistor

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 10, 2019, 08:18:33 pm
content: Yes, another note about stored charge -- because it depends on base current, if you can reduce base current to the absolute minimum needed for saturation, or avoid saturation altogether, you can minimize or eliminate stored charge as a problem.A diode from base to collector can be used to emulate this. It has to be a low voltage drop diode (schottky), because Vbe ~= 0.7V and Vce(sat) is in the 0.1V range. A diode of 0.4V is adequate. What happens is, drive current is shunted through the diode into the collector, increasing collector current a bit, but decreasing actual base current compared to the drive current. It's a feedback process where the transistor only draws as much base current as it needs (i.e., Ic / hFE), no more.Mind that schottky diodes do have considerable capacitance (e.g., BAT85 ~ 20pF), which cranks up Miller effect. No free lunch and all that. BAS70 might be the best option for a circuit like this (low ~pF, but also relatively high Vf for a schottky diode -- it is a quite small diode, indeed!).And there are tricks to prevent Miller effect, like cascoding. It's not very useful here, at logic voltages, but it can be helpful for higher voltage switching.Tim

author: Ian.M
author_rank: Super Contributor
timestamp: February 10, 2019, 09:21:44 pm
content: LTspice sim of the various BJT inverter ideas presented in this topic for comparison. The 100pF speedup capacitor seems to be the winner, but it does require a low impedance drive signal and has a nasty negative going glitch on the output due to the input falling edge.

author: ogden
author_rank: Super Contributor
timestamp: February 10, 2019, 09:42:26 pm
content: Quote from: Ian.M on February 10, 2019, 09:21:44 pmTry combining capacitor and diode augmentations. To limit glitch - add input current-limiting 100 Ohm resistor.

author: Zero999
author_rank: Super Contributor
timestamp: February 10, 2019, 10:11:00 pm
content: Quote from: T3sl4co1l on February 10, 2019, 08:04:01 pmTry putting 1A through a 2N7000 and see how long it lasts for and a gate charge of 1nC is tiny, compared to larger MOSFETs. Even with a fairly decent gate resistance, it should switch fairly quickly.http://www.mouser.com/ds/2/149/2N7002-8405.pdf

author: ogden
author_rank: Super Contributor
timestamp: February 10, 2019, 10:16:45 pm
content: Quote from: Zero999 on February 10, 2019, 10:11:00 pmRight. It's DRSon = 5Ohm @ 0.2A. For 1A it means that poor TO-92 shall dissipate (more than) 5WBTW specification say DC 0.2A, pulsed 0.5A. Nowhere near 1A.

author: David Hess
author_rank: Super Contributor
timestamp: February 11, 2019, 12:14:04 am
content: If you are driving the transistor base with a CMOS output which goes to ground, then the base-emitter shunt resistor is not as effective because the series resistor can already remove charge from the junction when the CMOS output is zero and the small capacitor in parallel with the series resistor makes this even more effective.But the baker clamp with a schottky diode from the collector to base to prevent saturation and associated storage time still helps for faster turn off.

author: Zero999
author_rank: Super Contributor
timestamp: February 11, 2019, 09:52:08 am
content: Quote from: T3sl4co1l on February 10, 2019, 08:04:01 pmI think the drain-source capacitance is more of a problem than the gate, especially with a 10k load. When the MOSFET turns off, the drain-source capacitance is going to take awhile to charge via 10k.