I recently bought 30 m of rgb led strip and I wondered if I could control it with my arduino using 3 pwm signals for each of the colors. Of course, an external power supply would be needed since arduino is not capable of supplying the current needed to turn on the led strip. Since I'm still a beginner, I tried to search on the internet, but I only found examples for driving 12v led strips. How can I adapt a circuit like this and make it work with a 5v led strip. which mosfets or transistors should i use?
There are different kinds of LED strips. Exactly what did you buy?
5050 5v led strip - non adressable
- Please give us a WEB Link
No changes needed, just replace 12V supply with 5V. Webpage say 2.88 Watts per meter, so 2.88 * 30 = 86.4W / 5V = 17.28 Amps. Can your power supply do that?
the rgb strip works completely fine using my phone's power supply which can only supply 5v 4.5A
I'd substitute bc337 for something more beefy, or preferably a logic level MOSFET like ao4700 or IRLZ44 if it needs to be TO220.
OK, but don't complain if one channel gets brighter if you turn another channel off once you start dimming/switching individual channels.
it works! first I took a usb extension cord, cut it and put a multimeter in series. strangely using the led controller provided by the seller, the strip absorbed only 0.71A. at this point since the current needed was so little, I tried using 2n2222 (which are transistors equivalent to the bc337, which I already had at home) and everything worked. one last question, since both with arduino and with the led controller provided by the seller the strip does not make enough light, if I buy a higher quality LED strip, with more LEDs per meter, and that works at 24v, can I reuse the same circuit, obviously changing the transistors with mosfets capable of handling more current?? if so, which mosfets do you recommend? To control a 24v strip, do the values of the resistors change??
So either the manufacturer's specs for the strip were totally wrong, or your power supply doesn't cope.
The strip apparently has 15 LEDs per meter. Let's assume that for 5V operation these are wired all parallel with a single current limiting transistor each. Let's also assume at least 20mA per LED. This means 300mA per color per meter = 1.5W/meter at 5V. 30 meters means around 9A per color, or 27A for all three colors. In case they wired the LEDs two in series (they may juuuust have managed it with the Vf of the blue LEDs), it would be half that current - 13.5A for the entire strip.
So something isn't right. You have the stuff sitting there on your desk, so it's up to you to figure out where the discrepancy/discrepancies is/are.
One more thing. You used the schematic @kolaha suggested, right? Did you use 1k for the base resistor? The beta/hfe will probably be low under those conditions - maybe 40 or so. 1k at 5V means a base current of 5mA. At hfe = 40 this would mean a collector current of around 200mA. Maybe you're lucky and your 2n2222 worked really well and managed a hfe of 100 under these conditions - which would still limit collector current to 500mA. I imagine it got uncomfortably hot, too.
Sure.
I'd always advise using MOSFETs over BJT's. The latter dissipate more energy than necessary, require more drive current etc. MOSFETs are more efficient and these days they're cheap as well.
Any logic-level MOSFET to your liking that can sink the current needed at an attractively low Rds(on). There are too many types to compile a list. I often use A4700 in applications like these because they're small & cheap. Thousands of other types will do fine, too. I think IRLZ44 is popular among DIY circles because it's easy to handle, also in a solderless breadboard, in its TO220 package. In any case, do not use IRF5x0. They're stone-age technology and not really suited here.
Not if you use MOSFETs. For a BJT you'll have to work out the required base current for your intended collector current and then use the BJT's specified beta to decide what base resistor is suitable. Then work out whether your controller can source that current and if not add a second driver stage, use a ready-made Darlington transistor or decide to use a MOSFET after all. See comment above about your 2n2222 and note how you quickly run into one or another brick wall.
In the schematic @kolaha posted, there's no real need for the 10k resistor between base and GND. It doesn't hurt and it may help a bit with leakage currents on a floating GPIO pin, but I doubt it does anything at all there. It's a good idea to use it when using a MOSFET though. It also gives you more leeway in selecting a gate resistor of your flavor. 1k would be OK for slow-ish PWM (1kHz or so).
the power supply I used for the first test delivers a maximum of 5v 20A. as base resistor I used a 1k resistor as in the schematic. I left the strip on for about 10 minutes and the 3 transistors did not seem hot. In any case when I install the LED strip, I will cut it into pieces, each of which controlled by 3 transistor and an arduino nano each. the pieces of LED strip will be a maximum of 5m, so are 3 2n2222 transistors enough?
also the 24v LED strip will be divided into pieces of maximum 5m each of which controlled by an arduino nano and 3 mosfets
to power everything, can this power supply be good??
So that's not a good idea, obviously, and it explains why the strip drew so little current and was kind of dim.
The 2n2222 is not suited for what you want to do. Put it back into the parts box for a different project in the future.
Much better idea!
I've used several of those kinds of units. They work fine and are good value. You may not need the 20A version for the 24V strips. Calculate your actual power requirements and pick a power supply that is rated for 30% more than what you need, at least.
so what value should the base resistor be if i use mosfets for the 5v strip?
A MOSFET has no base, so technically it doesn't have a base resistor, but a gate resistor. You can use 1k because a MOSFET works differently than a BJT. Simply put, a MOSFET is controlled by voltage, not by current like a BJT. So if you pick a suitable MOSFET type, as long as your PWM signal is 5V (or even 3.3V), the gate resistor isn't very critical. I wouldn't make it larger than 1k though.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.