Author Topic: Suicide MCU with a transistor  (Read 7188 times)

0 Members and 1 Guest are viewing this topic.

Offline Erwin RiedTopic starter

  • Regular Contributor
  • *
  • Posts: 206
  • Country: no
Suicide MCU with a transistor
« on: June 14, 2012, 08:54:43 am »
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
My website: http://ried.cl
 


Offline Erwin RiedTopic starter

  • Regular Contributor
  • *
  • Posts: 206
  • Country: no
Re: Suicide MCU with a transistor
« Reply #2 on: June 14, 2012, 06:39:12 pm »
Cool, not so simple as with a relay  :-\
My website: http://ried.cl
 

Offline 8086

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: gb
    • Circuitology - Electronics Assembly
Re: Suicide MCU with a transistor
« Reply #3 on: June 14, 2012, 06:45:43 pm »
Cool, not so simple as with a relay  :-\

That'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.
 

Offline Erwin RiedTopic starter

  • Regular Contributor
  • *
  • Posts: 206
  • Country: no
Re: Suicide MCU with a transistor
« Reply #4 on: June 14, 2012, 07:50:20 pm »
Cool, not so simple as with a relay  :-\

That'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.

Can you suggest me an IC? (to buy few in ebay) I wish to use this with an Attiny@3V-4.5V (aa batteries)
My website: http://ried.cl
 

Offline 8086

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: gb
    • Circuitology - Electronics Assembly
Re: Suicide MCU with a transistor
« Reply #5 on: June 14, 2012, 08:02:32 pm »
Cool, not so simple as with a relay  :-\

That'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.

Can you suggest me an IC? (to buy few in ebay) I wish to use this with an Attiny@3V-4.5V (aa batteries)

I'm using this: http://uk.mouser.com/ProductDetail/Diodes-Inc/DMG6602SVT-7/?qs=T%2fOtf55vL7fe3C3LKNnWjA%3d%3d

But it's a TSOT26-6 package - for a more easy to use one then there's this in a SOIC8 http://uk.mouser.com/ProductDetail/International-Rectifier/IRF7338TRPBF/?qs=9%252bKlkBgLFf3cLkslTme5D7%252bwWa%252bQoMdy2bT%252bwJrvsoY%3d

or even this in a DIP8 http://uk.mouser.com/ProductDetail/Advanced-Linear-Devices/ALD1115PAL/?qs=nNyf8ckWk3T5su21zbAks81aiNQSX1JEWiw8%252bUIWddQ%3d
 

Offline Erwin RiedTopic starter

  • Regular Contributor
  • *
  • Posts: 206
  • Country: no
Re: Suicide MCU with a transistor
« Reply #6 on: June 14, 2012, 08:50:14 pm »
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 shipment http://www.ebay.com/itm/VISHAY-SI4500DY-Dual-N-and-P-MOSFET-20V-SO-8-Qty-10-/400088441580?pt=LH_DefaultDomain_0&hash=item5d272122ec

I am right?
My website: http://ried.cl
 

Offline 8086

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: gb
    • Circuitology - Electronics Assembly
Re: Suicide MCU with a transistor
« Reply #7 on: June 14, 2012, 08:57:12 pm »
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 shipment http://www.ebay.com/itm/VISHAY-SI4500DY-Dual-N-and-P-MOSFET-20V-SO-8-Qty-10-/400088441580?pt=LH_DefaultDomain_0&hash=item5d272122ec

I am right?

Unfortunately 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.
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: Suicide MCU with a transistor
« Reply #8 on: June 14, 2012, 11:36:39 pm »
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 a
2nd NPN transistor at the drive to the PNP. The equation just shows formulas involved - ie if you supply 1mA to
R2 and Q1 has a beta of 100, then you'll have 100mA available (ideally). The Q1_CE loss will be APPROX 50-100mV
at say 50mA load, and increase a bit at 100mA, so either find a Transistor (NOT Darlington) with a higher beta
and 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
Hello <tap> <tap> .. is this thing on?
 

Offline Erwin RiedTopic starter

  • Regular Contributor
  • *
  • Posts: 206
  • Country: no
Re: Suicide MCU with a transistor
« Reply #9 on: June 15, 2012, 02:39:59 am »
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 a
2nd NPN transistor at the drive to the PNP. The equation just shows formulas involved - ie if you supply 1mA to
R2 and Q1 has a beta of 100, then you'll have 100mA available (ideally). The Q1_CE loss will be APPROX 50-100mV
at say 50mA load, and increase a bit at 100mA, so either find a Transistor (NOT Darlington) with a higher beta
and 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

Thanks 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.
My website: http://ried.cl
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: Suicide MCU with a transistor
« Reply #10 on: June 15, 2012, 03:32:05 am »
Quote
.. 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
My 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.
Hello <tap> <tap> .. is this thing on?
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: Suicide MCU with a transistor
« Reply #11 on: June 15, 2012, 08:10:25 am »
A 60 sec search found this - BD434
AT 500mA : HFe = 150, VCE loss = 50mV
Even better at lower current.
Price approx 35c
Hello <tap> <tap> .. is this thing on?
 

Offline Erwin RiedTopic starter

  • Regular Contributor
  • *
  • Posts: 206
  • Country: no
Re: Suicide MCU with a transistor
« Reply #12 on: June 16, 2012, 12:09:37 am »
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 kit :D but 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?
My website: http://ried.cl
 

Offline 8086

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: gb
    • Circuitology - Electronics Assembly
Re: Suicide MCU with a transistor
« Reply #13 on: June 16, 2012, 12:17:59 am »
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 solution  :)

http://www.ebay.com/itm/5pcs-SI4562DY-N-and-P-Channel-2-5-V-G-S-MOSFET-/180811542414?pt=LH_DefaultDomain_0&hash=item2a19352f8e

 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: Suicide MCU with a transistor
« Reply #14 on: June 16, 2012, 12:23:26 am »
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 10mA
It'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 !!
Hello <tap> <tap> .. is this thing on?
 

Offline Erwin RiedTopic starter

  • Regular Contributor
  • *
  • Posts: 206
  • Country: no
Re: Suicide MCU with a transistor
« Reply #15 on: June 16, 2012, 01:02:57 am »
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 solution  :)

http://www.ebay.com/itm/5pcs-SI4562DY-N-and-P-Channel-2-5-V-G-S-MOSFET-/180811542414?pt=LH_DefaultDomain_0&hash=item2a19352f8e

Cool! very cheap including shipping

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 10mA
It'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 !!

Thanks 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)
 
My website: http://ried.cl
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf