**Understanding Latch Circuits: A Comprehensive Guide**
As we explore the world of electronics, it's essential to grasp the concept of latch circuits. In this article, we'll delve into the details of these digital logic circuits, exploring their functionality, applications, and examples.
**What is a Latch Circuit?**
A latch circuit is a type of digital logic circuit that stores a signal or state until it's altered by an external input. It's like a mechanical switch that can be turned on and off repeatedly without losing its memory. In electronics, a latch circuit typically consists of a few simple components, such as transistors, diodes, and capacitors.
**Types of Latch Circuits**
There are several types of latch circuits, including the 1-input latch, set-and-reset latch, and toggle latch. Each type has its own unique characteristics and applications.
* **1-Input Latch:** This type of latch circuit uses a single input to store a signal or state. It's often used in simple digital logic circuits, such as switches and counters.
* **Set-and-Reset Latch:** This type of latch circuit uses two inputs: one to set the output high and another to reset it low. It's commonly used in more complex digital logic circuits, such as microcontrollers and memory devices.
**Examples of Latch Circuits**
Latch circuits have numerous applications in electronics, including:
* **Microcontrollers:** A set-and-reset latch is often used in microcontrollers to automatically turn off when a certain condition is met.
* **Overcurrent Protection:** A latch circuit can be used in overcurrent protection circuits to disconnect the power supply when an excessive current flows through a device.
* **Distance Sensors:** A 1-input latch can be used in distance sensors to store the state of the sensor and indicate whether an object is close or far away.
**Building a Latch Circuit**
If you're interested in building your own latch circuit, it's relatively simple to do so. You'll need a few basic components, such as transistors, diodes, and capacitors. With some patience and practice, you can build a functional latch circuit that meets your specific needs.
**Conclusion**
Latch circuits are an essential part of digital logic electronics. By understanding the basics of these circuits, you can create more complex digital logic systems that meet your specific requirements. Whether it's for microcontrollers, overcurrent protection, or distance sensors, latch circuits have numerous applications in electronics. With this guide, you'll be well on your way to mastering the art of latch circuit design and implementation.
WEBVTTKind: captionsLanguage: enHere is a quiz question: What do you thinkhas the lighting in my corridor, this powerbutton of a power supply and my DIY overcurrentprotection circuit all have in common?If you guessed that they all come with a Latchcircuit then you are absolutely right.In a nutshell a latch circuit is a circuitthat turns on or off a switching element andkeeps it in that state depending on a setand reset signal on the input that only requiresa small voltage pulse to trigger.Now you might be thinking what is wrong withusing the classic mechanical toggle switchwhich also often gets utilized for lightingin a room or as power switches in devices.Well; in such cases there is a bit of a proand contra situation about which I will talkabout later.But I can tell you for sure that there areplenty of electronics circuits out there forwhich latch circuits are mandatory like myovercurrent protection circuit here that withoutthe latch would just turn on and off rapidly.There are tons of other examples as well likefor example a self deactivating microcontrollerthat therefore draws absolutely no currentmost of the time.I think you get the idea why I am so excitedabout latch circuits and in this video I willtell you all you need to know about them sothat you will have no problem understandingthem and building them.Let's get started!This video is sponsored by Skillshare whichis an online learning community with thousandsof useful classes that you can use to levelup your Skills.No matter if you want to deepen your electronicsknowledge, learn a new skill like video editingor simply want to get edutained; Skillsharemost definitely got a fitting class for you.And that is also pretty much why I joinedin the first place, because there is alwayssomething new to discover and learn.And today I want to recommend to you the class“Master Digital Electronics – Logic Gatesand Boolean Algebra” by Ajatshatru Mishra;which is a great addition to the digital electronicssegment I will cover in today's video.So what are you waiting for?The first 1000 people to use the link in thedescription will get a 1 month free trialof Skillshare.First off let's start super basic withouteven creating our own transistor circuit.For that let's use this 74LS279 SR Latch IC.As you probably already guessed the SR standsfor set and reset which are always the inputsof such an IC.The output is usually labeled Q and sometimesyou got a second output which is just theinverted normal output.So by applying a 1 to the set input aka ahigh voltage, the output shots up to 1 aswell and latches in that state even when theset input goes back to 0.But as soon as reset shoots up to 1, the outputsobviously gets reset and returns back to 0.As a practical example I built this circuitup on a breadboard according to this rathersimple schematic and as you can see the setpush button turns the output on and latchesit in that state and the reset push buttonturns it back off just like you would expectit.It works this way because such SR Latchesin its simplest form only consist of two NORgates connected together like this.Such a gate along with others like AND, OR,NOT, and so on are so called Logic Gates.Their inputs and outputs act according toa truth table like for example with an ORgate the output will always be a 1 unlessboth inputs are off which I think is prettyself explanatory because it is called an ORgate.But a NOR gate however is a bit more complicatedbecause it combines an OR gate with a NOTgate meaning the original outputs of the ORgate get inverted and thus we only get a 1on the output when both inputs are a 0.And like I said before if we connect two NORgates together and call one input Reset andthe other Set; then we could go through thedifferent input states and find out that thisarrangement acts just like an SR Latch wehad a look at before because it is one.To practically prove that I even wired upa NOR gate IC like I just described it andas you can see by using two push buttons weonce again reached the functionality of aLatch circuit.Now using such dedicated ICs, which also includesthe world famous 555 timer that also comeswith an integrated SR Latch; is all fun andgood and pretty educational but honestly speakingvery few people do that.The reason is that you can pretty much buildthe same digital logic circuit with just ahandful of transistors, resistors and capacitorswhich not only cost little to nothing in comparisonto the ICs, but they also come with highercurrent capabilities and you can easily addextra features.So let's try that by firstly recreating thetoggle on/off functionality of the Stromstoßrelaisor latching relay as you would say in Englishthat is used in my corridor for the lights.For that I got myself an extra one which afterwiring it up for a test, can also easily turnon and off a light through the help of onepush button input.So let's have a look inside in order to understandhow it works and maybe copy some ideas.The only problem was that I quickly realizedthat this latching relay purely works mechanicallyby repeatedly closing an iron core throughwhich a spring is forced through an asymmetricalpath to create the two switching positions.Super clever design when you think about itbut not really an electronics solution forpower switches in devices that can also toggleon and off.But as it turns out such a circuit is notreally hard to build by yourself on a breadboardas long as you understand that a P-ChannelMOSFET is off when its gate voltage is highand on when its gate voltage is low, thatNPN BJTs are on if sufficient base currentis flowing though them and that capacitorssimply take a bit of time to charge up ordischarge.And with those fundamentals in mind I presentto you the schematic of this latch circuitwhich is pretty easy to understand.The MOSFET here is used to connect the loadat the end to the supply voltage but normallythe MOSFET gate is tied to the supply voltageas well; so the MOSFET is off.Only when a push button is pushed, the leftBJT activates in order to pull the gate ofthe MOSFET to GND and thus activate it.At this point the load turns on and the leftBJT latches on because it is now also connectedto the supply voltage.Only problem is that the right BJT is nowalso active which without this capacitor herewould immediately pull the base of the leftBJT to GND and thus turn it off.But since we got the extra capacitor herewhich got charged up before, it firstly dischargesitself through the right BJT before pullingthe left BJT to GND and thus we got enoughtime to release the push button.Next time we press it though the left BJTtruly gets pulled to GND, the load turns offand the crucial capacitor can once again chargeup to later repeat this process.Pretty simple and smart concept when you thinkabout it and as you can see it works perfectlyfine on the breadboard; which is why I invested30 minutes to build an even nicer lookingversion of it on a piece of perfboard.Now at this point I want to finally revealthe secret why you sometimes would want touse such a circuit instead of a simple toggleswitch.And the reason is simply that toggle switchesare normally more expensive than semiconductorswitches.This difference of course becomes more apparentwhen you go into the high current switchingsegment.Also when looking back at the latching relayexample then it is easy to understand thatwiring up three or more switches on one longcorridor to one lamp requires way more cablelength and thus money in comparison to justusing one additional relay.And that basically concludes the 1 input latchcircuit but what about a set and reset latchthat I is not only inside my overcurrent protectioncircuit but can also be used for a microcontrollerto automatically turn off completely.Well, for that we can use a pretty similarcircuit which is even a bit simpler than before.One Set Pulse turns on the left BJT whichthen turns on the MOSFET which then holdsthe BJT open.And the Reset Pulse then basically activatesthe right BJT which pulls the left one lowand thus deactivates everything.And as you can see with my distance sensorthat provides the Set Pulse and my microcontrollerfor the Reset pulse; the microcontroller keepsdoing its job when nothing is close but thenturns itself off when something gets close.Now of course my DIY overcurrent circuit doesnot work in that exact same way because itis including relay contacts for the latching.But you should now be able to understand howit works after having a closer look at itand that was basically the whole point ofthis video.Since there exist dozens of variations ofthis latch circuit which are more or lessall just digital logic which you should nowbe able to understand a bit better.If I helped with that then consider supportingme through Patreon.As always don't forget to like, share, subscribeand hit the notification bell.Stay creative and I will see you next time.