Suicide MCU with a transistor - Page 1
Forum section: electronics / general

author: Erwin Ried
author_rank: Regular Contributor
timestamp: June 14, 2012, 08:54:43 am
content: Can anyone help me to get a simple circuit to have a push button that turns on a MCU on, and then the MCU enables a digital leg to keep itself on until the program decides to turn off everything?The same idea seem to work pretty nice with a relay, but not with a npn transistor, maybe I require another transistor to control that transistor?Thanks in advance

author: Short Circuit
author_rank: Frequent Contributor
timestamp: June 14, 2012, 11:26:42 am
content: https://www.eevblog.com/forum/projects-designs-and-technical-stuff/mosfet-power-switch-with-auto-off/?topicseen

author: Erwin Ried
author_rank: Regular Contributor
timestamp: June 14, 2012, 06:39:12 pm
content: Cool, not so simple as with a relay

author: 8086
author_rank: Super Contributor
timestamp: June 14, 2012, 06:45:43 pm
content: Quote from: Erwin Ried on June 14, 2012, 06:39:12 pmThat's my thread linked above, and actually, it's pretty easy! You can get ICs with both mosfets inside (you need a P and N type) and then just add a couple of resistors and it's done. No more complicated really than doing a relay properly, and total cost for the switch (in my case) was £0.10 (not including button), so cheaper than a relay, too.

author: Erwin Ried
author_rank: Regular Contributor
timestamp: June 14, 2012, 07:50:20 pm
content: Quote from: 8086 on June 14, 2012, 06:45:43 pmCan you suggest me an IC? (to buy few in ebay) I wish to use this with an Attiny@3V-4.5V (aa batteries)

author: 8086
author_rank: Super Contributor
timestamp: June 14, 2012, 08:02:32 pm
content: Quote from: Erwin Ried on June 14, 2012, 07:50:20 pmI'm using this:http://uk.mouser.com/ProductDetail/Diodes-Inc/DMG6602SVT-7/?qs=T%2fOtf55vL7fe3C3LKNnWjA%3d%3dBut it's a TSOT26-6 package - for a more easy to use one then there's this in a SOIC8http://uk.mouser.com/ProductDetail/International-Rectifier/IRF7338TRPBF/?qs=9%252bKlkBgLFf3cLkslTme5D7%252bwWa%252bQoMdy2bT%252bwJrvsoY%3dor even this in a DIP8http://uk.mouser.com/ProductDetail/Advanced-Linear-Devices/ALD1115PAL/?qs=nNyf8ckWk3T5su21zbAks81aiNQSX1JEWiw8%252bUIWddQ%3d

author: Erwin Ried
author_rank: Regular Contributor
timestamp: June 14, 2012, 08:50:14 pm
content: Great, looking for similar ones in ebay (in digikey or mouser, etc shipping is a pain for my country) I think these ones will work fine and they are very cheap including shipmenthttp://www.ebay.com/itm/VISHAY-SI4500DY-Dual-N-and-P-MOSFET-20V-SO-8-Qty-10-/400088441580?pt=LH_DefaultDomain_0&hash=item5d272122ecI am right?

author: 8086
author_rank: Super Contributor
timestamp: June 14, 2012, 08:57:12 pm
content: Quote from: Erwin Ried on June 14, 2012, 08:50:14 pmUnfortunately not, that one won't work because the two mosfets are connected internally in a way that isn't right for this application. You need to find one with two completely separated mosfets.

author: digsys
author_rank: Unknown
timestamp: June 14, 2012, 11:36:39 pm
content: A simple method I use is as per JPG -If V_IN = V_SW = V_CPU Supply, this is all you need. If V_IN is higher than V_CPU, then you just need to add a2nd NPN transistor at the drive to the PNP. The equation just shows formulas involved - ie if you supply 1mA toR2 and Q1 has a beta of 100, then you'll have 100mA available (ideally). The Q1_CE loss will be APPROX 50-100mVat say 50mA load, and increase a bit at 100mA, so either find a Transistor (NOT Darlington) with a higher betaand Current capability, or put more drive in to R2. You can reduve V_CE loss with a better Transistor choice.Operation - R3 is to protect the switch. SW starts up the CPU/MPU, Turn P07 (any IO) LOW. When your done,turn P07 high or tristate (you can do this by changing it to an Input). Any method is ok

author: Erwin Ried
author_rank: Regular Contributor
timestamp: June 15, 2012, 02:39:59 am
content: Quote from: digsys on June 14, 2012, 11:36:39 pmThanks digsys, your circuit looks very understandable to me, I want in this case to use the same regulated V for the switch and 'v_cpu', can you tell me a suitable transistor to order? (like the most common that you can think), the only transistors I have right now are some 2222A (datasheet say beta>40) that I used to drive some relays in the past.

author: digsys
author_rank: Unknown
timestamp: June 15, 2012, 03:32:05 am
content: QuoteMy favourites for a pass element are D45H8 / D45H11. These have a beta over 100 (you want 100+) and a VCE dropout of~40mV at 1A !! You need at least a TO220 size package for the small amount of heat if you need 100mA+These are likely an OVER-KILL for what you need. There are many TO220 type transistors with betas 100+Just check their "VCE loss/current" charts. If you get stuck, I'll dig a few up for you.

author: digsys
author_rank: Unknown
timestamp: June 15, 2012, 08:10:25 am
content: A 60 sec search found this - BD434AT 500mA : HFe = 150, VCE loss = 50mVEven better at lower current.Price approx 35c

author: Erwin Ried
author_rank: Regular Contributor
timestamp: June 16, 2012, 12:09:37 am
content: Hi, thanks for those suggestions, I found them all online but +shipping no one is cheap (they are from 3-12 usd per piece, mainly because shipping)I found that I have some IRF1730G (overkill of course) but I want to ask you if you can say me in few words what I am trying to find when choosing a transistor here? (I know the basic notion of transistor but no more than that, hehe I still don't complete all the chapters on my radioshack electronic learning kitbut I am sure power transistors aren't one of the topics).I think I want:-low voltage transistor (<22v)-low VCE loss (probably to not lose batteries charge on off-mode?)right?

author: 8086
author_rank: Super Contributor
timestamp: June 16, 2012, 12:17:59 am
content: You seem keen on digsys' solution, but I found a cheap dual mosfet for you (im bored) in case you want to try the first solutionhttp://www.ebay.com/itm/5pcs-SI4562DY-N-and-P-Channel-2-5-V-G-S-MOSFET-/180811542414?pt=LH_DefaultDomain_0&hash=item2a19352f8e

author: digsys
author_rank: Unknown
timestamp: June 16, 2012, 12:23:26 am
content: No problem,For a prototype, overkill is a non issue, neither are perfect specs, as long as it does the job.Did you look at the 2 JPGs? Use the chart to find the VCE Voltage loss against the current you calculate you'll draw.Keep it under 100mV. Even 3.6 / 3.3V logic won't mind 100mV loss. If you pick 50mV, then you're well fine.You can overcome beta by putting in more base current, most ICs can easily put out 5mA, usually 10mAIt's nice to keep it low in production, wasting power just adds to heat etc but for a prototype, fine.VCE max is not important, you can use a 20V or 200V capable transistor, makes no "appreciable" difference !Don't you have an electronics store near you? How far away is the store you buy from? Yeah don't pay that !!

author: Erwin Ried
author_rank: Regular Contributor
timestamp: June 16, 2012, 01:02:57 am
content: Quote from: 8086 on June 16, 2012, 12:17:59 amCool! very cheap including shippingQuote from: digsys on June 16, 2012, 12:23:26 amThanks for the explanation. I also found npn, pnp and power mosfets on the radioshak learning lab!! 2x NPN transistors (9014) 2x PNP transistors (9015) 2x power MOSFET (B J14 IRF 630B) so more to test. I will do some tests soon.The nearest store I think is about 200 kms (Santiago de Chile), in my town itself it is hard to find even resistors (and they are expensive of course, like 5x 1usd), but most of them have very poor online service so I usually end buying all things from china or EEUU thru ebay (less disapointing that travelling and find out you can't get almost anything you need)