element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum ULN2003A driving IRF540N mosfet
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 34 replies
  • Answers 1 answer
  • Subscribers 395 subscribers
  • Views 6237 views
  • Users 0 members are here
Related

ULN2003A driving IRF540N mosfet

wallarug
wallarug over 10 years ago

Hey guys,

 

I am trying to expand the number of outputs on a board that I built 6 months ago that controls high current LED strips but am unsure if the following would work. Could someone please let me know if what I am trying to do in the following schematic will even work??

 

Thanks is advance.

 

imageimage

 

PS: I am aware of the 'negative logic' on the march 2014 version.

  • Sign in to reply
  • Cancel
Parents
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago

    Like this image

     

    "Here's one I prepared earlier"

     

    http://www.element14.com/community/groups/internet-of-things/blog/2014/08/05/drive-big-things-with-added-safety-opto-isolators

     

    Regards

     

    Peter

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 10 years ago in reply to Robert Peter Oakes

    Trust you to have polished your crystal ball.  image

     

    I always cringe when expensive hardware is not protected ...

    The advantage of the opto-couplers is they can be remote from the processor, and even duplicated.

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • wallarug
    0 wallarug over 10 years ago in reply to Problemchild
    Wasn't the optoisolator the preferred method last time this was raised BTW?

     

    No.  This is the first time I have heard of a optoisolator.  In the last discussion no-one even suggested them, which is why I was a bit confused when they came up here.

     

    Link to previous discussion:  http://www.element14.com/community/message/113013/l/arduino-and-transistors-question--re-school-musical-production#11301…

     

    I will take a detailed look at everything that everyone has posted on this thread and consider what I might do.

     

    >> I see he's using an unlicensed copy of Johnny Cad and added his own logo.....This is simply terrible!

    I don't think any version of Johnny Cad is going to cut it for the project I have in mind.  Is there an more digital alternative to Johnny Cad?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 10 years ago in reply to wallarug

    Actually the opto-coupler did come up in reply #105

    http://www.element14.com/community/message/114536/l/re-arduino-and-transistors-question--re-school-musical-production#114536

     

    To be fair optoisolator and optocoupler are basically the same device.

    Sometimes the 'isolator' can have a mechanical interrupter (ie mouse wheel, door switch, end stop) that breaks the link between the LED and detector.

     

    You have obviously gotten to the point where your skills are being used more and more.

    This is the opportunity to plan for the future and make the board/boards able to be multiversal.

     

    If you make the board with an optocoupler and bring out both the Anode and Cathode along with the ability to change the series resistance, then it could be driven by almost anything you want.

    Several could even be run in parallel, and at some distance from the controller, or switch bank or whatever.

     

    I did this once with a Jackpot system controller which switched 24vAC and was perfect when one establishement wanted two signs linked together.

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Problemchild
    0 Problemchild over 10 years ago in reply to wallarug

    Optoisolator/optocouplers are are used to describe what is basically the same thing.  After a while people may use the wrong exact term but every one knows what they mean (fortunately) I'm sure this goes for many fields of knowledge.

     

    If you go the E14 route I'm sure you can pic up some of the quad packages like this one here:

    http://uk.farnell.com/toshiba/tlp620-4-gb/optocoupler-quad-5kv-transtr-o/dp/1225838

     

    This is the UK one but I'm sure you can find the part in the .Au  E14or Farnell

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Problemchild
    0 Problemchild over 10 years ago in reply to Problemchild

    For the cad package have you considered Eagle which has a free version for low complexity boards (this one should be OK).

    Or go for completely opensource and go for Kicad

     

    http://www.cadsoftusa.com/

    http://www.kicad-pcb.org/display/KICAD/KiCad+EDA+Software+Suite

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago in reply to Problemchild

    For faster response time you can use the Darlington output versions, this provides faster rise time on the outputs, these are what I used for the Electronic Referee project

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • wallarug
    0 wallarug over 10 years ago in reply to mcb1

    mcb1 wrote:

     

    Actually the opto-coupler did come up in reply #105

    http://www.element14.com/community/message/114536/l/re-arduino-and-transistors-question--re-school-musical-production#114536

     

    Aha!  So they did...

     

    Must have skipped over those responses at the time (10 days before the musical started - lighting order due in 3 days).

     

    Some of them are very interesting, and sort of complicated for what I want to do.

     

    What are the chances of the MOSFET breaking anyway?

     

    I was doing a bit of research last night on the different ways and reasons that MOSFETs fail.  I found this website particularly interesting:  4QD Information Section

     

    In summary:

    • Too much voltage supplied (either to the gate or source/drain) 12 VDC is well inside the allowable limits of IRF540 (which is max 100V)
    • Too much current supplied (source/drain) only going to be supplying 0.5A on average maybe up to 1.0A at times through MOSFET (way inside max allowed: 33A)
    • dV/dt failure Not controlling motors, so I should be right on this one.
    • Excess Power dissipation Like before, using the MOSFET way inside its limit
    • "Foreign Object Failure"
    • Short-Circuit

     

    Of the list above, only two of them could possibly cause a massive failure in the MOSFET:

    1. Foreign Objects (leading to...)
    2. Short Circuit

     

    If a short circuit did occur (which still has a low chance when one is being extremely careful), then having an opto-coupler between the controller and the board would be nice.  I was thinking of making a sort of 'complimentary' buffer board with opto-couplers on it.  Maybe I could just buy one to save on the soldering.


    I will have a poke around on Element14 AU and see what they have.


    Replies to messages that came while I was typing this one (reverse order):

     

    0. Noted.   Thanks peter.

    1. I will give eagle cad free a go.

    2. Thank you for all the links.  I will have a look once this is submitted.

    3. More knowledge / information on  opto-couplers --> thank you for informing me on differing terminology.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • wallarug
    0 wallarug over 10 years ago in reply to Problemchild

    This one could do the trick:

     

    http://au.element14.com/vishay/cny74-4h/optocoupler-transistor-5000vrms/dp/1045432

     

    But when using these with a micro-controller, you would have to provide some sort of 'boost'/buffer due to the input current being >30mA,  right?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago in reply to wallarug

    yup, or this for the Darlington version

     

    http://au.element14.com/vishay-semiconductor/ilq55/optocoupler-photodarlington-5300vrms/dp/1612450

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • wallarug
    0 wallarug over 10 years ago in reply to Robert Peter Oakes

    I am reading the datasheet correctly:

    maximum 125mA output current

    20mA into the base (now an LED)

     

     

    1. To use one of these do you have to buffer both the input and the output if you plan on driving >120mA and your micro-controller can only handle <15mA output?

    2. Connect to controller like a normal LED?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 10 years ago in reply to wallarug

    you would have to provide some sort of 'boost'/buffer due to the input current being >30mA,  right?

    Not necessarily, as this is the maximum current.

     

    Your current transfer ratio is the 'gain/loss' in the system.

     

    In thisimage

    In this spec they apply 5mA to the LED, and the Collector current is 2.5-30mA (50-600%) at 5v supply

    At 10mA it is 6-12mA (60-120%) at 5v supply

     

    The other one peter quoted is between 100 and 400% transfer but has a higher saturation voltage (0.9v), which may cause some problems depending what fet you use.

    Since you will be driving a mosfet and its a voltage device, then high current isn't really necessary, and with the isolation, you can always use it to supply voltage to the gate, rather than drag down the voltage source.

     

    Your investigation about failures is absolutely right.

    For a production where you want nothing to go wrong having that litte extra insurance, for a few dollars is probably worth it.

    It also gives you some increased flexibility, so its not wasted.

     

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • mcb1
    0 mcb1 over 10 years ago in reply to wallarug

    you would have to provide some sort of 'boost'/buffer due to the input current being >30mA,  right?

    Not necessarily, as this is the maximum current.

     

    Your current transfer ratio is the 'gain/loss' in the system.

     

    In thisimage

    In this spec they apply 5mA to the LED, and the Collector current is 2.5-30mA (50-600%) at 5v supply

    At 10mA it is 6-12mA (60-120%) at 5v supply

     

    The other one peter quoted is between 100 and 400% transfer but has a higher saturation voltage (0.9v), which may cause some problems depending what fet you use.

    Since you will be driving a mosfet and its a voltage device, then high current isn't really necessary, and with the isolation, you can always use it to supply voltage to the gate, rather than drag down the voltage source.

     

    Your investigation about failures is absolutely right.

    For a production where you want nothing to go wrong having that litte extra insurance, for a few dollars is probably worth it.

    It also gives you some increased flexibility, so its not wasted.

     

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • wallarug
    0 wallarug over 10 years ago in reply to mcb1

    Yes, for the supplying the FET there is nothing wrong with using the above Opto-coupler.

    Still learning about opto-couplers ATM and getting my head around the different terminology but I understand everything that you said above.

     

    However, I haven't been very clear on this thread and might have drifted a bit from the original question because I am working on a number of different projects at once, trying to see how I can improve each one with what is said in this discussion.  Other projects that I have done in the past have also drifted into this discussion as well.  I will just briefly outline each one for clarity.

     

    Project One:  The Musical Set Prop Control Board (A.k,a:  "The Hot Box Sign")

    Status:  Complete and FINISHED.  It is just being used as a reference for "project two" because it worked so well.

     

    Project Two:  Christmas Lights Control Board for controlling 5050 RGB LED Strips

    Status:  Planning stage.  It should be the one being discussed in this thread.  I might have mentioned it above somewhere but just for clarity I shall rehash:  I want to control seven RGB LED strips which vary in length from 0.5 meters to 2 meters.  I worked out that I need 21 channels to control each strips RGB colours individually. The power used by each 'channel' is approximately 0.6A maximum. I was going to use IRF540N MOSFETs allow me to control the LEDs from a micro-controller (possible a Raspberry Pi or Arduino).

     

    Project Three:  Model Railway Redo

    Status:  Planning Stage.  I will probably do a write up on this one later but I was going to use some of the content discussed here (such as: Opto-couplers, MOSFETs, ULN2003, etc.) on this project as well.  It involves controlling a variety of different devices (signals, point motors) with an Arduino, 98% software driven.

     

    So in response to mcb1

    Since you will be driving a mosfet and its a voltage device, then high current isn't really necessary, and with the isolation, you can always use it to supply voltage to the gate, rather than drag down the voltage source.

    I understand but I have been thinking about a variety of projects as well as discussing this one and that's why I asked:

    1. To use one of these do you have to buffer both the input and the output if you plan on driving >120mA and your micro-controller can only handle <15mA output?

    So you don't have to buffer the input if you plan on driving < 5mA load due to the gain/loss ratio.  Thank you for answering my ambiguous questions.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube