eev blog 262 - Page 1
Forum section: electronics / general

author: bruce273
author_rank: Contributor
timestamp: March 29, 2012, 10:57:52 pm
content: suggestion - Is a d flip flop not simpler. perhaps a schmitt trigger for debounce. all easy to get 74 series logic. or will it use more power?

author: Psi
author_rank: Super Contributor
timestamp: March 30, 2012, 12:16:17 am
content: An IC would likely be more expensive. It also wouldn't be very elegant.

author: EEVblog
author_rank: Unknown
timestamp: March 30, 2012, 01:10:17 am
content: The whole idea is using passive parts you will likely have elsewhere in your design.And yes, a chip is likely more expensive, even if it is jellybean.There is in fact an even simpler refinement to my circuit, and it's blindingly obvious with a bit more thought about how my circuit works, I don't know why it didn't occur to me yesterday while filming.Let's see if someone can come up with it...Dave.

author: johnnyfp
author_rank: Frequent Contributor
timestamp: March 30, 2012, 03:42:29 am
content: A Thyristor in a Forced Commutation circuit?

author: electronic_eel
author_rank: Regular Contributor
timestamp: March 30, 2012, 04:45:11 am
content: Good idea to save money on the switch.I think some users will have a problem with the oscillating when they keep pressing the button. Think elderly people or a device which does need some time to boot up. Most users will keep pressing until they see some reaction.Do you have some links to circuits which don't do this, but otherwise are simple too?

author: amspire
author_rank: Super Contributor
timestamp: March 30, 2012, 05:14:15 am
content: Dave, you set a challenge for us to find something simpler.OK, here is my attempt. One transistor, one FET, one capacitor and four resistors.I tested it is LTSpice, so that's the reason for the weird switch circuit.I also added a load as there is one problem with this kind of switch. If the load has filter caps across the supply usually. Those capacitors take a time to discharge. If I increase the load capacitor from 10uF to 100uF, the circuit will not switch off, as at there is enough voltage from the load to turn the circuit back on. I think your circuit has the same problem.So to make this work, you have to find the worse case decay time of the load, and adjust C1 to suit.This circuit does not oscillate. If does not matter how long you press the button for.Richard.

author: EEVblog
author_rank: Unknown
timestamp: March 30, 2012, 05:32:30 am
content: Quote from: amspire on March 30, 2012, 05:14:15 amNice try, but one component too manyDave.

author: amspire
author_rank: Super Contributor
timestamp: March 30, 2012, 05:42:09 am
content: Quote from: EEVblog on March 30, 2012, 05:32:30 amYou didn't coun't the load by any chance? That is not part of the switch - that is just there to test with capacitance on the output. My circuit is less then yours by one component (a transistor).Edit: If you need to allow for a load with a DC resistance of over a few hundred K, then I do need one extra resistor to make sure it stays off if you hold your finger on the button too long while turning off.

author: EEVblog
author_rank: Unknown
timestamp: March 30, 2012, 06:21:11 am
content: Quote from: amspire on March 30, 2012, 05:42:09 amNope.QuoteI have a variation that uses one less component again :-PI'm sure someone will get it, it was staring me in the face the whole time...Dave.

author: amspire
author_rank: Super Contributor
timestamp: March 30, 2012, 07:45:22 am
content: You got me Dave. Every way I could think of with one less part has a flaw. I usually needed one extra resistor to slow the capacitor discharge to allow for the voltage decay time of the capacitance in the load.See if anyone else can come up with the solution.Richard.

author: toggi
author_rank: Newbie
timestamp: March 30, 2012, 08:02:34 am
content: It may not be smaller, but at least it does not oscillate, and it's cheaper

author: dics
author_rank: Contributor
timestamp: March 30, 2012, 08:14:40 am
content: toggi, i really like your version of the circuit ! Thumbs upHere is a modeled online version of it. I changed the capacitor to a 47nF in this simulation, it works a little better.Also it needs a loadhttp://goo.gl/Ua1YiThere is a small problem with it though : in "on" state, if you keep the push button pressed long enough it turns off at first, stays off as long as you have juice in the capacitor and then it turns on again. If you keep the button pressed just a little bit then it turns off and stays off

author: BravoV
author_rank: Super Contributor
timestamp: March 30, 2012, 08:36:08 am
content: toggi, your version for turning on only, how bout turning off ?

author: dics
author_rank: Contributor
timestamp: March 30, 2012, 08:37:42 am
content: It works, capacitor acts like a tank and supplies positive voltage to mosfet's gate.

author: amspire
author_rank: Super Contributor
timestamp: March 30, 2012, 08:55:32 am
content: Toggi, I did look at your solution, but I couldn't get it to work fully when you start adding capacitance to the load.First you want to make R8 5 or more times the value of R4. Otherwise if you press to turn off but hold the finger on the button too long, it turns on again. I just had trouble find a value of C2 big enough to allow for the load to fully discharge without ending up with such a long recharge time for the R8/C2 time constant that you had to wait for 10 seconds or more before you can switch the supply again.The version I posted has the same number of components, except it is easier to get time constants to work well with a load with a capacitive decay.Dave reckons his answer of how to use seven parts including the switch was in front of his eyes, but I still cannot see it.Dics, the capacitor has to be greatly increased, not reduced. Your capacitor only works with a resistive load. A real load has caps across the power rails that take time to decay to zero.Richard.

author: dics
author_rank: Contributor
timestamp: March 30, 2012, 09:23:11 am
content: I lowered the capacitor value for this particular type of simulator (which is like arcade versus real simulation), it is quite slow and because of this the 100nF capacitor was charging really slow

author: EEVblog
author_rank: Unknown
timestamp: March 30, 2012, 09:27:25 am
content: Quote from: amspire on March 30, 2012, 08:55:32 amToggi had it essentially right, except it uses a MOSFET instead of the BJT, thus needing one less resistor.But as it turns out, it seems it's not new, somebody tweeted the same thing on a Russian site:http://www.uschema.com/safe_power_switch/It became really obvious on second thought, because I was obsessed with doing the turn on/off using the gate connected BJT. But when you think about the using the gate of the P MOSTFET itself, it's obvious the existing RC can be used and there is no need for the 2nd latch BJTDave.

author: dics
author_rank: Contributor
timestamp: March 30, 2012, 09:38:40 am
content: amspire : now that i think about it and after i tested a little, you are right. If the load is capacitive and has a large capacitance then the functionality is quite weird.If you match the capacitance of the load in the timing capacitor then you can kinda make it work but the timings are quite large.I really have to start thinking laterally when trying to understand circuitsLater edit: This is what i meanhttp://goo.gl/RCZUI

author: amspire
author_rank: Super Contributor
timestamp: March 30, 2012, 09:43:23 am
content: The mosfet instead of the transistor does work better then a NPN transistor, but it still does depend on the load dropping to below the MOSFET turn-on voltage before the switching cap discharges. With many loads that can happen. With loads like a microcontroller, they usually go into a very low current mode as the voltage drops, and so it is easy to get the load voltage decaying pretty slowly with modern microcontroller and micro perihperal IC circuits.It is one of those switches that only works with a cooperative load.Richards.

author: fmaimon
author_rank: Unknown
timestamp: March 30, 2012, 10:00:44 am
content: How about this? It would not depend on the load, as the transistor discharges the capacitor instantly.

author: toggi
author_rank: Newbie
timestamp: March 30, 2012, 10:04:42 am
content: I really liked my switch, but asamspirepointed out, it will not work on a capacitive load because the output has to fall to zero before the tank capacitor C2 empties

author: dics
author_rank: Contributor
timestamp: March 30, 2012, 10:16:11 am
content: fmaimon : it works for turning on but if you try to turn in off, C2 in instantly discharged through T3 and is not modifying the voltage on T4's gate

author: electroguy
author_rank: Regular Contributor
timestamp: March 30, 2012, 11:11:59 am
content: Dave, as you mentioned towards the end of your video about using a micro, how would you do this for a circuit that has a regulator (4.5-15v in 3.3v out) with EN pin, and a micro in it (has lots of free IO and A-D pins to be used if needed).I have a couple of designs in my head, but none of them are "elegant"so far i have 3 resistors, 2 MCU pins (1 IO and 1 A-D) I'll draw it up later and post it if i get a chance.

author: george graves
author_rank: Super Contributor
timestamp: March 30, 2012, 12:13:48 pm
content: I've got you all beat. $0.33 each.

author: electroguy
author_rank: Regular Contributor
timestamp: March 30, 2012, 12:26:53 pm
content: Quote from: george graves on March 30, 2012, 12:13:48 pmyuklol

author: jsoderquist
author_rank: Contributor
timestamp: March 30, 2012, 12:39:30 pm
content: I'm still trying to wrap my head around your comment concerning tapping the white board, Dave - people really complained about it? That baffles me.

author: EEVblog
author_rank: Unknown
timestamp: March 30, 2012, 12:51:42 pm
content: Quote from: jsoderquist on March 30, 2012, 12:39:30 pmYep, they do.For every nit-picking thing in my videos, you can be sure their will be someone who complains about it!Dave.

author: Rerouter
author_rank: Super Contributor
timestamp: March 30, 2012, 12:56:42 pm
content: your way to good at laughing at nitpickers

author: stryker
author_rank: Regular Contributor
timestamp: March 30, 2012, 01:01:24 pm
content: Hi DaveThanks for the inspirational videos (and fwiw no problems here with the whiteboard tapping either!).Apologies for the newbie question. Have just started with electronics and want to take this to a breadboard for a play but don't have a P channel MOSFET in the supplies just yet. At one stage your diagram had IRF9110 marked on there. Is there anything special in the selection, or will any P-channel do for the sake of the exercise? From google-fu it looks like IRFD9110 is the breadboard-friendly one?ThanksGeoff

author: Greg323i
author_rank: Contributor
timestamp: March 30, 2012, 01:18:23 pm
content: Personally, I found it annoying, but you know what? Why complain about some little pittily bullshit thing when I'm gaining so much great information. If it annoyed me that much I wouldn't watch the videos and I'd STFU!!! It's rather cliche, but if you don't have something nice to say, then STFU!!Just my little ol' opinion!

author: Rufus
author_rank: Super Contributor
timestamp: March 30, 2012, 01:47:09 pm
content: A patent applied for variationhttp://www.faqs.org/patents/imgfull/20090237065_01I recently had the same requirement except one side of the push button is ground. I don't think there is a two transistor plus a few passives solution to that one.To control a battery supply you should also have an automatic low battery turn off to prevent complete battery discharge. For the uSupply the processor monitors the battery so it would probably be better to use a processor pin which could do the automatic turn off and on/off latching.

author: Neilm
author_rank: Super Contributor
timestamp: March 30, 2012, 03:54:17 pm
content: Quote from: EEVblog on March 30, 2012, 12:51:42 pmYou should have had the evil laugh going when you were tapping itMWhahahahahahahahaNeil

author: IanB
author_rank: Super Contributor
timestamp: March 30, 2012, 05:16:35 pm
content: Quote from: EEVblog on March 30, 2012, 12:51:42 pmHmm. If you really want to send a message you could try a big sheet of paper and a felt tip/marker pen (seenumberphile). All sorts of nice squeaky, scratchy noises available there to entertain people(And yes, half the YouTube comments are from people complaining about the squeaky pen noises. You are not alone with nitpickers...)

author: Chet T16
author_rank: Frequent Contributor
timestamp: March 30, 2012, 06:39:42 pm
content: Whiteboard tapping highlights my audio sync issues

author: king.oslo
author_rank: Frequent Contributor
timestamp: March 30, 2012, 07:56:58 pm
content: Quote from: stryker on March 30, 2012, 01:01:24 pmGeoff,Use any. You got to check the datasheet and find its VGS. It has to be more negative than your GND to rail voltage. It also have to be rated high enough for the main voltages and currents which it will conduct.Kind regards,Marius

author: electroguy
author_rank: Regular Contributor
timestamp: March 30, 2012, 11:57:53 pm
content: Dave, can you please use a blackboard and some chalk in your next few videos. i can't believe people actually complain about stuff like this. lol

author: Zad
author_rank: Super Contributor
timestamp: March 31, 2012, 03:25:53 am
content: Quote from: george graves on March 30, 2012, 12:13:48 pmThat's my solution too. Cheap, reliable, small. Or use a rocker. Something like this is less prone to casual knocks. There is something reassuring about a click as contacts make or break. That feedback is part of what generates perceived product quality. Soft switches are a bit... vague.

author: johnnyfp
author_rank: Frequent Contributor
timestamp: March 31, 2012, 03:50:08 am
content: But wheres the fun in that? Rocker switches are mmh, old school. Momentary push switches are hip and trendyBut in either case, I can't get this new and revised version working in my spice emulator. The old one with two transistors works, but this new one with either one transistor or two Mosfets, I just can't get to emulate. I'm wonder how sensitive the balance of the values or fet/transistors I used can affect the simulator.Jfp

author: kaz911
author_rank: Super Contributor
timestamp: March 31, 2012, 04:35:16 am
content: I would say - use an XOR gate driving the mosfet - and tie the output of the mosfet to on input pin - and other XOR to the switch with a cap.Switch 0v - VccIn 0v - output 0v (stay off)Switch 5v - VccIn 0v - output 5v (switch on)Switch 0v - VccIn 5v - output 5v (stay on)Switch 5v - VccIn 5v - output 0v (switch off)Seems a bit simpler in component count. But I don't know about cost../kaz

author: Bored@Work
author_rank: Super Contributor
timestamp: March 31, 2012, 08:52:53 am
content: Quote from: johnnyfp on March 31, 2012, 03:50:08 amIt is rather sensitive. And just putting 100k resistors everywhere won't cut it. You need to dimension each resistor and the cap appropriately. For example, R5 is likely too large to drive Q2 as switch. But on the other hand, it shouldn't be to low, otherwise it gets difficult to turn the transistor off. And add a capacitive load, since the load has influence on the behaviour, making the circuit even more sensitive.In general, I don't see much advantage compared to a mechanical switch, especially because the soft switch is not controlled by the micro. If it would be controlled by the micro one could add some features like auto-turn-off when idle (no current drawn for x minutes -> turn off), which might be interesting for a battery powered device.

author: SeanB
author_rank: Super Contributor
timestamp: March 31, 2012, 11:10:08 am
content: Only issue I have is humid environments. Leakage can do odd things then.

author: FreeThinker
author_rank: Frequent Contributor
timestamp: March 31, 2012, 04:32:18 pm
content: Quote from: EEVblog on March 30, 2012, 09:27:25 amTruly there is nothing new, nice try anyway Lol.

author: siliconmix
author_rank: Frequent Contributor
timestamp: April 01, 2012, 08:50:37 am
content: Quote from: dics on March 30, 2012, 09:38:40 amhey i like that falstad applet.why havent i seen this before ?

author: PA3BNX
author_rank: Regular Contributor
timestamp: April 01, 2012, 03:30:20 pm
content: Hello Every body,I didn't see no comments on the fact that there could be RF present on the input and outputof this switch hi...But I maybe should add a diode in series with the capacitor so the voltage will dropto zero also if there is almost or no load.There are many TFT TVs that switches on and off if I transmit close to it with my 2/0.70m 5 Watt handheld.Very annoying hi...

author: bpkdasbaum
author_rank: Newbie
timestamp: April 09, 2012, 03:01:27 pm
content: Hi everyone,I went on a crusade for several hours to find me a latching momentary switch, until I finally ended up here. Though I should have checked this blog first >_> since i've been watching the videos now and then, informative and fun! Thx by the way Dave.Now, I really don't understand most of technical background stuff here and would like to get some help with the parts.I would like to know if the schematic will work this these transistors, since I can't find the exact ones used in the video/schematics, but according to the data sheets i've looked up, they are pretty much the same.I am using this schematic as a reference, since Dave said in a post here, that is pretty much the best solution and is the same he came up with too after making his video:Infineon BSS 123 NdatasheetIRLML6401datasheetSo can i use those 2?Thanks in advance

author: amspire
author_rank: Super Contributor
timestamp: April 09, 2012, 04:04:41 pm
content: That circuit was the best in terms of least components, but it does not work well if your load has capacitors across the supply rails. The one I did back on the first page of posts has one extra resistor, but it is the one that works best with a capacitive load. The circuit is from LTSpice, so there is extra junk in the diagram for the simulation.To me the method in general is not a robust solution as it depends a so much on the way the load behaves. For example, a transient from the load circuit can turn the supply on, even if the switch is not touched. If your load was a linear regulator IC with a reverse diode across it, and you attach an external load to the regulator output which happens to have a charged supply cap, then this switch circuit will turn itself onRichard.

author: bpkdasbaum
author_rank: Newbie
timestamp: April 09, 2012, 04:55:37 pm
content: i don't have anything fancy in the main circuit, just a 9v battery and 3 fans, thats it. But space is an issue, thus I am aiming for the one with the least parts, it should work just fine.I just need to know, if it will work at all with those 2 transistors.

author: T4P
author_rank: Super Contributor
timestamp: April 09, 2012, 05:01:48 pm
content: Quote from: bpkdasbaum on April 09, 2012, 04:55:37 pmBe careful of inductive spiking .

author: amspire
author_rank: Super Contributor
timestamp: April 09, 2012, 09:11:37 pm
content: Quote from: bpkdasbaum on April 09, 2012, 04:55:37 pmYou will have to check to see if the fans generate any voltage while they are slowing down. If they do, they will turn the switch back on just after you press the button to turn the switch off.Richard.

author: billclay
author_rank: Regular Contributor
timestamp: April 09, 2012, 09:23:30 pm
content: Quote from: EEVblog on March 30, 2012, 12:51:42 pmDave, you are using the wrong color marker on the whiteboard. Please stop it.

author: bpkdasbaum
author_rank: Newbie
timestamp: April 09, 2012, 11:14:56 pm
content: @amspire @ Dave.SOkay, I copied both circuits now and added my fans(hopefully I copied yours correctly amspire)I did read up on inductive spiking too: As far as I understood a diode parallel to the fans will do the trick (and circle the overload back into the fans until it dissipates). Question is do I really need to care about this in either of the circuits, since the fans are quite small (15x15x3 milimeter, specs in image below)?So, will either of the circuits work? If not, why and what needs to be changed?Edit:Oopps forgot circuits:

author: EEVblog
author_rank: Unknown
timestamp: April 10, 2012, 05:46:15 am
content: Quote from: amspire on April 09, 2012, 04:04:41 pmThat right there is what you call a featureDave.

author: EEVblog
author_rank: Unknown
timestamp: April 10, 2012, 05:48:19 am
content: Quote from: billclay on April 09, 2012, 09:23:30 pmNo, your monitor is just out of whack. Twiddle the colour knob until correctDave.

author: Ben
author_rank: Newbie
timestamp: April 17, 2012, 11:47:26 pm
content: Quote from: Rufus on March 30, 2012, 01:47:09 pmBy the way, this patented version is available at:http://www.pololu.com/catalog/product/750- Ben

author: ftransform
author_rank: Frequent Contributor
timestamp: April 23, 2012, 07:44:48 am
content: Quote from: PA3BNX on April 01, 2012, 03:30:20 pmI think that this issue needs to be addressed. Is this circuit RF interference resistant to a reasonable degree?

author: timelessbeing
author_rank: Frequent Contributor
timestamp: May 07, 2012, 05:41:47 am
content: Great video. I just happened to need a soft switching circuit similar to this, only I'm a 'noob' and I don't have 'mad skillz' yet.I have a 12V source, three loads (LEDs), and a common return. I want to use a momentary micro switch to toggle between four states:1. off2. turn on load 13. turn on load 1 + 24. turn on load 1 + 2 +3I have seen this type of behaviour in LED headlamps. Is it possible to create using common components like Daves?Tap on Dave!

author: Scarionn
author_rank: Contributor
timestamp: June 10, 2012, 02:42:30 am
content: Hi dave. Really good design but, how I do a normally ON latch switch? Like a multimeter.Having just one pole rotary switch.

author: natezimmer
author_rank: Newbie
timestamp: August 18, 2012, 12:59:54 pm
content: Issue I see with this circuit is that if your input is say 20V, you stand a decent chance of damaging the pmosfet due to exceeding VGS max. Anyone know a simple way around that while still using the pmos switch? (lowering the supply voltage doesn't count)

author: pbendel
author_rank: Contributor
timestamp: December 08, 2012, 11:59:27 pm
content: Does anybody have one that works with smd components?I am not that lucky I guess...

author: electroguy
author_rank: Regular Contributor
timestamp: December 09, 2012, 01:08:28 am
content: Quote from: natezimmer on August 18, 2012, 12:59:54 pm5V to 10V Zener across the gate-source might work?I use a Zener across G-S when using a pfet for reverse polarity protection, works a treat up to VDS (usually 60V and above) while making sure VGS is still under 20V

author: onlooker
author_rank: Frequent Contributor
timestamp: December 11, 2012, 02:54:17 am
content: This would be my solution if switch-on-ground and load-independent are required. This is actually a simplified and extended version of one I used for UT61E mod. In that sense, it works as a real circuit.It works like this:short press of switch (<0.5s) does turn-on; long press of switch (>0.5s) does turn-off. The time constant can be changed by changing C1.For resistive loads, M3Vto-2 is not needed and loads should be parallel to R4. M3Vto-2 is purely for separating power supply path from switch ctrl path.

author: Jeremyvnc
author_rank: Newbie
timestamp: January 11, 2013, 03:27:56 am
content: This is driving me bonkers! I have been able to breadboard two different designs but when I go to make the pcb with smd components, it no longer works.Can you all please tell me what I'm doing wrong?Attached is my schematic.The 5uF capacitor is actually a 4.7uF tant cap.The diode is a STPS1L30A Schottky diode.The P-channel is a IRLML2246TRPBFthe N-Channel is a IRFML8244TRPBFWhat I'm seeing is the controlled device either just stays on or it will drop the voltage for a moment enough to reset.When I breadboarded it, the circuit would start in the off state, push the button and it turns on, wait a few seconds and press it again to turn it off. Exactly what I need.Pleeease help me...-Jeremy

author: Ebis
author_rank: Newbie
timestamp: October 09, 2015, 01:22:11 pm
content: Hi everyoneA bit of a necro but maybe someone will point me in the right direction.I was trying to base an on/off touch button on one of these designs, getting the touch functionality proved fairly easy with swapping out the tactile for an NPN, tying the base to a touchable pad, throwing in some small capacitors to adjust sensitivity. This worked fine on a breadboard with no real load attached.ButWhen I attach my load (a string of parallel&serial bound LEDs with a bit of resistance in front) I get a huge voltage drop across the pMOSFET. So i returned to the initial designs, removed all my additions and ported to falstad to investigate.What I found is the designs all works great with a load of a 100 Ohms or so, but my load should be pulling between 500-700mA.As an added bonus I'm trying to power it off an old phone charger which when just loaded with the LEDs and some minor resistance (11Ohm) in series is happy to spit out 700mA at 7.7V which is ok for the load but exceeds the values my transistors are happy to take.. (the charger is rated at 1A so all good there)If anyone has any insight or suggestions they are willing to share it would be much appreciated.Though I always dabbled in tech, but I only started studying electronics in detail fairly recently and it feels like the answer is a year of books away...

author: Ebis
author_rank: Newbie
timestamp: October 12, 2015, 01:07:43 pm
content: Here is my take on the on/off latching button, only ran it in falstad so far, need to try breadboarding it.There are probably several issues with it, I will be most grateful if anyone points them out, or maybe explains the math behind it so a better version can be made. This one is a little bit sensitive to how long you need to hold the tactile.Also... the simulator is showing double the expected voltage on the capacitor when circuit is in on state, is that just a simulator artefact?http://tinyurl.com/p2ysh4sp.s: 4 components - do I win?

author: 4JimBeam
author_rank: Newbie
timestamp: February 18, 2016, 03:46:07 pm
content: @Ebis:I tried your ciruit with LT Spice, it does waste a lot power in the N-Mos and did not switch off.Did you / anyone tried this ciruit in real?

author: timelessbeing
author_rank: Frequent Contributor
timestamp: February 19, 2016, 05:36:08 am
content: I built the one in this patent:http://www.faqs.org/patents/imgfull/20090237065_01It works fine. I did not test it with any heavy duty loads, though.