element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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 Simple circuiting question, using Arduino
  • 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 Verified Answer
  • Replies 30 replies
  • Answers 2 answers
  • Subscribers 420 subscribers
  • Views 3152 views
  • Users 0 members are here
Related

Simple circuiting question, using Arduino

e14 Contributor
e14 Contributor over 13 years ago

I want to control a 24v DC circuit with a my arduino, what would be the proper component and roughly how would I use it. Basically when I set a pin to high, I want it to switch the 24V on, and turn it off when set to low. From what I can gather, I need a MOSFET, but I have minimal knowledge on what to look for in one. Would someone be able to assist me?

 

(p.s. This is my first discussion, sorry if I am doing this incorrectly)

  • Sign in to reply
  • Cancel

Top Replies

  • johnbeetem
    johnbeetem over 13 years ago in reply to ntewinkel +2
    Nico teWinkel wrote: You should probably at least have a resistor between the Arduino pin and the mosfet. [I've never designed with Arduino, so these are comments that apply to most microcontrollers.]…
  • ntewinkel
    ntewinkel over 13 years ago +1 suggested
    Hi Mason, You should probably at least have a resistor between the Arduino pin and the mosfet. Oomlout has a circuit example using a smaller transistor: http://www.oomlout.com/oom.php/products/ardx/circ…
  • ntewinkel
    ntewinkel over 13 years ago +1
    ps, this Instructable might also help: http://www.instructables.com/id/Use-Arduino-with-TIP120-transistor-to-control-moto/
Parents
  • johnbeetem
    0 johnbeetem over 13 years ago

    Here's a short Raspberry Pi discussion about driving a 5V relay from a RasPi GPIO.  The second comment shows a simple NPN transistor circuit.  I believe you can use the same circuit with your 24V external device provided that you select a transistor with a high voltage rating.  [This opinion provided without warranty.]

     

    Note that the circuit has a 1K current limiting resistor between the GPIO and transistor base.  You don't want to drive an NPN transistor base directly from a GPIO with the transistor's emitter grounded, because the voltage drop across the transistor base-emitter junction should not be more than 0.6 volts and if the GPIO pin tries to pull it up to 3.3V you're likely to damage something.  The 1K resistor limits the current to about 2.7mA assuming a 3.3V GPIO, or about 4.4mA with a 5V GPIO.

     

    The transistor multiplies current by a factor of "beta", with is typically 10-20.  That is, the transistor can amplify a 2.7mA current through its base-emitter junction to 27 mA or more through its collector-emitter junction depending on what's hooked up.  If this is not enough current, you can use two NPN transistors in the form of a Darlington Pair, which gives you a current multiplication of "beta" squared.

     

    Before using your external 24V device, be sure to test using an LED so you can tell if you've got things hooked up correctly.  You typically want to limit LED current to 2-5mA, which means you need a 5-10K resistor between the LED and 24V.  The voltage drop across a working LED is 2.4V or so, depending on color.  If you put more than that across an LED, it will emit a very bright light once before it turns into a DED (dark-emitting diode).

     

    Edit: a high-voltage transistor with at least 40V reverse breakdown voltage should be all the protection you need.  However, since 24V will easily kill a micro-controller, if you're worried you can use a 5V relay or opto-isolator to control the 24V circuit.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • johnbeetem
    0 johnbeetem over 13 years ago

    Here's a short Raspberry Pi discussion about driving a 5V relay from a RasPi GPIO.  The second comment shows a simple NPN transistor circuit.  I believe you can use the same circuit with your 24V external device provided that you select a transistor with a high voltage rating.  [This opinion provided without warranty.]

     

    Note that the circuit has a 1K current limiting resistor between the GPIO and transistor base.  You don't want to drive an NPN transistor base directly from a GPIO with the transistor's emitter grounded, because the voltage drop across the transistor base-emitter junction should not be more than 0.6 volts and if the GPIO pin tries to pull it up to 3.3V you're likely to damage something.  The 1K resistor limits the current to about 2.7mA assuming a 3.3V GPIO, or about 4.4mA with a 5V GPIO.

     

    The transistor multiplies current by a factor of "beta", with is typically 10-20.  That is, the transistor can amplify a 2.7mA current through its base-emitter junction to 27 mA or more through its collector-emitter junction depending on what's hooked up.  If this is not enough current, you can use two NPN transistors in the form of a Darlington Pair, which gives you a current multiplication of "beta" squared.

     

    Before using your external 24V device, be sure to test using an LED so you can tell if you've got things hooked up correctly.  You typically want to limit LED current to 2-5mA, which means you need a 5-10K resistor between the LED and 24V.  The voltage drop across a working LED is 2.4V or so, depending on color.  If you put more than that across an LED, it will emit a very bright light once before it turns into a DED (dark-emitting diode).

     

    Edit: a high-voltage transistor with at least 40V reverse breakdown voltage should be all the protection you need.  However, since 24V will easily kill a micro-controller, if you're worried you can use a 5V relay or opto-isolator to control the 24V circuit.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
No Data
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 © 2026 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube