Soft latching switch no working as intended (assistance appreciated)

Thread Starter

IQWorkshop

Joined Jun 9, 2020
4
Hi all,

First of all i will say i'm a novice circuit maker so please be kind.

I wonder if someone would be so kind as to offer some support in figuring out why my soft latching switch, which will be controlling an Arduino pro micro in the end, is not behaving as expected.

I'm following an example from EEVblog on YouTube but I am swapping the NPN and PNP transistors for N-channel mosfets and a P-channel mosfet respectfully.


this is my schematic



And this is my board layout (there is 1 via for connecting GND)



The Mosfets i'm using are: -
P channel Mosfet is a BSS84 (SOT23)
N channel Mosfet is a BSS138 (SOT23)


I have checked out the circuit to the best of my ability and cannot find any shorts and all traces have continuity.

Behaviour
The circuit is powered by a single 18650 cell, and when connected I get the full voltage on the output pins of the latching switch circuit without pressing the button.

Pressing the button, I see voltage drop to the mV range so I know the shutdown side of the circuit is good.

As soon as i release the button the voltage goes back to full output voltage.

It would seem that something is triggering the n channel mosfet and in turn triggering the main p channel output mosfet, but I cannot wrap my head around the logic of why this is happening.

I do wonder if my mosfet selection is the problem here and that the internal diode is breaking down, but this is me guessing as opposed to having any logic to back that up.

Thanks for any help and suggestions
Steve
 

dl324

Joined Mar 30, 2015
16,846
Before I try to make any sense of your schematic, are you really using a -5V supply?

soft latching switch
What is a "soft latching" switch? If you're trying to make a momentary switch behave as an alternate action switch, why not just call it that?
 

crutschow

Joined Mar 14, 2008
34,284
That circuit has a feedback problem if the push-button is held down too long, and will then oscillate as shown;
1591742886729.png
The R4 C1 time-constant must be longer than the maximum time the button is pressed.
What is the value of C1 (why is it not on the schematic)?

Below is the LTspice simulation of a similar but simpler circuit that is insensitive to the length of the button press.
You could likely modify your circuit board for that circuit without changing any traces, just adding a couple jumpers.

1591742692442.png
 

Thread Starter

IQWorkshop

Joined Jun 9, 2020
4
Hi,
thanks for the response, but i'm a little confused by your reply.

are you really using a -5V supply?
No i'm using a +5v supply. Not really sure where you are picking up a -5v from but the schematic clearly states +5v.
The headers JP1-4 are connected to +5v, GND and VOUT just to have reasonably sized pads for pins or wires to be soldered.

What is a "soft latching" switch? If you're trying to make a momentary switch behave as an alternate action switch, why not just call it that?
As stated at the header of my post, I am a novice. The terminology that I have parroted comes from the EEVblog YouTube channel who I believe is an electronic engineer, so apologies if I have made a foe par. But it does seem that you have understood my intention

I have subsequently resolved the issue I was having.
It would appear I have some current leakage from T1 (P Channel Mosfet) that was sufficient to trigger Q4, subsequently latching the circuit.

This was resolved by putting a 10K resistor from the drain on T1 to GND.
 

Thread Starter

IQWorkshop

Joined Jun 9, 2020
4
Hi @crutschow
Thanks for your reply

The capacitor value of C1 is 47uF (not in the schematic as i left it out in error- thanks for the prompt).
I have resolved the latching element of the circuit now (mentioned above), but have noticed some issues with the response time of the button press.

I have improved this by dropping R4 from 1M ohm to 240K ohm, but I will keep experimenting until I get an acceptable range while maintaining the desired behaviour.
 

ci139

Joined Jul 11, 2016
1,898
you have multiple issues rising from this design ... likely already covered but still ::
  • holding the button down enters the oscillating loop --or-- an undefined state of the circuit
  • the button can strobe = you should either ::
    • make it act on first make ... and inhibit other makes during some period after that 1-st make
    • make it act if there is no strobing (e.g. low pass filter the "button press") - and add a functionality that does not let your circuit to start "latching" ... something like the state table below
\(\begin{array}{ccc}button(prev.) &{previous\\power\\state}&{current\\power\\state}\\
OFF(OFF) & OFF & \mathbf{OFF}\\
{}\ ON(OFF) & OFF & \mathbf{ON}\\
{}\ ON({}\ ON) & ON & \mathbf{ON}\\
OFF({}\ ON) & ON & \mathbf{ON}\\
OFF(OFF) & ON & \mathbf{ON}\\
{}\ ON(OFF) & ON & \mathbf{OFF}\\
{}\ ON({}\ ON) & OFF & \mathbf{OFF}\\
OFF({}\ ON) & OFF & \mathbf{OFF}\\
OFF(OFF) & OFF & \mathbf{OFF}
\end{array}\)
 

Thread Starter

IQWorkshop

Joined Jun 9, 2020
4
Hi @ci139,
yes i'm aware of the limitations of this design.
For my use case it will be good enough for a v1 iteration.
my current testing shows the R C relationship provides sufficient time for the switch to operate in an acceptable manner.
Strobing is not a major issue as this currently takes at least 3 seconds to initiate.

This is not for a commercial product. It is an opportunity for me to learn as I build a practical device for me.
I could quite easily purchase a mass produced product, but where would the fun be in that.
 

dl324

Joined Mar 30, 2015
16,846
No i'm using a +5v supply. Not really sure where you are picking up a -5v from but the schematic clearly states +5v.
My mistake. It happened when I converted your image to JPG and converted the JPG to gray scale.

Next time, try printing the schematic so the "origin markers" won't be visible and use black and white. Colors aren't very meaningful or useful in schematics. Reading poorly drawn schematics is enough of a distraction.
 
Top