• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

MOSFET switching issue

Status
Not open for further replies.

earckens

Member
In the schematic below MOSFET Q3 is a 2N7000. This component is used to connect the ground for the analog circuit to active ground by means of output pin 9 of the controller. This results in a switching off of the oscillator part when low, and activating the oscillator when high.

This works well when using a 2N700 or a larger MOSFET, however when replacing the 2N7000 with a SMD such as a AO3400 in a SOT23 package then the microcontroller is being reset: is soon as the gate is driven high, a scope reveals a sharp (several microseconds) dip on Vcc (grounded to GND of the microcontroller).

Why would that be?

A 10uF cap across source to gate sometimes helps, but a larger cap causes oscillations, so no solution there.
 

dknguyen

Well-Known Member
Most Helpful Member
The fact that Q3 connecting GND to A-GND doesn't really make sense in the first place and your explanation of why its there is not helpful into understanding its purpose. Are you trying to say Q3 is supposed to be a low-side load-switch? Because saying it connects two grounds together means something else and is nonsensical.

If what I assumed about it being a low-side load switch is correct, then your your description of a Vcc dip means that a large startup current is being drawn by the oscillator circuit. There's too much inductance and not enough decoupling capacitors nearby so the current surge produces a voltage sag which is browning out your microcontroller. This is made worse by the lower resistance of the AO3400. Increasing the gate resistor should help since it slows down the time it takes for Q3 to turn on and spreads the current surge out over time, thereby spreading the voltage sag out over time, thereby reducing its peak, but what you should really do is place another 1uF to 10uF decoupling cap close and in parallel close to the oscillator circuit and its low-side switch.

You also have no high frequency decoupling caps anywhere on any of your ICs. All you have is C5 as a 10uF bulk decoupling capacitor and that is not enough. Your MCU could have possibly not resetted if you had such a cap on the MCU. Put a 0.1uF ceramic cap in parallel with EVERY pair of power pins on EVERY IC, and as close as possible to such pins.
 
Last edited:

crutschow

Well-Known Member
Most Helpful Member
The term "active ground" has no defined meaning.
It can be analog ground, digital ground, circuit ground, system ground, etc, but not active ground.
 

earckens

Member
The fact that Q3 connecting GND to A-GND doesn't really make sense in the first place and your explanation of why its there is not helpful into understanding its purpose. Are you trying to say Q3 is supposed to be a low-side load-switch? Because saying it connects two grounds together means something else and is nonsensical.

If what I assumed about it being a low-side load switch is correct, then your your description of a Vcc dip means that a large current startup current is being drawn by the oscillator circuit. There's too much inductance and not enough decoupling capacitors nearby so it the current surge produces a voltage sag which is browning out your microcontroller. This is made worse by the lower resistance of the AO3400. Increasing the gate resistor should help since it slows down the time it takes for Q3 to turn on and spread the current surge out over time, spreading the voltage sag out over a longer period of time thereby reducing its peak, but what you should really do place another 1uF to 10uF decoupling cap close and in parallel close to the oscillator circuit and its low-side switch.

You also have no high frequency decoupling caps anywhere on any of your ICs. All you have is C5 as a 10uF bulk decoupling capacitor and that is not enough. Your MCU could have possibly not resetted if you had such a cap on the MCU. Put a 0.1uF ceramic cap in parallel with EVERY pair of power pins on EVERY IC, and as close as possible to such pins.
Thanks a lot for that helpful note! Your comments will be implemented.
Q3 is switching high side load: Vcc supplies the oscillator, then to Q3, then to actual ground.
 

dknguyen

Well-Known Member
Most Helpful Member
Do the 0.1uF caps first, gate resistor second, bulk cap last in order of importance (mainly because you already have C5. Without C5, gate resistor would be least important. You might want to experiment with just the second two without the first to see the difference and how little you can get away with. The 0.i1uF are the ones that definitely should be there though, even if you did not have this problem.
 

earckens

Member
Thanks, will do.

I did not realise such a surge current would occur. The complete circuit draws 35mA when active, the battery supply has a very low output impedance, and the 5V regulator is capable of 600mA: yet still a 5usec dip to 0,5V.
Strange, until I read your answer.
 
Last edited:

dknguyen

Well-Known Member
Most Helpful Member
Thanks, will do.

I did not realise such a surge current would occur. The complete circuit draws 35mA when active, the battery supply has a very low output impedance, and the 5V regulator is capable of 600mA: yet still a 5usec dip to 0,5V.
Strange, until I read your answer.
Trace/wire inductance gives a middle finger to all those things.

Floating ground? ;)
No, because it's not floating.
 

earckens

Member
Do the 0.1uF caps first, gate resistor second, bulk cap last in order of importance (mainly because you already have C5. Without C5, gate resistor would be least important. You might want to experiment with just the second two without the first to see the difference and how little you can get away with. The 0.i1uF are the ones that definitely should be there though, even if you did not have this problem.
Before I had read your post: increased R12 from 150R to 10k caused the dip to go not lower than 3.5V. Adding a 22uF tantalum piggyback on the existing one (C5 already was 22uF) caused the dip to go not lower than 0.9V below Vcc.
 

earckens

Member
I think now that the AO3400 mosfet is overkill for this application: such a low on-resistance is not required. Maybe revert to a SOT23 version of the 2N7000?
 

earckens

Member
Ok. Step 3, add .1uF ceramics to the oscillator IC, stay with AO3400.
I must admit I had overlooked the HC12 startup current: another 22uF cap.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top