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 3901 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
  • Former Member
    0 Former Member over 11 years ago

    I honestly in my opinion would use a 3.3v or 5v relay. But im not sure im only 14

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

    I honestly in my opinion would use a 3.3v or 5v relay. But im not sure im only 14

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

    Keep up the thinking , a very valid observation.

     

    Here is why it is mostly not done in this scenario (It is a valid approach but read on)

     

    If you use a relay (3V3 or 5V) you will still need a driver which will still probably be a ULN2003 or equivalent circuit (As there so cheap) as most controllers do not have the drive to switch a relay directly (Not without overloading the pin). As the load in this case is low voltage (Just high current) it is not necessary to add the addition of a relay as the driver already has the ability to control the LEDs.

     

    If the load was to be say mains voltage (~110V or ~220V depending on location) then it would be very prudent to provide Isolation between the load and your circuit. firstly to prevent  accidentally blowing up your board or other attached devices to the PI and also to protect you when touching the board or connected stuff. it also prevents mains interference and spikes (Board Killers) from getting to your stuff.

     

    So as a general rule if your load low voltage and don't need the isolation, a driver circuit like the ULN2003 is perfect for the job, you can always add a power MOSFET for very high currents. If you need to isolate the load for various reasons, then use a relay (Solid State or Mechanical). If your driving AC loads then a relay makes it easy. If you don't know what your going to control, a relay is a safe bet to have max flexibility

     

    Hope this clarifies and helps you to decide for future projects

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

    Hi Hayden age is not an issue at all, knowledge doesn't know about ages, old guys as me just had more time to learn.

     

    The problem with a relay for this setup is they are going to be good just for the on/off strip and timing.

     

    The PWM strip can't use relays as relays won't see the pulses as light dimming and just will see low voltages on low duty cycles and will turn on on high duty cycles.

     

    Relays are also quite slow for lights, when you want to do fancy light effects.

     

    They are also more expensive than darlington arrays, the ULN2003 is just a handful of cents, and you can drive many nice stuff with them like stepper motors and other things.

     

    They are also safer to use as they are not inductive and produce no flyback when the electric field in the inductive load collapses.

     

    They are quite fun devices to play with. I always have some in my components box, you can use them for a lot of things.

     

    If you don't understand any of those terms just ask. I will leave here some links just in case ( I don't mean you don't know them, I put them just in case as I said ).

     

    Pulse-width modulation - Wikipedia, the free encyclopedia

     

    Flyback diode - Wikipedia, the free encyclopedia

     

    Darlington transistor - Wikipedia, the free encyclopedia

     

    Inductance - Wikipedia, the free encyclopedia

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

    Great point Peter.

     

    Sometimes I forgot this is the Raspberry forum.

     

    You won't drive a 5V relay directly from the Pi GPIOs.

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

    Relays are not really suitable for this kind of applications because although they can certainly switch the voltage/current they can only realistically operate sub 10 times a second and at this rate they would wear out in a very shot time.

    10 times a second would not give any perception of a dimming controller just a flashing light and very unpleasant .

    Most dimmers operate on the 50/60hz of the mains and in practice it's much nicer if you switch at much higher frequencies than this !!

    • 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

    If i lead anyone to think I was talking about using them for the PWM channel... Sorry but no

     

    I was only referring to the simpler on off channels. John is absolutely right in his statement, relays are not fast enough or suitable for dimming

     

    the ULN2003 of course will work for all the above required situations, PWM and ON/Off alike

     

    Peter

    • 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