EEVblog #262 - World's Simplest Soft Latching Power Switch Circuit

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi the humble toggle switch you've seen him you've used and when your projects to switch your projects off and on and it seems pretty obvious when you design a product well I need to switch the power off and on you use a toggle switch but when you're going into production it's not always the best idea I thought would take a look at it I think you might find it rather interesting no take my power supply project for example I've got to switch the power to this thing off and on and it can be drawn in a couple of amps so your switch has to be rated for that and of course it's got to be a latching type switch like this now these switches are great this simple they work there Izzy you've used them before but are they the most economical solution not really because one off these things are 2 3 I don't know even 5 bucks for you know even a reasonable quality switch that can handle your switching current for your particular project or even if they're low current ones get any ones that actually latch like that instead of the momentary push-button ones that you might be using on your product or you've seen on other commercial products they're much cheaper than these latching types so when you go into volume production even from the one in China you gotta be struggling to pick these things up for under a buck or something like that now a dollar I can buy you a hell of a lot of circuitry can buy your microcontroller a whole bunch of passives and all sorts of active components and stuff like that so really is the mechanical to latch toggle switch the best way to go if you try and get the cost down your product not really so today are we gonna try and design a soft latching power circuit sounds simple enough but let's see if we can do it and one of the first things you start out with with any design like this what are the requirements let's take a look at them we've got zero power went off we don't want the circuit to draw any power when it switches off just like a regular toggle switch we want the one switch to do the on/off function no separate on and off button one switch you wanna lower the cost simple just like on regular commercial products three standalone we don't want the microcontroller in our system to actually have to switch the thing off or do any control or things like that sometimes that's actually desirable but in this case I don't want that I want completely standalone number four we wanted to use jellybean parts only we don't want to use specific or dedicated chips hard-to-get part so we're talking basic transistors resistors caps diodes that sort of stuff only and we want it to have a minimal number of parts cuz we want to be elegant don't we always now if we just ignore our requirements for a second look at the basic application of this for just a separate on/off switch how can you do that well I've got our input here and our output power here and we have a pass transistor in this case it's a p-channel bipolar but you can use a MOSFET as well which we'll do in our final one and if an election transistor down the bottom now if you have a look at the first case when you initially power this circuit up this transistor is not going to be on because there's no base current flowing through here it's like that chicken and egg kind of situation if there's no base current this for them to be base current flowing through here like this to turn this transistor on this transistor down here needs to be switched on first and of course it's not so you have the on switch here when you turn on the on switch current flows down through there like that and switches on that transistor and then the voltage and what the current flows through here and then it's can then switch on this transistor down here like this which then latches it so you only have to press that on switch very briefly and that will latch eclis because it's in parallel with this switch it'll keep us which turned on keep this transistor turned on and bingo you've latched you power on simple and how do you turn it off well you just turn off this transistor down here by shorting its base to ground that'll switch it off this gets no base carrot nothing goes through the story so that's how you can use that's a basic circuit for switching on and off but we don't want to switches and we want we want to use one switch so it's a bit more complicated so what we're gonna do for starters is to replace our bipolar transistor with a p-channel MOSFET works exactly the same except it's got low on resistance they're just nice are more readily available so we're gonna use a MOSFET be you could still use a bipolar transistor if you really wanted to and because it's a MOSFET we you know you don't want the gate here flapping in the breeze around like that bad idea so we're just going to tie it to the input here so it just keeps the gate of the transistor stable when it's switched off and we've got our same NPN bipolar transistor down here and it works exactly the same it matches the same way we can put out on switch across here and our off switch across here but the one switch to toggle off and on we're gonna add some extra stuff over here we'll start out with a basic understanding of what we want this one toggle switch to do and I've just diagrammatically drawn it as two separate switches here just for starters if we've got our on switch the the base of this transistor we need to switch this transistor on somehow so you've ever pull-up resistor back to the input here so the input voltage is always there when you hit this switch you want it's transistor to turn on the latch thing will happen and everything's sweet and then you want this same node because effectively these two nodes here you want to them to switch between one and the other or toggle between one and the other so when the so when the circuit the soft latch circuit is off you want this point here in your circuit to be if our switches on this base here we want it to be high to the input and then once this thing switches on we want this thing to go low like this so that then we can short out the base to ground switch it off how are we gonna do it so what I've done here is I've left our imagine green circuit there in place and I've drawn in the new real black circuit here to replace these two switches with this one switch and it's doing exactly the same thing I said before when this past transistor is off the circuits off and you want to switch it on you want this one switch to act as the on switch here's this resistor up here pulled high to the input like that so if the circuits off and you want to switch it on by pressing the button then current will flow through this resistor through the switch through the base of this transistor latching it on and Bob's your uncle and then what happens is this let this transistor down here will switch on and then pull this point here to ground so now you can see that that's what we wanted before we wanted this point to toggle from high to low when it switched on and that's exactly what it's gonna do toggle from high to low and then I'm assuming it's circuits been working for a while it's been switched on and this you want to use the same button to switch it off then this is pulled to ground this point here is effectively grounded like that so when you press it it shorts out the base and switches the whole thing off bingo you've got some basic on/off functionality with a single switch love it but I know it you're saying dave says analog circuitry operates really really fast and a button press is really really slow because it's human well unless you're a superhero yeah if you press you're gonna hold down effectively hold down this button ignoring switch bounce and things like that you're gonna hold it down for 100 milliseconds quarter of a second something like that even if you press it really quick so this thing is actually gonna oscillate off and on off and on off and on you don't want that we're gonna have to slow it down how can we do that easy edie the capacitor in he to ground should do the trick so let's take a closer look at that I have taken out the imaginary green stuff and this is our real final circuit but I think's gonna do the trick it should do in theory now it works exactly the same as before when you push this switch if the circuits off this transistor is off push you push this switch it switches this base current on latches this and you supply power to your circuit and now this capacitor here starts out at zero and it starts to charge up in voltage based on the RC time constant plus the base current flows through there because this is a this is an NPN bipolar transistor there's going to be some base current flowing in there as well but anyway that will charge that capacitor up so it won't immediately switch back off because this point will still be high it'll still be high for I don't know and depending on the RC time constant you might point naught point five seconds or something like that that you want this point to be high and then once it reaches a threshold voltage of the transistor it will switch the transistor on and pull that to ground and if you're still holding down that switch after this transistor switches on well it's going to oscillate exactly like before but assuming you can push it quicker than half a second or a second whatever your time constant is then this transistor will be fully on and then this the functionality of this switch changes from an on button to an off button I love it so I've got to put some real values in any 100k pull up how many K pull up for the base here it's relatively high but stick with me and we've got a hundred K here and we've got a 1 me and a 22 Mike he should roughly do the trick I think we need to build this up but I think the circuit because we're using bjts here it could be a bit critical in terms of getting the ratio between because this value needs to be high unless you've got a massive cap here you've only got a little very small amount of base current this resistor has behind there's gotta be a balance between these values so could be a little bit tricky unless you went to MOSFETs but I'm gonna try and build this up with bjts and a MOSFET pass transistor up here see how it go breadboard time and here's my circuit buildup on the breadboard for my MOSFET here I've got an IRF nine double one oh that won't be the final one I use in my circuit but that's what I had to hand so I'm going to use one of those basically I want this to operate from a very low voltage a single lithium-ion ourselves so 4.2 volts maximum down to three volts or something like that so you really need to pick a MOSFET with a very lower vgs that has a particular on the maximum on resistance you want for a certain low vgs voltage so you can't just use any one off the shelf if you're picking like a if you need a low voltage supply like we're using for my power supply for example and I'm just using that transistors o2 n3 3904 bog-standard stuff I've using a forty seven my cut cap I didn't have a twenty two two hand so let's give it a go let's switch this thing on and bingo there it is it automatically switches on and I press the button and it switches off press the button switches on to easy and that works a treat and if I hold it down it should oscillate just like we said at the frequency set by that RC time constant so let me actually replace that 22 that 47 sorry with say a 10 Mike and let's see what happens there we go there we go it's oscillating much quicker and now it's going to be still works but it's gonna be a little bit touchy I there you go so yeah that's a higher value it's going to do the trick there now you'll note that I've actually got no load on this thing so this is assuming a circuit with absolutely zero load and by the way I was operating that at 4 volts there so let's wind the week down and see how low it will go with this particular MOSFET so there we go we're at 3 volts so we'll power that on and try it at 3 volts it switches on and it switches off it requires hold down the switch for a bit longer that's the thing it'll miss if I press that off button really quick it'll actually miss that I need to hold it down for a bit more for a bit longer than I do to switch it on I can do a really quick on but I can't do a quick off there you go you could actually call that a feature and let's have a look at the output voltage on the scope here that's 500 millivolts per division so we're getting our 3 volts out there or just under and if we switch it off it look the output voltage doesn't actually go to ground it's at 500 millivolts now I'm measuring the output with the meter there and you'll notice that it's dropping so that is the capacitor are charged up to the base emitter voltage of the transistor that it's on and then it's discharging through the extra resistors there so that will actually eventually get down to ground that's because there is no load and of course that makes perfect sense because when you switch this off this capacitor is charged up to the base emitter voltage up here so the only plate when this transit when you press the button and you actually switch this transistor off here the voltage up here goes to you know it switches off so it's got a discharge through these resistors here and that's what's causing it to stay on but you'll find that if we stick a load on here and say 10 K or something like that it should just vanish and go to zero instantly but that's the disadvantage of this circuit with no load or a very light load and we'll try that again with our 10 K load let's switch it on and switch it off bang right down to zero no problems let's set our trigger point in the middle there and capture that switching off to see the switches off cleanly yep not a problem whatsoever and we might as well capture that switching on as well so let's go bang there it is no problems at all and one small note just remember these MOSFETs have a built-in parasitic reverse diode like that in case that matters in your circuit if you remember one of our requirements for the circuit was that it actually takes zero power when it's off does it yep it does there we go it's eventually going to go down to practically zero micro amps there you go it draws now for half Abby's dick so there you have it I think that's probably the simplest discrete stand-alone software our switch you could possibly do I could be wrong but I'm gonna claim that dammit why not uses all jellybean parts to NPN transistors it doesn't use NPN and PNP like some of the other solutions I've seen the best solution I've seen before this is a three transistor one plus the MOSFET as well and well it seems to work reasonably well there are other solutions I'm sure but I rather like this one it's kind of neat we could probably do it differently using MOSFETs if we wanted to but I'm using bipolar transistors here and this is a standalone one there are other ways you can do these sort of things where you can switch them off using a micro controller like if you've got an automated if you want your software to be able to switch off the unit to go into power-save mode after a certain amount of time well that's a different thing again but this is just a standalone circuit using one very low cost momentary push-button switch and I love it is that the simplest solution possible well I don't know I think it's pretty dang close if you know uh something better jump on the forum and and share your thoughts and if you like the video give it a thumbs up and in this video I won't bother experimenting with values and stuff like that just to show you which parts are critical and non-critical and how they interact I'll leave that one up to you get the breadboard out play around and for those who hate me tapping on the white board just for you catch you next time you
Info
Channel: EEVblog
Views: 460,880
Rating: undefined out of 5
Keywords: soft, latch, latching, power, switch, circuit, schematic, mosfet, transistor, npn, pnp, n-channel, p-channel, toggle, idea, concept, momentary, tact, tactile, push, button, resistor, capacitor, theory, explanation
Id: Foc9R0dC2iI
Channel Id: undefined
Length: 17min 43sec (1063 seconds)
Published: Thu Mar 29 2012
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.