Connect with us

Help select suitable Mosfet for driving relay.

Discussion in 'Microcontrollers, Programming and IoT' started by HellasTechn, Apr 27, 2019.

  1. HellasTechn

    HellasTechn

    1,406
    195
    Apr 14, 2013
    Hello !

    I want to drive a DPDT relay (FEME LCA 002 12 57) from my arduino mega board. So far i used a BC337 transistor but after running it for a day or two having the relay continuously engaged, i found the transistor shorted. The relay coil will draw 45-50ma and has a resistance of 265 Ohms. The relay coil does get warm but i am not sure if that is normal or not. I replaced the relay with a new one of the exact same brand and model and got the same outcome (shorted transistor not blown open).

    To be honest i dont know why the transistor shorted since it is supposed to be able to handle up to 500ma of load current. I do use a 1n4001 flyback diode to protect the transistor. Could it be that the 1n4001 is not sufficient to protect the transistor ? Should i use an 1n4004 for example ?

    Now i am thinking to replace it wit a mosfet. Any suggestion which one to use or how to select one?

    P.S.
    I think it might be worth mentioning that i bought the transistors from ebay-china but i would like to upgrate to something more durable anyway so the question about mosfet selection still stands.

    THANK YOU!
     
    Last edited: Apr 27, 2019
  2. Minder

    Minder

    2,807
    583
    Apr 24, 2015
    IRL540 is a logic gate version I use.
    M.
     
    hevans1944 and HellasTechn like this.
  3. Bluejets

    Bluejets

    3,423
    691
    Oct 5, 2014
    2N7000 is also a common choice for driving relays from Arduino.
     
    hevans1944 likes this.
  4. Bluejets

    Bluejets

    3,423
    691
    Oct 5, 2014
    Depends how hard you turn it on.
     
    Mark2019 likes this.
  5. HellasTechn

    HellasTechn

    1,406
    195
    Apr 14, 2013
    Yes. It looks very interesting.

    The 2n7000 can handle up to 200ma instead of the 500ma that the BC337 can. i am not sure why to select that over the BC337.

    Well it is controlled by the Microcontroller. I write the commant to turn it on and the pin goes from 0V to 5V through a 1K resistor. Now if you are asking about me pulsing the transistor on and off fast then that is not the case.
     
  6. Bluejets

    Bluejets

    3,423
    691
    Oct 5, 2014
    No, not asking about pulsing,
    1K0 may be too high on 5v.
    I'd normally use 330R just to make sure it's hard on.
     
  7. Bluejets

    Bluejets

    3,423
    691
    Oct 5, 2014
    To avoid the problems selecting the right base resistor and the transistor getting cooked perhaps...??

    If you decide to go with a mosfet, don't forget the gate to ground 10K resistor.
     
    HellasTechn likes this.
  8. duke37

    duke37

    5,200
    710
    Jan 9, 2011
    A 1N4001 flywheel diode should protect the transistor. Why consider a 1N4004 when you can get a 1N4007 for the same price or very little more?

    Measuer the voltage across the transistor to check that it is turned on fully (under 0.5V).
    Is the transistor hot?
     
  9. HellasTechn

    HellasTechn

    1,406
    195
    Apr 14, 2013
    No. The transistors do not run hot at all. i will measure voltages and let you know.
     
  10. hevans1944

    hevans1944 Hop - AC8NS

    4,139
    1,965
    Jun 21, 2012
    This is really strange: AFAIK it should not happen if the BC337 NPN transistor base is driven hard enough from a digital (NOT ANALOG!) output port bit to cause the collector to emitter voltage to saturate. See @Bluejets post #6 above.

    At collector-emitter saturation, there should be 0.7 VDC maximum from collector to emitter. If the BC337 collector-emitter voltage rises above saturation, toward the power supply voltage of the relay coil, because the base voltage is too low, the transistor will be operating in its so-called linear region. Its power dissipation, the product of collector current and the collector-emitter voltage, is much larger than the small amount of power dissipated at saturation. And of course there is no power dissipated if the BC337 is biased off and little to no collector current occurs. You must avoid operating in the so-called linear region.

    The datasheet specs a base current of 50 mA for 500 mA collector current at saturation. That seems a bit high to me, but 5 V across 1 kΩ is only 5 mA, and perhaps a lot less, since you also have to forward-bias the base-emitter junction by about 0.7 VDC, which subtracts from the voltage available to drive the transistor base-emitter junction and the current through the 1 kΩ base resistor.

    Sometimes leakage paths can develop that prevent a transistor that has no intentional base-drive voltage (Arduino output is OFF) from achieving cut-off. If this unfortunate defect in layout or design occurs, the transistor will be ON and operating somewhere in its so-called linear region when it is supposed to be non-conducting. If you suspect this is a problem, or verify that it exists by making collector-emitter voltage measurements, adding a 10 kΩ resistor from base to emitter will generally be enough to "short circuit" the leakage currents without appreciably attenuating the base drive signal when the Arduino output is ON. But try lowering the value of the base resistor first. The digital I/O ports are capable of providing 40 mA at 5 VDC, so an output pin should be capable of driving 125 Ω. I would try using a 220 Ω resistor instead of the 1 kΩ you are currently using. Check the collector-emitter voltage with the relay coil energized... should be about 0.7 VDC. Check the collector-emitter voltage with the relay coil de-energized... should be the same as power supply voltage applied to the relay coil. Finally, make sure the diode is wired as close as possible directly across the relay coil terminals, not six or twelve inches away. Diode cathode to power supply positive, diode anode to transistor collector.

    Report back here with your voltage measurement results.
     
    Bluejets likes this.
  11. HellasTechn

    HellasTechn

    1,406
    195
    Apr 14, 2013
    Ok, here are the readings.

    The supply voltage is 11.97V and the readings on the transistor (emitter to ground) with the relay engaged AND A 1K base resistor are as follows:
    VCE = 0.09V (positive terminal to collector)
    VBE = 0.75V (positive terminal to base)
    VBC = 0.66V (positive terminal to base)
    VBE with the relay disengaged is exactly the same as the supply voltage = 11.97V

    Why on the arduino forums they suggest an 1k base resistor ?
    https://forum.arduino.cc/index.php?topic=493559.0

    The picaxe manual also recommends 1K base resistor.
     
    Last edited: Apr 29, 2019
  12. HellasTechn

    HellasTechn

    1,406
    195
    Apr 14, 2013
    I have one other question. if i use the mosfet to drive the relay then i suppose i can add one more relay in parallel. there should be no problem right ? Like in the attached diagram.
     

    Attached Files:

  13. Bluejets

    Bluejets

    3,423
    691
    Oct 5, 2014
    Don't forget to common the grounds between Arduino and the 12v supply.
     
    HellasTechn likes this.
  14. hevans1944

    hevans1944 Hop - AC8NS

    4,139
    1,965
    Jun 21, 2012
    Your voltages (except for the last one, VBE, look okay, so whatever is causing your transistor to melt down is not obvious. If you measured VBE = 11.97 V, I would expect that to quickly destroy the base-emitter junction and no further "transistor action" would be possible.
     
  15. hevans1944

    hevans1944 Hop - AC8NS

    4,139
    1,965
    Jun 21, 2012
    Sure, that should work. But DPDT relays in the same form-factor as SPDT are readily available at virtually the same cost. Or do you just happen to have a lot of SPDT relays on-hand and available for use?
     
  16. HellasTechn

    HellasTechn

    1,406
    195
    Apr 14, 2013
    OOOPS, my bad !!!
    It is VCE = 11.97V that was a typographical error. SORRY.
     
  17. HellasTechn

    HellasTechn

    1,406
    195
    Apr 14, 2013
    Actually i was too lazy to look for the DPDT symbol in the drawing software :p
    Again like you said it the same thing, only in my case i want to drive two DPDT's with the same MOSFET from one arduino output.

    The cause is probably ebay-china... What else could it be huh ?
     
    Last edited: Apr 30, 2019
  18. BobK

    BobK

    7,592
    1,636
    Jan 5, 2010
    Um, that means the transistor is fully off. How about readings when it is on?

    Bob
     
  19. hevans1944

    hevans1944 Hop - AC8NS

    4,139
    1,965
    Jun 21, 2012
    That was reported in post #11:

    My response to that was to add comments (in red) inside his quote, which upon review was probably not a good idea. The editor truncates the display of quoted texts unless the reader explicitly expands the displayed text. I suppose this is a "good" idea, since it prevents cluttering up the screen with previous posts, but it makes responding to multiple points a real PITA if each point must be replicated again to distinguish individual responses.

    Anyhoo, based on the readings Constantine reported (and later corrected), I can find no reason why his original circuit destroys BJTs. He blames it all on eBay and Asian merchants in his post #17, but I think there is something else going on that we don't know about yet. <sigh> And now, if I read post #17 correctly, he wants to drive two DPDT relays (paralleled coils) instead of just one 4PDT relay. Again, that should work with either BJT or MOSFET drivers.
     
  20. HellasTechn

    HellasTechn

    1,406
    195
    Apr 14, 2013
    I understand your thinking but no. not really. Unless there is something i am not aware of like a pcb defect. Again dont think so since all readings are good.
    Come to think about it i can buy a few BC337's from my local electronics shop and run them for a few days to see what happens. I know for sure that they get the parts from reputable importers which in turn import only original parts.

    P.S.
    Generally speaking i am very happy with the parts i get from ebay - china but it hapens from time to time to run into malfunctioning parts like the MAXIM MAX232 back in 2016 where they would overheat and burn without obvious reason(they where counterfeit).
    Sir if you are curious enough i have the link for you. You even answered me back then
    https://www.electronicspoint.com/fo...ilover-circuit-upgrade-attempt.278866/page-12
    post #222 states the problem
    Posts #242 through 244 are the answer.

    That is correct. I can not use one 4PDT relay because of the physical locations of the components on the PCB. I can always use two different mosfets with their gates connected on the same arduino pin to drive each relay but since one mosfet can safely handle more than one relay then i dont see the reason why not.
     
    Last edited: May 1, 2019
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-