@@hxhdfjifzirstc894 you want to turn on ac only if someone standing near ac ? You can go for PIR sensor as it have ideal for this type of work, you may have seen automatic lights in corridors, same way you can operate AC too.
Hi Great Scott, just a little translating advice: in your “pro and contrast” dialog, it should be “pro and con” pro = yes (affirmative) / con = no (negative) I am not certain what language this stems from, my guess is either Latin, or Greek.
@@greatscottlab thank you for the video I've been trying to find a good circuit for the job and you found it for me thank you for all the great videos keep it up
For battery operated devices that are used infrequently, I really prefer a mechanical switch where there is ZERO drain (other than the compulsory modelled resistance in the battery). Otherwise when you need said devices, you find dead batteries at best or corroded terminals usually.
mechanical switches and relays are important in many applications due to considerations surrounding failure modes. in safety and life critical applications the failure mode is critical.
Can someone explain why? I am building a soft latching circuit myself, based on PMOS, and the leakage current when off is low enough that it would take hundreds of years to drain the battery (yes I know it would die naturally well before that). the resistance of the mosfet is also very low when on. something like 50 milli-Ω...how does that drain/corrode a battery? 😕
@@mikepaul6688 well, leakage current varies exponentially with temperature so depending on your application (e.g. something likely to get left in a hot car, chemical process, solar or thermal related, etc.) that might be a consideration. Also, MOSFETS with a lower threshold voltage tend to be more leaky. So again it all depends on your circuit and its application.
I think there is a trend to over-complicate simple devices. you did point out where latch circuits are an advantage, but there hundreds of examples where manufacturers are using a 10 component board to do the same job as a simple device. This is why you cannot repair your own tech any more it always seems to have to go back to the factory to be fixed. For example Apple phones and John Deer tractors. And now the manufacturers of cars that want you to push a button rather than open a door or not have to put a key in the ignition are failing to deliver their cars because of a micro chip shortage. I do hope the current "right to repair" movement is successful and we can stop this madness of having to pay a fortune at the garage to get the cars interior light repaired.
I agree that over-complication is an issue. I bought a used drip coffee maker (barely used, just out of its 1-year warranty) that had a latch circuit to turn it on and off. The heating elements were 230V AC and the latch circuit was 12V DC. After a few months the machine wouldn't turn on anymore. Turns out the latch circuit died, everything else was fine. So I replaced the whole latch circuit with a 230V AC 10A mechanical toggle swith with a built-in LED, which cost me 1.50€. It's been 2 years and the machine is working without an issue. These companies are sacrificing reliability and screwing over the environment for a few pennies.
this seems like an irrelevant complaint. if you're opening up a circuit to (de)solder it, that's already inaccessible to most. and whether a mechanical switch or latch is used, the complexity of repair is about the same at that point. plus you can replace it with a switch if you really want and if the application makes sense for it. "right to repair" doesn't seem to apply here
@@LC-hd5dc The point is: The smallest Replaceable Unit (SRU) used to be something like a switch or relay or some other discreet component costing about £1. Now everything is part of a complex circuit on a Printed Circuit Board (PCB) costing about £100 to replace. Sometimes you cant even replace the PCB and you have to buy the whole unit that the PCB is part of. Soon, you wont even be able to have your car/TV/fridge/washing machine repaired at all, they will all be repair-by-replacement. Then, maybe you'll look back and think, when did this all start? And you will remember, oh yes; it all began 30 years ago when they decided to replace a mechanical switch with a complex switching circuit.
I both agree with you on this, and think it's a bit out of place here. There's been countless examples of stuff being complicated for no other reason than someone either in management deciding it has to be "special" somehow and it gives no real benefit, or just engineers and designers that are lacking time to stop and think about everything from the start. As a parallel talk I'm fully on it, being a product development engineer now it was literally the topic of our last meet up at the company (the boss saying "guys, sometimes we just need to... Stop, breathe, look at what the heck we're doing, and think: WHY is it like this? Can't it be made easier?"), and I agree right to repair just has to happen and disposable devices have to stop. People gotta stop feeding this insanity. But I'll also say that I don't think the complaint relates to the video. There's several situations you'll want a circuit like that in place of a mechanical system. As an example, anything remote controlled. You'll not want that the only way to get that remote controlled device on and off is the mechanical button all the way at the device, neither you'll want to waste power unnecessarily with who knows, a mechanical actuator to that switch. A latch circuit solves the problem no doubt the simplest way. This circuit being or not an unnecessary complication is always a matter of situation. It may very well be simpler than a mechanical switch even, remember a mechanical switch has to deal with contact bouncing and protecting the contacts against corrosion and arching.
and out side of a pandemic, would chips for starting the engine opening or loseing the doors wear out one day, and surprise, surprise, the only people allowed to make then the car company and they stopped making them when the last of that model rolled off the line, they will say they will supplied chip for 5 years or something but when they run out there are going to say it unecanomaly to make new stock on the odd chance a old car will need a replacement chip aren't there and even if you take court action, and win, even if you are the same person that's had the car from new, in most cases the cars will be at least second hand, they will do some sort of calculations taking in to account the age ,the time and mileage, the car has dune, and come to the concision the they is worth $£5 or less, they may invent bitt you to cart it a way to,
Don't forget you can buy latching push buttons, which when pressed and released close a pair of contacts and they remain closed until the button is pressed again. So there are times when a latching push button is a good option and you don't need to build a load of electronics.
Unless momentary, ALL switches are latching switches. WTF are you babbling about? The TYPE of button is not the topic here... it could be push, toggle, slide, etc. UGH How did you miss the context of this discussion so completely?????
For a headphone I am designing I would like to use a nice looking button, but the circuit requires a switch or a latching button. The latching button is too tall meaning I would have to increase the case of the headphone. A circuit like this could solve my issue. I only wish a circuit of some kind existed so I wouldnt have to solder as much.
Honorable mention to the humble (two coil) bistabile relay which is also set reset, and very useful in applications where a pseudo-latched run off the mill relay might draw to much power over time.
Mechanical switches are certainly not obsolete. They are simpler and cheaper for nearly all maker-type projects. Nice information to know if I ever build a project that requires it. I probably have 200 switches of a dozen or more styles and there will probably be many left when I am gone. Why change the way I do things now?
I teach mechatronics, the latch circuit using a relay is one of the things we teach our students, it is absolutly essential for safety in an industrial setting, love the video! keep em coming scott!
Could still pop in a mechanical switch as the input to a set-reset latch. I understand some vintage computers did that for critical signals, so the switch bounce wouldn't fire things by mistake.
I used a latching relay to drive a fog light relay in my SUV so I could use an OEM push button. The latching relay gets power from the tail light circuit so the fog lights can only come on when the tail lights are on. When the tail lights turn off, the latching relay loses power, and the fog lights automatically turn off. They won’t turn back on again unless the OEM button is pressed.
I wanted a circuit to pop up my headlights. There was a one year only button that can keep them up with the lights off. Completely different wiring and controller... or an annoying blank off plate. I had to consider, flash to pass overide to make sure the buckets go up for that, no matter the state. Fog lights require park lights like your circuit, also should switch off with high beams since fogs and high beams are considered as 6 lights, whereas regular headlights and fog lights are considered 4, the legal limit. Automotive lights are more complicated than they look on the surface.
Thanks for this great Video. One thing you missed is the useful and for safety often used restart protection of this circuit. For example a safe angle grinder or drilling maschine don't start by itself after replug the power cable even when the power button wasn't shut off
Been learning electronic as a hobby and this channel is such a gem, the pace and diagram explanations are on point. Thank for making high quality content.
This is not truly a latching circuit because it requires timing on the button press. If the initial press of the button from the quiescent state (off) is too long, the output is only going to be ON for a brief period of time. After that, Q3 will have sufficiently discharged C1 and the base of Q2 goes low... and stays low. A true latching circuit would require two manual triggers to cycle the output.
I did 2 years in college. And 3 year working in electrical control systems industrial working on draw bridges. Now I have a greater knowledge of ladder logic and logic gate. Thanks bro.
This is obviously a really interesting and problem specific solution to mechanical switches with potential benefits, but all I see when I look at a latch circuit is extra points of failure.
Mechanical switches (relays, contactors, even buttons and switches meant for small loads or logic signals) have to be the number one cause of electrical failure in industry.
@@kuni45 But the vast majority of mechanical switches fail to a safe state. Mechanical switches also maintain fidelity for small signal AC information that would otherwise be distorted or completely destroyed by the gate logic transistors and they are immune to voltage polarity. Mechanical switches are far from obsolete.
Because you think complexity means unnecessary. Adding a square-root button to a calculator also adds an extra point of failure. Funny how calculators work for decades with all the "added points of failure." SMH
For future reference, if looking for wall-voltage electrically controlled relays, look at HVAC contractor stores. Every AC powered air conditioner or heat pump uses such a relay, and since they sometimes die there's a need to be able to quickly & easily replace them, thus they're sold in such stores in areas where such appliances are common. In the US, the relays are commonly refered to a "contactors".
Using dedicated ic is kinda cheating, and I feel like transistor latch has some kind of problem where if u held down the button too short or too long a duration, undesired result can happen because of the capacitor And the ic also uses 2 button, a t flip flop will be needed for 1 button latch, and here is where the challenge comes, it will just oscillate if the button is pushed because it is missing clock signal, a master slave configuration is needed this video did not cover that. A latch is essentially a digital flipflop, I challenged myself to build a 1 button latch when I was new to learning flip flop, surprisingly, when I searched, everything I found was transistor latch, I had no resources to learn from and didn't know where to start, I had to figure it out myself. And this video didn't bring anything new to the table, just the same transistor latch as every other video, in a place where latch videos are mostly transistors and digital ones are so rare to find, in most cases they just slap a flip flop on a slide and start teaching theory, where in real world a latch is more than 2 nor gates so it didnt really work in practice, it was more like a digital logic class than a latch video...... Utterly disappointed......
You're right about long & short switch presses possibly causing problems in some designs, though short presses at least usually aren't a problem. As for the circuit itself, it doesn't mention that the "out" terminal needs to always have a current (though small) to ground in order for it to reliably work- otherwise it'll occasionally switch itself to a "default" state (which depends on the "polarity" of the transistors you're using) instead. Not usually a big deal, but something to be aware of. This circuit _is,_ incidentally, a flip-flop, though certainly an optimized one. In particular, the capacitor gets charged to a state such that when that central switch is flipped, it will force the circuit into the _opposite_ state from what it was in before- it doesn't malfunction by oscillating when the press is too short, but instead too long, or even malfunctions by not flipping state if the switch is pressed a second time too soon after it was last pressed. As for the normal T flipflop, the normal situation is to connect the switch to both a capacitor _and_ the clock input of the flipflop _and_ a resistor that shorts the capacitor- the capacitor will be almost instantly charged when the switch is pressed, and will stabilize the signal into the flipflop's clock input long enough for the switch to reach it's fully depressed position, where the switch _is supposed to_ tie the capacitor and clock input directly to power (or ground, for inverted-input inputs). The resistor & capacitor will control the "debounce period" that follows an interruption of the switch connection, but for the small push-switches here can reasonably be a second or less without problems. The data input, of course, needs to be tied to the flipflop's inversion output.
I felt it pretty bad when the NOR based latch was discussed - I've had nothing but trouble when making a transistorized version, it needs equal loading on it's outputs... The NAND version is topologically the same and is very stable, even better you can make them with just 4 transistors o_O And this reminds me of a curious circuit I remember seeing somebody posting on reddit a year ago, there are differences but it'll likely still have a problem with input voltage changes causing malfunction - definitely a no-go for anything battery operated... Though in my take on latching power-switches, I used that effect to not only detect when the battery was low - but also protected against short-circuits! Edit: I just saw the thumbnail to ElectroNoobs' video, and that circuit looks awfully similar to this one... Also worthy of note, GS got 4x views on his rehash of Clive's Joule Thief video - and they say something's not worth doing when it's already been done!
You are showing your gross ignorance based on a single video. Yes, this particular simplified circuit has timing issues (see my other comment for full explanation) but that doesn't mean all latching circuits built with discrete components suffer this issue. Also, IC latches are not just of the R-S type and DO NOT REQUIRE separate input triggers for toggling. You don't know enough to be criticizing.
@@DiffEQ Dude, don't just walk in and drop ad-hominems - saying "your'e stupid, stop talking" is not going to change minds; if you want to show an error, point out what went wrong and how to fix it, don't just hit at it blindly and spew insults like that... Nothing is worse than an ignorant man accusing someone of being ignorant! Also, don't just go 'refer to my previous comment' like that. Nobody will find it, and that's a fact... Either repeat what you said, or put a hard link to your comment - don't just go "x marks the spot" and expect people to go find it... Now it might seem like this guy doesn't know enough to criticize the theory / lesson here; he's absolutely qualified to judge a *video* about the basics - a video which fails to cover the basics in a complete fashion, only skims through the cool and important bits. No variations, no run-down of the caveats - I found this format in the SEPIC converter video, where that design was all hyped up - without discussing the huge drop in output efficiency, or the alternative (a flyback converter) which would achieve the same goal, and add the benefit of electrical isoation... At least, that's what I think is being discussed here; this thread is pretty old... Anyway, thanks for coming to my TED talk - that is all for now
A "555" latch will be much simpler to implement and also less complex and also a little cheaper. But for understanding the concept this is a great circuit. Thank you
A long time ago I criticized your channel. I was so stupid. This is one of the BEST electronics channels online now. Your simple explanations are so useful and concise. You really improved the production value as well. Anyway, thank you for such excellent content. Cheers! W0XO Jonathan
Dunning-Kruger effect. Most people, however, never learn enough to realize how little they knew when they were so very confident of their own abilities. Good on you!
I'm curious to know what the criticism was back then? I'm a new electronics student, and I believe in learning from all types of questions! It would be interesting to hear your perspective, knowing now that it has changed. No pressure though, take care!
Great Circuit for high current. FYI the Momentary button 1-2 is floating when off. I made this for a project and it would randomly turn on. Use a 100k ohm or more resistor to Tie the 1-2 of the switch to GND and no more problem
Have to say, for like my Bench Power Supply, Oscilloscope, and Frequency Generator they all had to have physical latching buttons or rocker switches, removing the slightest possibility of a logical malfunction of a momentary latching _circuit_.
This is an argument from ignorance as you IGNORE the fact that the entire device is billions of transistors working ALL THE TIME. And you're worried about the power-on circuit failure, only??????
And by "sometimes" you mean to say that PLSM is NOT unique to mechanical switches/latches. So, what was the point of your qualified statement? I have over a dozen devices in my home, including a PC, that has programmable return-from-power-loss state with NO MECHANICAL latches.
I have been looking for something simple to use in my miniatures and only now I found you did exactly that in this video! Thanks for showing how to do this, and also explaining how the s-r latch works
There are many uses for a latch circuit, swapping an active circuit with quite a few components, a cheap chinese momentary switch and a relay in place of a mechanical switch that is going to work problem free for as long as 50+ years, i assure you it isn't one. But since this video is more about explaining the latch circuit in general i really appreciated watching the video as you get into deep explanation, also 555 does wonders.
This toggle circuit works great with BC337 / IRFU9024 . When first powered, it turns the mosfet ON. Also, the LED is a must. If you don't use the LED (or a diode) in parallel with the output, the output becomes unstable and prefers to latch to 0V. I was searching for an electronic end stop and this is just amazing thanks for sharing
GREAT CONTENT!! I love the way you explain a circuit. I have been trying to learn electronics for some time now as a hobby. for some reason I have this mental hurdle I cant seem to get past. Yours is one of my favorite channels! THANK YOU!
People don't realize that these latching circuits are very useful. Just a few days ago I was looking for a simple way to do one and here you are offering one with your good explanation. Thank you. Would some time teach how to build a variable square signal generator with a variable duty cycle? to use for inyector cleaning. Using simple devices NOT programable. Thanks.
I've made a nice PCB that toggles a switch output on button single press, double-press, long press, etc., with debouncing. And it has an I2C and serial interface. It's very neat.
I use a power latch circuit for my bicycle automatic shifter. The cadence reed switch latches it on (also an input) and the Arduino switches it off if 0 speed for 30 seconds. Works great and no power draw when off.
They have a latching circuit for the lights in the bathroom at my work. It has a motion sensor and a timer. It has a rocker switch that always returns to the middle position up for on down for off. If turned on the timer and latching circuit are activated. If after 10 minutes no motion is detected the light turns off. The sensor still works for some time after in case someone is sitting too long.
For mains voltage applications an important failure mode of electronic switches (latch or not) is Failing On, which is often undesirable or even dangerous. This is a failure mode that is very rare in mechanical switches. Failing On can be caused by component failure or by high voltage pulses on the mains voltage. These pulses can be caused by (inductive) switching actions or can be induced by lightning, even without a direct strike. Therefore I prefer to have at least an (additional) mechanical means of switching.
At the industrial level, having mechanical switches and buttons are far more useful than electronic latches, because they ensure a clear break in the line.
10:08 You are exceeding the input common mode voltage (max of VCC - 1.7V) for the LM358 opamp using this high-side current sense. This can lead to some odd circuit behavior in your difference amp.
@@greatscottlab "So far it has worked just fine"; one of the most dangerous statements I hear with regard to circuit operation. Yes, it works in this configuration, but you are reying on the stress margins the designer/manufacturer put into this LM358. Another brand of LM358 may not have the same margins, and could fail if used in the same manner. For long term, i.e. product level, reliability components must be operated within datasheet parameters, often with some additonal margin to boot. You're showing how a circuit can work, but not highlighting risks that may be exposed by this configuration. This can be the difference between "hacking" electronic circuts and designing them.
You cant beat a simple mechanical switch for anything battery powered. A latch switch will always require power and that will be a drain on the battery which will ultimately go flat. A proper switch disconnects the battery completely and this means the battery will last as long as its able to hold charge, which in some cases is years. Apart from that it takes up so much less space. Its a no brainer, use a mechanical switch whenever possible.
In equipment reviews often a mechanical on/off switch is seen as a good thing. I agree. I would never use a latch circuit in anything I build as it is just a complicated and expensive solution to something that is not a problem. An electronic light switch that was widely used and prone to remote activation would be a hugely entertaining discovery. In a winters evening you could take a dog for a walk and switch peoples lights off in a block of flats and listen to the residents blundering around in the dark to turn them back on. Then in summer walk the same dog at three in the morning and turn them all back on. Even bad design can be fun in a prankster kind of way.
Please don’t use this kind of switches or latches for mains voltage purposes. See the comments below (Joop and others). Mains switches shall comply requirements for thermal resistance, fire resistance, clearance distances (as per over voltage category II), failure mode requirements, between others. Component standards and product standards are mandatory in mains related, not an option.
Great video @GreatScott! Interesting thing to note is how much current does it use when on standby as I needed to use this latch circuit on coin cell. Since coin cells dont have alot of power, it would be helpful to have a latching circuit to turn off after use or when a specific event occurs.
4:45 when i first got into electronics (after reading and watching a bunch) and ordering my first arduino and similar stuff, i wanted to build something but was missing that SR latch, china ordered took months to arrive, in the mean time my pcb had the IC header on there, with a custom circuit board of a nor gate in it ^^
IC latch circuits are useful in low voltage, low currant applications. When you get into controlling high voltage/high currant applications you get into electro-mechanical latch circuits.
My solution to power control is a small circuit/PCB I designed that uses a microcontroller and a 6A high-side MOSFET load switch to control power to any 3.0-5.5VDC circuit. The microcontroller gives the circuit special abilities such as lag/crash detection when used with microcontroller or SBC (e.g., Raspberry Pi) based projects, automatic startup on power-on, automatic restart after crashing, delayed-start/restart, and soft-button power control (tap-on, tap-off, press/hold force-off). I have one of them controlling power to my 3D printer by switching AC mains to the printer's power supply via sold-state relay. It even has a locking USB type-A output connector that's wired to appear to a USB-connected device as a 2.5A charge port, which means it can be used to make custom chargers. It's been a great little piece of gear, rock solid performance and super-easy to use, and I'd love to mass-produce them but I would have to make a hundred at a time to make the profit/cost ratio worth the time and effort.
Use a NAND latch for better performance, it doesn't need equal loading on the outputs to prevent it from 'sticking' to one state should it have a lower impedance. Also, unless you used capacitive touch or some sensor - you needed a mechanical switch to make the button! And then another in the form of a relay...
I once found and used an interesting variation that solely used one momentary switch, one DPDT latching relay, and a couple of resistors, caps and diodes. Basically cross wiring the relay and using the cap voltage to provide the voltage spike to flip the relay over. It had issues if not switched in a long time as the caps slowly drained due to parasitics. But I thought it clever. Your version though is cheaper and likely more relaible (and allows more current). I like it!!!
The disadvantage of latch circuits is that they draw small amounts of current which is not much of a problem until the battery goes dead and starts leaking. This is the reason I prefer on-off switches. If you have a battery powered device with a latching on-off switch and don't use it often, take the batteries out. there is less of a worry with a device that does not draw power until it is switched on causing battery leakage. I have a guitar pedal which does not draw power until a cable is plugged into it one day, I opened it up and noticed the battery expiration date was 5 years ago no leakage. I use energizer batteries. I still try to remember to remove batteries if I am not using them however, I do forget sometimes.
Another place the latch circuit would be handy is for machinery in the event of a power outage. If the power goes out, I don’t want my table saw to restart automatically when the power comes back up. It would be nice to replace the mechanical switch with a latching circuit. More expensive saws have a magnetic switch that automatically shut off when the power dies.
Funny enough, when I fix up 80's Saab radios, the one model that has a latch circuit is the one that often won't power on until the circuit is recapped or power button repaired. The mechanical volume dial switch models just about always power up
Have a think about using TRIACs & SCRs as your switching elements. There is a latching function built in for DC & a very simple capacitor shunt bypass allows the SCR or TRIAC to switch off. These are often overlooked devices with impressive ratings for literally pennies...
I won’t mention it again, but I have a challenge for Great Scott! Build a video monitor camera system that sits under the workbench and tracks dropped items, with a laser pointer to show you where the tiny screw, resistor, or whatever you dropped actually ended up! The savings in man/hours looking for the tiny item alone might save millions of hours! I have been known to drop the same item up to three times, and spend a half hour trying to find it. Amazing how far they can bounce and where they can end up. Would be so cool to have it mounted under the workbench, and a laser pointer shows where it went (or as far as last point in space seen, in case it went out of sight.
I have a personal rule that if I don't find the dropped item within 10 seconds, it is lost to the abyss. Life is too short to be on my hands and knees looking for a 10 cent component. It also focuses my attention when handling expensive and/or limited supply components.
@@msmith2961 it’s a good philosophy. I find though often the tiny little item I dropped is the last one, or the only one. It’s either find it, or spend an hour finding a replacement, ordering it, and waiting for it.
Without me even watching the rest of this video, I do have to agree that latch circuits have their place. However in the automotive industry they are widely over used and result in overengineered circuits that provide no extra benefit from their counterparts 20 years ago. On top of that with vehicle thefts on the rise, having something mechanical like an ignition cylinder is more important than ever. I know nothing I say here will have any impact. And I am not against latch circuits, or any electronic controls that go beyond a simple relay circuit. They have their place most definitely. I am just upset that the core of automotive design doesn't need over complicated circuits. It doesn't improve fuel efficiency. It doesn't lead to greater power gains. Worst of all it leads to vehicles being scrapped way before their time due to increased repair costs. Today Toyota considers the lifespan of a vehicle at 3 years. What happened to vehicles lasting 30+ years? Wouldn't that have a larger positive environmental impact? Of course companies will lose money based on their business models. Even EV vehicles are over the top with their engineering. This is proven with many small companies providing EV swaps into classic cars. The only complex electronics are the battery, electric motor, and the computer that drives all that. No different than fuel injection vehicles since the late 80s to early 2000s. After that it just became a nightmare of over engineering. Emissions were never improved. Perhaps some power gains but believe it or not those power gains come with enhanced emissions. The old school dyno emissions machines proved that until they were replaced with OBD2 emission tests, outside diesels. Sorry for the blah blah. I'm just trying to say there are so many ways a simple on/off switch, with relays if necessary, is probably the most viable and most easily repairable circuit that I know of. Just to throw out an example, I would love to know the person that created the footwell module in some later BMWs. I mean, just why? Its software is prone to corruption from most high end scanners. Results in a very expensive repair from the dealer and actually has created a whole market for diy equpiment and specialists. And there is no work around unless you really rewire the harness and will still be left with a module unhappy shouting codes at you. And what does it control? Stuff like power windows and crap. I swear if someone explains to me how that is more efficient than just having either postive or ground control with relays and fuses over your power windows, power locks, and other silly stuff in your door, please, I'm all ears.
How the hell is a mechanical ignition cylinder supposed to provide security here? They're piss-easy to pick and you don't even have to do that, you can just connect the wires and off you go. But you can't do that nowadays, because when the key with a proper code isn't present, the ECM is disabled, and you ain't going nowhere. That's an electronic system that is an (almost) impenetrable barrier to theft, the mechanical bit is worth nothing. That's why cars have fobs instead of keys nowadays. The electronic circuits in cars help save expensive raw materials like copper, and they save weight. For taillights you need a wire for position lights, one for brake lights, two for the indicators, one for reversing light and one for fog taillight. All of them must be thick enough to carry the current required without heating up or creating losses. All the switches - relays, brake switch, light switch and so on - must be beefy enough to make and break the connection, and they must be sturdy enough to do that over thousands of cycles. With an electronic system, theoretically, you just need a power supply wire and a bus wire, and send signals (CAN bus, say), to the rear lamp clusters and they use a couple of Mosfets to switch the lamp required on. That's a lot of copper, lots of weight, lots of mechanical switches, and, above all, lots of money saved, and unless you design the electronics stupidly, it will never fail.
@@horrovac Mechanical cylinder provides a mechanical steering column lock, which takes more skill and time to break, depending on the design. Picking a lock with a laser cut design is not easy. Most likely you'd have to smash the column open. Not saying its impossible but louder and more time consuming than just programming a fob the way current car thefts are being done. Not to mention the key with a mechanical lock also usually has programming that needs to be detected. So now you have much more protection than a simple electronic system where once you get the fob programmed, it takes car of the steering column lock since its electronic, push start means no cylinder needs to be destroyed, and away you go. That electronic barrier you speak of is actually quite easy to get through. There are numerous scanners you can pick up that do key programming. If you have access to dealership info and equipment its even easier. A lot of illegal type of equipment that works flawlessly is available for purchase. These are all the reasons car thefts are happening in such numbers today. Now with the wiring, I'm not sure how you think the computer instead of a relay and switch is getting the power to the lights? The computer is just bypassing what the relays used to do. You still need to run wiring regardless. And the wiring needs to be thick enough for whatever the load requires. Most manufacturers switched to aluminum wires awhile ago anyways. A lot of wiring now is too thin actually causing issues and needing repairs which require thicker copper wiring to be spliced in if you want the repair to last. And if you want a completely computerized relay system, the board and components must be hefty enough to take the load. Look at the infamous Chrysler/Dodge integrated power module. Piece of a junk. I rewire these for people regularly leading to the thing looking like a christmas tree. It fails. Often. And instead of just replacing one silly relay, the proper dealer approved repair is to replace the damn thing which is 1000 bucks plus. So you are actually losing money since the average joe doesn't know how to repair the computerized controllers, and the specialists that do charge quite a bit. Even then there is no guarantee of a repair. Depends on the damage. But having just a basic body control module and engine control module with relays as support is the best most cost effective way that allows for quick inexpensive repairs since every system is isolated. In the event a relay box is burned, you can still either buy a box which is cheaper than power modules, or just rewire the thing. I mean seriously, where is the extra weight? Have you held the stupid BMW footwell module in your hand and held an interior Ford relay/fuse box in the other? Tell me which is heavier and which has the thicker wiring harness?
@@Membreins AFAIK the thieves just break the steering column lock by turning the steering wheel with a lot of force. But I'm not a car thief, so I won't claim any knowledge on that. The electronic barrier I'm talking about is not the car remote lock. Those can be defeated by replay attacks in some cases (but not if designed properly). The code I'm talking about is on the key itself and is not transmitted via radio. You can't scan that. Programming a new key on-the-spot is *way* above the paygrade of a typical thief. At least here in central Europe, car theft is a non-issue. Apparently there is significant car theft in the UK, but those are break-in thefts - that is, they break into the front door of your house and get the key, or fish the key out through the letterbox. Having one power bus wire instead of many different ones is more economical, whatever the material used. The example with the light clusters is just that - an example that should be easy to comprehend. But in modern cars there is waay more stuff than that, and the wire harnesses are already getting out of hand. Electronics is dirt cheap, way cheaper than mechanical switches or relays or copper, and much more reliable. So instead of wiring every bit of electronics front to back and top to bottom, having a common power bus and a signal bus that transmits commands or feedback is just common sense. I know that it's not the case yet, but you could really supply the whole car with just a couple of wires. Sure, you could build a car that the "average Joe" could repair - but then everyone, including Joe, would just throw it away when it's broke and buy a new car. People are not interested in doing that. They either get it fixed or exchange it. What they are interested in are gadgets - sensors every which way, cameras, motorised everything, heated this and that, soft-touch controls instead of ker-chunk switches, or touchscreens and automatic controls, and chimes instead of clicking of relays. So yeah, you could build an all-mechanical switch and wiring car, but good luck selling it to anyone. You're talking about something that offers nothing to almost every car buyer, and just a fringe benefit for a couple of weirdos like you. There is nothing unreliable about electronics. It can last forever and usually does, when designed correctly. Have a look at the ECUs which almost never fail, or the fly-by-wire systems in modern aircraft. I'd much prefer solid state electronics instead of contactors and relays and switches. I had a lot of those go wrong on me. Sure, you can also screw it up, and manufacturers like Mercedes and BMW are likely offenders when it comes to electronics overengineering and failures, but solid state electronics is a huge boon.
@@horrovac You're wrong about steering locks but you are right about the fact that the moronic consumer is driving auto manufacturers towards marketing gadgets to people and delivering a low-quality car attached. But you're wrong, at least in North America, there are still people with knowledge and skill to maintain a vehicle, build a house, make a gun. That's why there is a strong market for older (pre-2008-ish) vehicles here. I am a mechanic, solid-state ECU's of all types. brands and functions fail all the time. The problem is for consumers, replacing a $1200 body control module so you can open your trunk, is not worth the savings using less copper reduced the vehicle's sales price. Only the manufacturer benefits. Don't call people weirdo, weirdo
@@horrovac Modern keyless entry and start vehicles are susceptible to relay (range extension) attacks. Was not a problem before because keys would not transmit anything without pressing a button. Engine immobiliser transponders were very short ranged, only a couple of cm, which made it highly unlikely that you could walk up to someone and read the key from their pocket. To allow button starts without having to take your key out of the pocket the range had to be extended, thus making it vulnerable. A man with a briefcase walks past you in a supermarket, another man with a similar briefcase is near you car, and they can easily steal it. Manufacturers are introducing motion sensors into keys to prevent them being read while sitting on a table, but that is just a band aid to the problem.
I never comment on your stuff because i know so little. However I actually prefer mechanical switches. Just that feeling you know. Way more satisfying.
Replacing 1 simple component by multiple other components may result in: more expensive, more complicated, more points of failure, more space requirements and more assembly costs. There better be enough benefits to make this idea valuable.
A few years ago I bought a nice lit switch for my bench power supply (based on an old ATX PSU). Turned out it was a momentary button, while the PSU needed a latching switch. So instead of buying another switch (it wasn't a cheap switch) I built a latching circuit like the one you are using. I additionally put in an opto-isolator between the circuit and the PSU though.
Audio equipment for use in loud environments benefit from the obvious tactile feedback of toggle switches. Also, any system can easily telegraph it’s state if that state is displayed by switch positions. Hidden latches provide no such information.
I studied electronics repair in the 1980's after I left active duty and quickly realized the KISS principle, Keep It Simple Stupid, really applies in electronics design. Keeping it simple allows the device to brakedown less and when it does it is easier to repair and get back to the customer.
Totally Off Position Switch (tops) is preferred as there is no energy drain. If I could do that with my remote control devices, I would. The batteries would last longer. There's nothing more comforting in knowing that when something is turned off, that indeed it is off. Obviously there are things that turn on with the push of a button, and the same action turns it off.
One of the biggest advantages I haven’t seen many mention is the fact that you can use this circuit to control power with a microcontroller. It is very low power consumption during standby then you can have something like a motion sensor wake the circuit up. When the microcontroller does it’s thing it just pulls the pin down to turn itself off. This circuit is invaluable on battery powered electronics.
How is the Microcontroller shutting itself off at 9:45? I assumed that when the SET pin was triggered by the IR sensor, it just cut power to the Microcontroller. How can the Microcontroller send the RESET pulse, if it's receiving no power. Apologies if I've misunderstood that part of the circuit
A latched circuit like this would've been useful a few years ago (shortly before a crash I had, lol) for a piece of test equipment I were working on. I were looking around for one to make that I can then control with a micro-controller to turn itself off when finished to conserve battery for use in the field... I had to make do with another workaround tho.
@@deang5622 Yes, I know.... I'm on about this more simplified one-button on/off mechanism. BTW, I ended up using a clocked S/R flipflop IC in the end anyway and then just used the MCU to turn off the supply by resetting the flipflop. That meant the device stayed on until a delay and the person couldn't just manually turn off the test equipment.
I have the most fun with a latch made with an OR Gate an AND gate and Inverter combo latch since there are no disallowed states along with its simplicity . Without crosscoupled wires to confuse me as to witch output is energized first. One OR gate input is the latch input. The OR Gate output is connected to one AND Gate input and the other AND Gate input is connected to the Inverter output. The AND Gate output is connected to the other OR Gate input and is also the output of the Latch. The Inverter input is the reset input of the latch. Some times I need a pull down resistor connected from the feedback wire to ground . Maybe 5 kohms.
Be sure to have an R/C across triac type switches that operate anything that would incur a counter emf like a solenoid with a collapsing flux field. The induced voltage from the collapsing flux field will fry the semiconductor type switch.
I can see controlling a large current with indirect means such as this. And things that cannot tolerate switch bounce or deterioration of the contacts. But for any project I will build, a regular switch is cheap simple and easy KISS. I had a joke about how they might convert the standard wall switch to a microcontroller based complicated unit at high cost for those that love tech regardless of need.
this is what i was looking for 😋 recently i started building an amplifier for my gf and i wanted to build a latch switch in ... instead of mechanical push/latch button .. I found schematics using 555 timer , transistor and rellay , circuit was quite simple , but this is even simpler :) .. and since it involves mosfet, it basically draws miniscule current in comparison to rellay version.. definitely going with this design next time ! many thanx 🙏🏻
The problem of electronic switches like shown in the video is that it has no "memory" to remember its state. When there is a power problem/dip for a short period of time, it turns the device off and it will stay off until you press the button again. Not very suitable for devices that needs to stay on.
actually one big advantage of the normal switch is that there is no standby current and connection ofc is broken meaning if you had a fault situation that could fry your devices they are a bit safer.
@@greatscottlab There's leakage currents through the transistors. The IRF5210 datasheet specifies a maximum 25uA of drain to source leakage current at -100Vds at 0Vgs. A microcontroller shutoff would be asked to switch about 5V, so we can guess maybe 1uA of leakage at -5Vds. If the output is low impedance, then that would be all. If the output is high impedance, however (e.g. disconnected), then the leakage current would charge up the bases of Q2 and Q3. Worst-case, the transistors are mismatched and 1uA flows through the base of Q2, which is amplified by a typical factor of 200 to 200uA of emitter-base current. That _would_ draw the gate voltage of Q1 down by 200uA*100kOhm=20V, but that would be strong enough to turn Q1 on hard, latching the circuit on. (Sanity check: 1uA flowing through the 100K R2 would be consistent with a base voltage of 4.9V, more than enough to drive current through Q2 to turn Q1 on.) The real equilibrium would depend on the small-VGS behaviour of the IRF5210, but the datasheet doesn't have enough information there. I would be comfortable calling 1uA of standby current a plausible value, with a risk of the circuit self-latching on if the output is disconnected. (If instead Q3 turns on first, the circuit might not latch but now Q3 amplifies the base current, drawing more 'standby' current through R3.) I'd need to simulate it to be sure, but I suspect you could avoid the risk of self-latching if you add a diode ahead of the Q2 base; that would force stray voltage in the latch to find its way to ground via Q3.
Other than the fact you need an additional power IC to power the latch circuit and a isolated driver to drive the interface switch (which is short on supply). Beside that, great video.
I have single button power control circuit with ICs in my home build stereo, by now, it's working more than 20 years.. MCU can control it too from remote and there is independent indication part.. If power supply fails at starting, LED will blink continuously.. At normal situations, it never fails.. Circuit is different from simple ones and it is with protection from bouncing contacts.. 😉
Online, there are many different circuits just like this one, with identical functionality. But nobody compares them and has the pros/cons next to each other.
Mechanical switches are so nice and simple and rely on nothing but a physical connection . I work in automation and I see anything else fail on any given day . Plc’s get stuck on on out puts inputs break .. but a mechanical switch lasts almost forever
Only small downside to a latching circuit is the lack of inherent feedback that your circuit is on, but you can add a feedback LED on the output to somewhat overcome this. At least with a switch you can tell in what state it is at first glance.
for my latch circuits I just use a D-type Flip-Flop with the switch going into the clock input, and !Q connected to D, S & R grounded, and Q as your output.
I like a mechanical switch, i mostly modify cars and when the switch in the dash is set up to be momentary with a circuit keeping it on (ac button for example) it becomes not as simple to just unplug the connector from the back and run other wires to it for use elsewhere as the body controller does the switching so the dashboard button becomes momentary as soon as you unplug it from the loom and sometimes theres not alot of space to build a whole setup neatly in there, on older cars changing the "useless" buttons like ac and rear window defogger to do other functions like a high boost button or to trigger a relay to turn an oil cooler fan on were easy, and easy to undo if you wished to undo the modification later, but its not so easy with more modern cars. I usually end up de soldering the switch and soldering in a mechanical one, but then it requires more work to undo it later.
I have used more 7476 flip-flops than I can imagine throughout my life. I could draw the connections to use them in toggle mode in my sleep. I always thought one of the big companies should have created a small 4 pin device (power, ground, input, output) with a decent current handling capability and a wide operational (both trigger and switched) voltage. I'm sure that company could have made a whole lot of money throughout the 70s, 80s and 90s when I designed and built a lot of my own circuits.
I've always wanted light switches that latch, but had no idea they exist! I have a bunch of lights that are controlled by multiple switches, and I'd prefer latching behavior. Time to change them out!
The lights in our office are on an "intelligent" latching switch. It's such an enormous pain in the ass... to have a switch that simply could be put in either of two positions would be so much more practical, lol.
4:09 i prefer use Q~ feedback to A and the trigger to clock in a flop flop D Just remember use a pull-doun resistor to make always starts Q=off if you wana always start on, just change -feedback/output- Q to Q~ a TIP41 to 12Vdc charges, or a SCR to 120 Vac and have fun
I like that latching relay in your consumer unit, wish they were more common here in the UK, would certainly make smart home stuff simpler than having to install separate modules to each lighting circuit in the house each with their own nuances.
Great thought but I use mechanical flip toggle switches in my business because I have confinement issues. Look at the size difference! Otherwise great idea!
Thanks, interesting video. I use a latch circuit in a ESP8266 doorbell using a P and N channel MOSFET, very small IC's exist that have both included, like the Si4599
I can't find the part you're describing. Any chance you could post a link or some more info? Something like that is exactly what I need cluttering my parts bin waiting for a future project.
@@wjn777 perfect, thank you! I managed to find the part but unfortunately I can't find any in stock. I'll have to find similar parts but this gave me a great start, thanks again!
The first 1,000 people to use the link will get a 1 month free trial of Skillshare: skl.sh/greatscott07221
1:35 i hate this new bgm while placing those LEDs.....
Older one was awesome to hear 🤠🤠
Can you make a momentary wireless AC footswitch project? Normally open.
@@hxhdfjifzirstc894 you want to turn on ac only if someone standing near ac ? You can go for PIR sensor as it have ideal for this type of work, you may have seen automatic lights in corridors, same way you can operate AC too.
Spending 10% of your video on an advert wasn't enough?
Hi Great Scott, just a little translating advice:
in your “pro and contrast” dialog, it should be “pro and con”
pro = yes (affirmative) / con = no (negative)
I am not certain what language this stems from, my guess is either Latin, or Greek.
In most situations I still feel better when I hear and feel the "clack" of a mechanical switch
Well, that is definitely a selling point for mechanical toggle switches.
@@greatscottlab you can still include haptic feedback to the latch, so... it is something that can be a big plus
When I read "clack" I expected you to talk about relays...
And no battery drain when off.
@@greatscottlab thank you for the video I've been trying to find a good circuit for the job and you found it for me thank you for all the great videos keep it up
For battery operated devices that are used infrequently, I really prefer a mechanical switch where there is ZERO drain (other than the compulsory modelled resistance in the battery). Otherwise when you need said devices, you find dead batteries at best or corroded terminals usually.
Yes. I have a very expensive flashlight and I have to unscrew the end where the batteries go because otherwise they drain when it's not being used.
Use a mechanical latch switch. They only draw power to change state.
mechanical switches and relays are important in many applications due to considerations surrounding failure modes. in safety and life critical applications the failure mode is critical.
Can someone explain why? I am building a soft latching circuit myself, based on PMOS, and the leakage current when off is low enough that it would take hundreds of years to drain the battery (yes I know it would die naturally well before that). the resistance of the mosfet is also very low when on. something like 50 milli-Ω...how does that drain/corrode a battery? 😕
@@mikepaul6688 well, leakage current varies exponentially with temperature so depending on your application (e.g. something likely to get left in a hot car, chemical process, solar or thermal related, etc.) that might be a consideration. Also, MOSFETS with a lower threshold voltage tend to be more leaky. So again it all depends on your circuit and its application.
I think there is a trend to over-complicate simple devices. you did point out where latch circuits are an advantage, but there hundreds of examples where manufacturers are using a 10 component board to do the same job as a simple device. This is why you cannot repair your own tech any more it always seems to have to go back to the factory to be fixed. For example Apple phones and John Deer tractors. And now the manufacturers of cars that want you to push a button rather than open a door or not have to put a key in the ignition are failing to deliver their cars because of a micro chip shortage. I do hope the current "right to repair" movement is successful and we can stop this madness of having to pay a fortune at the garage to get the cars interior light repaired.
I agree that over-complication is an issue. I bought a used drip coffee maker (barely used, just out of its 1-year warranty) that had a latch circuit to turn it on and off. The heating elements were 230V AC and the latch circuit was 12V DC. After a few months the machine wouldn't turn on anymore. Turns out the latch circuit died, everything else was fine. So I replaced the whole latch circuit with a 230V AC 10A mechanical toggle swith with a built-in LED, which cost me 1.50€. It's been 2 years and the machine is working without an issue. These companies are sacrificing reliability and screwing over the environment for a few pennies.
this seems like an irrelevant complaint. if you're opening up a circuit to (de)solder it, that's already inaccessible to most. and whether a mechanical switch or latch is used, the complexity of repair is about the same at that point. plus you can replace it with a switch if you really want and if the application makes sense for it. "right to repair" doesn't seem to apply here
@@LC-hd5dc The point is: The smallest Replaceable Unit (SRU) used to be something like a switch or relay or some other discreet component costing about £1. Now everything is part of a complex circuit on a Printed Circuit Board (PCB) costing about £100 to replace. Sometimes you cant even replace the PCB and you have to buy the whole unit that the PCB is part of. Soon, you wont even be able to have your car/TV/fridge/washing machine repaired at all, they will all be repair-by-replacement. Then, maybe you'll look back and think, when did this all start? And you will remember, oh yes; it all began 30 years ago when they decided to replace a mechanical switch with a complex switching circuit.
I both agree with you on this, and think it's a bit out of place here. There's been countless examples of stuff being complicated for no other reason than someone either in management deciding it has to be "special" somehow and it gives no real benefit, or just engineers and designers that are lacking time to stop and think about everything from the start.
As a parallel talk I'm fully on it, being a product development engineer now it was literally the topic of our last meet up at the company (the boss saying "guys, sometimes we just need to... Stop, breathe, look at what the heck we're doing, and think: WHY is it like this? Can't it be made easier?"), and I agree right to repair just has to happen and disposable devices have to stop. People gotta stop feeding this insanity.
But I'll also say that I don't think the complaint relates to the video. There's several situations you'll want a circuit like that in place of a mechanical system. As an example, anything remote controlled. You'll not want that the only way to get that remote controlled device on and off is the mechanical button all the way at the device, neither you'll want to waste power unnecessarily with who knows, a mechanical actuator to that switch. A latch circuit solves the problem no doubt the simplest way.
This circuit being or not an unnecessary complication is always a matter of situation. It may very well be simpler than a mechanical switch even, remember a mechanical switch has to deal with contact bouncing and protecting the contacts against corrosion and arching.
and out side of a pandemic, would chips for starting the engine opening or loseing the doors wear out one day, and surprise, surprise, the only people allowed to make then the car company and they stopped making them when the last of that model rolled off the line, they will say they will supplied chip for 5 years or something but when they run out there are going to say it unecanomaly to make new stock on the odd chance a old car will need a replacement chip aren't there and even if you take court action, and win, even if you are the same person that's had the car from new, in most cases the cars will be at least second hand, they will do some sort of calculations taking in to account the age ,the time and mileage, the car has dune, and come to the concision the they is worth $£5 or less, they may invent bitt you to cart it a way to,
Don't forget you can buy latching push buttons, which when pressed and released close a pair of contacts and they remain closed until the button is pressed again.
So there are times when a latching push button is a good option and you don't need to build a load of electronics.
these are called bistable buttons, and yeah, in many cases it's enough
Unless momentary, ALL switches are latching switches. WTF are you babbling about? The TYPE of button is not the topic here... it could be push, toggle, slide, etc. UGH How did you miss the context of this discussion so completely?????
For a headphone I am designing I would like to use a nice looking button, but the circuit requires a switch or a latching button. The latching button is too tall meaning I would have to increase the case of the headphone. A circuit like this could solve my issue. I only wish a circuit of some kind existed so I wouldnt have to solder as much.
Honorable mention to the humble (two coil) bistabile relay which is also set reset, and very useful in applications where a pseudo-latched run off the mill relay might draw to much power over time.
Mechanical switches are certainly not obsolete. They are simpler and cheaper for nearly all maker-type projects. Nice information to know if I ever build a project that requires it. I probably have 200 switches of a dozen or more styles and there will probably be many left when I am gone. Why change the way I do things now?
I teach mechatronics, the latch circuit using a relay is one of the things we teach our students, it is absolutly essential for safety in an industrial setting, love the video! keep em coming scott!
Why are electronics and electricity so complex and consumerist ?
Could still pop in a mechanical switch as the input to a set-reset latch. I understand some vintage computers did that for critical signals, so the switch bounce wouldn't fire things by mistake.
I used a latching relay to drive a fog light relay in my SUV so I could use an OEM push button. The latching relay gets power from the tail light circuit so the fog lights can only come on when the tail lights are on. When the tail lights turn off, the latching relay loses power, and the fog lights automatically turn off. They won’t turn back on again unless the OEM button is pressed.
I wanted a circuit to pop up my headlights. There was a one year only button that can keep them up with the lights off. Completely different wiring and controller... or an annoying blank off plate. I had to consider, flash to pass overide to make sure the buckets go up for that, no matter the state. Fog lights require park lights like your circuit, also should switch off with high beams since fogs and high beams are considered as 6 lights, whereas regular headlights and fog lights are considered 4, the legal limit. Automotive lights are more complicated than they look on the surface.
Thank you for saving other drivers' eyes!
Thanks for this great Video.
One thing you missed is the useful and for safety often used restart protection of this circuit.
For example a safe angle grinder or drilling maschine don't start by itself after replug the power cable even when the power button wasn't shut off
Great observation 👌
Love your content. Love my mechanical switches. Compact, tactile feedback, certainty.
Been learning electronic as a hobby and this channel is such a gem, the pace and diagram explanations are on point. Thank for making high quality content.
Glad to see you back to basics. Love you Great Scott.
This is not truly a latching circuit because it requires timing on the button press. If the initial press of the button from the quiescent state (off) is too long, the output is only going to be ON for a brief period of time. After that, Q3 will have sufficiently discharged C1 and the base of Q2 goes low... and stays low. A true latching circuit would require two manual triggers to cycle the output.
I did 2 years in college. And 3 year working in electrical control systems industrial working on draw bridges. Now I have a greater knowledge of ladder logic and logic gate. Thanks bro.
This is obviously a really interesting and problem specific solution to mechanical switches with potential benefits, but all I see when I look at a latch circuit is extra points of failure.
Depends on the use-case. Switch "bounce" can sometimes be the bigger issue.
Mechanical switches (relays, contactors, even buttons and switches meant for small loads or logic signals) have to be the number one cause of electrical failure in industry.
More than loose wire terminations and failed capacitors?
@@kuni45 But the vast majority of mechanical switches fail to a safe state. Mechanical switches also maintain fidelity for small signal AC information that would otherwise be distorted or completely destroyed by the gate logic transistors and they are immune to voltage polarity. Mechanical switches are far from obsolete.
Because you think complexity means unnecessary. Adding a square-root button to a calculator also adds an extra point of failure. Funny how calculators work for decades with all the "added points of failure." SMH
For future reference, if looking for wall-voltage electrically controlled relays, look at HVAC contractor stores. Every AC powered air conditioner or heat pump uses such a relay, and since they sometimes die there's a need to be able to quickly & easily replace them, thus they're sold in such stores in areas where such appliances are common. In the US, the relays are commonly refered to a "contactors".
Using dedicated ic is kinda cheating, and I feel like transistor latch has some kind of problem where if u held down the button too short or too long a duration, undesired result can happen because of the capacitor
And the ic also uses 2 button, a t flip flop will be needed for 1 button latch, and here is where the challenge comes, it will just oscillate if the button is pushed because it is missing clock signal, a master slave configuration is needed
this video did not cover that. A latch is essentially a digital flipflop, I challenged myself to build a 1 button latch when I was new to learning flip flop, surprisingly, when I searched, everything I found was transistor latch, I had no resources to learn from and didn't know where to start, I had to figure it out myself.
And this video didn't bring anything new to the table, just the same transistor latch as every other video, in a place where latch videos are mostly transistors and digital ones are so rare to find, in most cases they just slap a flip flop on a slide and start teaching theory, where in real world a latch is more than 2 nor gates so it didnt really work in practice, it was more like a digital logic class than a latch video......
Utterly disappointed......
You're right about long & short switch presses possibly causing problems in some designs, though short presses at least usually aren't a problem.
As for the circuit itself, it doesn't mention that the "out" terminal needs to always have a current (though small) to ground in order for it to reliably work- otherwise it'll occasionally switch itself to a "default" state (which depends on the "polarity" of the transistors you're using) instead. Not usually a big deal, but something to be aware of.
This circuit _is,_ incidentally, a flip-flop, though certainly an optimized one. In particular, the capacitor gets charged to a state such that when that central switch is flipped, it will force the circuit into the _opposite_ state from what it was in before- it doesn't malfunction by oscillating when the press is too short, but instead too long, or even malfunctions by not flipping state if the switch is pressed a second time too soon after it was last pressed.
As for the normal T flipflop, the normal situation is to connect the switch to both a capacitor _and_ the clock input of the flipflop _and_ a resistor that shorts the capacitor- the capacitor will be almost instantly charged when the switch is pressed, and will stabilize the signal into the flipflop's clock input long enough for the switch to reach it's fully depressed position, where the switch _is supposed to_ tie the capacitor and clock input directly to power (or ground, for inverted-input inputs). The resistor & capacitor will control the "debounce period" that follows an interruption of the switch connection, but for the small push-switches here can reasonably be a second or less without problems. The data input, of course, needs to be tied to the flipflop's inversion output.
I felt it pretty bad when the NOR based latch was discussed - I've had nothing but trouble when making a transistorized version, it needs equal loading on it's outputs...
The NAND version is topologically the same and is very stable, even better you can make them with just 4 transistors o_O
And this reminds me of a curious circuit I remember seeing somebody posting on reddit a year ago, there are differences but it'll likely still have a problem with input voltage changes causing malfunction - definitely a no-go for anything battery operated... Though in my take on latching power-switches, I used that effect to not only detect when the battery was low - but also protected against short-circuits!
Edit: I just saw the thumbnail to ElectroNoobs' video, and that circuit looks awfully similar to this one...
Also worthy of note, GS got 4x views on his rehash of Clive's Joule Thief video - and they say something's not worth doing when it's already been done!
You are showing your gross ignorance based on a single video. Yes, this particular simplified circuit has timing issues (see my other comment for full explanation) but that doesn't mean all latching circuits built with discrete components suffer this issue. Also, IC latches are not just of the R-S type and DO NOT REQUIRE separate input triggers for toggling. You don't know enough to be criticizing.
@@DiffEQ Dude, don't just walk in and drop ad-hominems - saying "your'e stupid, stop talking" is not going to change minds; if you want to show an error, point out what went wrong and how to fix it, don't just hit at it blindly and spew insults like that...
Nothing is worse than an ignorant man accusing someone of being ignorant!
Also, don't just go 'refer to my previous comment' like that. Nobody will find it, and that's a fact...
Either repeat what you said, or put a hard link to your comment - don't just go "x marks the spot" and expect people to go find it...
Now it might seem like this guy doesn't know enough to criticize the theory / lesson here; he's absolutely qualified to judge a *video* about the basics - a video which fails to cover the basics in a complete fashion, only skims through the cool and important bits. No variations, no run-down of the caveats - I found this format in the SEPIC converter video, where that design was all hyped up - without discussing the huge drop in output efficiency, or the alternative (a flyback converter) which would achieve the same goal, and add the benefit of electrical isoation...
At least, that's what I think is being discussed here; this thread is pretty old...
Anyway, thanks for coming to my TED talk - that is all for now
A "555" latch will be much simpler to implement and also less complex and also a little cheaper. But for understanding the concept this is a great circuit. Thank you
I like how your videos are so short... yet perfectly informative.
I love the older this channel gets the more confidence you got with making videos and putting some hood humor in
A long time ago I criticized your channel. I was so stupid. This is one of the BEST electronics channels online now. Your simple explanations are so useful and concise. You really improved the production value as well. Anyway, thank you for such excellent content. Cheers! W0XO Jonathan
Dunning-Kruger effect. Most people, however, never learn enough to realize how little they knew when they were so very confident of their own abilities. Good on you!
I'm curious to know what the criticism was back then? I'm a new electronics student, and I believe in learning from all types of questions! It would be interesting to hear your perspective, knowing now that it has changed.
No pressure though, take care!
Great Circuit for high current. FYI the Momentary button 1-2 is floating when off. I made this for a project and it would randomly turn on. Use a 100k ohm or more resistor to Tie the 1-2 of the switch to GND and no more problem
Have to say, for like my Bench Power Supply, Oscilloscope, and Frequency Generator they all had to have physical latching buttons or rocker switches, removing the slightest possibility of a logical malfunction of a momentary latching _circuit_.
This is an argument from ignorance as you IGNORE the fact that the entire device is billions of transistors working ALL THE TIME. And you're worried about the power-on circuit failure, only??????
Sometimes a power loss state memory can only be done with a mechanical latch.
And by "sometimes" you mean to say that PLSM is NOT unique to mechanical switches/latches. So, what was the point of your qualified statement? I have over a dozen devices in my home, including a PC, that has programmable return-from-power-loss state with NO MECHANICAL latches.
I have been looking for something simple to use in my miniatures and only now I found you did exactly that in this video! Thanks for showing how to do this, and also explaining how the s-r latch works
There are many uses for a latch circuit, swapping an active circuit with quite a few components, a cheap chinese momentary switch and a relay in place of a mechanical switch that is going to work problem free for as long as 50+ years, i assure you it isn't one.
But since this video is more about explaining the latch circuit in general i really appreciated watching the video as you get into deep explanation, also 555 does wonders.
This toggle circuit works great with BC337 / IRFU9024 . When first powered, it turns the mosfet ON. Also, the LED is a must. If you don't use the LED (or a diode) in parallel with the output, the output becomes unstable and prefers to latch to 0V. I was searching for an electronic end stop and this is just amazing thanks for sharing
GREAT CONTENT!! I love the way you explain a circuit. I have been trying to learn electronics for some time now as a hobby. for some reason I have this mental hurdle I cant seem to get past. Yours is one of my favorite channels!
THANK YOU!
This guy's hand printing and schematic drawing are superb.
Thanks for the circuit/video. I really enjoy them!
You are welcome 🙂
People don't realize that these latching circuits are very useful.
Just a few days ago I was looking for a simple way to do one and here you are offering one with your good explanation. Thank you.
Would some time teach how to build a variable square signal generator with a variable duty cycle? to use for inyector cleaning. Using simple devices NOT programable.
Thanks.
The ergonomics of a mechanical switch are unique. They will not be replaced where they make sense.
I've made a nice PCB that toggles a switch output on button single press, double-press, long press, etc., with debouncing. And it has an I2C and serial interface. It's very neat.
Good for you. And where is it?
I use a power latch circuit for my bicycle automatic shifter. The cadence reed switch latches it on (also an input) and the Arduino switches it off if 0 speed for 30 seconds. Works great and no power draw when off.
They have a latching circuit for the lights in the bathroom at my work. It has a motion sensor and a timer. It has a rocker switch that always returns to the middle position up for on down for off. If turned on the timer and latching circuit are activated. If after 10 minutes no motion is detected the light turns off. The sensor still works for some time after in case someone is sitting too long.
Man, I love your way of expaining things using trattopens on paper!
For mains voltage applications an important failure mode of electronic switches (latch or not) is Failing On, which is often undesirable or even dangerous.
This is a failure mode that is very rare in mechanical switches.
Failing On can be caused by component failure or by high voltage pulses on the mains voltage.
These pulses can be caused by (inductive) switching actions or can be induced by lightning, even without a direct strike.
Therefore I prefer to have at least an (additional) mechanical means of switching.
At the industrial level, having mechanical switches and buttons are far more useful than electronic latches, because they ensure a clear break in the line.
Great Video! 👍
... And long live the *Stromstoßrelais* !
Haha YES!
10:08 You are exceeding the input common mode voltage (max of VCC - 1.7V) for the LM358 opamp using this high-side current sense. This can lead to some odd circuit behavior in your difference amp.
Thanks for the feedback. So far it worked just fine.
@@greatscottlab "So far it has worked just fine"; one of the most dangerous statements I hear with regard to circuit operation. Yes, it works in this configuration, but you are reying on the stress margins the designer/manufacturer put into this LM358. Another brand of LM358 may not have the same margins, and could fail if used in the same manner. For long term, i.e. product level, reliability components must be operated within datasheet parameters, often with some additonal margin to boot. You're showing how a circuit can work, but not highlighting risks that may be exposed by this configuration. This can be the difference between "hacking" electronic circuts and designing them.
@@donbarr9487 Aha!
You cant beat a simple mechanical switch for anything battery powered. A latch switch will always require power and that will be a drain on the battery which will ultimately go flat. A proper switch disconnects the battery completely and this means the battery will last as long as its able to hold charge, which in some cases is years. Apart from that it takes up so much less space. Its a no brainer, use a mechanical switch whenever possible.
In equipment reviews often a mechanical on/off switch is seen as a good thing. I agree. I would never use a latch circuit in anything I build as it is just a complicated and expensive solution to something that is not a problem. An electronic light switch that was widely used and prone to remote activation would be a hugely entertaining discovery. In a winters evening you could take a dog for a walk and switch peoples lights off in a block of flats and listen to the residents blundering around in the dark to turn them back on. Then in summer walk the same dog at three in the morning and turn them all back on. Even bad design can be fun in a prankster kind of way.
Please don’t use this kind of switches or latches for mains voltage purposes. See the comments below (Joop and others). Mains switches shall comply requirements for thermal resistance, fire resistance, clearance distances (as per over voltage category II), failure mode requirements, between others. Component standards and product standards are mandatory in mains related, not an option.
Pretty sure he used a mechanical latch for his lights. AC would fry those transistors he used for the other switch.
Use a relay
Great video @GreatScott! Interesting thing to note is how much current does it use when on standby as I needed to use this latch circuit on coin cell. Since coin cells dont have alot of power, it would be helpful to have a latching circuit to turn off after use or when a specific event occurs.
4:45 when i first got into electronics (after reading and watching a bunch) and ordering my first arduino and similar stuff, i wanted to build something but was missing that SR latch, china ordered took months to arrive, in the mean time my pcb had the IC header on there, with a custom circuit board of a nor gate in it ^^
IC latch circuits are useful in low voltage, low currant applications. When you get into controlling high voltage/high currant applications you get into electro-mechanical latch circuits.
My solution to power control is a small circuit/PCB I designed that uses a microcontroller and a 6A high-side MOSFET load switch to control power to any 3.0-5.5VDC circuit. The microcontroller gives the circuit special abilities such as lag/crash detection when used with microcontroller or SBC (e.g., Raspberry Pi) based projects, automatic startup on power-on, automatic restart after crashing, delayed-start/restart, and soft-button power control (tap-on, tap-off, press/hold force-off). I have one of them controlling power to my 3D printer by switching AC mains to the printer's power supply via sold-state relay. It even has a locking USB type-A output connector that's wired to appear to a USB-connected device as a 2.5A charge port, which means it can be used to make custom chargers.
It's been a great little piece of gear, rock solid performance and super-easy to use, and I'd love to mass-produce them but I would have to make a hundred at a time to make the profit/cost ratio worth the time and effort.
Use a NAND latch for better performance, it doesn't need equal loading on the outputs to prevent it from 'sticking' to one state should it have a lower impedance.
Also, unless you used capacitive touch or some sensor - you needed a mechanical switch to make the button! And then another in the form of a relay...
Good old basics are always a pleasure. Thanks for reviewing them again.
I once found and used an interesting variation that solely used one momentary switch, one DPDT latching relay, and a couple of resistors, caps and diodes. Basically cross wiring the relay and using the cap voltage to provide the voltage spike to flip the relay over. It had issues if not switched in a long time as the caps slowly drained due to parasitics. But I thought it clever.
Your version though is cheaper and likely more relaible (and allows more current). I like it!!!
I love the way way you present your tutorials like a really good teacher. Thanks!
The disadvantage of latch circuits is that they draw small amounts of current which is not much of a problem until the battery goes dead and starts leaking. This is the reason I prefer on-off switches. If you have a battery powered device with a latching on-off switch and don't use it often, take the batteries out. there is less of a worry with a device that does not draw power until it is switched on causing battery leakage. I have a guitar pedal which does not draw power until a cable is plugged into it one day, I opened it up and noticed the battery expiration date was 5 years ago no leakage. I use energizer batteries. I still try to remember to remove batteries if I am not using them however, I do forget sometimes.
Another place the latch circuit would be handy is for machinery in the event of a power outage. If the power goes out, I don’t want my table saw to restart automatically when the power comes back up.
It would be nice to replace the mechanical switch with a latching circuit. More expensive saws have a magnetic switch that automatically shut off when the power dies.
Klasse,dass ich hier deutsch in den Kommentaren schreiben kann und der Great scott es immernoch versteht.
So does everyone else thanks to google translate.
@@mikebond6328 I know, but great Scott is from Germany, so am I, and he doesn’t has to use google translate.
Funny enough, when I fix up 80's Saab radios, the one model that has a latch circuit is the one that often won't power on until the circuit is recapped or power button repaired. The mechanical volume dial switch models just about always power up
I love one shot- latches, I make bank on service calls swapping them to a mechanical . Keep them coming.
Have a think about using TRIACs & SCRs as your switching elements. There is a latching function built in for DC & a very simple capacitor shunt bypass allows the SCR or TRIAC to switch off. These are often overlooked devices with impressive ratings for literally pennies...
I won’t mention it again, but I have a challenge for Great Scott! Build a video monitor camera system that sits under the workbench and tracks dropped items, with a laser pointer to show you where the tiny screw, resistor, or whatever you dropped actually ended up!
The savings in man/hours looking for the tiny item alone might save millions of hours! I have been known to drop the same item up to three times, and spend a half hour trying to find it. Amazing how far they can bounce and where they can end up.
Would be so cool to have it mounted under the workbench, and a laser pointer shows where it went (or as far as last point in space seen, in case it went out of sight.
I have a personal rule that if I don't find the dropped item within 10 seconds, it is lost to the abyss. Life is too short to be on my hands and knees looking for a 10 cent component. It also focuses my attention when handling expensive and/or limited supply components.
@@msmith2961 it’s a good philosophy. I find though often the tiny little item I dropped is the last one, or the only one. It’s either find it, or spend an hour finding a replacement, ordering it, and waiting for it.
@@shader26 it's guaranteed that it'll be found in the last place you look, so just start there 🙃
@@dubmob151 thanks, but I tried it and it ended up being the first place I would have looked.
@@shader26 😂
Without me even watching the rest of this video, I do have to agree that latch circuits have their place. However in the automotive industry they are widely over used and result in overengineered circuits that provide no extra benefit from their counterparts 20 years ago. On top of that with vehicle thefts on the rise, having something mechanical like an ignition cylinder is more important than ever. I know nothing I say here will have any impact. And I am not against latch circuits, or any electronic controls that go beyond a simple relay circuit. They have their place most definitely. I am just upset that the core of automotive design doesn't need over complicated circuits. It doesn't improve fuel efficiency. It doesn't lead to greater power gains. Worst of all it leads to vehicles being scrapped way before their time due to increased repair costs. Today Toyota considers the lifespan of a vehicle at 3 years. What happened to vehicles lasting 30+ years? Wouldn't that have a larger positive environmental impact? Of course companies will lose money based on their business models. Even EV vehicles are over the top with their engineering. This is proven with many small companies providing EV swaps into classic cars. The only complex electronics are the battery, electric motor, and the computer that drives all that. No different than fuel injection vehicles since the late 80s to early 2000s. After that it just became a nightmare of over engineering. Emissions were never improved. Perhaps some power gains but believe it or not those power gains come with enhanced emissions. The old school dyno emissions machines proved that until they were replaced with OBD2 emission tests, outside diesels. Sorry for the blah blah. I'm just trying to say there are so many ways a simple on/off switch, with relays if necessary, is probably the most viable and most easily repairable circuit that I know of.
Just to throw out an example, I would love to know the person that created the footwell module in some later BMWs. I mean, just why? Its software is prone to corruption from most high end scanners. Results in a very expensive repair from the dealer and actually has created a whole market for diy equpiment and specialists. And there is no work around unless you really rewire the harness and will still be left with a module unhappy shouting codes at you. And what does it control? Stuff like power windows and crap. I swear if someone explains to me how that is more efficient than just having either postive or ground control with relays and fuses over your power windows, power locks, and other silly stuff in your door, please, I'm all ears.
How the hell is a mechanical ignition cylinder supposed to provide security here? They're piss-easy to pick and you don't even have to do that, you can just connect the wires and off you go. But you can't do that nowadays, because when the key with a proper code isn't present, the ECM is disabled, and you ain't going nowhere. That's an electronic system that is an (almost) impenetrable barrier to theft, the mechanical bit is worth nothing. That's why cars have fobs instead of keys nowadays.
The electronic circuits in cars help save expensive raw materials like copper, and they save weight. For taillights you need a wire for position lights, one for brake lights, two for the indicators, one for reversing light and one for fog taillight. All of them must be thick enough to carry the current required without heating up or creating losses. All the switches - relays, brake switch, light switch and so on - must be beefy enough to make and break the connection, and they must be sturdy enough to do that over thousands of cycles. With an electronic system, theoretically, you just need a power supply wire and a bus wire, and send signals (CAN bus, say), to the rear lamp clusters and they use a couple of Mosfets to switch the lamp required on. That's a lot of copper, lots of weight, lots of mechanical switches, and, above all, lots of money saved, and unless you design the electronics stupidly, it will never fail.
@@horrovac Mechanical cylinder provides a mechanical steering column lock, which takes more skill and time to break, depending on the design. Picking a lock with a laser cut design is not easy. Most likely you'd have to smash the column open. Not saying its impossible but louder and more time consuming than just programming a fob the way current car thefts are being done. Not to mention the key with a mechanical lock also usually has programming that needs to be detected. So now you have much more protection than a simple electronic system where once you get the fob programmed, it takes car of the steering column lock since its electronic, push start means no cylinder needs to be destroyed, and away you go.
That electronic barrier you speak of is actually quite easy to get through. There are numerous scanners you can pick up that do key programming. If you have access to dealership info and equipment its even easier. A lot of illegal type of equipment that works flawlessly is available for purchase. These are all the reasons car thefts are happening in such numbers today.
Now with the wiring, I'm not sure how you think the computer instead of a relay and switch is getting the power to the lights? The computer is just bypassing what the relays used to do. You still need to run wiring regardless. And the wiring needs to be thick enough for whatever the load requires. Most manufacturers switched to aluminum wires awhile ago anyways. A lot of wiring now is too thin actually causing issues and needing repairs which require thicker copper wiring to be spliced in if you want the repair to last. And if you want a completely computerized relay system, the board and components must be hefty enough to take the load. Look at the infamous Chrysler/Dodge integrated power module. Piece of a junk. I rewire these for people regularly leading to the thing looking like a christmas tree. It fails. Often. And instead of just replacing one silly relay, the proper dealer approved repair is to replace the damn thing which is 1000 bucks plus.
So you are actually losing money since the average joe doesn't know how to repair the computerized controllers, and the specialists that do charge quite a bit. Even then there is no guarantee of a repair. Depends on the damage. But having just a basic body control module and engine control module with relays as support is the best most cost effective way that allows for quick inexpensive repairs since every system is isolated. In the event a relay box is burned, you can still either buy a box which is cheaper than power modules, or just rewire the thing. I mean seriously, where is the extra weight? Have you held the stupid BMW footwell module in your hand and held an interior Ford relay/fuse box in the other? Tell me which is heavier and which has the thicker wiring harness?
@@Membreins AFAIK the thieves just break the steering column lock by turning the steering wheel with a lot of force. But I'm not a car thief, so I won't claim any knowledge on that.
The electronic barrier I'm talking about is not the car remote lock. Those can be defeated by replay attacks in some cases (but not if designed properly). The code I'm talking about is on the key itself and is not transmitted via radio. You can't scan that. Programming a new key on-the-spot is *way* above the paygrade of a typical thief. At least here in central Europe, car theft is a non-issue. Apparently there is significant car theft in the UK, but those are break-in thefts - that is, they break into the front door of your house and get the key, or fish the key out through the letterbox.
Having one power bus wire instead of many different ones is more economical, whatever the material used. The example with the light clusters is just that - an example that should be easy to comprehend. But in modern cars there is waay more stuff than that, and the wire harnesses are already getting out of hand. Electronics is dirt cheap, way cheaper than mechanical switches or relays or copper, and much more reliable. So instead of wiring every bit of electronics front to back and top to bottom, having a common power bus and a signal bus that transmits commands or feedback is just common sense. I know that it's not the case yet, but you could really supply the whole car with just a couple of wires.
Sure, you could build a car that the "average Joe" could repair - but then everyone, including Joe, would just throw it away when it's broke and buy a new car. People are not interested in doing that. They either get it fixed or exchange it. What they are interested in are gadgets - sensors every which way, cameras, motorised everything, heated this and that, soft-touch controls instead of ker-chunk switches, or touchscreens and automatic controls, and chimes instead of clicking of relays. So yeah, you could build an all-mechanical switch and wiring car, but good luck selling it to anyone. You're talking about something that offers nothing to almost every car buyer, and just a fringe benefit for a couple of weirdos like you.
There is nothing unreliable about electronics. It can last forever and usually does, when designed correctly. Have a look at the ECUs which almost never fail, or the fly-by-wire systems in modern aircraft. I'd much prefer solid state electronics instead of contactors and relays and switches. I had a lot of those go wrong on me. Sure, you can also screw it up, and manufacturers like Mercedes and BMW are likely offenders when it comes to electronics overengineering and failures, but solid state electronics is a huge boon.
@@horrovac You're wrong about steering locks but you are right about the fact that the moronic consumer is driving auto manufacturers towards marketing gadgets to people and delivering a low-quality car attached. But you're wrong, at least in North America, there are still people with knowledge and skill to maintain a vehicle, build a house, make a gun. That's why there is a strong market for older (pre-2008-ish) vehicles here.
I am a mechanic, solid-state ECU's of all types. brands and functions fail all the time. The problem is for consumers, replacing a $1200 body control module so you can open your trunk, is not worth the savings using less copper reduced the vehicle's sales price. Only the manufacturer benefits.
Don't call people weirdo, weirdo
@@horrovac Modern keyless entry and start vehicles are susceptible to relay (range extension) attacks. Was not a problem before because keys would not transmit anything without pressing a button. Engine immobiliser transponders were very short ranged, only a couple of cm, which made it highly unlikely that you could walk up to someone and read the key from their pocket. To allow button starts without having to take your key out of the pocket the range had to be extended, thus making it vulnerable. A man with a briefcase walks past you in a supermarket, another man with a similar briefcase is near you car, and they can easily steal it. Manufacturers are introducing motion sensors into keys to prevent them being read while sitting on a table, but that is just a band aid to the problem.
I never comment on your stuff because i know so little. However I actually prefer mechanical switches. Just that feeling you know. Way more satisfying.
Replacing 1 simple component by multiple other components may result in: more expensive, more complicated, more points of failure, more space requirements and more assembly costs. There better be enough benefits to make this idea valuable.
A few years ago I bought a nice lit switch for my bench power supply (based on an old ATX PSU). Turned out it was a momentary button, while the PSU needed a latching switch. So instead of buying another switch (it wasn't a cheap switch) I built a latching circuit like the one you are using. I additionally put in an opto-isolator between the circuit and the PSU though.
Audio equipment for use in loud environments benefit from the obvious tactile feedback of toggle switches. Also, any system can easily telegraph it’s state if that state is displayed by switch positions. Hidden latches provide no such information.
I studied electronics repair in the 1980's after I left active duty and quickly realized the KISS principle, Keep It Simple Stupid, really applies in electronics design. Keeping it simple allows the device to brakedown less and when it does it is easier to repair and get back to the customer.
Simple circuit explained in a simple way. Great work!
Glad you liked it!
Totally Off Position Switch (tops) is preferred as there is no energy drain. If I could do that with my remote control devices, I would. The batteries would last longer. There's nothing more comforting in knowing that when something is turned off, that indeed it is off.
Obviously there are things that turn on with the push of a button, and the same action turns it off.
One of the biggest advantages I haven’t seen many mention is the fact that you can use this circuit to control power with a microcontroller. It is very low power consumption during standby then you can have something like a motion sensor wake the circuit up. When the microcontroller does it’s thing it just pulls the pin down to turn itself off. This circuit is invaluable on battery powered electronics.
How is the Microcontroller shutting itself off at 9:45? I assumed that when the SET pin was triggered by the IR sensor, it just cut power to the Microcontroller. How can the Microcontroller send the RESET pulse, if it's receiving no power. Apologies if I've misunderstood that part of the circuit
A latched circuit like this would've been useful a few years ago (shortly before a crash I had, lol) for a piece of test equipment I were working on.
I were looking around for one to make that I can then control with a micro-controller to turn itself off when finished to conserve battery for use in the field... I had to make do with another workaround tho.
SR flipflops in integrated circuit form have been around since the 1970's....
@@deang5622 Yes, I know.... I'm on about this more simplified one-button on/off mechanism.
BTW, I ended up using a clocked S/R flipflop IC in the end anyway and then just used the MCU to turn off the supply by resetting the flipflop.
That meant the device stayed on until a delay and the person couldn't just manually turn off the test equipment.
I have the most fun with a latch made with an OR Gate an AND gate and Inverter combo latch since there are no disallowed states along with its simplicity . Without crosscoupled wires to confuse me as to witch output is energized first. One OR gate input is the latch input. The OR Gate output is connected to one AND Gate input and the other AND Gate input is connected to the Inverter output. The AND Gate output is connected to the other OR Gate input and is also the output of the Latch. The Inverter input is the reset input of the latch. Some times I need a pull down resistor connected from the feedback wire to ground . Maybe 5 kohms.
Be sure to have an R/C across triac type switches that operate anything that would incur a counter emf like a solenoid with a collapsing flux field. The induced voltage from the collapsing flux field will fry the semiconductor type switch.
I love latch circuits. Very excited to see this video.
I remember building these from 7400series chips, way back in the 90s.
I can see controlling a large current with indirect means such as this. And things that cannot tolerate switch bounce or deterioration of the contacts. But for any project I will build, a regular switch is cheap simple and easy KISS. I had a joke about how they might convert the standard wall switch to a microcontroller based complicated unit at high cost for those that love tech regardless of need.
this is what i was looking for 😋 recently i started building an amplifier for my gf and i wanted to build a latch switch in ... instead of mechanical push/latch button .. I found schematics using 555 timer , transistor and rellay , circuit was quite simple , but this is even simpler :) .. and since it involves mosfet, it basically draws miniscule current in comparison to rellay version.. definitely going with this design next time ! many thanx 🙏🏻
I made a similar system for an automatic water refill for a salt water aquarium. Worked very well.
The problem of electronic switches like shown in the video is that it has no "memory" to remember its state. When there is a power problem/dip for a short period of time, it turns the device off and it will stay off until you press the button again. Not very suitable for devices that needs to stay on.
actually one big advantage of the normal switch is that there is no standby current and connection ofc is broken meaning if you had a fault situation that could fry your devices they are a bit safer.
Latch circuit does also not draw any current.
@@greatscottlab There's leakage currents through the transistors. The IRF5210 datasheet specifies a maximum 25uA of drain to source leakage current at -100Vds at 0Vgs. A microcontroller shutoff would be asked to switch about 5V, so we can guess maybe 1uA of leakage at -5Vds.
If the output is low impedance, then that would be all. If the output is high impedance, however (e.g. disconnected), then the leakage current would charge up the bases of Q2 and Q3. Worst-case, the transistors are mismatched and 1uA flows through the base of Q2, which is amplified by a typical factor of 200 to 200uA of emitter-base current. That _would_ draw the gate voltage of Q1 down by 200uA*100kOhm=20V, but that would be strong enough to turn Q1 on hard, latching the circuit on. (Sanity check: 1uA flowing through the 100K R2 would be consistent with a base voltage of 4.9V, more than enough to drive current through Q2 to turn Q1 on.)
The real equilibrium would depend on the small-VGS behaviour of the IRF5210, but the datasheet doesn't have enough information there. I would be comfortable calling 1uA of standby current a plausible value, with a risk of the circuit self-latching on if the output is disconnected. (If instead Q3 turns on first, the circuit might not latch but now Q3 amplifies the base current, drawing more 'standby' current through R3.)
I'd need to simulate it to be sure, but I suspect you could avoid the risk of self-latching if you add a diode ahead of the Q2 base; that would force stray voltage in the latch to find its way to ground via Q3.
He really left the "qwiss question" in. Love it.
Other than the fact you need an additional power IC to power the latch circuit and a isolated driver to drive the interface switch (which is short on supply). Beside that, great video.
I have single button power control circuit with ICs in my home build stereo, by now, it's working more than 20 years.. MCU can control it too from remote and there is independent indication part.. If power supply fails at starting, LED will blink continuously.. At normal situations, it never fails..
Circuit is different from simple ones and it is with protection from bouncing contacts.. 😉
Incredible good + useful Electronics Basics tutorial!! I would love to see more of those in the future!
Mechanical Switches will never be obsolete. good luck making a 240vAC 32amp electronic switch
A clicky pen is a good latching machine, whose mechanism can be used to design Motor Contactors.
Online, there are many different circuits just like this one, with identical functionality. But nobody compares them and has the pros/cons next to each other.
Mechanical switches are so nice and simple and rely on nothing but a physical connection . I work in automation and I see anything else fail on any given day . Plc’s get stuck on on out puts inputs break .. but a mechanical switch lasts almost forever
Yes, theres also the problem with current draw using electronic switching
Only small downside to a latching circuit is the lack of inherent feedback that your circuit is on, but you can add a feedback LED on the output to somewhat overcome this.
At least with a switch you can tell in what state it is at first glance.
for my latch circuits I just use a D-type Flip-Flop with the switch going into the clock input, and !Q connected to D, S & R grounded, and Q as your output.
I like a mechanical switch, i mostly modify cars and when the switch in the dash is set up to be momentary with a circuit keeping it on (ac button for example) it becomes not as simple to just unplug the connector from the back and run other wires to it for use elsewhere as the body controller does the switching so the dashboard button becomes momentary as soon as you unplug it from the loom and sometimes theres not alot of space to build a whole setup neatly in there, on older cars changing the "useless" buttons like ac and rear window defogger to do other functions like a high boost button or to trigger a relay to turn an oil cooler fan on were easy, and easy to undo if you wished to undo the modification later, but its not so easy with more modern cars. I usually end up de soldering the switch and soldering in a mechanical one, but then it requires more work to undo it later.
Simple but powerful idea⚡😃 This will never wear out and last long
True ;-)
5:37 ElectroBoom must be so proud 😆
I have used more 7476 flip-flops than I can imagine throughout my life. I could draw the connections to use them in toggle mode in my sleep. I always thought one of the big companies should have created a small 4 pin device (power, ground, input, output) with a decent current handling capability and a wide operational (both trigger and switched) voltage. I'm sure that company could have made a whole lot of money throughout the 70s, 80s and 90s when I designed and built a lot of my own circuits.
I've always wanted light switches that latch, but had no idea they exist! I have a bunch of lights that are controlled by multiple switches, and I'd prefer latching behavior. Time to change them out!
Go for it ;-)
The lights in our office are on an "intelligent" latching switch. It's such an enormous pain in the ass... to have a switch that simply could be put in either of two positions would be so much more practical, lol.
4:09 i prefer use Q~ feedback to A and the trigger to clock in a flop flop D
Just remember use a pull-doun resistor to make always starts Q=off
if you wana always start on, just change -feedback/output- Q to Q~
a TIP41 to 12Vdc charges, or a SCR to 120 Vac and have fun
I like that latching relay in your consumer unit, wish they were more common here in the UK, would certainly make smart home stuff simpler than having to install separate modules to each lighting circuit in the house each with their own nuances.
A dil twin coil latching relay can do all you have described with far les components including isolation from a high voltages.
I also like the latch because of its debouncing function! Cool video!
Great thought but I use mechanical flip toggle switches in my business because I have confinement issues. Look at the size difference! Otherwise great idea!
Thanks, interesting video. I use a latch circuit in a ESP8266 doorbell using a P and N channel MOSFET, very small IC's exist that have both included, like the Si4599
I can't find the part you're describing. Any chance you could post a link or some more info? Something like that is exactly what I need cluttering my parts bin waiting for a future project.
@@swiz747 I tried posting a link but my comment was deleted. I've corrected the part number, it's Si4599
@@wjn777 perfect, thank you! I managed to find the part but unfortunately I can't find any in stock. I'll have to find similar parts but this gave me a great start, thanks again!
@@swiz747 You can also try IRF7317