Shop OBEX P1 Docs P2 Docs Learn Events
Strange uC to FET behavior — Parallax Forums

Strange uC to FET behavior

turbosupraturbosupra Posts: 1,088
edited 2010-09-18 17:58 in Propeller 1
I have my prop turning on a mosfet transistor like a switch

http://www.infineon.com/dgdl/IPP_B_I70N10SL-16.pdf?folderId=db3a304412b407950112b42a6a0a4339&fileId=db3a304412b407950112b42a72ce4342

and the transistor seems to be turning on and off, instead of turning on and staying that way until it should turn off.

I've placed my DMM on the props pin and I'm seeing 3.5, 3.6, 3.7. 3.8 and 3.9v at the gate, where the prop is connected to through a 1k resistor. How is that possible?

Comments

  • ErNaErNa Posts: 1,753
    edited 2010-09-18 08:13
    The gate has a certain capacity, which has to be charged to open the FET. In the range of 20 nC. Fig 6 parameter e shows, that it takes about 6 VGS to fully open the FET. Driving the FET directly from the prop is possible under certain circumstances, but not really a good idea.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-09-18 08:25
    Did you remember to connect the MOSFET's source to logic ground, as well as to the negative supply of your load?

    -Phil
  • ElectricAyeElectricAye Posts: 4,561
    edited 2010-09-18 08:54
    Did you remember to connect the MOSFET's source to logic ground, as well as to the negative supply of your load?

    -Phil

    Phil helped me out with a similar problem some time ago. You might check this link, number 25 has a picture Phil drew for me to clear up my own Mosfet troubles. Click on the thumbnail for a bigger view. But I was using an IRF3708 mosfet which can be directly driven by a Prop, so keep the gating voltage in mind.

    http://forums.parallax.com/showthread.php?t=116423&highlight=great+mosfet+grounded&page=2

    :)
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-09-18 09:03
    Thanks, ElectricAye! I was looking for that post. Here's the schematic:

    attachment.php?attachmentid=64181&d=1254549366

    It was drawn this way to emphasize that the load supply and logic ground need to be connected at a single point right at the transistor's source terminal.

    -Phil
  • T ChapT Chap Posts: 4,223
    edited 2010-09-18 09:58
    I just went through the same thing. Built a board that had the source tied to ground and the mosfet turned on fine. But then built a version that had the source floating, it stopped working when looking at it with an ohm meter across d/s. I wanted to build a version that was 'voltage free' so that the mosfet acted like a relay contact shorting out without the gnd in the equation, no luck.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-09-18 11:25
    T Chap,

    The MOSFET turns on when the voltage between the gate and the source reaches a certain level. That's why the source needs to be at ground potential relative to the signal driving the gate.

    If you need to isolate the two grounds, you can drive the MOSFET gate via a photovoltaic optoisolator.

    -Phil
  • turbosupraturbosupra Posts: 1,088
    edited 2010-09-18 11:42
    Hi ErNa,

    I was looking at line B with the 3.0v saturation line, it looks like I can drive 15A with 30mOhms of internal resistance, do you agree?


    ErNa wrote: »
    The gate has a certain capacity, which has to be charged to open the FET. In the range of 20 nC. Fig 6 parameter e shows, that it takes about 6 VGS to fully open the FET. Driving the FET directly from the prop is possible under certain circumstances, but not really a good idea.
  • T ChapT Chap Posts: 4,223
    edited 2010-09-18 11:45
    T Chap,

    The MOSFET turns on when the voltage between the gate and the source reaches a certain level.

    -Phil




    .....now you tell me...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-09-18 11:49
    T Chap wrote: »
    .....now you tell me...
    That's why is specified in the datasheets as VGS. :)

    -Phil
  • turbosupraturbosupra Posts: 1,088
    edited 2010-09-18 12:02
    Thanks for the replies.

    I'm not 100% sure if I did what you all are describing or not. I do have the source directly connected to battery minus (ground) but in order for current to flow through the solenoid, it has to take the path through the mosfet drain ---> mosfet source to ground.


    solenoiddiagram4.png





    I also tried replacing another relay with this same type of transistor and a 2n2222 BJT, but I burned out a prop pin. Maybe I need to use a PNP instead?

    solenoiddiagram5.png

    Did you remember to connect the MOSFET's source to logic ground, as well as to the negative supply of your load?

    -Phil
    Phil helped me out with a similar problem some time ago. You might check this link, number 25 has a picture Phil drew for me to clear up my own Mosfet troubles. Click on the thumbnail for a bigger view. But I was using an IRF3708 mosfet which can be directly driven by a Prop, so keep the gating voltage in mind.

    http://forums.parallax.com/showthread.php?t=116423&highlight=great+mosfet+grounded&page=2

    :)
    Thanks, ElectricAye! I was looking for that post. Here's the schematic:

    attachment.php?attachmentid=64181&d=1254549366

    It was drawn this way to emphasize that the load supply and logic ground need to be connected at a single point right at the transistor's source terminal.

    -Phil
    T Chap wrote: »
    I just went through the same thing. Built a board that had the source tied to ground and the mosfet turned on fine. But then built a version that had the source floating, it stopped working when looking at it with an ohm meter across d/s. I wanted to build a version that was 'voltage free' so that the mosfet acted like a relay contact shorting out without the gnd in the equation, no luck.
    T Chap,

    The MOSFET turns on when the voltage between the gate and the source reaches a certain level. That's why the source needs to be at ground potential relative to the signal driving the gate.

    If you need to isolate the two grounds, you can drive the MOSFET gate via a photovoltaic optoisolator.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-09-18 12:12
    Your top schematic should work if your ground symbol represents both the 13.8V negative supply line and the Propeller's Vss. I do urge you to connect these two "grounds" together at only a single point near the MOSFET's source pin. If the relay return current has to run through logic traces to get back to the 13.8V supply, you will be in for trouble.

    BTW, put your gate grounding resistor on the other side of the 680R series resistor. You'll maximize your gate drive voltage that way.

    -Phil
  • turbosupraturbosupra Posts: 1,088
    edited 2010-09-18 12:44
    Hi Phil,

    This is in a car, so if I understand you correctly, all electronics share a common ground with battery minus.

    The solenoid does have to go through some wiring to get to the chassis, but not through traces yet. I'm still at the breadboard phase :)

    For some reason when I try and actuate 2 of these transistors with 1 prop pin, I am having trouble. Any theory on why? If you had 2 of these transistors that you need to turn on with 1 prop pin, can you show me how you'd configure it through a schematic please?



    With the resistors, do you mean like this? (thank you again for the reply)

    solenoiddiagram6.png


    Your top schematic should work if your ground symbol represents both the 13.8V negative supply line and the Propeller's Vss. I do urge you to connect these two "grounds" together at only a single point near the MOSFET's source pin. If the relay return current has to run through logic traces to get back to the 13.8V supply, you will be in for trouble.

    BTW, put your gate grounding resistor on the other side of the 680R series resistor. You'll maximize your gate drive voltage that way.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-09-18 13:20
    "This is in a car, so if I understand you correctly, all electronics share a common ground with battery minus."

    Correct. But what are you using as a power supply for the Prop?

    Why two transistors? What are they driving?

    -Phil
  • ErNaErNa Posts: 1,753
    edited 2010-09-18 13:45
    As I told above: a FET is much more than an ideal switch: is incorporates a lot of cross coupled capacity, so you are driving more than 1 A, there is some ringing even when there is a freewheeling diode, the whole thing may oscillate and 3.0 v rarely open the FET, normally they are driven with more than 200 mA to the gate and at higher voltages. I would not try to drive a powerfet directly from a processor.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-09-18 14:04
    ErNa,

    I looked at the datasheet for the MOSFET that he's using. It has a low VGS drive requirement and should work fine with the Prop for driving a relay. The only time a MOSFET needs a high current drive is if you're PWMing it at a high rate. If all you're doing is turning it on and of to switch a relay, the static gate current requirement is near zero (i.e. leakage current). His 680R series resistor is more than enough to limit any transient gate current due to the gate capacitance.

    -Phil
  • turbosupraturbosupra Posts: 1,088
    edited 2010-09-18 14:36
    I'm using the 5v and 3.3v regulators, which step down the ~12v battery voltage.


    Phil, just to make sure there is no difference, I'm driving a solenoid and not a relay. I have 3 solenoids in the car to drive

    a solenoid that draws 1.5 amps and is switched on and off for seconds at a time (~1/4hz)
    a solenoid that draws 1.5 amps and is cycled at 300hz between ~25% and ~75% duty cycle
    a solenoid that draws 15 amps and is switched on for 1 or 2 seconds, only a few times a day (it opens my trunk)

    I'd like to use a FET that can do all 3 functions and I want to use 2 of these FETs to open the trunk solenoid, what do you think?

    "This is in a car, so if I understand you correctly, all electronics share a common ground with battery minus."

    Correct. But what are you using as a power supply for the Prop?

    Why two transistors? What are they driving?

    -Phil
    ErNa,

    I looked at the datasheet for the MOSFET that he's using. It has a low VGS drive requirement and should work fine with the Prop for driving a relay. The only time a MOSFET needs a high current drive is if you're PWMing it at a high rate. If all you're doing is turning it on and of to switch a relay, the static gate current requirement is near zero (i.e. leakage current). His 680R series resistor is more than enough to limit any transient gate current due to the gate capacitance.

    -Phil
  • turbosupraturbosupra Posts: 1,088
    edited 2010-09-18 14:36
    ErNa,

    Would you use a BJT in conjunction?

    ErNa wrote: »
    As I told above: a FET is much more than an ideal switch: is incorporates a lot of cross coupled capacity, so you are driving more than 1 A, there is some ringing even when there is a freewheeling diode, the whole thing may oscillate and 3.0 v rarely open the FET, normally they are driven with more than 200 mA to the gate and at higher voltages. I would not try to drive a powerfet directly from a processor.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-09-18 15:01
    You can certainly parallel MOSFETs; but, for the 15A load, I think I'd save myself some grief and use an optoisolated DC SSR. The other two loads shouldn't be a problem.

    -Phil
  • turbosupraturbosupra Posts: 1,088
    edited 2010-09-18 16:02
    Phil,

    These look pretty expensive compared to the 2 transistors, is this what you meant?


    http://www.mouser.com/Semiconductors/Solid-State-Relays/_/N-6gqku?P=1z0x2pjZ1yzvdptZ1z0x2psZ1yzutooZ1z0x35vZ1z0x35oZ1z0x2rkZ1z0x15eZ1z0x37sZ1z0x15dZ1z0x2roZ1z0x2pdZ1z0x2paZ1yzxf70Z1z0x2rrZ1z0x2p9Z1z0x2pzZ1z0x11nZ1z0x2riZ1z0x2poZ1z0x2q0Z1z0x0k8Z1yzuvrg

    or

    http://www.mouser.com/Semiconductors/Solid-State-Relays/_/N-6gqku?P=1z0x2pjZ1yzvdptZ1z0x2psZ1yzutooZ1z0x35vZ1z0x35oZ1z0x2rkZ1z0x15eZ1z0x37sZ1z0x15dZ1z0x2roZ1z0x2pdZ1z0x2paZ1yzxf70Z1z0x2rrZ1z0x2p9Z1z0x2pzZ1z0x11nZ1z0x2riZ1z0x2poZ1z0x2q0Z1z0x0k8Z1z0x104Z1z0x103Z1yzuujfZ1z0x11l


    I could just use a standard relay as well, but it would be nice to use the 2 inexpensive transistors?



    You can certainly parallel MOSFETs; but, for the 15A load, I think I'd save myself some grief and use an optoisolated DC SSR. The other two loads shouldn't be a problem.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-09-18 16:17
    No, those SSRs are all for AC loads. Unfortunately, the ones built for DC seem to be even more expensive. In that case, I think I would go the relay route and put the relay at the point of load (i.e. in the trunk). That will eliminate the 15A return currents back to your electronics module, which may be the source of your problems.

    You will need a diode across the relay coil, and another one across the contacts to prevent arcing, which will pit the contacts and shorten their life.

    BTW, something you will need to check: Most automotive apps use high-side switching, since the ground returns usually go through the chassis. Your circuit is meant for low-side switching. Make sure that you can switch the low sides of the solenoids in question.

    -Phil
  • turbosupraturbosupra Posts: 1,088
    edited 2010-09-18 16:51
    Hi Phil,

    I'll go back to switching off of the high side with the relay, that is a good idea.

    Right now I'm switching the coil with a BJT, it'd be nice to just drive the coil directly with the prop, what do you think about that? And with a relay like this?

    http://panasonic-denko.co.jp/ac/e_download/control/relay/vehicle/catalog/mech_eng_cnm.pdf



    No, those SSRs are all for AC loads. Unfortunately, the ones built for DC seem to be even more expensive. In that case, I think I would go the relay route and put the relay at the point of load (i.e. in the trunk). That will eliminate the 15A return currents back to your electronics module, which may be the source of your problems.

    You will need a diode across the relay coil, and another one across the contacts to prevent arcing, which will pit the contacts and shorten their life.

    BTW, something you will need to check: Most automotive apps use high-side switching, since the ground returns usually go through the chassis. Your circuit is meant for low-side switching. Make sure that you can switch the low sides of the solenoids in question.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-09-18 17:58
    No, you won't be able to drive the relay directly from the Prop. It has a 12V coil. Use the MOSFET for that.

    -Phil
Sign In or Register to comment.