Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: martynball on Oct 09, 2018, 11:31 pm

Title: LED Controller, new to this.
Post by: martynball on Oct 09, 2018, 11:31 pm
Hey, im new to all of this so please bare with me! Got a couple of questions but I will first explain what I want to do.

Basically I will use 4 of the pins to output power, and RGB values to a maximum of 3 LED strips, about 30-40 LED's.

I will then have a an input, which is a rotary switch, this of course will change the hue, and it also has momentary push inputs, but of course all of the is down to the program.

My main question is how do I go about powering the Arduino Nano, and the LED strips using a 12V input from a motorbike battery, without busting anything.
Title: Re: LED Controller, new to this.
Post by: septillion on Oct 09, 2018, 11:45 pm
About connecting the leds, please use Google. Pages and pages full about it.

12V is fine for the Vin of an Arduino if it doesn't need to provide real power (which it doesn't seem to do here) But the 12V from a vehicle isn't really 12V. When it's running it's getting close to 15V. It can also be very noisy. So I would get a DCDC buck converter, set it to around 8V, add a +-220uf and a 100nF cap to that and connect it to the Vin of the Nano.

Or the real easy solution. Get a (decent) USB car charger, plug it in and connect the USB of the Arduino to it.
Title: Re: LED Controller, new to this.
Post by: PaulRB on Oct 10, 2018, 07:42 am
Quote
Basically I will use 4 of the pins to output power, and RGB values to a maximum of 3 LED strips, about 30-40 LED's.
Arduino pins do not output "power". They can only output a small current at 5V. They can power a single small led, but not much more. They are meant to control, not to power. So you will need some transistors. These can be used to boost the current and voltage to be enough for your strips. We can recommend a type of transistor once we know more about your project.

You mention using 4 pins for 3 RGB led strips. But there are several types of RGB strip. Some need 12V, some need 5V. Some allow control of individual LEDs in the strip. Some allow control of groups of 3 leds. Some only allow control of the strip as a whole. Some need transistors to drive them.

So please post a link to the type of strip you intend to use. Read the forum sticky post to find out how to post links properly so they can be clicked on. Then we can advise further how to control the led strips.

If it were my project, I would power the Nano using a dc-dc convertor as septillion says, but I would use a 12V to 5V designed for car/bike use and power the Nano through its 5V pin.
Title: Re: LED Controller, new to this.
Post by: martynball on Oct 10, 2018, 09:19 pm
Hi, sorry about the lack of knowledge in this. Been watching some videos and doing some reading and realise I would need to a MOSFET to control the power going to the LED strip, correct?

Can't find the exact LED strips I ordered, no longer in my eBay order history for some reason, I was mistaken, they are 5V.

Voltage: 5V
LED's: 15
Length: 0.5m
Can only control the whole strip, not individual LED's.

Pretty much the same LED's (https://www.ebay.co.uk/itm/4pcs-USB-Strip-Light-Mood-Light-RGB-LED-Multi-Color-TV-Backlight-Remote-Control/263534650043?_trkparms=aid%3D555017%26algo%3DPL.CASSINI%26ao%3D1%26asc%3D20151016114640%26meid%3Dbc09d1950efd401f96e7b131a318c623%26pid%3D100507%26rk%3D1%26rkt%3D1%26%26itm%3D263534650043&_trksid=p2045573.c100507.m3226)

It would be nice to get the circuit designed and maybe have a prototype built which I can plug into the Arduino  like an Ardiuno shield.

I have just ordered a breadboard to make prototyping easier.
Title: Re: LED Controller, new to this.
Post by: PaulRB on Oct 11, 2018, 12:53 am
Hmm... Ok that puts a different perspective on things. You are going to need a substantial 12V to 5V dc-dc convertor. Not just to power the Nano but the strips as well.

Your strips will need around: 3 strips x15 LEDs x3 colours x20mA per led = 2.7A. Plus a little something for the Nano. So you are looking for a 3A, 12V to 5V convertor.

You are correct about the MOSFETs. But don't buy them without first checking the model with us here in the forum. You are looking for a logic-level, n-channel mosfet. IRL540 or STP16NF06L would be suitable examples, but there are many more available. How many MOSFETs depends on whether you want to control the colour of each strip independently or together. If together, you will need 3 MOSFETs and 3 Arduino pwm pins. For independent control of each strip you would need 9 MOSFETs and 9 Arduino pwm pins. Uno/Nano only has 6 pwm pins. But it is possible to simulate more pwm pins in software, as long as the Arduino is not too busy.
Title: Re: LED Controller, new to this.
Post by: martynball on Oct 11, 2018, 08:49 pm
So, for power I have found this on eBay, would this (https://www.ebay.co.uk/itm/DC-DC-9V-12V-24V-to-5V-3A-Step-Down-Voltage-Regulated-Power-Supply-Converter/263028374311?hash=item3d3db67b27:g:BiEAAOSwF71Zy8dO:rk:34:pf:0) do the job in reducing the voltage?


For the MOSFET's I want to control all of the LED's together, so I will just need the 3 then, would these (https://www.ebay.co.uk/itm/ST-STP16NF06L-N-Channel-MOSFET-60V-16A-45W-TO-220/202010737707?hash=item2f08c73c2b:g:k9wAAOSwfDhZhfJM:rk:4:pf:0) do the job?
Title: Re: LED Controller, new to this.
Post by: PaulRB on Oct 11, 2018, 11:18 pm
The MOSFETs are fine. That dc-dc convertor says
Quote
Load capacity:3A(Max) Typical 1.5A
Is not a good idea to run components at their max for long periods. (And it's not very ethical to sell something based on the max rating and only mention a typical rating of half that in the "small print", so I would avoid that seller.)

Maybe look for something similar but with a "typical/nominal" rating of 3A or more, ideally something with a heatsink built in or metal case, and says it is for vehicle use.
Title: Re: LED Controller, new to this.
Post by: septillion on Oct 12, 2018, 08:45 am
And it's not very ethical to sell something based on the max rating and only mention a typical rating of half that in the "small print", so I would avoid that seller.
That's what every MOSFET manufacturer does... ::) At least this seller tells you.
Title: Re: LED Controller, new to this.
Post by: PaulRB on Oct 12, 2018, 08:23 pm
That's what every MOSFET manufacturer does... ::) At least this seller tells you.
Was talking about dc-dc convertors, not MOSFETs. Martyn's suggested MOSFET should be plenty for the task, they are rated for (max) 5x the current he needs, so should not even need heatsinks, but I was worried about the dc convertor he found.

But you're not wrong about about MOSFET manufacturers...
Title: Re: LED Controller, new to this.
Post by: PaulRB on Oct 12, 2018, 08:44 pm
Actually, there is a disadvantage to those MOSFETs you linked to. It may not be important in practice. They have "cropped leads": this means they probably won't be any good for building a prototype circuit on a breadboard. The short leads won't make (good/any) contact with the breadboard's contacts. That said, breadboards can't deal with current much more than an amp or so anyway. And if you don't have any breadboards, it's probably not worth you buying any because you will still have to do some soldering even to build a minimal prototype.
Title: Re: LED Controller, new to this.
Post by: martynball on Oct 13, 2018, 02:49 am
I have already ordered the MOSFETs, but if you say the breadboard can't handle the current then I can just solder the circuit together using wires, not a problem.

I have found this (https://www.ebay.co.uk/itm/DC-DC-Converter-Regulator-12V-Stepdown-to-5V-3A-15W-Car-Power-Supply-Module-UK/183422302014?_trkparms=aid%3D555017%26algo%3DPL.CASSINI%26ao%3D1%26asc%3D20170912102056%26meid%3D0ecc5420762e4e40b6cc50b1215a9b6a%26pid%3D100753%26rk%3D1%26rkt%3D1%26%26itm%3D183422302014&_trksid=p2045573.c100753.m4841) DC Converter, it's rated at a max of 3A though, and you said it's not good to constantly run it at max?

If so is there one you would suggest?
Title: Re: LED Controller, new to this.
Post by: PaulRB on Oct 13, 2018, 09:45 am
You can get 5A convertors like this one (https://www.ebay.co.uk/itm/12v-to-5v-LED-stepdown-power-supply-5A-25W-10A-50W-15A-75W-20A-100W-30A-150W/272258563508?hash=item3f63dffdb4:m:mG30R1fASKCQ0bSZj_Ugabg:rk:18:pf:0) for example. I can't personally recommend any particular model.