Latching MOSFET turns on by touch? - Page 1
Forum section: electronics / beginners

author: KimLum
author_rank: Contributor
timestamp: March 19, 2025, 06:41:34 pm
content: I have made this rather simple circuit which is going to be switched on/off by a Raspberry Pi. The circuit will "latch on / off" via "Logic ON" and "Logic OFF" and this will allow the RasPi to be rebooted without changing the state of the cirquit. The RasPi will be able to sense the state via "Logic SENSE" (a voltage divider will be placed to drop the voltage to ~3V). The loads will be ~6A @ 12V and ~4A @ 5V, it has been tested - in a breadboard - for several days without any hiccups.I did, however, discover a strange issue which I cannot wrap my head around.. If the second half of the voltage divider (R3) is removed, touching anything connected to PMOS1 drain / Q1 base will cause the circuit to latch on. This includes the metal back plate of PMOS1 (which has continuity to drain), the drain pin of PMOS1, both sides of R2 and R4, the base pin of Q1 and the collector pin of Q2. By touching I mean with a finger, either probe of my DMM, a screwdriver or an unconnected jumper wire which I only touch on the insulation (no, I've not tried with my cat.. Yet.. Heeeree kitty, kitty, kitty.. ;-). When the circuit is on, touching either side of R5 does not switch it off.Since I cannot use my DMM to measure any changes in voltage without latching on, I assume that the added capacitance somehow causes Q1 to saturate just enough to pull down the gate of PMOS1, but I am far from sure. Can anyone explain this odd behaviour?Thanks! :-)

author: inse
author_rank: Super Contributor
timestamp: March 19, 2025, 06:56:27 pm
content: It sounds to me like you found the answer yourselves already.A capacitor from base of Q1 to ground should make it more robust against any spikes being picked up.

author: SteveThackery
author_rank: Super Contributor
timestamp: March 20, 2025, 12:57:25 am
content: Goodness me, that wiring diagram is very difficult to follow! Would you consider drawing it as a traditional schematic?

author: Peabody
author_rank: Super Contributor
timestamp: March 20, 2025, 02:41:11 pm
content: Is this test done with the 12V load connected? What is the nature of that load? And why would you remove R3? It seems pretty clear that without that ground connection, and with presumably nothing connected to Logic-On as well, the Q1 base is essentially floating, and therefore picking up whatever signals come its way when a big antenna-like object connects to it. But again, why do you need to know how the circuit behaves with R3 removed?

author: KimLum
author_rank: Contributor
timestamp: March 20, 2025, 07:00:08 pm
content: Thank you for your answers! :-)@inse:I have tried to add 100nF to Q1 base + GND but that did not change anything.@SteveThackery:Is it really that bad? Usually I would use KiCad, but this one is GIMP'ed.@Peabody:The load(s) are replaced with LED's for testing, and I am just trying to understand why this happens.The conclusion must be, that a pull down resistor (here represented by R3) is required. Usually I use NPN's with MCU's like ATmega / ATtiny / Arduino and the I/O pins on those act as GND when set to OUPUT+LOW, so no dedicated pull down is required. What confused me was that touching Q2 base / R5 did not switch the circuit off, but using a longer piece of wire actually does cause Q2 to saturate and thus switch off the circuit so a pull down is required for Q2 base as well to prevent unwanted behaviour. Beginner after all!

author: Peabody
author_rank: Super Contributor
timestamp: March 20, 2025, 09:33:50 pm
content: I have to say that I usually don't use base pulldown resistors on NPN transistors. My reasoning is that, unlike mosfets, actual current has to flow through the base to turn on the transistor. So it shouldn't matter if the base is floating. But your results may mean that I need to rethink that. Still, it seems that if Logic-on is connected to the MCU, even if it's powered down, you should not be getting this result.

author: amyk
author_rank: Super Contributor
timestamp: March 22, 2025, 07:15:02 am
content: Quote from: Peabody on March 20, 2025, 09:33:50 pmDepending on the rest of the circuitry and the "antenna", it's certainly possible to induce enough current to cause a bipolar transistor to turn on (and thus amplify) with a floating base.

author: KimLum
author_rank: Contributor
timestamp: March 22, 2025, 06:32:28 pm
content: Quote from: Peabody on March 20, 2025, 09:33:50 pmThe default state of pins on ATmega / ATtiny based MCU's is "INPUT", which means that they do not provide a path to GND before the pin-mode has been changed to "OUPUT". On a Raspberry Pi, the default state of pins are either "HIGH" (3.3V) or "LOW" (GND).I am most likely going to use RasPi to remote control (via the internet) the circuit and as already mentioned, I would like to be able to reboot the Pi whitout changing the state of the MOSFET's and instead of relying on floating base pins not causing trouble, I would rather add a cheap-as-dirt pull-down resistor to be sure that the state is fixed.I have attached a KiCad schematic of the cirquit for those who did not like the GIMP'ed one from earlier. I have added the voltage divider for the logic sense pin. Resistor values are selected from what I have, which may in fact not be what is optimal - but it works!Thanks for the advices given!

author: MarkT
author_rank: Frequent Contributor
timestamp: March 23, 2025, 11:31:31 am
content: That's a much improved schematic.However you have several transistors that are at 90 degrees to what's expected - current should flow vertically through devices unless there's a good reason not to show it this way - would you write sentences with various words at 90 degrees to the others?When a schematic follows the conventions well then someone familiar with schematics can parse it visually in literally a fraction of a second - otherwise they usually have to redraw it themselves to understand it - the visual part of the brain does the heavy lifting.So basically:Voltage rails horizontal, more positive ones are higher up (in a.c. circuits live above neutral/earth)Signal flow left to right whenever possible (feedback has to go the other way of course).Current flow vertical for each stage of the circuit. Signal currents may have to flow horizontally though, so devices on the signal path can be exceptions.Active devices the same way up.Things like voltage regulators / fuses often have current flow horizontal, just to add some complication (conceptually they live in the voltage rail).

author: KimLum
author_rank: Contributor
timestamp: March 23, 2025, 06:23:55 pm
content: Quote from: MarkT on March 23, 2025, 11:31:31 amThank you! My reasoning was to make as few path/trace crossings () as possible. What you are instructing makes a lot of sense so I have made a revision of the revised revision and I must say that it is in fact much easier to understand, so very many much thanks for the info, I will remember that for future schematics!