No luck with latch circuits - Page 1
Forum section: electronics / beginners

author: osmax_br
author_rank: Regular Contributor
timestamp: March 20, 2025, 03:09:12 pm
content: Hello EverybodyFor the last two days I was doing nothing but experimenting with latch circuits , I've gone nearly crazy because the circuit is not workingI tried using Dave's latch circuit from his fundamentals video , but didn't have the same MOSFET so I switched to another one (40p03)However no matter what I try the circuit doesn't workI tried another circuit from a yt video ,it somewhat works , but sometimes it latches randomly when the button is pressed , however the comments on that video stated that there is a design issue and he needs to put a resistor in series with the button in order to not fry the 2n2222 in the long runI use 11 volts on the input , the datasheet of the MOSFET says that I need -10v difference in order to work , which I belive haveThe orange circuit is the another video's circuitThe white board one is Dave's (with my specific values on it)I'm very curious to know why it is not working in my case , What did I do wrong , I've spent two days on it so I feel that my IQ is 50Thanks for your help , I appreciate it

author: jwet
author_rank: Frequent Contributor
timestamp: March 20, 2025, 05:10:33 pm
content: The Dave circuit should work. Your FET is fine. Verify the pinout of it and the transistors. The threshold voltage of the FET you're using is -1 to -2.5v, meaning if the gate goes lower than -2.5v from Vin, the FET will be on. The two circuits are sort of opposites of one another- stick with the first.When power is first applied, the FET is off. The collector of Q2 is at V2. When the switch is pressed, the gate of the left bipolar will pull down the gate of the FET. This also turn of RC to charge up and latch on. When the switch is let go, the right side of the switch will be at 0V becase the RC is holding it base up and its collector will be low. This allows you to touch again and unlatch the circuit.You might try going in steps, just tying the gate of the FET low. Then add the left bipolar and etc

author: PGPG
author_rank: Frequent Contributor
timestamp: March 21, 2025, 01:13:32 am
content: You didn't wrote how behavior you expect and what you get.For me your first circuit looks like it was intended to be switched on by pressing switch and then after some time to self switch off.But to work that way the collector of the transistor on the right picture side should be connected to the opposite side of switch (to base of the left 2N2222.

author: osmax_br
author_rank: Regular Contributor
timestamp: March 21, 2025, 02:17:18 am
content: Quote from: PGPG on March 21, 2025, 01:13:32 amno no it is a latch circuityou have one button to toggle the state of the led on or offone click onone click offusing one button instead of using on off switchwhat the comment above said that the circuit with my specific mosfet should work fine, but it is not and I've done the wiring multiple timesI think that the mosfet itself maybe damaged? , since my local store definitely uses Chinese clonesalso maybe the resistors values should be a bit higher , the current values may put the 2n2222 in the active region rather than acting as a switch (maybe?)the thing is that this is a simple circuit and it should work from the first try , I watched a lot of yt videos explaining this circuit without having any luckthis is why I feel a bit offended why it is not working lol

author: MathWizard
author_rank: Super Contributor
timestamp: March 21, 2025, 02:33:30 am
content: Have you tried making a Set/Reset SR-latch ? I've made them and with them made JK-flip/flops w/ common NPN's like 2N3904, maybe a PNP aswell. The circuits worked pretty good, there's lots of ways to make them aswell.

author: osmax_br
author_rank: Regular Contributor
timestamp: March 21, 2025, 02:55:45 am
content: Quote from: MathWizard on March 21, 2025, 02:33:30 amYou mean soft latch? Where you have two buttons? Yes I've done that using 2 npn transistors , but when I try making it one button with a mosfet like above something goes wrongI am aware that there are multiple ways of doing it , we can use the 555 timer ic to do so , but it is not recommended because you can do it cheaper by using 2 npn (not my words , I heard it in a yt tutorial)Didn't know about making it using flip flops Thanks for the suggestion, I will try it

author: Peabody
author_rank: Super Contributor
timestamp: March 21, 2025, 02:56:15 am
content: I think you said you're using an 11V supply. Dave's circuit used a 3.3V supply as I remember. You might try it at a much lower voltage and see if that makes a difference.

author: osmax_br
author_rank: Regular Contributor
timestamp: March 21, 2025, 03:02:10 am
content: Quote from: Peabody on March 21, 2025, 02:56:15 amUnfortunately it doesn'tI remember him saying that his mosfet needs 10v difference to work , I am not sure at this point (maybe I heard that in another yt vid)the orange circuit above worked but still has weird times when you press the button and it goes on off on off on , tried changing the rc circuit parameters but didnt help a lot

author: RJSV
author_rank: Super Contributor
timestamp: March 21, 2025, 04:57:35 am
content: Push buttons have NOISE, is that a mechanical push button ?You could literally depend on flakey results, as the electronic switches are very fast.One quick pulse, you get your correct response, but then, 15 milliseconds later you get another, and another

author: RJSV
author_rank: Super Contributor
timestamp: March 21, 2025, 05:05:59 am
content: Mentioned above; J-K flip flops switch on the first pulse, but then any noise in the push-button does not do anything.

author: RJSV
author_rank: Super Contributor
timestamp: March 21, 2025, 05:23:29 am
content: It's a hassle, to try to effectively get that 'T' or toggle style circuit working reliably using time delays. Best maybe use a J-K as a front end, but using TWO button presses when changing, for each change.That JK circuit will provide a crude de-bounce of the switch noise, so that multiple pulses only clock your circuit once.Kind of a hassle, having to press BOTH buttons, in turn, for each toggle at the output of the full circuit.

author: RJSV
author_rank: Super Contributor
timestamp: March 21, 2025, 05:36:56 am
content: ALSO, if you get interested in 7400 series latches, check out a classic .method for generating a pulse, for any rising 'edge' on some pulse...That uses a NAND gate plus a few inverters, delaying one of the inputs. Interesting !

author: pqass
author_rank: Super Contributor
timestamp: March 21, 2025, 06:36:05 am
content: Try the attached version (simulationhere).The only change is a 500K pull-down on the left NPN. Although, I'd recommend a 10K+100K divider instead.Hold button down until LED goes off (then release) or wait until until voltmeter >1V before pressing the button to turn on.If you hold down the button indefinitely you should expect the LED to blink.Adjust the 500K+22uF stack such that the blinking has a 50% duty cycle; with each half long enough that you have time to remove your finger without re-triggering.FYI: I changed the threshold and beta of the PFET in the simulation (via double-clicking symbol) to match your chosen part as per thedatasheet.Threshold (-2.5) and beta (7.4) were determined bythis calculatorwith Rds(on)=0.018R, Vgs=-10V, and threshold=-2.5V.

author: osmax_br
author_rank: Regular Contributor
timestamp: March 21, 2025, 12:35:35 pm
content: Quote from: pqass on March 21, 2025, 06:36:05 amThanks a lot for you help and your timeI appreciate itI will try to do it

author: RJSV
author_rank: Super Contributor
timestamp: March 21, 2025, 04:19:38 pm
content: You might benefit from investigating the various 7400 series ICs.Try the 74193 counter IC, perhaps in combination with things you already are doing.Counters often are also used as simple 4-bit latches. Often similar to 'D' or data type of flip flop data bit storage.

author: Ian.M
author_rank: Super Contributor
timestamp: March 21, 2025, 04:51:14 pm
content: In terms of real world component count, the discrete latch circuits aren't that attractive for voltages below approx. 18V where you can use CMOS logic ICs Below 5V where you can use tiny two gate 74LVC ICs insted of four or six gate 4000 series CMOS, its even less attractive. See the classic two inverter toggle latch circuit (as suggested by eblc1388) which only needs a momentry switch + four jellybean components for a logic level output, and simply add a power MOSFET to drive higher current loads.https://www.eevblog.com/forum/beginners/going-slightly-mad-simple-tristate-buffer-not-properly-driving-output/(reply #3 onwards)

author: osmax_br
author_rank: Regular Contributor
timestamp: March 21, 2025, 08:14:11 pm
content: Quote from: Ian.M on March 21, 2025, 04:51:14 pmthanks a lotI heard in the tutorials that designers prefer using 2 npn and a mosfet since it is cheaper (mass manufacturing in mind)so what I understand that if I need something over 18 volts I should use the 2 npn methodhowever under 18 volts (12 volts in my case) I should do it the way you suggested

author: Zero999
author_rank: Super Contributor
timestamp: March 24, 2025, 09:06:12 pm
content: Have you tried this simpler circuit?