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
  • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum RasPi and PWM controlled LED strip
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 26 replies
  • Answers 1 answer
  • Subscribers 677 subscribers
  • Views 3825 views
  • Users 0 members are here
  • raspberrypi
Related

RasPi and PWM controlled LED strip

freddyfred5
freddyfred5 over 11 years ago

Hello there people, I am currently working on a casemod, and I would like to use a RasPi as the controller for some LED strips (12v, pulling about 700ma each).

 

The RasPi will act as a webserver hosting a website for remotely controlling the strips, as well as viewing some information about the system (temp sensors, fan speed. don't care about these, they are up and running). But it will also control 2 12v LED strips, and these strips pull too much for the RasPi to control directly.

 

Now, I do have some TIP120's here, and as far as I can see they should work, but I am unsure of how to connect them.

 

Could someone here please help me with getting everything set up properly?

 

Parts:

PSU: Corsair CX

RasPi: Rev 1, model B

Lights: 12v, pulling around 700ma each

 

Wanted outcome:

PWM control on one LED strip

Normal (on, off) on the other

A living RasPi

 

Questions:

Could you help me set this up in a way that does not any part?

Do I need a capacitor in front of the RasPi to ensure no harm is done under startup? (Will 4700 microfarads do?)

Should I use a fuse, or is it unnecessary?

Am I asking too many questions?

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

    Easiest thing I can recommend is to use an ULN2003 8 channel driver chip, quite cheap and available everywhere

    you can gang channels together for more current handling and each channel will handle about 500mA (So 4A total)

    look here for details http://www.newark.com/stmicroelectronics/uln2003a/darlington-transistor-array-npn/dp/89K1130

     

    you may need to search you local branch, just search for ULN2003

     

    directly logic compatible and will handle well over 12 volts for the supply of the devices being driven and much simpler to interface then individual transistors (No resistors except perhaps to limit the LED current

     

    power the PI from a separate adapter than the LEDs and other loads, it will be much more stable and less lightly to blow the PI and then you do not need a capacitor on that line.

     

    only have the grounds of the PI and LED supply connected together.

     

    You probably can use any available GPIO for the ON/OFF and there is one GPIO that supports PWM, this too can directly drive the 2003 chip

    see http://raspberrypi.stackexchange.com/questions/298/can-i-use-the-gpio-for-pulse-width-modulation-pwm for details on PWM

     

    if you still want to use the TIP120 then put a 2K2 resistor (Approx.) between the output of the PI to the Base of the TIP120, connect the emitter to ground and the collector to the LED's low side, connect the high side of the LEDs to the 12V. Make sure there is something to limit the LED current if there not pre wired to sun on 12V supply (I don't know the brand or configuration you using) The ULN2003 contains 8 channels of drivers and there all Darlington pairs so very high gain, plus they contain all resistors etc to drive the load from a simple logic output so you wont need resistors between GPIO and the 2003 for instance (Simpler to use)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Reply
  • Robert Peter Oakes
    0 Robert Peter Oakes over 11 years ago

    Easiest thing I can recommend is to use an ULN2003 8 channel driver chip, quite cheap and available everywhere

    you can gang channels together for more current handling and each channel will handle about 500mA (So 4A total)

    look here for details http://www.newark.com/stmicroelectronics/uln2003a/darlington-transistor-array-npn/dp/89K1130

     

    you may need to search you local branch, just search for ULN2003

     

    directly logic compatible and will handle well over 12 volts for the supply of the devices being driven and much simpler to interface then individual transistors (No resistors except perhaps to limit the LED current

     

    power the PI from a separate adapter than the LEDs and other loads, it will be much more stable and less lightly to blow the PI and then you do not need a capacitor on that line.

     

    only have the grounds of the PI and LED supply connected together.

     

    You probably can use any available GPIO for the ON/OFF and there is one GPIO that supports PWM, this too can directly drive the 2003 chip

    see http://raspberrypi.stackexchange.com/questions/298/can-i-use-the-gpio-for-pulse-width-modulation-pwm for details on PWM

     

    if you still want to use the TIP120 then put a 2K2 resistor (Approx.) between the output of the PI to the Base of the TIP120, connect the emitter to ground and the collector to the LED's low side, connect the high side of the LEDs to the 12V. Make sure there is something to limit the LED current if there not pre wired to sun on 12V supply (I don't know the brand or configuration you using) The ULN2003 contains 8 channels of drivers and there all Darlington pairs so very high gain, plus they contain all resistors etc to drive the load from a simple logic output so you wont need resistors between GPIO and the 2003 for instance (Simpler to use)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Children
  • freddyfred5
    0 freddyfred5 over 11 years ago in reply to Robert Peter Oakes

    I was thinking of using the cap to protect the RasPi from voltage spikes at startup, I have measured a slight spike on the 5v rail, is this necessary? (it reached 5.3 and pretty much immediately set itself to 5.01v)

     

    When you say high and low, do you mean positive/negative? (coming from a purely computerbased background, I can only think of 1 and 0 when hearing that image)

     

    I was thinking of using the TIP120 as I have quite limited space (also because I have a couple lying around, hehe), and I would need to rethink the cabling a little, if I should choose to use the 2003 chip.

     

    But thanks alot for giving me some solid advice on resistor values and such, and thanks for the link on the PWM functionality. And it is good to know that it is not too many questions image

     

    One last question: do I need to take care of what type of wire I use, or is that not so important? (thinking of using solidcore wire, unsure of thickness yet)

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

    Cap for the PI supply, not necessary but make sure you have a good power adapter (a 5V one, NOT 5.25V one) and a good USB cable to the PI (Or a short one), see http://www.element14.com/community/community/raspberry-pi/blog/2014/03/07/raspberry-pi-usb-power-cables-crashing-and-other-problemsfor details and background

     

    solid wire is ok on bread boards and proto boards, not so good if the device attached can move around

     

    I would suggest something like 24AWG or better multi-strand wire for the run to the LEDs, available from home depot and most hardware stores. Here depending on how far away they are you could get a significant voltage drop across the cable if it is too thin (28AWG for instance) and the LEDs will therefor be dimmer.

     

    Using the TIP120 is ok, it is already a darlington pair (Like one of the channels in the 2003 but without the base 2.2K resistor) but more current capable so it will work with no problems in your application

     

    The LEDs your mentioning should have markings on them to indicate + and -. high refers to the + end, low refers to the - end.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • freddyfred5
    0 freddyfred5 over 11 years ago in reply to Robert Peter Oakes

    As said, the PSU is a Corsair CX, it is using the 5v rail on that, meaning a relatively stable ATX PSU.

     

    The device will not move around much (it will be put in place, and moved slightly when opening the case door).

     

    They have the markings, the prototype is now wired up with everything in a bit of an ugly way, and now are only missing the paintjob to reach a "proper" casemod procedure, thanks alot for the help image

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

    no problem, post a pic when complete, would be nice to see

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to Robert Peter Oakes

    Peter,

    The ULN2003 is only a seven channels power darlington.

    For an 8 channels, there was an ULN2083 most likely discontinued now.

    Or better look for MOSFET low side drivers that are now higher current and fairly high voltage.

     

     

    Jean-Paul

    AC9GH

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 11 years ago in reply to Former Member

    Thanks for the correction, either way in this case more than enough for the job

     

    Peter

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

    Peter I would note the manufacturer's de-rating curves for temperature/Duty Cycle/number of outputs and I think you'll find it's current switching capacity for this application to be much much less than the optimal 4A.

    Also he does  not specify the number of light strips which are normally at 1A+ per Metre.

    Larger descrete FETs may well be the way to go !

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

    this is all for illuminating the inside of a computer case for a mod hack, so not too many LEDs and stuff the devices recommended should be ok for this purpose

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

    I was working on the "several strips" at 700ma ea and mapping on to the curves in the Data Sheet

    Fullscreen 4478.contentimage_176476.html Download
    <html><head><title>Jive SBS</title></head>
    <body><font face="arial,helvetica,sans-serif">
    <b>Error</b><br><font size="-1">
    An general error occurred while processing your request.
    </font></font></body></html>
    

    • 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