Noise on N-channel MOSFET gate for BJT-MOSFET on-by-Default circuit

Thread Starter

Juand

Joined Aug 25, 2016
8
Hello all,

I'm attempting to get a little dead-man's vigilance device working. I've got a handheld-unit with a microcontroller that once activated with a push button, begins to count down, which is reset by pushing the button again. If the counter runs down, then the hand-held device sends a signal to a "main unit" through an 25m extension lead, to set off an alarm.

The switching circuit I'm using to switch the alarm looks similar to this:

The Port-C2 is fed into a output pin of a Teensy LC, whose voltage levels are 3.3V. The BJT I'm using is a BC337, and the mosfet I'm using is a FQD13N10L N-Channel, with a 12V 120mA motorcycle alarm instead of the motor. The idea is is the alarm should only go off if the counter runs down, or the hand held unit is destroyed or the cable is cut somehow. The Teensy's Port pulls it's pin to 3.3v, the BJT conducts, a voltage drop occurs over the R1 10k resistor and so the mosfet is switched off.


The thing is, when I plug in my device, the alarm goes off, fine, the Teensy in the hand held unit needs to power up, run the code and pull it's output pin high to turn on the BJT - it does, but instead of silence I hear a crackling noise from the alarm - it's still kind of running! So I used a oscilloscope to the gate end of the R1 resistor while it was doing so, and I saw:


Problem.png Problem3.png

Since the threshold voltage of the FQD13N10L is 1 V according to the datasheet, the noise I'm seeing here seems large enough to set off the mosfet!
I had problems with noise before, as I simply attempted to pull the mosfet gate to zero directly through the Teensy. The cable I'm using acted as an antenna and the Teensy's sensitive pins picked up the noise, and the alarm ran at full loudness.

I'm concerned that this is still what is happening. Any Ideas on how to deal with this? Thanking you all in advance.
 

ebp

Joined Feb 8, 2018
2,332
Where is the 12 volts coming from?
How is "ground" of the switch circuit connected to ground of the microcontroller?
I seriously doubt there is pickup in the cable unless the control wire is routed along with another with a lot of crud on it.
Photo of setup, please.
 

Thread Starter

Juand

Joined Aug 25, 2016
8
My Apologies. Here:thumbnail.jpg thumbnail (7).jpg thumbnail (2).jpg thumbnail (1).jpg thumbnail (6).jpg thumbnail (5).jpg

12V is supplied by the battery, which serves as the +12V rail for both the Alarm and the gate of the mosfet. The Negative pin of the battery serves as GND for the switch circuit and the micro, and the 12V rail is sent along the cable to the micro's board, which as a 3.3 regulator, which powers it. The yellow cable in the main unit and the white cable in the hand held unit are the same, which is fed to the collector of the BJT stored in the hand-held unit. This is why I suspect noise.
 

ebp

Joined Feb 8, 2018
2,332
Okeley dokeley. (good grief, for a few seconds I thought the spell checker was OK with "dokeley")
The long cable does make your concern about noise seem quite valid. I though perhaps there was noise from your 12 volt supply, but batteries are pretty quiet (not, surprisingly, totally so).

What kind of regulator are you using for the 3.3 V? I'm guessing a switcher. If so, do you have a photo of it?
 

Thread Starter

Juand

Joined Aug 25, 2016
8
Okeley dokeley. (good grief, for a few seconds I thought the spell checker was OK with "dokeley")
The long cable does make your concern about noise seem quite valid. I though perhaps there was noise from your 12 volt supply, but batteries are pretty quiet (not, surprisingly, totally so).

What kind of regulator are you using for the 3.3 V? I'm guessing a switcher. If so, do you have a photo of it?
Terribly sorry, I don't have a picture handy at the moment, but it is a LD29150 surface mount (DPAK). Here's a link to the datasheet:

http://www.st.com/content/ccc/resource/technical/document/datasheet/cc/41/70/73/f5/e6/40/50/CD00003403.pdf/files/CD00003403.pdf/jcr:content/translations/en.CD00003403.pdf

I do have it's placement on my PCB - It's to the left, marked U2:
PCB.PNG
 

ebp

Joined Feb 8, 2018
2,332
No need to apologize! Lots of the problems that show up at AAC require some back-and-forth to get all the details. You've done well.

It looks like this is an "all ceramic" design - all of the capacitors are ceramic, which is now quite common because SMD ceramic capacitors in high values are cheap and usually "better" than other caps in power supply circuits.
The very good performance of ceramic capacitors at high frequency can sometimes lead to some interesting but problematic behavior. The combination of the ceramic cap and the inductance in wiring can sometimes form a "high-Q" circuit that can "ring" at rather high amplitude when excited by fast transitions of current.
If unwanted resonance is a problem, the solution is to "spoil the Q". There are several ways to do this, but all of them basically do the same thing - "burn up" high frequency energy. One way is to use an electrolytic capacitor in parallel with a ceramic cap. Here you would put it in parallel with the cap at the input to your voltage reg (if I understand your circuit correctly - the regulator is on the opposite end of the long cable from the battery). Electrolytic caps tend to be "lossy" at high frequency, plus the bulk capacitance lowers the resonant frequency. Another way is to add another ceramic capacitor in series with a resistor of a few ohms.

Sorry - have to quit for a bit. One of my weird visual disturbances is coming. Back in a while (maybe not for several hours). Haven't proof read what I wrote, so there may be errors.
 
Last edited:

Sensacell

Joined Jun 19, 2012
2,595
Re- configure the wiring so the BJT and FET circuit are in the same box - with the micro.

The configuration you have chosen puts sensitive nodes on the long cable- asking for trouble.
Run the high-current alarm signal through the cables, not the logic / gate signals.

The new configuration will place the drain lead of the FET on a connector pin, which can make it vulnerable to static discharge damage.
Connect a simple diode with the the cathode to +12V and anode to the drain terminal, this clamps the voltage to the 12 V rail.
 

Thread Starter

Juand

Joined Aug 25, 2016
8
Re- configure the wiring so the BJT and FET circuit are in the same box - with the micro.

The configuration you have chosen puts sensitive nodes on the long cable- asking for trouble.
Run the high-current alarm signal through the cables, not the logic / gate signals.

The new configuration will place the drain lead of the FET on a connector pin, which can make it vulnerable to static discharge damage.
Connect a simple diode with the the cathode to +12V and anode to the drain terminal, this clamps the voltage to the 12 V rail.
Thank you, I had considered this before but I wasn't sure if it would help. Much obliged.
 

Thread Starter

Juand

Joined Aug 25, 2016
8
No need to apologize! Lots of the problems that show up at AAC require some back-and-forth to get all the details. You've done well.

It looks like this is an "all ceramic" design - all of the capacitors are ceramic, which is now quite common because SMD ceramic capacitors in high values are cheap and usually "better" than other caps in power supply circuits.
The very good performance of ceramic capacitors at high frequency can sometimes lead to some interesting but problematic behavior. The combination of the ceramic cap and the inductance in wiring can sometimes for a "high-Q" circuit that can "ring" at rather high amplitude when excited by fast transitions of current.
If unwanted resonance is a problem, the solution is to "spoil the Q". There are several ways to do this, but all of them basically do the same thing - "burn up" high frequency energy. One way is to use an electrolytic capacitor in parallel with a ceramic cap. Here you would put it in parallel with the cap at the input to your voltage reg (if I understand your circuit correctly - the regulator is on the opposite end of the long cable from the battery). Electrolytic caps tend to be "lossy" at high frequency, plus the bulk capacitance lowers the resonant frequency. Another way is to add another ceramic capacitor in series with a resistor of a few ohms.

Sorry - have to quit for a bit. One of my weird visual disturbances is coming. Back in a while (maybe not for several hours). Haven't proof read what I wrote, so there may be errors.
A bit belated, but thank you so much, much appreciated.
 

ebp

Joined Feb 8, 2018
2,332
So ...

Let's look at the "ground" connection:
Because of current flowing through the ground conductor in your cable, there will be a voltage drop across it. The end that connects to the microcontroller board is going to be positive with respect to the battery end - where your alarm driver is located. This means that even if the micro can pull its output pin right down to processor's ground pin potential, the other end of the signal wire is going to be at a more positive voltage relative to its local ground. But that is just a "DC" voltage drop, and in this instance it is actually working to our benefit (don't expect such treats all the time!)

Now consider the fact that that ground conductor is also an inductor. As the load current at the micro end varies, the inductive reactance will also contribute potential differences - both positive-going and negative-going and of large magnitude. If the current changes are slow enough, the inductance is unimportant. You can confirm (or disprove) this effect with your scope: Connect the scope probe ground to the ground conductor at one end of the cable and probe the ground connection at the other end. Incidentally, having the cable coiled up increases the inductance, though probably not by much. It's like a multi-turn coil, but the magnetic coupling from any turn to adjacent ones is probably quite small due to the spacing between the turns.

We can do something about the varying current acting against the inductance - get rid of the variation. This can be done with some capacitance between the +12V line and the ground line at the microcontroller end. Without knowing the magnitude of the variation, I can only suggest some experimental values. I would start with about a 100 µF good-quality aluminum electrolytic cap. There is no harm in using more, except that you'll get a spike of current when you connect the battery - often with some sparking that can be alarming if you aren't expecting it. There is probably enough "high frequency" capacitance from the ceramic input cap on your voltage regulator board, but you might experiment with some more in parallel with the electrolytic. The "bulk" capacitance of the electrolytic will help with the possible ringing issue I mentioned previously.

I think that this will allow you to leave your driver at the alarm end so the alarm will sound if the yellow cable is disconnected. Filtering the FET drive remains an option, but there are some other options, too.
 

MrSoftware

Joined Oct 29, 2013
1,906
Start removing parts from the system to try to find where the noise is originating. Start by removing the really long wires, replace it with something very short. If the noise is still there, eliminate the wire completely and short R2 to R1 on the 12v side. Is the noise gone? Continue until you find where the noise is originating. Once you know where the noise is coming from, you will have a better idea for how to eliminate it.

Also don't discount @ScottWang 's idea for some noise filtering.

If the 3.3v regulator is a switching type, then try removing that and powering the 3.3v portion from a bench supply just to see if that was the source of the noise.
 
Last edited:

ScottWang

Joined Aug 23, 2012
6,933
Start removing parts from the system to try to find where the noise is originating.
This is what I want to say after he try the noise filter circuit since you talk about that, that is the best to solve the real problem in the end, and the problem should be solved step by step.
 

Sensacell

Joined Jun 19, 2012
2,595
The circuit as drawn turns on at only 600 mV into the base of the BJT.
The gate node has an impedance of 10K - which will pick up everything over a long wire.

1) The 600 mV is not a problem if the transistor and micro are directly connected via a short wire.
2) The gate node is sensitive, keep it short and directly connected to the BJT- do not route this over a long cable.
 

ebp

Joined Feb 8, 2018
2,332
1) The 600 mV is not a problem if the transistor and micro are directly connected via a short wire.
2) The gate node is sensitive, keep it short and directly connected to the BJT- do not route this over a long cable.


As I understand it, sounding the alarm if the cable is disconnected is part of the requirement. This is defeated if the alarm driver is at the micro end of the cable.
 
Top