RGB LED strip controlled by Arduino Pro Mini and powered by 12V wall adapter

Hi all,

I need some guidance regarding a light up sign that I'm making. Primarily, I need assurance that I won't completely overload any of my components. The setup is attached as an image, and the following parts are used:

1x Arduino Pro Mini (5V/16MHz)
1x 12V DC/9V DC converter
1x barrel jack adapter
1x 12V DC/600 mA wall adapter
1x RGB LED strip
3x NPN transistors
6x 470 ohm resistors

I can provide a more detailed description if need be. Any input would be much appreciated --- thanks!

Mind you, I'm fine on the programming side of things --- this sort of hardware setup is a bit new for me though.

I'd measure the LED current when directly connected to 12V. The transistors are rated 200mA only, what may be not enough.

For small projects it may be possible to power the Mini directly from 12V. For bigger projects a step down converter from 12V to 7V, or from 12V to 5V to Vcc pin, will save some energy (heat) on the Mini board.

One meter of that strip has 60 LEDs, but they are divided into sections of three LEDs (for 12volt).
Each colour of a section (cut lines) could draw 20mA, so 20 sections (1 meter) could draw 400mA per colour.
A <= 200mA 2N3904 signal transistor is obviously not going to cut it.
A 2N2222 might just be able to handle this. A TIP120, or a logic level mosfet would be better.
The supply must be able to deliver 3*400mA = 1.2Amp for the three colours at max brightness.
Leo..

Thanks Wawa & DrDiettrich for the information! What would you two suggest to address this issue? I plan to cycle the colors according to the rainbow, so there should only be two of the color channels on at any given time, which I guess would only draw a total of 800 mA for an LED strip of 1m length (assuming maximum brightness). If I ensure that each color channel is running at half brightness, tops, would this suffice? Or would heat generation still remain an issue? If I should obtain new parts altogether, what should I get and where should they go?

The supply might be happy with two colours and reduced brightness (reduced average current),
but the transistors are not.

Dimming LEDs is done by varying the duty cycle, not the current.
A PWM value of 128 means that the LEDs are on half of the time.
The transistors still have to switch full current during that 'on' time.
Get three TIP120 transistors with three 1k base resistors.
Or, better (brighter LEDs), three logic level mosfets.

Lots of guides online. Here's one.
Leo..

c60c1cc648013c5f136692832b9aba12077f9d57.png
Do not use a step-down converter from 12 V to 9 V - it makes absolutely no sense at all.

The Pro Mini runs on 5 V, not 9 V, so if you are going to provide a regulated voltage, provide 5 V with the appropriate step-down ("buck") regulator.

The Pro Mini - like all the basic (ATmega) Arduinox, has a fairly useless little on-board regulator for the situation where 7 to 12 V is the only supply you happen to have available, and you do not want to run anything else from it.

Forget (bipolar) transistors (including TIP120s). You need to get some logic level FETs.

Thanks Paul__B and Wawa for the help.

With regards to the 12V/9V converter, I was told that the Arduino Pro Mini functions optimally at around 9V. So you're saying that I can wire the Arduino directly to the power supply without any overheating problems? Or alternatively, I should step the voltage down to 5V somehow?

With regards to the power supply, I found two variants:
12V DC/1000 mA
12V/5A switching power supply

I'm thinking the first one might be the better alternative, but I don't know.

I also found an N-channel MOSFET or a TIP120 power transistor that I could use to replace the transistors, but (1) I don't know how to configure the pins, like I don't know if the prongs hold the same functions as the NPN transistors, and (2) I only have 470 ohm and 2.2K ohm resistors on hand, so I may just use two 470 ohm resistors in series per line.

Would this fix all of the problems? It won't get too warm, will it?

Actually I found better components:
30A 60V N-Channel Power Mosfet TO-220
1K Ohm, 1/4 Watt, 5%, Carbon Film Resistors
12 Volt 2A Power Adapter Supply AC to DC 2.1mm X 5.5mm Plug

Would these work as part replacements?

REX647:
With regards to the 12V/9V converter, I was told that the Arduino Pro Mini functions optimally at around 9V. So you're saying that I can wire the Arduino directly to the power supply without any overheating problems? Or alternatively, I should step the voltage down to 5V somehow?

OK, as I explained before, the Pro Mini runs at 5 V. It has on board a regulator which can power it, given that it has to power basically nothing else, from 12 V and nothing more, which will work given that the 12 V is regulated as you propose.

If you wanted to power anything else which required 5 V, the proper approach would be to provide a proper 12 V to 5 V buck regulator for the Pro Mini and those other components.

Power supply: You have 1 metre of LED strip which Wawa observes will draw 1.2 A at full brightness and we presume you intend to use the whole length. So a 1 A power supply is insufficient and a 5 A is overkill; the 2 A supply is the right one. We make a point of never specifying the use of a component at its exact maximum rating.

Both the FETs you cite will function in this application as they are substantially over-rated. They are "sort of" logic-level, close enough if not used near full ratings. Were you using them more critically, the IRLB8721 appears to be somewhat superior.

To use the FETs, the source goes to your common ground, the drain to the LED cathode for that colour, the gate goes to the PWM pin on the Arduino via a 470 Ohm resistor and you need a 10k resistor directly from that Arduino pin to ground.

The 470 Ohm resistor limits the impulse current charging the gate-to source capacitance of the FET as the PWM occurs - it is not to protect the FET but the Arduino. The 10k holds the Arduino output LOW during start-up to avoid the LEDs flashing - if that matters.

Okay, so let me know if I have this straight Paul__B:

OK, as I explained before, the Pro Mini runs at 5 V. It has on board a regulator which can power it, given that it has to power basically nothing else, from 12 V and nothing more, which will work given that the 12 V is regulated as you propose.

If you wanted to power anything else which required 5 V, the proper approach would be to provide a proper 12 V to 5 V buck regulator for the Pro Mini and those other components.

Since I intend to operate the MOSFETs via the Arduino, I should step the 12V down to the 5V operating voltage of the Arduino Pro Mini. I probably won't need to power the Arduino through the RAW pin then, correct? You say "and the other components" after you say stepping the voltage down to 5V on the Arduino. Do you mean the LED strip as well? Doesn't this need 12V to operate though?

Power supply: You have 1 metre of LED strip which Wawa observes will draw 1.2 A at full brightness and we presume you intend to use the whole length. So a 1 A power supply is insufficient and a 5 A is overkill; the 2 A supply is the right one. We make a point of never specifying the use of a component at its exact maximum rating.

You say that the 12V/2A power supply is the best choice. I will get this along with the other components I need to get (when I get the MOSFETs for example).

Both the FETs you cite will function in this application as they are substantially over-rated. They are "sort of" logic-level, close enough if not used near full ratings. Were you using them more critically, the IRLB8721 appears to be somewhat superior.

With respect to the MOSFETs I listed, are you saying they're a bit overkill for this sort of application? If yes, what might be a more appropriate component?

To use the FETs, the source goes to your common ground, the drain to the LED cathode for that colour, the gate goes to the PWM pin on the Arduino via a 470 Ohm resistor and you need a 10k resistor directly from that Arduino pin to ground.

The 470 Ohm resistor limits the impulse current charging the gate-to source capacitance of the FET as the PWM occurs - it is not to protect the FET but the Arduino. The 10k holds the Arduino output LOW during start-up to avoid the LEDs flashing - if that matters.

So if I were to think about the MOSFET pinout with respect to the transistors used in my original plan, I should attach the Arduino control to the leftmost pin of the MOSFET (gate), the ground to the rightmost pin of the MOSFET (source), and the line to the LED strip attaches to the center pin of the MOSFET (drain). This happens three different times for each of the three color channels, of course. I will leave the 470 ohm resistor inline with the gate of each line. When you say "10K resistor directly from that Arduino pin to ground," which place are you referring to? From the GND next to RAW to the power supply, or do you mean from the MOSFETs to the ground of the power supply? (Perhaps the 10K ohm resistor doesn't even matter, as I plan to plug the whole system into the wall outlet and leave it on indefinitely. A little bit of initial flickering or flashing is probably okay if it stabilizes itself after a brief period of time.)

REX647:
Since I intend to operate the MOSFETs via the Arduino, I should step the 12V down to the 5V operating voltage of the Arduino Pro Mini. I probably won't need to power the Arduino through the RAW pin then, correct?

If you provide a step-down regulator for 5 V, then you supply the Pro Mini (I like Pro Minis! :grinning: ) at its actual operating voltage via the 5 V pin and the "Raw" pin is no longer relevant.

On the other hand, given that you are not attempting to power any other components or modules (apart from a few 470 Ohm resistors), the on-board regulator should be able to handle a 12 V input to "Raw". Just feel the regulator - if it does not burn your finger, it is OK.

REX647:
You say "and the other components" after you say stepping the voltage down to 5V on the Arduino. Do you mean the LED strip as well? Doesn't this need 12V to operate though?

Given that the LEDs are operating from the 12 V, and unless you add other things which do require 5 V, I see no need at this point to provide another 5 V supply.

REX647:
You say that the 12V/2A power supply is the best choice. I will get this along with the other components I need to get (when I get the MOSFETs for example).

OK.

REX647:
With respect to the MOSFETs I listed, are you saying they're a bit overkill for this sort of application? If yes, what might be a more appropriate component?

Overkill is in this case, very good. They will not heat up appreciably and thus will not require a heatsink. The only reason to use a different component would be if it was important that it be substantially cheaper. Most of us buy components from eBay unless we are in a hurry. :astonished:

REX647:
So if I were to think about the MOSFET pinout with respect to the transistors used in my original plan, I should attach the Arduino control to the leftmost pin of the MOSFET (gate), the ground to the rightmost pin of the MOSFET (source), and the line to the LED strip attaches to the centre pin of the MOSFET (drain).

If you have identified the pinout of the FET correctly, that should be it.

REX647:
This happens three different times for each of the three colour channels, of course. I will leave the 470 ohm resistor inline with the gate of each line. When you say "10K resistor directly from that Arduino pin to ground," which place are you referring to? From the GND next to RAW to the power supply, or do you mean from the MOSFETs to the ground of the power supply?

You will want a 10k resistor to ground from each Pro Mini pin which also has a 470 Ohm resistor to a FET gate. This ensures that whenever the Pro Mini is not controlling it as an OUTPUT, it will switch the FET off. A common mistake is to connect the resistor between the gate of the FET itself and source, but this would then form a minor voltage divider with the 470 Ohm resistor and albeit only slightly, reduce the voltage switching the FET on.

REX647:
(Perhaps the 10K ohm resistor doesn't even matter, as I plan to plug the whole system into the wall outlet and leave it on indefinitely. A little bit of initial flickering or flashing is probably okay if it stabilises itself after a brief period of time.)

Maybe, maybe not. The flickering or flashing may not annoy you, but if the voltage on the gate spends any time in a mid-way state, neither switching it fully on or fully off, the FET will be both passing current and have a non-trivial voltage across it and will then heat up.

Hi Paul__B,

Okay, so after taking everything you said into account, I've come up with a plan (see the attached images, and don't take the shown components too literally --- for example, that 5V regulator is merely a placeholder, as I need to determine the exact type of component to put there).

The full list of components I'll be using is as follows:

1x box of multicolored 22AWG stranded copper wire
1x AC/DC wall adapter (12V/2A)
1x barrel jack adapter
1x 5V step-down buck converter
1x Arduino Pro Mini (5V/16MHz)
1x 12V RGB LED strip (~1m)
3x TO-220 N-channel power MOSFET (30A/60V)
3x 470 ohm 5% 0.25W resistor
3x 10K ohm 5% 0.25W resistor

I elected to go the "safe route" and include the 10K resistors and step-down buck converter in the interest of keeping temperatures down, as I intend to 3D-print an enclosure for all of the electronics. Do you think this setup will work fine now? Are there any modifications that I need to make before I go ahead and order these parts? (Or at least the parts that I don't have, like the buck converter, 12V/2A wall adapter, and MOSFETs?)

Also, in the future I will try to go the cheaper route and use eBay or something to get my parts, since that costs significantly less to buy parts there in bulk rather than buying like three little pieces from a specialized electronics distributor like SparkFun...