Shop OBEX P1 Docs P2 Docs Learn Events
Switch power to sensors — Parallax Forums

Switch power to sensors

BasilBasil Posts: 380
edited 2007-05-07 00:28 in Propeller 1
Hi All,

I am trying to figure out a MCU controlled power switch for my device.

Prior to launch, I want to be able to turn off the sensors (ADXL78 accelerometer & MPX4115A pressure sensor) to save power, and only turn them on every 250ms to take a sample.

During flight, they may need to stay on all the time due to the sample rate of 5ms being higher than the powerup time of the devices (The MPX is 20ms, ADXL is not so much but still not fast enough)

I am wondering if I can put a P-Channel FET on the 5V power line and just switch it on/off with the MCU? I would assume i'd need a pull down resistor, is there anything else I'd need to watch out for?
«1

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-05-01 23:37
    You can't drive a PMOS FET directly from the Propeller (3.3V outputs) for switching 5V, since the gate will always be at least 1.7V below the source and hence partially "on". Use a pullup to 5V on the PMOS gate, and turn it on via another transistor: either an open-collector NPN or an open-drain NMOS FET.

    -Phil
  • BasilBasil Posts: 380
    edited 2007-05-01 23:54
    Something like this?

    Sorry about the messyness, I had to butcher my firing circuit as I don't have Eagle at work smile.gif
    My firing circuit has a similar arrangment.

    The Bias transistor is a MUN2211.

    What should I look for in an FET for say 100ma max current?

    EDIT: Attached file...
    326 x 259 - 8K
  • swriderswrider Posts: 16
    edited 2007-05-02 00:21
    I think these 2 sensors use less than 10ma combined. Are you sure the power switching of them nets you a gain in power savings, since you'll be consuming a bit of power in the switching circuit/logic?

    With such a minimal load could you·use just a NPN or·PNP·transistor to control power?
  • BasilBasil Posts: 380
    edited 2007-05-02 00:41
    swrider said...
    Are you sure the power switching of them nets you a gain in power savings, since you'll be consuming a bit of power in the switching circuit/logic?

    I had thought about that. The combined power usage is about 12ma so your not far off smilewinkgrin.gif
    Im not sure how much current it would consume to do the switching though...

    This will all be running off a 9V battery which needs to be able to fire up to 15A a couple of times so im trying to keep power draw to a minimum smile.gif
    I guess I just have to figure out if the pros outweigh the con's...
    swrider said...
    With such a minimal load could you use just a NPN or PNP transistor to control power?

    I guess I could, are you able to give me some insight into how you would do this? I can't imagine it being much different to the circuit I posted smile.gif
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-05-02 00:58
    Basil,

    Yes, the circuit you've shown will work just fine. 'Best of all, its power consumption when "off" is virtually nil. You can improve consumption in the "on" state by replacing the NPN with an NMOS FET. High-value (100K) gate-to-source resistors will help, too, for both transistors. (BTW, you've got the PMOS drain and source reversed in your schematic.)

    -Phil
  • BasilBasil Posts: 380
    edited 2007-05-02 02:04
    Phil Pilgrim (PhiPi) said...
    Basil,

    Yes, the circuit you've shown will work just fine. 'Best of all, its power consumption when "off" is virtually nil. You can improve consumption in the "on" state by replacing the NPN with an NMOS FET. High-value (100K) gate-to-source resistors will help, too, for both transistors.

    Something like the attached?

    Does the Datasheet I attached look ok?
    Phil Pilgrim (PhiPi) said...
    (BTW, you've got the PMOS drain and source reversed in your schematic.)

    ?? Is my FET picture wrong? It looks ok compared to the data sheet?
    326 x 259 - 8K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2007-05-02 04:15
    Phil's got a sharp eye, the right hand fet is a P-CH and the power should go to the source which you have shown going to the sensor.

    *Peter*
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-05-02 04:17
    Basil,

    On your PMOS FET, the source should be connected to +5V, and the drain to your load. You have it the other way around. Also, be sure to connect a 100K resistor from the NMOS FET's gate to ground. This will prevent inadvertent activation if the Propeller's pin is floating.

    -Phil
  • BasilBasil Posts: 380
    edited 2007-05-02 04:24
    Ahh ok, only a minor problem wink.gif

    Will fix that up thanks, same with the firing circuit!

    Will add the 100k, thanks for that.
    Do you think I should use 100k to 5V instead of 47k on the PMOS FET gate also?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-05-02 04:55
    The PMOS FET gate resistor value will depend on how fast you want the load to turn off when you're finished. The lower the resistance, the faster the turn-off, the time being on the order of R * CGS. Given the nature of your app, this is probably not critical, so a 100K resistor should work fine.

    BTW, when your sensors are turned off, make sure that any other lines to them are either floating or pulled low. Otherwise, you could end up powering the sensors through these other connections.

    -Phil
  • BasilBasil Posts: 380
    edited 2007-05-02 06:28
    Cool, thanks for the help there.

    Phil,

    With the NMOS FET, what do you mean by an 'open drain' FET? Is this just a normal N channel FET?

    Do I need one with a low Vth or something? Or will any N channel do?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-05-02 07:09
    "Open drain" refers to just the kind of circuit you've posted: there's no complementary FET that drives the PMOS gate high. That's up to the gate-source resistor to accomplish. Low VGS(th) will be a necessity, since you've only got 3.3V to drive it. But the NMOS isn't sinking much current, so it doesn't need to be driven to single-digit ohm levels, or even close to it. An FDV301N would be perfect here. The PMOS FET should also have a low VGS(th). A good candidate for this one is the IRLML6402.

    -Phil
  • BasilBasil Posts: 380
    edited 2007-05-02 21:38
    Phil Pilgrim (PhiPi) said...
    "Open drain" refers to just the kind of circuit you've posted: there's no complementary FET that drives the PMOS gate high. That's up to the gate-source resistor to accomplish. Low VGS(th) will be a necessity, since you've only got 3.3V to drive it. But the NMOS isn't sinking much current, so it doesn't need to be driven to single-digit ohm levels, or even close to it. An FDV301N would be perfect here. The PMOS FET should also have a low VGS(th). A good candidate for this one is the IRLML6402.

    -Phil


    EDIT: Ignore my comment below, I have had a good look at Wikipedia and understand now tongue.gif


    Ahhh ok then.

    About the reversed PMOS FET I had.

    Everything I have seen suggests it was around the right way in the first place so I'm a little confused?
    Would you be able to explain a bit?

    The original diagram I posted is the firing circuit, which should allow current to flow when the Prop pin connected to the RET goes high.
    It is being used as a high side switch (I think thats the right term)

    I have attached the firing circuit FYI if it helps. smile.gif

    Sorry to be a pain!

    Thanks,

    Alec

    Post Edited (Basil) : 5/2/2007 10:28:36 PM GMT
    715 x 738 - 116K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-05-02 23:37
    Your PMOS FETs are backwards. If you're using them to switch 9V to the op-amp inputs, the sources should go to +9V and the drains to the op-amps. A PMOS FET conducts when the gate voltage is lower than the source voltage. That's why you see a spec for VGS(th), but not VGD(th).

    -Phil
  • BasilBasil Posts: 380
    edited 2007-05-03 00:20
    Oops, sorry I had changed the diagram since taking that picture.
    I now have the source connected to 9V and drain connected to the load smile.gif


    Thanks for pointing out my error! That could of turned nasty lol
  • BasilBasil Posts: 380
    edited 2007-05-03 00:31
    While we are on the subject of PMOS FET's.

    how do I figure out the resistor to use in order to keep the Gate voltage higher then the Source voltage when I want the switch to be 'off'
  • Bill HenningBill Henning Posts: 6,445
    edited 2007-05-03 07:20
    At the risk of asking a very stupid question, and making the HUGE assumption that the devices will run off 3.3V...

    if you have the I/O pins to spare...

    Why not simply power the devices by setting an output to '1' and using that as the Vcc?

    Otherwise, a "solid state relay" may be appropriate; or perhaps abusing an opto isolator...
    Basil said...
    swrider said...
    Are you sure the power switching of them nets you a gain in power savings, since you'll be consuming a bit of power in the switching circuit/logic?

    I had thought about that. The combined power usage is about 12ma so your not far off smilewinkgrin.gif
    Im not sure how much current it would consume to do the switching though...

    This will all be running off a 9V battery which needs to be able to fire up to 15A a couple of times so im trying to keep power draw to a minimum smile.gif
    I guess I just have to figure out if the pros outweigh the con's...
    swrider said...
    With such a minimal load could you use just a NPN or PNP transistor to control power?

    I guess I could, are you able to give me some insight into how you would do this? I can't imagine it being much different to the circuit I posted smile.gif
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com - a new blog about microcontrollers
  • BasilBasil Posts: 380
    edited 2007-05-03 07:33
    Bill Henning said...
    At the risk of asking a very stupid question, and making the HUGE assumption that the devices will run off 3.3V...

    if you have the I/O pins to spare...

    Why not simply power the devices by setting an output to '1' and using that as the Vcc?

    Otherwise, a "solid state relay" may be appropriate; or perhaps abusing an opto isolator...
    I have some spare IO pins :-)

    However ;-) the devices are 5V.

    This device will be in a high powered rocket which can experience upwards of 40G in some cases, but usually around 4G.
    I would prefer to stay away from mechanical switching due to the risk of the high G's turning things nasty :-)
  • crgwbrcrgwbr Posts: 614
    edited 2007-05-05 22:18
    Bill is correct, an opto-coupler would work nicely ( as long as the load in under 100mA).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I would love to change the world, but they won't give me the source code

    People say that if you play Microsoft CD's backwards, you hear satanic things, but that's nothing, because if you play them forwards, they install Windows.

    I spent a minute looking at my own code by accident. I was thinking "What the heck is this guy doing?"
  • BasilBasil Posts: 380
    edited 2007-05-06 02:22
    Hmmm.

    A few questions about the opto.

    What is the current draw on the opto itself? Which spec do I look for on the data sheet? Is it 'If'?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-06 02:46
    The LED in the optoisolator is a fairly standard LED. A commonly used optoisolator, the 4N25, (on the datasheet) has a relative current transfer ratio vs forward current of around 1 for currents from roughly 5ma to 20ma, so anything in that range should work. The forward current is set by the power supply voltage and the current limiting resistor used in the circuit.
  • BasilBasil Posts: 380
    edited 2007-05-06 05:00
    Hmmm so current draw is a fair bit more than using the FET combo by the looks of it.

    Would there be any benefit of going with the opto over the FET combo?

    Board space is much the same from what I have seen.
  • Tracy AllenTracy Allen Posts: 6,660
    edited 2007-05-06 16:11
    You wouldn't want a standard opto-isolator for power control. Look for photoMOS relays. They are solid state relays that use 5 or 10 ma into an LED to control a much larger currrent, a good fraction of an amp in a 6-pin dip or soic package.

    They don't waste any current when off, but they do require the LED drive current to turn them on. One big reason for using them is to acheive isolation between the control and the power circuit. Also, they can veery easily translate voltage levels from a DC control input to either DC or AC output.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • BasilBasil Posts: 380
    edited 2007-05-06 21:20
    Hmmm.

    The sensors I will be switching only consumes 10mA and 1mA which makes it almost not worth it in that case.

    The FET solution seems the best solution in this case, but thanks for the clarification, I think there may be a situation where I will need to use an opto in the not to distant future [noparse]:)[/noparse]

    I should mention that even though the current draw is low for these sensors, this whole system will be running on a 9V battery so every bit counts [noparse]:)[/noparse]

    Those 15A bits are really going to suck the life out of the poor little battery. (in all honesty, most of the time 1A will be all that is needed to fire the pyro charge, but sometimes it gets up there...)

    Post Edited (Basil) : 5/6/2007 9:25:34 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-06 21:36
    You may not be able to get that kind of peak current out of a 9V battery. If you have experience using them for this task, then go right ahead. Most 9V batteries have a fairly high internal resistance which will limit the maximum current output.
  • BasilBasil Posts: 380
    edited 2007-05-06 21:44
    I personally haven't had any experience, but similar devices out there use 9V batteries to do this. I have added a 1000uf Cap into the circuit to be safe (which may or may not be enough).

    What current do you think a 9V could supply?

    Post Edited (Basil) : 5/6/2007 9:50:56 PM GMT
  • BasilBasil Posts: 380
    edited 2007-05-06 22:00
    Oh yeah, the 9V battery is connected using terminal blocks.

    With the low current ignitors (sub 1A) 9V should be fine right?
    With the high current ignitors (<15A), the user could attach thier own battery up to 12V to the terminals [noparse]:)[/noparse]

    I forgot that I put terminal blocks on the board! Current draw wont be a problem as the user could just connect a bigger battery [noparse]:)[/noparse]
    Bah, silly memory.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-06 22:17
    From the Duracell MN1604 datasheet, the internal impedance is about 1.7 ohms at 1KHz. That doesn't translate into peak currents though and the data sheets don't really discuss discharge currents above 100ma. Without any factual data to back it up, I would say that you could possibly get on the order of 1A for a short time. I checked out some NiMH rechargable 9V (actually 8.4V) batteries. The highest discharge current I found was 400ma.
  • BasilBasil Posts: 380
    edited 2007-05-06 22:30
    Quote from the net.

    "At a minimum, according to the manual, the unit is designed to operated from a single 9 volt alkaline transistor battery. A quality alkaline battery is capable of sourcing 5 amps for the hundreth of a second of current flow required to activate the e-match"

    For higher current ignitors. most people seem to use large 9.6V batterys.

    For some reason I though the current would be drawn for a longer period
  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-06 22:52
    Well, there you go! Do keep in mind that you need solid battery connections and wiring to conduct that 5A x 10ms surge. A lot of 9V battery clips are cheaply made with loose clips and crimps and small gauge wires not well crimped because the typical current draw is well under 100ma.
Sign In or Register to comment.