Author Topic: Logic gate output won't go low enough to turn off NPN transistor  (Read 3323 times)

0 Members and 1 Guest are viewing this topic.

Offline InfravioletTopic starter

  • Super Contributor
  • ***
  • Posts: 1001
  • Country: gb
I'm trying to get a 74HC00 (NAND) logic gate's output to turn an NPN transistor (BC337) on and off. But I'm finding the logic gate's output, although an oscilloscope shows it to be going as low as gnd (and below due to ripple) and as high as the 5V power rail (plus some ripple), doesn't seem to ever go "low" enough to switch the transistor off.

Measuring the transistor's base (separated from the NAND's output by a 1K resistor to prevent the NAND gate driving too much current) shows it constantly sitting at the 1.2V or so above ground one would expect to see when it is on, and the NPN's collector, at the the lower end of a high side load, stays at the sort of low voltage one would expect when a current is flowing through the load.

I tried pulling the NAND gate's output to GnD with another 1K resistor, transistor still won't turn off when connected.

I then resorted to having a 10nF cap in series after the 1K resistor, the other end of this cap is held just above ground by a potential divider between the power rail and gnd, so that the cap lets the signal vary about this reference voltage, decoupled from any DC offset in the NAND's output. This way I can get the transistor to go off and on, but it decoupling its base from DC through the capacitor seems an excessive number of components to need just to get a signal from a logic gate output to a transistor. Is there a way which needs less components and doesn't give a situation where if the logic signal were further attenuated by more than 1K  it would no longer be able to get high enough to turn the transistor on.

This is a fast signal, square wave with a frequency of several MHz, rise time and fall time not important so long as it can rise and fall the full voltage in the time available for a period.

Thanks

 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5817
  • Country: de
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #1 on: June 04, 2023, 09:19:46 pm »
The pinout of the BC337 is different to, eg, BC547.
Check that first.
 
The following users thanked this post: bdunham7

Online bdunham7

  • Super Contributor
  • ***
  • Posts: 7689
  • Country: us
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #2 on: June 04, 2023, 09:22:24 pm »
Could you draw out a schematic showing all the details, including the load that the transistor is driving? 

Are you saying you have an output of 0V at the output of the 74HC00, that output is connected to the base of the transistor by a 1K resistor, and the voltage at the base of the transistor is 1.2V?  Is this all true in the steady-state (DC) condition?  Is there any other component connected to the base of the transistor?

Benta beat me to it, but I was also going to ask--are the pins of the transistor connected correctly?
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2070
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #3 on: June 04, 2023, 09:26:35 pm »
If Benta's solution is not correct:
The transistor is probably saturated during the "on" time. It takes extra time to recover from saturation and remove the stored base charge. A quick fix might be to reduce the impedance of the base drive circuit - make the base drive from a potential divider between the output of the logic gate and ground. Aim to get the impedance seen by the base to 100\$\omega\$ or less. Or use a schottkey diode between base and collector to prevent saturation.
Using a low base drive impedance would also mitigate the effects of miller capacitance too.

If you want to use the speed-up capacitor trick - put it in parallel with the 1k resistor.
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5802
  • Country: es
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #4 on: June 04, 2023, 09:43:41 pm »
Try 10K or 100K with 100pf in parallel.
« Last Edit: June 04, 2023, 09:53:48 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline srb1954

  • Super Contributor
  • ***
  • Posts: 1082
  • Country: nz
  • Retired Electronics Design Engineer
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #5 on: June 04, 2023, 10:27:15 pm »
I'm trying to get a 74HC00 (NAND) logic gate's output to turn an NPN transistor (BC337) on and off. But I'm finding the logic gate's output, although an oscilloscope shows it to be going as low as gnd (and below due to ripple) and as high as the 5V power rail (plus some ripple), doesn't seem to ever go "low" enough to switch the transistor off.

This is a fast signal, square wave with a frequency of several MHz, rise time and fall time not important so long as it can rise and fall the full voltage in the time available for a period.
The BC337 transistor is not characterised for high speed switching applications but rather as a medium power driver for lower speed applications so it will be a fairly difficult task to get it to switch at this speed.

There are various tricks for speeding up bipolar transistor switching but, depending on the load being driven, it might be a better option to use a small power MOSFET.
 
The following users thanked this post: RJSV

Offline InfravioletTopic starter

  • Super Contributor
  • ***
  • Posts: 1001
  • Country: gb
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #6 on: June 05, 2023, 01:31:16 am »
Thanks all.

I was using a BC337 because I have pleny to hand in through hole for prototyping, it is not the same type I'd use when doing final boards (BCW66GLT1G of which I have a box of SMD format transistors), but at some point in the past (cannot rememebr when, but I've worked this way quite a while) I came to the conclusion that the BC337 and BCW66... seem similar enough to use one in breadboarding and the other on PCBs. I had checked the pins, that wasn't the issue.

Andy Watson seems to have diagnosed it best, reducing impedance between the base and ground has helped.

I found a 180 ohm pulldown to ground after the 1K resistor (that is to say at the transistor's base) seemed to keep the voltage on the base low enough that it would turn off when the NAND gate output low and turn on when the NAND output a high level. Lower part count than the whole capacitor decoupling of DC offsets. A 100pF in parallel with the 1K has also helped.
 

Offline RJSV

  • Super Contributor
  • ***
  • Posts: 2099
  • Country: us
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #7 on: June 05, 2023, 04:44:05 am »
Srb1954 Seems to have right.
   Can you test at reduced speed, like 500 khz, just for that section?  That would relate to the issues being brought up, where the transistor can't keep up, at the 2 Mhz.

  That bit about 'driving impedance' sounds more like RF stuff, but how about then changing the base resistor, to maybe 2 kohms, to keep the transistor 'honest' (not saturating)...Rough figure say 3 volts driving 2 K would be base current of roughly1.5 mA.  With a typical beta of 40 to 80 that would drive, say about 60 to 120 mA.

 

Offline RJSV

  • Super Contributor
  • ***
  • Posts: 2099
  • Country: us
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #8 on: June 05, 2023, 04:58:07 am »
...oh and actually, most common emitter circuits (you have ? right ?), the base drive ON voltage is a static 0.6, 0.75, that sort of base to emitter characteristic.
 

Offline RJSV

  • Super Contributor
  • ***
  • Posts: 2099
  • Country: us
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #9 on: June 05, 2023, 05:00:14 am »
...You mention 1.2 volts, which isn't a typical ON value, assuming common emitter, and generally always having a base resistor of some value, typically.
 

Offline InfravioletTopic starter

  • Super Contributor
  • ***
  • Posts: 1001
  • Country: gb
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #10 on: June 05, 2023, 02:10:30 pm »
I could swear it was showing 1.2V when it wasn't working, but since my changes which made it work the base pin is getting a waveform of zero volts when the NAND is outputting low and around 0.7V when the NAND is high.

I can definitely try a lower frequency signal later, but it thankfully seems to be working now. In the final application it needs to be at 3 or so MHz though.
 

Online bdunham7

  • Super Contributor
  • ***
  • Posts: 7689
  • Country: us
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #11 on: June 05, 2023, 02:28:36 pm »
I could swear it was showing 1.2V when it wasn't working, but since my changes which made it work the base pin is getting a waveform of zero volts when the NAND is outputting low and around 0.7V when the NAND is high.

I had asked you if that 1.2V remained the case in the DC or LF case.  The data sheet for the BC337 actually shows a VBE(on) of 1.2V under stated conditions that don't quite appear to be saturation.  I don't know what the recovery (turn-off) time would be from that condition but from what you've posted, that appears to be the issue.

Tweaking the components until it works in your prototype may not result in a stable result that works in production.  One solution that might be less dependent on individual device characteristics is a Baker clamp.

https://en.wikipedia.org/wiki/Baker_clamp
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 
The following users thanked this post: MK14

Offline InfravioletTopic starter

  • Super Contributor
  • ***
  • Posts: 1001
  • Country: gb
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #12 on: June 05, 2023, 02:56:31 pm »
Thanks for the baker clamp link, I'll give that a go.
 

Online bdunham7

  • Super Contributor
  • ***
  • Posts: 7689
  • Country: us
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #13 on: June 05, 2023, 03:20:04 pm »
Thanks for the baker clamp link, I'll give that a go.

BAW56 might be a good selection.

https://assets.nexperia.com/documents/data-sheet/BAW56.pdf
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16510
  • Country: us
  • DavidH
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #14 on: June 05, 2023, 03:48:25 pm »
It seems the delay time because of saturation is the problem.  Solutions include:

1. Place a small capacitor in parallel with the series resistor to move charge in and out of the base more quickly.
2. Baker clamp the transistor to prevent saturation, which can be done with a single schottky (or germanium) diode.  This can be combined with the capacitor above.
3. Use a faster transistor, like a fast saturated switching transistor.  This is *not* the same as an RF transistor however, and they are no longer commonly available.

If you really need faster switching, then an alternative is to drive the emitter with the output of the HCMOS gate instead of the base, with the base held at a fixed voltage.  However this requires the load current to flow through the gate which may or may not be acceptable.


 

Offline InfravioletTopic starter

  • Super Contributor
  • ***
  • Posts: 1001
  • Country: gb
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #15 on: June 05, 2023, 10:19:20 pm »
I tried various capacitors in parallel with the 1K resistor, 10pF, 100pF, 1nF, with no success.
I tried the two diode type of baker clamp, but no success.
I've also tried substituting the BC337 with a 2N3904 (correcting for alternative pinout, 2N3904 has a short t_on and t_off in the datasheet), this doesn't make the baker clamp or parallel cap work, yet like the BC337 the 2N3904 does work when a 180 resistor is run from base to ground (emitter is at ground).

Changing the 1K series resistor whilst keeping 180 ohms from base to ground
Reducing that 180 ohms to 150 ohms makes the transistor barely able to turn on any more, lowering to 120ohms it doesn't turn on at all, raising to 220 ohms it turns on and off as well as at 180, 270 ohms behaves well, 470 ohms has the transistor only managing to turn off for a brief portion of the input wave form and at higher resistances the transistor never goes off at all.

Do these observations reveal anything further?
Thanks

« Last Edit: June 05, 2023, 11:17:46 pm by Infraviolet »
 

Online bdunham7

  • Super Contributor
  • ***
  • Posts: 7689
  • Country: us
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #16 on: June 05, 2023, 10:52:11 pm »
Do these observations reveal anything further?

Do you have a DSO that you can use to provide a screenshot of the voltage at the base of the transistor and perhaps at the input side of the 1K resistor at the same time?  Can you slow your input signal rate down and look at the transitions?  Also, what is the (approximate) collector current in the on state, or IOW, what is your load?
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline InfravioletTopic starter

  • Super Contributor
  • ***
  • Posts: 1001
  • Country: gb
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #17 on: June 05, 2023, 11:30:06 pm »
Yes, I have a scope. I can how two traces at once, I'll get those pics uploaded ASAP.

The "load" is from the collector upwards towards the 5V rail. It is an LC tank circuit which I am driving at resonance (plus some extra resistances and smoothing capacitors to ensure the resonance doesn't cause ripples on the 5V rail). The DC current would be a maximum of 24mA. The AC current, judged by the voltages on a 56 ohm resistance in series after the LC tank and before the collector (diagram coming up) seems to be peaking at about 70mA with a mean of 22mA.
 

Offline InfravioletTopic starter

  • Super Contributor
  • ***
  • Posts: 1001
  • Country: gb
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #18 on: June 06, 2023, 10:12:59 pm »
Thank you

Images are attached,

Schematic: the NAND gate is powered from 5V and Gnd, the signals feeding in to it aren't shown. The load is an LC tank consisting of a PCB coil (L) and a capacitor, when this is in resonance it is used for wireless "power transfer", transferring a smal amount of power to be reflected off the geometry of some carefully shaped rotors as a type of angular resolver. C3 and C4 as well as the 56R resistors are there to serve to prevent any high voltages generated in the LC tank at resonance causing ripples or spikes on the power rails, they may be excessive for the task and somewhat inefficient but they do work. That string of diodes (to be replaced with an appropriate zener facing the other way in future versions) and the stuff righward of it is only there incase component variation means one gets really utterly perfect resonance in the LC tank, in which case it is there to take away any higher voltages which might threaten the transistor well before they get serious, as the resonance isn't quite perfect the peak voltages around the LC tank are under 8 volts and never quite get clipped by the diode string.

O-scope images: One shows the waveforms when R2 is present, the other shows how the base stays high (transistor never turns off, and though not shown in traces here the collector never gets pulled down so all one gets in the LC is a DC current through L) when R2 is pulled out so there is "infinite" resistance (or anything large enough, performance gets bad for R2>470 ohms) from the base to ground. Yellow trace is at the NAND gate's output pin, blue is at the transistor's base pin, note the different voltage scales on the channels. I've been making those scope measurements using scope probes with the hook covers taken off so the needle pin can go stright in to breadboar, and with little wire loops round the probe end for grounding rather than the long grounding clip, else I get ringing on the edges.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16510
  • Country: us
  • DavidH
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #19 on: June 06, 2023, 11:20:30 pm »
That looks about right for driving a transistor into saturation.  I do not understand why a capacitor across R1 does not result in better results.
 

Online bdunham7

  • Super Contributor
  • ***
  • Posts: 7689
  • Country: us
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #20 on: June 06, 2023, 11:27:46 pm »
I would be interested in seeing the output of the 74HC00 and perhaps another set with a two-diode Baker clamp setup, with and without R2.  I have the feeling we're all missing something here.
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline InfravioletTopic starter

  • Super Contributor
  • ***
  • Posts: 1001
  • Country: gb
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #21 on: June 07, 2023, 02:15:58 am »
The yellow trace is the 74HC00's output.

Something very odd must have been going on, I just tried a cap (10nF) in parallel with R1 againand took out R2. The trace at the NAND gate's output is now somewhat distorted with the falling edge becoming multi-stepped, but the trace at the transistor's base in now a distorted square waveform in phae with the 74HC00's output which has a high level at 800mV and a low at -3.12V. Transistor now switches fully on and off without needing R2, like it did when R2 was present but this time with base going below ground (emitter) at times when the transistoris turned off.

A 1nF also worked here, waveform from NAND more distorted (I can't post a picture so quickly, so imagine a row of Burj Al Arab skyscrapers in profile, the sort of sail shaped building), wavefrm at base a square with sloping tops/bottoms high 960mV, low -1.84V.

330pF gave a distorted square wave at the base of 960mV and -240mV. Smaller capacitances led to the scenario where the transistor never turns off.

It seems a cap parallel to R1 is working instead of R1 this time, don't know why it didn't last time.
The choice is whether the cap in parallel or the resistor to ground is the better choice, is it helthy for the NAND gate to be, even only for a brief fraction of each wave to be driving in to the "short-circuit" of the cap, and is it ok for the base of the transistor to go so far below the grounded emitter?
Thanks
 

Online bdunham7

  • Super Contributor
  • ***
  • Posts: 7689
  • Country: us
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #22 on: June 07, 2023, 03:17:21 am »
The yellow trace is the 74HC00's output.

Doh!  That should have been obvious...

Quote
Something very odd must have been going on,

Are you doing this on a breadboard?

Quote
The choice is whether the cap in parallel or the resistor to ground is the better choice, is it helthy for the NAND gate to be, even only for a brief fraction of each wave to be driving in to the "short-circuit" of the cap, and is it ok for the base of the transistor to go so far below the grounded emitter?

I don't know about the first two and to an exent it depends on exactly how you need the circuit to perform, but as far as reverse-biasing the BE junction 5V is the limit if there's any energy behind it.  Is the -3.12V a spike from ringing or something or is that the approximate level of the bottom of the distorted square wave? 

A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline InfravioletTopic starter

  • Super Contributor
  • ***
  • Posts: 1001
  • Country: gb
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #23 on: June 07, 2023, 06:26:25 am »
Yes, this is on breadboard for now. I get things working on breadbords before I design PCBs (and whenever possible do PCBs with SMD versions of the through hole parts I use when breadboarding). Perhaps I might have let one end of the cap go in to an empty row or something first time round, tricky to see which one it is going in to when there are leads of other components all around.

-3.12V is the level of the bottom of any spikes as per my o-scope's reading, but by eye on the scope's graph I could judge the flat bottom of the waveform was down in the -2.5V to -3V area.

Given what I've found now, what difference is the parallel cap or 200 ish ohms to ground making which lets the transistor turn off where it otherwise remained stuck on throughout?


« Last Edit: June 07, 2023, 06:28:05 am by Infraviolet »
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6730
  • Country: pl
Re: Logic gate output won't go low enough to turn off NPN transistor
« Reply #24 on: June 07, 2023, 10:12:42 am »
Given what I've found now, what difference is the parallel cap or 200 ish ohms to ground making which lets the transistor turn off where it otherwise remained stuck on throughout?
They pull current out of the base and suck out stored charge faster than it would clear naturally. The resistor adds an extra ~3.5mA current sink (which also reduces base current going into the transistor when ON from 4.3mA to 0.8mA) and the capacitor draws sharp negative current pulses each time NAND output goes down.

Whatever you do, if you want this to be reproducible, check if it works with transistor specimens with different β (as there is likely at least 2:1 spread between the guaranteed maximum and minimum). Particularly the resistor option, which significantly decreases base current.
« Last Edit: June 07, 2023, 10:19:56 am by magic »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf