How to avoid unwanted activations when connecting USB-C to a circuit with MOSFET - Page 1
Forum section: electronics / projects

author: amintegia
author_rank: Contributor
timestamp: July 16, 2025, 09:39:39 am
content: Design ContextI have a motor powered by an LDO, whose GND (GND_MT) is controlled by an N-channel MOSFET (IRLML6344) in a low-side switch configuration.This MOSFET switches the ground of the entire motor power circuit (GND_MT), allowing it to activate only when the MOSFET channel is closed.The MOSFET’s gate is driven by the Q̅ output of a D-type flip-flop (74LVC1G80GV), which toggles state when a button is pressed.The circuit is powered by a Li-Ion battery. A USB-C connector on a second PCB provides 5V only for charging the battery, not for directly powering the system.⚠The ProblemWhen I touch the USB-C connector with the charger cable (even before fully plugging it in), the motor activates, as if the MOSFET were turning on by itself.But it shouldn’t:The button hasn’t been pressed.The flip-flop logic shouldn’t change (but it does — seemingly triggered by this contact).The flip-flop supply remains stable and active throughout.Things I’ve already tried without success:Added a 100kΩ resistor between GND_MT and BAT+ → no effect.Connected the USB-C shield to GND → no improvement.Placed various capacitors (100 pF to 10 nF) between GND and BAT+.Added a capacitor between the ENABLE signal (gate of the MOSFET) and GND → didn’t help.❓What I’m looking forI’m trying to find a simple solution that doesn’t require a full redesign. Ideally, something that stabilizes the behavior without permanently tying GND_MT to the system ground, since it must be controlled via the MOSFET.I’ve attached the relevant part of the schematic showing the flip-flop, LDO, and MOSFET, as well as the USB-C charging section.Any ideas or insight would be greatly appreciated!

author: Whales
author_rank: Super Contributor
timestamp: July 16, 2025, 11:48:28 am
content: One terminal of the motor is connected to +3V_MOTOR. What is the other terminal of the motor connected to? GND or GND_MT?

author: tooki
author_rank: Super Contributor
timestamp: July 16, 2025, 12:12:30 pm
content: Why not just use an LDO that has an enable input?!

author: temperance
author_rank: Super Contributor
timestamp: July 16, 2025, 12:43:49 pm
content: You can't use an LDO the way you did. This will anyhow result in unpredictable behaviour. The LDO will end up in some "strange state" and unpredictable when its internals have a current patch to GND from the output through the motor instead of the (mandatory) GND connection.Either switch the motor to GND or, as it has been suggested, use an LDO with an enable pin.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: July 16, 2025, 11:37:43 pm
content: There are some intricacies for keeping a signal at a defined state during a power on sequence, and reset controllers are are designed to do this, and often combined with a brown-out circuit. And for a reliable circuit you really need both, even if only the power up behavior is important for you. The reason is that normally you can't guarantee how long the power has been off, and without a brown out circuit, timing capacitors may have an intermediate state during power on.Apparently you have not given much thought to the power off behavior. but also, I have not much interest in figuring out the working of a schematic with power and GND randomly connected on all sides of schematic symbols.

author: wraper
author_rank: Unknown
timestamp: July 16, 2025, 11:58:31 pm
content: Quote from: temperance on July 16, 2025, 12:43:49 pmNah, it's totally predictable. LDO either works normally when Vss is tied to GND, or it outputs voltage limited only with its input voltage minus droput voltage when Vss is floating. But since motor's minus wire is tied to LDO Vss and there is no other load, it does not matter and it's as good as disconnecting power on the high side. It's the same as arguing about disconnecting + vs - wire in otherwise floating circuit.QuoteMotor is not connected to GND, it's disconnected together with LDO. If it was connected to GND, it would never shut down and would only spin faster when MOSFET is open.

author: wraper
author_rank: Unknown
timestamp: July 17, 2025, 12:24:54 am
content: Quote from: amintegia on July 16, 2025, 09:39:39 amWhat's strange is that you never added a capacitor to the flip-flop input. Flip-flop circuit is obviously the issue if the motor keeps running after it was activated by the transient. Not to say this circuit has nothing to deal with switch contact bounce.QuoteAnd this is just stupid because you placed it after the source of the problem and it does not do jack shit to prevent IC from being triggered.And you literally bothered with every other part of the circuit except where the actual issue lies.

author: temperance
author_rank: Super Contributor
timestamp: July 17, 2025, 12:44:18 am
content: Quote from: wraper on July 16, 2025, 11:58:31 pmYou are correct. The op states:Quote

author: Kasper
author_rank: Frequent Contributor
timestamp: July 17, 2025, 04:25:15 pm
content: Quote from: wraper on July 17, 2025, 12:24:54 amOP got it wrong but as you note, they are putting effort in, trying almost every part of the circuit. I think that earns them the right to be treated with decency. I doubt they are stupid. Probably just not very experienced.Instead of calling them stupid, you could say:I think you are on the right track with adding a cap. Where else do you think one may be helpful?

author: Ian.M
author_rank: Super Contributor
timestamp: July 17, 2025, 04:50:13 pm
content: Quote from: amintegia on July 16, 2025, 09:39:39 amThat 'smells' like a common mode transient issue. The USB C charger probably doesn't have a grounded output, so assuming the usual SMPS with a Y capacitor between secondary side 0V and the negative side of the primary DC bus as a return for HF leakage through the transformer inter-winding capacitance for EMI mitigation, you get a significant line frequency leakage current through the Y capacitor with approx 160V RMS driving it. If the target device is poorly laid out or screened, the moment of contact transient glitching it is not notably unusual.Predictions: Either ground the USB C shell of the cable before contact or use a battery powerbank, and the problem will go away!

author: wraper
author_rank: Unknown
timestamp: July 17, 2025, 05:29:17 pm
content: Quote from: Kasper on July 17, 2025, 04:25:15 pmI did not call the person stupid, I called doing something stupid. Smart people often do stupid things, myself included.

author: Kasper
author_rank: Frequent Contributor
timestamp: July 17, 2025, 07:25:05 pm
content: Quote from: wraper on July 17, 2025, 05:29:17 pmThat's not as bad. I certainly do plenty of stupid things!

author: temperance
author_rank: Super Contributor
timestamp: July 18, 2025, 05:25:09 pm
content: QuoteIndeed, the problem is probably somewhere else in the circuit where a common mode transient is turned into a differential transient.