FYI for those novice, such as myself, who are building this soft latching switch. I had been working on making this switch work for over a month. I'm using all bjts. I tried different resistors, different capacitors, and different types of bjts. I could not get it to latch off. As soon as I let off the momentary switch the light came back on. Holding down the push button I could get it to flash like Dave's but it would not stay in the off position. Finally I went back to original components and then it dawned on me, after viewing Dave's video a couple of dozen times, the LED I was using was not a sufficient load. I put in a 1/2 watt 2200 ohm in parallel with the LED and viola! It's working! Thanks Dave.
Just in case you were wondering how much this saves... I got a parts list for what he drew whipped up in digikey, and this is what I found: 3A toggle switch = $1.76/unit at 200 item price break (min quantity) 200 units = *$352 total* I will assume the 200 unit price break for the rest of these numbers and surface mount components except for the push button. If the minimum quantity is higher, I'll include that cost. 5,000 100k resistors = $6.46 (4,400 not used) 250 1M resistors = $7.99 (50 not used) 200 22uF capacitors = $16.86 200 30V 3.8A P-channel MOSFET's = $35.00 200 Dual NPN transistors (2 transistors, one package) = $25.90 200 Through hole momentary push buttons = $15.18 Total price = *$107.39* Less than 1/3 the price! And I didn't even try to make things better by trying to minimize the number of different parts.
Yes, but you must consider also the operation cost. The pcb must be manufactured, the electrical components must be placed an soldered. If you are gonna place this components on a pcb which already is designed to be in your system, the influence on the operation cost for this feature is almost insignificant. Anyway, the final price tag is still below.
Try expand the calculation by comparing the pcb cost, pcb assembly and fitting vs Drilling a hole for the toggle switch, soldering leads to the switch and fitting the switch Yes - I do consider the electronic solution done with other electronics fitted anyway. As a former PTA engineer I learned to avoid any extra manual assembly cost on the production line.
As you go higher in production count the end cost may worth it, because the robot machines can populate all those parts in 3 seconds and the addition of the PCB is almost negligible. It is good alternative however.
Hi Dave, I have a slight improvement on the circuit, move the capacitor to collector of the T2 and remove 1 M resister from base of T2, connect both bases togater and put switch between the collector of t2 and basses. replace 100 k resister with 650k at collector of t2 and vcc.works just fine , no more ocilations, hold the switch as long as you want
Your channel is damn good. The way you describe things from simple to complex can rival the best tech school teacher out there. I am learning things I've never bothered to learn, all thanx to your channel. Cheers.
For anyone wanting to simulate or build some of these circuits as Dave goes along, remember that BJT transistors realistically require either a pull-up or pull-down resistor in order to ensure their default state. For example, in this video, at minute 4:00, this circuit would likely actually start in the ON condition without pressing anything because the base of Q1 (the PNP) transistor is not guaranteed to be held high, and is likely close enough to ground, it will start conducting, causing Q2 to fire turning the circuit on. If we use 100K-Ohm resistors everywhere to keep current low on the base of the BJTs, a weaker pull-up is necessary on Q1 simply to ensure the base is high on startup but can be easily overcome by the ON switch, grounding the base. For this pull-up, simply connect a 1M-Ohm resistor between the collector of Q2 and the emitter of Q1.
You are right.... In reality this 4.00 circuit will be pretty unstable.... We just have to use a big resistor between the collector and base to ensure that the base of Q1 remains high enough not to turn on randomly.
Youare actually right, I tried to make the circuit at 4.00 but turned ON by itself and the ON sswitch seemed to be doing nothing at all. I will try with your suggestion again
Would I read this earlier, I would save myself some 8 hours of building and simulating... 😂 On the plus side, I am able to simulate this circuit in CircuitJS, TinkerCad AND Ltspice... 😅
Commenting again because this is that good. This is the first video by EEVblog I've watched, but communicating the thought/development process of a circuit is what I've been searching for since my undergrad years! Extremely impressed. And delivered with an Australian (?) accent? Amazeballs, and Bob's your uncle.
Yes, it will usually be cheaper, cost it out yourself. It's not just about cost either. Sometimes you want/need a soft switch instead of a big clunker mechanical toggle.
And here I was trying to find a reasonable price for a switch that could handle 200 mA and wasn't momentary... I should ask for them to rescind my degree for the amount of time I've spent on this! It's almost like I could've saved precious time by watching every video from this channel! Beauty!
It's a really good idea! Thank you! Remarks: 1) for the second transistor use a NMOS --> no big capacitors needed 2) use a resistor from basis to ground for the first transistor - helps against leakage current 3) If the battery voltage is more than 15V ... 20V, most of the PMOS don't like this and go to the semiconductor heaven.
re pt 2 - i had issues with the filter cap of the downstream circuit bleeding back through Q1 turning it back on. A 680k resistor as suggested solved this
Bob IS my uncle. First time I heard you say that it kind of freaked me out. I had never heard that phrase until I started watching your AMAZING videos. Thank you for all the great information and for the care you take in presenting it.
Bread Board Success: I built Dave's circuit and it worked. Things to note: - I used a 5Vsupply. - I used an IRF9Z24N P-MFET. - I used a 47uF e-cap. Dave spec'd 22uF, but actually used a 47uF on his board. I like the button press timing of the 47uF better. - I used a red, SMD LED with a 1K resistor, for the load. - Dave's circuit starts in an on state, when power is first applied. To me, this is a problem. Say this is on a stereo and the power goes off/on in the night. The stereo is going to startle you awake . However, for whatever reason, mine does not start in the on state. Lot's of fun, Mr. Dave = Thanks!
I tried the circuit @04:00 with BJTs, but without the buttons. On 'out' I had a resistor followed by a lit LED. In theory it was supposed to be off. Apparently, there's a thing called 'transistor leakage'. It means even when a transistor is in cut-off state, some current might still go through (micro-Amps in magnitude, I guess it varies among the different types). I suppose it could be ignored if applied to load, but when it's connected to a base of another transistor - it gets amplified, then it feeds the first transistor and we end up with fully activated circuit. I hope this comment will save people about half a day of puzzled head scratching. In the end it was fun to find that out, probably I should have added a "Spoiler alert" in the beginning :)
Loved it ! I had to pause for like 5-10 min when he showed the circuit, trying to simulate the thing in my head, and was able to do it :) Learned a lot from this, thx.
I paused the video at near the beginning, and I tried to make a own solution to this, and I came up with the EXACT same solution you did! LOL (I just used 1K resistors in LTspice instead of 100K and 1M ones.)
Power Max While the NPN transistors are ON, you'll be drawing 100x more current through both of your 1K resistors than if you used 100K resistors, stressing them more. For production, you'd probably want higher reliability, thus higher resistor values.
downthetube within Well it was a simulation, I often use the 2N2222 transistor in LTspice in such a way it ends up dissipating many hundred watts. Not an issue! I often use TO220 transistors when prototyping stuff, as they are more difficult to destroy. However the disadvantage is that more base current is necessary for bias the transistor, and consequently I will end up using low value pullups for the bases. For small signal transistors and darlingtons and stuff, you are correct.
Thanks - I was just mentioning some obvious improvements as a design philosophy. Guess I'd have to look up datasheet for 2N3904 to see how much margin is left when increasing from 1K's or decreasing from 100K's. Another issue is power budget or allotment on the input power form. Of course, how one makes these compromises and reiterations in design are largely dictated by an overall product specification, implementation, schedule, budget, and all the "ilities". The video is a fun, nicely explainable circuit. cheers!
Awesome vid. Quite helpful to see AND hear why things work or don't. Usually you get one or the other. Time to get busy making stuff, thanks for sharing
Dear EEVBlog, Thank you very much for your lovely video on Latching. I am doing a small project on controlling small out put (max 20mA 5VDC) with 02 source of separated Inputs as following: 1. Input 1 (Vin1) of about 4.0 V at HIGH and 0 V at LOW (maintained continuously until the switch is off) 2. Input 2 (Vin2) of about 4.96V at HIGH and 0.3 V at LOW (maintained continuously until the switch is off) What I want to do is: 1. Upon Input 1 turn on High or Low the Output will toggle its state; 2. Upon Input 2 on turning HIGH/LOW the Output will toggle it's state as well. I don not care on the state of the out put is HIGH or LOW but I do care about changing the state of each input, the Output state will toggle ON/OFF respectively. This case is similar to controlling of staircase lamp with 2 two-way switches. I hope you would not mind taking sometime to advice me with thanks.
Important: if you have a capacitor on the output, the comportment becomes erratic. It will not latch off anymore (will turn off only while switch is closed), and oscillation becomes unbalanced.
Very educational in a number of ways. It is essential to (1) try a range of components that result in both working and non-working circuits (digging into why a circuit is not working invariably leads to aha! moments), and (2) use both a multimeter and oscilloscope to observe the voltages and currents are various locations in the circuit, both when it is working and when it is not working. One of the revelations is that the duration *between* button presses, as well as the duration of button presses, comes into play. The reason for this is evident when watching the voltage on the collector and base of the transistor on the right.
Just here for a bit of nostaligia for when Dave's videos were actually about circuits! Now they're all mail bags and teardowns, like every other channel :(
this video is so good. i already made the circuit years ago. and today i was in the need for something like that and remember it. i don't have any toggle switch at hand but plenty of transistors, resistors etc.
This was an *excellent* video, I appreciate you taking the time to explain the how and why in so much detail, as well as giving us the opportunity to ponder some of it on our own. Have you considered teaching as an occupation? You have a knack for it. Tap away!
Uh. This doesn't start up in the on state. The gate of the *P*-MOS is pulled up and the transistor that pulls it down has no base current before you press the switch.
The bad thing is that the FET is ON after plug-in. Who want to have circuit activated after plug-in? If then you do not need this circuit at all. I think if you add BE resistor to the transistor on the left should solve the plug-in problem. The voltage at the resistor should be lower than 0,5 V assuming the leak current from FET. As it was explained by Trunov Michael bellow.
I'm disappointed. I'll just take the liberty to throw the jellybean rule out of the window based on economy and employ a CMOS divider/counter. Then just one resistor, one cap (those just to smooth out the button input) and an output transistor and Bob's your uncle! No blinking, no residual current (which you forgot to fix in your design), an option to make several ON modes in sequence... and the price will be the same!
Sounds interesting! I know nothing about that kind of circuitry (sounds like logic!). Please make a video on a design concept and give us a walk through! Especially of the power-on sequence capability. Then throw a couple part numbers in there so novice people can get up and running! It'd be great!
Luke Wren Also, I doubt his CMOS chip has as tiny standby current as the circuit in the video. Video circuit standby is dominated by C-E leakage in the left BJT.
@@johnfrancisdoe1563 that's true! I have one major problem with Dave's circuit though, which is its sensitivity to bleed time of the system load. Large output capacitance and small load -> 2N3904 becomes biased again and doesn't switch off. I think any circuit where you try and be clever and use system load as a switching element can have this issue. My current favourite circuit involves a latch built from a dual inverter IC, e.g. 74LVC2G04. They cost around the same as a small-signal transistor, leak around 4 uA, and give you clean switching every time. I think the lesson might be "if you want a latch, build a latch" :)
I absolutely love your videos! Usually, analog+me=fire! but your detailed explanations of the theory has given me confidence, and I have less fires and explosions on my breadboards now. So not only have you helped my understanding of electricity, you have helped to save the world as well! Hey! Bob's your uncle! Great job and thank you!
Is there an auto dislike bot on TH-cam because every one of your videos has roughly the same amount of dislike and it's almost every channel on TH-cam all having about 30-100 dislikes so wtf???
Jeremiah Lowe There is a core group of people who thumbs down all my videos, some within minutes of uploading. They haven't even watched it yet. I don't know about other channels, but I have a core group of haters!
Almost all videos have approx. 1% downvotes. That's the "standard". Less downvotes than that is either a video on a small channel or what you could call "exceptionally" good. A higher percentage means you either said something controversial or just too much stupid/boring stuff.
EEVblog You're pretty harsh sometimes and some people really don't like that. Me on the other hand I would give thumps up for the sole reason of being able to speak clearly even if it means to bash people who deserve it. Well that is if I could get myself to use the (dis)likes buttons at all. I believe they are made for immature people who actually beleive quality derives from how many likes one gets. Even though enormous amount of proof points in the opposite direction, stupid people (which includes most of the human kind) still cling to the lie. You are doing a great job teaching electronics and I hope it is enough money for you to keep on making videos until death. If it was something I would like to see more of it would be rf. Maybe even a simple DIY spectrum analyzer just to crack the nut about it being so hard. You are a great teacher and you would know how to make so called hard stuff simple to understand. Against, I really appreciate your videos.
You were right, leave it to us to play with the value of resistors. You made me spent hours playing with it and trying to make it as good as I can. Finally I managed it, my main goal was not to turn on again when I turn it off if for any reason I keep the button pressed. So brief press to turn on and brief or not brief press for turning off.
I quite liked the circuit at www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch - see figure 3. two MOSFETS, 3 resistors and a cap.
Did not have that P channel Mosfet you used. I had IRF5210 so used that. Worked like a charm first try! Thanks for sharing. You are just amazing. Although I will modify this and using this as an oscillator. I like the wave form coming out of it. A very neat square wave.
Thank you very much Dave for that fantastic video! :) You are a very good teacher. Thank you for doing the EEVblog channel. I enjoy watching it and often find it quite enlightening.
So instead of using an on/off switch, add 6 more components to an on/off switch and you now have an on/off switch! Did he really say "Half a bee's dick?"
IvanIvan1974 he means the point of this is that its cheaper to implement because it means you don't need a beefy switch and can use an elcheapo switch without blowing it up :) if you were just joking it didn't work, this is text its hard to tell so you should expect those reactions from people :)
megaspeed2v2 I don`t even know if he wrote to me. His reply is not directed to me. BTW, I use switch system like this too, I implement it a little bit in a different way but actually it`s quite similar. (without Christmas illumination)
That expression appears to have come from the UK, probably in the 19th century, and travelled to some other English speaking commonwealth countries. It is still used in England and Wales, not sure about Scotland or Northern Ireland. It's only when watching YT videos from visitors, some having settled here, from other English speaking countries that you realise how many euphemisms, expressions and sayings we have and why they sometimes find us odd, hard to understand, though interesting. Me, I'm odd all the time! Though Australia and New Zealand do have their own expressions, etc we do share many.
Thank you so much for this. I have been wondering how to do this since I was really little (im 14 now) and this was great info. Everybody that I asked said to use a microcontroller, but this is the first simple solution that ive seen and works great!!!!!!!!!!!
Great video, you have a natural design sense (could actually call that a feature) rofl. Cheers mate, I'm shamelessly ripping off your circuit for my project as I type. Top work.
Great circuit :-) Mine design had 4 transistors but I needed that much because I added extra function - turns on quickly, but to turn off you have to hold it for 2 seconds :-) Kind of for safety reasons :-) Waiting for other great videos! ;-)
The one thing I don't like about this is that it defaults to ON whenever power is first applied. I'm interested in this sort of circuit for a couple automotive ideas I have, like being able to turn cargo lights on/off from either the cab or the cargo area independently. The idea being that momentary switches in parallel in the separate locations could toggle the state of the circuit. Obviously I don't want cargo lights turning on every time I start the vehicle and I also don't necessarily want them wired always-hot. But your presentation style made it fairly simple for an electrical dunce like myself to follow the logic of the circuit. Thanks for that.
I'm in need of a latching circuit like this, and I was about to use a J-K Flip Flop to do the job, but that would require a debouncing circuit with a schmitt trigger. This circuit looks neat, and it just might work great for my application. Thanks Dave!
I have been looking for this kind of circuit for ages. Whats great is, now I also understand why it works the way it does. Since I'm new to circuitry this instructional has been the pretty insightful. Not that it's that it's going to deter me from watching, but I find that typical Australian way of describing things by dipping the voice slightly distracting, and had to go back a few times to regather. I'm sure I will get used to it soon enough though. Thanks for the vid.
Really liked the video and I can see some good reasons to do this but not sure cost would be one. You can get a ten pack of latching pushbutton switches rated at 1 amp off Amazon for $8 US and a 30 pack of mystery spec ones for $6 US. Now the ability to be able to switch it off automatically could be important for some things so? Nice to know how to do it though and I love that you explain the why's as you go.
Thank you just what I needed, very informative and well explained. I was building a portable lithium battery charger with one tactile switch. Best solution by far, but still there are caveats like with everything, Mosfet threshHold, if it reached maybe 2.6v lets say, and you have a battery that went down but has a lot current power, and your load is heavy. The mosfet might get really hot because it does not like to be in saturated voltage levels, it needs proper 5v and 0v or negative to turn on or off, thus my thoughts of using a separate power supply to turn on or off the power Mosfet once turned on.. Just need to modify your circuit detect if button is pressed or not with micro-controller, in case I need one switch to do many functions, like two fast taps to enable debugging mode or etc. Nice vids, keep up the good work!
You didn't get the idea, it's about saving energy. The NE555 would draw current from the source either the output is in 1 logic state(ON) or 0 logic state(OFF). Even the CMOS version(LMC555) draws a little amount of power. This one draws current only in ON state, which could be an advantage in some applications such as battery powered/portable apparatuses/appliances.
I found this circuit to work best driving a relay, it worked very good for that, and you can switch high current supplies with very little trouble this way.
FYI for those novice, such as myself, who are building this soft latching switch. I had been working on making this switch work for over a month. I'm using all bjts. I tried different resistors, different capacitors, and different types of bjts. I could not get it to latch off. As soon as I let off the momentary switch the light came back on. Holding down the push button I could get it to flash like Dave's but it would not stay in the off position. Finally I went back to original components and then it dawned on me, after viewing Dave's video a couple of dozen times, the LED I was using was not a sufficient load. I put in a 1/2 watt 2200 ohm in parallel with the LED and viola! It's working! Thanks Dave.
It may be the leakage current. I've witnessed a thyristor made of jellybean BJTs turn on by itself due to leakage.
Just in case you were wondering how much this saves... I got a parts list for what he drew whipped up in digikey, and this is what I found:
3A toggle switch = $1.76/unit at 200 item price break (min quantity)
200 units = *$352 total*
I will assume the 200 unit price break for the rest of these numbers and surface mount components except for the push button. If the minimum quantity is higher, I'll include that cost.
5,000 100k resistors = $6.46 (4,400 not used)
250 1M resistors = $7.99 (50 not used)
200 22uF capacitors = $16.86
200 30V 3.8A P-channel MOSFET's = $35.00
200 Dual NPN transistors (2 transistors, one package) = $25.90
200 Through hole momentary push buttons = $15.18
Total price = *$107.39*
Less than 1/3 the price! And I didn't even try to make things better by trying to minimize the number of different parts.
Yes, but you must consider also the operation cost. The pcb must be manufactured, the electrical components must be placed an soldered. If you are gonna place this components on a pcb which already is designed to be in your system, the influence on the operation cost for this feature is almost insignificant. Anyway, the final price tag is still below.
Well, that's the problem.. your buying off digikey haha
Try expand the calculation by comparing the pcb cost, pcb assembly and fitting
vs
Drilling a hole for the toggle switch, soldering leads to the switch and fitting the switch
Yes - I do consider the electronic solution done with other electronics fitted anyway.
As a former PTA engineer I learned to avoid any extra manual assembly cost on the production line.
You forgot to factor in 200 breadboards at $2 a piece...
As you go higher in production count the end cost may worth it, because the robot machines can populate all those parts in 3 seconds and the addition of the PCB is almost negligible. It is good alternative however.
EEVblog Please do more videos like this, showing how circuits are developed, I learnt so much from it. I like it,
+Adam Harrington +EEVblog yes please! this REALLY helped me grok a few things. would love to see more like this one. Thanks for keeping this going!
same!!
It's seems hard to find proper circuit development tutorials around. This one was perfect!
ditto
This channel is solely responsible for getting me hooked on electronic circuit design
Hi Dave, I have a slight improvement on the circuit, move the capacitor to collector of the T2 and remove 1 M resister from base of T2, connect both bases togater and put switch between the collector of t2 and basses. replace 100 k resister with 650k at collector of t2 and vcc.works just fine , no more ocilations, hold the switch as long as you want
Works great, thank you very much !!!
This works great :)Thank you :)
Anyone have a diagram for this? Is the capacitor in series with the collector of t2 or between collector and ground?
Intrigued...
Jacob Kon between collector and ground
How about an explanation WHY it works ... is it as "good" as the original concerning current in OFF state ?
Your channel is damn good. The way you describe things from simple to complex can rival the best tech school teacher out there. I am learning things I've never bothered to learn, all thanx to your channel. Cheers.
Absolutely agree
For anyone wanting to simulate or build some of these circuits as Dave goes along, remember that BJT transistors realistically require either a pull-up or pull-down resistor in order to ensure their default state. For example, in this video, at minute 4:00, this circuit would likely actually start in the ON condition without pressing anything because the base of Q1 (the PNP) transistor is not guaranteed to be held high, and is likely close enough to ground, it will start conducting, causing Q2 to fire turning the circuit on. If we use 100K-Ohm resistors everywhere to keep current low on the base of the BJTs, a weaker pull-up is necessary on Q1 simply to ensure the base is high on startup but can be easily overcome by the ON switch, grounding the base. For this pull-up, simply connect a 1M-Ohm resistor between the collector of Q2 and the emitter of Q1.
You are right.... In reality this 4.00 circuit will be pretty unstable.... We just have to use a big resistor between the collector and base to ensure that the base of Q1 remains high enough not to turn on randomly.
Youare actually right, I tried to make the circuit at 4.00 but turned ON by itself and the ON sswitch seemed to be doing nothing at all. I will try with your suggestion again
Would I read this earlier, I would save myself some 8 hours of building and simulating... 😂
On the plus side, I am able to simulate this circuit in CircuitJS, TinkerCad AND Ltspice... 😅
Congrats man, your video is now offered as a first result when looking for a soft on/off circuitry.
This must mean something.
Commenting again because this is that good. This is the first video by EEVblog I've watched, but communicating the thought/development process of a circuit is what I've been searching for since my undergrad years! Extremely impressed. And delivered with an Australian (?) accent? Amazeballs, and Bob's your uncle.
Yes, it will usually be cheaper, cost it out yourself.
It's not just about cost either. Sometimes you want/need a soft switch instead of a big clunker mechanical toggle.
your explanation with green ink makes it far more clear. clearly you prioritized how to think comprehensively. salute to you.
cheers from Indonesia
Living in the US I had never heard the phrase "half a bee's dick" before. I burst out laughing. Thanks Dave!
Laughing
I'm from UK. I'm learning a lot of awesome Aussie slang from this channel.
And here I was trying to find a reasonable price for a switch that could handle 200 mA and wasn't momentary...
I should ask for them to rescind my degree for the amount of time I've spent on this! It's almost like I could've saved precious time by watching every video from this channel!
Beauty!
It's a really good idea! Thank you!
Remarks:
1) for the second transistor use a NMOS --> no big capacitors needed
2) use a resistor from basis to ground for the first transistor - helps against leakage current
3) If the battery voltage is more than 15V ... 20V, most of the PMOS don't like this and go to the semiconductor heaven.
re pt 2 - i had issues with the filter cap of the downstream circuit bleeding back through Q1 turning it back on. A 680k resistor as suggested solved this
Bob IS my uncle. First time I heard you say that it kind of freaked me out. I had never heard that phrase until I started watching your AMAZING videos. Thank you for all the great information and for the care you take in presenting it.
Dave, as always your tutorials are the best around! Your videos have taught me more than many of my electrical engineering classes. Thank you!
Bread Board Success: I built Dave's circuit and it worked.
Things to note:
- I used a 5Vsupply.
- I used an IRF9Z24N P-MFET.
- I used a 47uF e-cap. Dave spec'd 22uF, but actually used a 47uF on his board. I like the button press timing of the 47uF better.
- I used a red, SMD LED with a 1K resistor, for the load.
- Dave's circuit starts in an on state, when power is first applied. To me, this is a problem. Say this is on a stereo and the power goes off/on in the night. The stereo is going to startle you awake . However, for whatever reason, mine does not start in the on state.
Lot's of fun, Mr. Dave = Thanks!
13:37
"My product never has bugs. It just develops random features."
Interesting the 1337 timing... like "1337" slang on Reddit. Creepy coincidence...
@@BlackXeno what doe sit mean?
@@play_sports_and_read_books en.wikipedia.org/wiki/Leet
Bob Ross of electronics
Happy little accidents.
What an explanation, watching similar video on another channel which was made 9 years after yours but I must say, your explanation is at par.
I don't know who's clicking dislike button on this nice piece of video.
This is one of the best tutorials i ever came across... Thank you so much Dave for this solution.
I tried the circuit @04:00 with BJTs, but without the buttons. On 'out' I had a resistor followed by a lit LED. In theory it was supposed to be off. Apparently, there's a thing called 'transistor leakage'. It means even when a transistor is in cut-off state, some current might still go through (micro-Amps in magnitude, I guess it varies among the different types). I suppose it could be ignored if applied to load, but when it's connected to a base of another transistor - it gets amplified, then it feeds the first transistor and we end up with fully activated circuit. I hope this comment will save people about half a day of puzzled head scratching. In the end it was fun to find that out, probably I should have added a "Spoiler alert" in the beginning :)
OMG I LOVE YOU, i thought i was just dumb
just add one small capacitor between emitter and base of a PNP transistor and it will work as theory describe.
If referring the circuit at 4:00, just add a 1M resistor between the emitter of PNP and the collector of NPN.
@@dharmikbhavani7272 it works well!! thank you
Loved it !
I had to pause for like 5-10 min when he showed the circuit, trying to simulate the thing in my head, and was able to do it :)
Learned a lot from this, thx.
OMG i have been looking for some thing like this... i would like to see you doing more projects like this..
very simple, very clear, very usefull. I have a lot of push buttons and this is the features I look for. Dave, you are the BOSS !
My secretary is bi-polar too. And she works as a soft latch switch like a beauty. Almost telepathically.
Bingo!
Thanks for the inspiration.
Ernst Stavro Blofeld does she has high input impedance if you know what i mean ?^__^
marionetadelplaneta She does, but that is none of your business.
Ernst Stavro Blofeld
what's so private in asking if someone is friendly?
marionetadelplaneta I signed a nondisclosure agreement.
You can't fathom how much I'm learning from your videos. I always have a sheet of paper and a pen at the ready when watching your tutorials x)
I paused the video at near the beginning, and I tried to make a own solution to this, and I came up with the EXACT same solution you did! LOL (I just used 1K resistors in LTspice instead of 100K and 1M ones.)
Power Max While the NPN transistors are ON, you'll be drawing 100x more current through both of your 1K resistors than if you used 100K resistors, stressing them more. For production, you'd probably want higher reliability, thus higher resistor values.
downthetube within Well it was a simulation, I often use the 2N2222 transistor in LTspice in such a way it ends up dissipating many hundred watts. Not an issue!
I often use TO220 transistors when prototyping stuff, as they are more difficult to destroy. However the disadvantage is that more base current is necessary for bias the transistor, and consequently I will end up using low value pullups for the bases. For small signal transistors and darlingtons and stuff, you are correct.
Thanks - I was just mentioning some obvious improvements as a design philosophy. Guess I'd have to look up datasheet for 2N3904 to see how much margin is left when increasing from 1K's or decreasing from 100K's.
Another issue is power budget or allotment on the input power form. Of course, how one makes these compromises and reiterations in design are largely dictated by an overall product specification, implementation, schedule, budget, and all the "ilities".
The video is a fun, nicely explainable circuit.
cheers!
Awesome vid. Quite helpful to see AND hear why things work or don't. Usually you get one or the other. Time to get busy making stuff, thanks for sharing
Please show me a simpler design for a discrete soft latch power circuit. There are many reasons to use such a circuit, not just cost.
Dear EEVBlog,
Thank you very much for your lovely video on Latching.
I am doing a small project on controlling small out put (max 20mA 5VDC) with 02 source of separated Inputs as following:
1. Input 1 (Vin1) of about 4.0 V at HIGH and 0 V at LOW (maintained continuously until the switch is off)
2. Input 2 (Vin2) of about 4.96V at HIGH and 0.3 V at LOW (maintained continuously until the switch is off)
What I want to do is:
1. Upon Input 1 turn on High or Low the Output will toggle its state;
2. Upon Input 2 on turning HIGH/LOW the Output will toggle it's state as well. I don not care on the state of the out put is HIGH or LOW but I do care about changing the state of each input, the Output state will toggle ON/OFF respectively.
This case is similar to controlling of staircase lamp with 2 two-way switches.
I hope you would not mind taking sometime to advice me with thanks.
Important: if you have a capacitor on the output, the comportment becomes erratic. It will not latch off anymore (will turn off only while switch is closed), and oscillation becomes unbalanced.
Very educational in a number of ways. It is essential to (1) try a range of components that result in both working and non-working circuits (digging into why a circuit is not working invariably leads to aha! moments), and (2) use both a multimeter and oscilloscope to observe the voltages and currents are various locations in the circuit, both when it is working and when it is not working.
One of the revelations is that the duration *between* button presses, as well as the duration of button presses, comes into play. The reason for this is evident when watching the voltage on the collector and base of the transistor on the right.
Just here for a bit of nostaligia for when Dave's videos were actually about circuits! Now they're all mail bags and teardowns, like every other channel :(
this video is so good. i already made the circuit years ago. and today i was in the need for something like that and remember it. i don't have any toggle switch at hand but plenty of transistors, resistors etc.
Tap on the white board...Yes!
Very good, mate!
LOL. I gave it a thumbs-up just for the tapping on the whiteboard at the end. That was hilarious.
"..And for those that hate me tapping on the whiteboard."
Ha ha. Nice line :-)
Beauty! Love the tapping on the whiteboard too - I was in fits. I wouldn't have dared pull you up on it, but...
Great tutorial Dave.
Maybe you should do this more :-)
This was an *excellent* video, I appreciate you taking the time to explain the how and why in so much detail, as well as giving us the opportunity to ponder some of it on our own. Have you considered teaching as an occupation? You have a knack for it. Tap away!
does this work on 12v to power up a relay?or what i need to change?
I want more videos like this in favour of the teardowns... I learn more from this kind of videos. Who's with me? :P
If understand this correctly. If you had a power cut then this thing will turn on the device. Can you modify it to start up in the off state?
Uh. This doesn't start up in the on state. The gate of the *P*-MOS is pulled up and the transistor that pulls it down has no base current before you press the switch.
@@0x8badf00d Uh. It can start in the on state. You're clearly missing something in your highly simplified response. Don't be a shit.
"And for those who hate me tapping on the whiteboard just for you".... Instant subscribe after that .... well done Dave
The bad thing is that the FET is ON after plug-in. Who want to have circuit activated after plug-in? If then you do not need this circuit at all. I think if you add BE resistor to the transistor on the left should solve the plug-in problem. The voltage at the resistor should be lower than 0,5 V assuming the leak current from FET. As it was explained by Trunov Michael bellow.
Love the tapping...and the accent. thanks for this!
I'm disappointed. I'll just take the liberty to throw the jellybean rule out of the window based on economy and employ a CMOS divider/counter. Then just one resistor, one cap (those just to smooth out the button input) and an output transistor and Bob's your uncle! No blinking, no residual current (which you forgot to fix in your design), an option to make several ON modes in sequence... and the price will be the same!
Sounds interesting! I know nothing about that kind of circuitry (sounds like logic!). Please make a video on a design concept and give us a walk through! Especially of the power-on sequence capability. Then throw a couple part numbers in there so novice people can get up and running! It'd be great!
Or just use an MCU if you already have one (very probable), a pushbutton, and a MOSFET. Problem solved for a few cents!
How are you setting the initial state of that counter after power on?
Luke Wren Also, I doubt his CMOS chip has as tiny standby current as the circuit in the video. Video circuit standby is dominated by C-E leakage in the left BJT.
@@johnfrancisdoe1563 that's true! I have one major problem with Dave's circuit though, which is its sensitivity to bleed time of the system load. Large output capacitance and small load -> 2N3904 becomes biased again and doesn't switch off.
I think any circuit where you try and be clever and use system load as a switching element can have this issue.
My current favourite circuit involves a latch built from a dual inverter IC, e.g. 74LVC2G04. They cost around the same as a small-signal transistor, leak around 4 uA, and give you clean switching every time. I think the lesson might be "if you want a latch, build a latch" :)
I absolutely love your videos! Usually, analog+me=fire! but your detailed explanations of the theory has given me confidence, and I have less fires and explosions on my breadboards now. So not only have you helped my understanding of electricity, you have helped to save the world as well! Hey! Bob's your uncle! Great job and thank you!
Is there an auto dislike bot on TH-cam because every one of your videos has roughly the same amount of dislike and it's almost every channel on TH-cam all having about 30-100 dislikes so wtf???
Jeremiah Lowe There is a core group of people who thumbs down all my videos, some within minutes of uploading. They haven't even watched it yet. I don't know about other channels, but I have a core group of haters!
EEVblog
that's how you know you're doing something good :)
EEVblog i knew itd be something like that btw do you know any cheap power supplies like under 50$ mine broke and idk why it was a computer PSU anyways
Almost all videos have approx. 1% downvotes. That's the "standard". Less downvotes than that is either a video on a small channel or what you could call "exceptionally" good. A higher percentage means you either said something controversial or just too much stupid/boring stuff.
EEVblog You're pretty harsh sometimes and some people really don't like that. Me on the other hand I would give thumps up for the sole reason of being able to speak clearly even if it means to bash people who deserve it. Well that is if I could get myself to use the (dis)likes buttons at all. I believe they are made for immature people who actually beleive quality derives from how many likes one gets. Even though enormous amount of proof points in the opposite direction, stupid people (which includes most of the human kind) still cling to the lie. You are doing a great job teaching electronics and I hope it is enough money for you to keep on making videos until death. If it was something I would like to see more of it would be rf. Maybe even a simple DIY spectrum analyzer just to crack the nut about it being so hard. You are a great teacher and you would know how to make so called hard stuff simple to understand. Against, I really appreciate your videos.
man. im watching this video 5th times. your explanation is so satisfying i keep falling asleep.
why not replacing the 1M by a 100k (and 22uF cap with a 2.2uF) so that the BOM gets smaller?
Check your math. The time constant would be a hundredth. If you go down in resistance, you'd need to go up in capacitance.
You were right, leave it to us to play with the value of resistors. You made me spent hours playing with it and trying to make it as good as I can. Finally I managed it, my main goal was not to turn on again when I turn it off if for any reason I keep the button pressed. So brief press to turn on and brief or not brief press for turning off.
"Half a bee's dick"
TH-camr phrase of the week
This circuit is a killer. Simple and functional. Love it. Thank you so very much for this!
I quite liked the circuit at www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch - see figure 3. two MOSFETS, 3 resistors and a cap.
Made it seem so simple it's brilliant! Thanks Dave.
LMAO is it me or does he say "Half a Bee's dick" at 15:48
Did not have that P channel Mosfet you used. I had IRF5210 so used that. Worked like a charm first try! Thanks for sharing. You are just amazing. Although I will modify this and using this as an oscillator. I like the wave form coming out of it. A very neat square wave.
"Half a bee's dick" hahahaha
I love that half a micro-amp is half a bees dick in Australia.
Thank you very much Dave for that fantastic video! :) You are a very good teacher. Thank you for doing the EEVblog channel. I enjoy watching it and often find it quite enlightening.
So instead of using an on/off switch, add 6 more components to an on/off switch and you now have an on/off switch! Did he really say "Half a bee's dick?"
...and don`t forget the Christmas illumination when you hold the switch.
You can't really be this dense.
magicponyrides What do you mean exactly?
IvanIvan1974 he means the point of this is that its cheaper to implement because it means you don't need a beefy switch and can use an elcheapo switch without blowing it up :)
if you were just joking it didn't work, this is text its hard to tell so you should expect those reactions from people :)
megaspeed2v2 I don`t even know if he wrote to me. His reply is not directed to me. BTW, I use switch system like this too, I implement it a little bit in a different way but actually it`s quite similar. (without Christmas illumination)
Love your videos! this one you have turned World's Simplest Soft Latching Power Switch Circuit to the most complicated one.
"...and Bob's your uncle!" Great explanation!
That expression appears to have come from the UK, probably in the 19th century, and travelled to some other English speaking commonwealth countries. It is still used in England and Wales, not sure about Scotland or Northern Ireland. It's only when watching YT videos from visitors, some having settled here, from other English speaking countries that you realise how many euphemisms, expressions and sayings we have and why they sometimes find us odd, hard to understand, though interesting. Me, I'm odd all the time! Though Australia and New Zealand do have their own expressions, etc we do share many.
Схема простая, но - гениальная! Питаю с помощью нее усилитель - ОЧЕНЬ ДОВОЛЕН! GOOD LUCK!!!
I love the way you explain electronics.. a big thumbs up..
Thank you so much for this. I have been wondering how to do this since I was really little (im 14 now) and this was great info. Everybody that I asked said to use a microcontroller, but this is the first simple solution that ive seen and works great!!!!!!!!!!!
google first hit on 'mosfet latch' video . awesome Dave !
Had to give it a thumbs up, just for tapping the whiteboard.
What a nice electronics project design class, I'm speechless, thank you very much!
I've always implemented this with a JK Flip Flop and a pass transistor. Great to see a discrete implementation!
What a great presentation - I've learned something & enjoyed doing so. Thanks
I especially love the idioms.... and the white board tapping heh heh.
Thank you for the tutorial!!
Thank you for the clear explanation, saved me a lot of struggle!
Beautiful. Simply beautiful teaching.
You make electronics fun and interesting, even for a dabbler like me. Keep up the good work!
Great video, you have a natural design sense (could actually call that a feature) rofl. Cheers mate, I'm shamelessly ripping off your circuit for my project as I type. Top work.
Great circuit :-) Mine design had 4 transistors but I needed that much because I added extra function - turns on quickly, but to turn off you have to hold it for 2 seconds :-) Kind of for safety reasons :-)
Waiting for other great videos! ;-)
The one thing I don't like about this is that it defaults to ON whenever power is first applied. I'm interested in this sort of circuit for a couple automotive ideas I have, like being able to turn cargo lights on/off from either the cab or the cargo area independently. The idea being that momentary switches in parallel in the separate locations could toggle the state of the circuit. Obviously I don't want cargo lights turning on every time I start the vehicle and I also don't necessarily want them wired always-hot.
But your presentation style made it fairly simple for an electrical dunce like myself to follow the logic of the circuit. Thanks for that.
Always get useful info from you. Thanks Dave
i dont understand half the stuff you say but i enjoy watching anyway. keep up the good work :)
Thank you for this video.
I love these simpler, how-to tutorials.
I'm in need of a latching circuit like this, and I was about to use a J-K Flip Flop to do the job, but that would require a debouncing circuit with a schmitt trigger. This circuit looks neat, and it just might work great for my application. Thanks Dave!
Dave, you are DA MAN, and I like it when you tap on the white board!?
and Bob's your uncle!
I have been looking for this kind of circuit for ages. Whats great is, now I also understand why it works the way it does.
Since I'm new to circuitry this instructional has been the pretty insightful.
Not that it's that it's going to deter me from watching, but I find that typical Australian way of describing things by dipping the voice slightly distracting, and had to go back a few times to regather. I'm sure I will get used to it soon enough though. Thanks for the vid.
Really liked the video and I can see some good reasons to do this but not sure cost would be one. You can get a ten pack of latching pushbutton switches rated at 1 amp off Amazon for $8 US and a 30 pack of mystery spec ones for $6 US.
Now the ability to be able to switch it off automatically could be important for some things so?
Nice to know how to do it though and I love that you explain the why's as you go.
wow I'm a complete noob and know nothing at all about transistors, but this video was still very helpful. thanks!!
It means a common and widely used general purpose device. The kind you would have in your parts draw.
Plain simple and elegant; can be combined with over-discharge protection.
Thank you just what I needed, very informative and well explained. I was building a portable lithium battery charger with one tactile switch. Best solution by far, but still there are caveats like with everything, Mosfet threshHold, if it reached maybe 2.6v lets say, and you have a battery that went down but has a lot current power, and your load is heavy. The mosfet might get really hot because it does not like to be in saturated voltage levels, it needs proper 5v and 0v or negative to turn on or off, thus my thoughts of using a separate power supply to turn on or off the power Mosfet once turned on.. Just need to modify your circuit detect if button is pressed or not with micro-controller, in case I need one switch to do many functions, like two fast taps to enable debugging mode or etc. Nice vids, keep up the good work!
One thing for sure, he rocks.
very nice... i also love you tapping on the whiteboard :D
Thank you for the instructive video on MOSFET power switching experiment.
i thought about using 555 timer but now David's way is better.thank you
Your videos make me so happy.
This is great, i already know , that i could use this circuit in my project , thanks Dave!
You didn't get the idea, it's about saving energy. The NE555 would draw current
from the source either the output is in 1 logic state(ON) or 0 logic state(OFF).
Even the CMOS version(LMC555) draws a little amount of power. This one
draws current only in ON state, which could be an advantage in some
applications such as battery powered/portable apparatuses/appliances.
I like the fact that I could actually understand most of this video! :)
I like it, Dave. I'll use this. I would love to see it use a capacitive touch button too.
Great! I actually understood it this time :D (been away learning things)
I found this circuit to work best driving a relay, it worked very good for that, and you can switch high current supplies with very little trouble this way.